Emergency 2017 Dokumentation  v3.0.1
qsf::editor::base::SetLayerPropertyOperation Class Reference

Set layer property operation class. More...

#include <SetLayerPropertyOperation.h>

Public Member Functions

 SetLayerPropertyOperation ()
 
 SetLayerPropertyOperation (uint32 layerId, uint32 propertyId, const camp::Value &newCampValue, const camp::Value *previousCampValue=nullptr)
 Constructor. More...
 
virtual ~SetLayerPropertyOperation ()
 Destructor. More...
 
uint32 getPropertyId () const
 Return the unique class property ID the CAMP property to manipulate. More...
 
void setPropertyId (uint32 propertyId)
 
std::string getNewCampValueAsString () const
 Return the new camp value as string. More...
 
void setNewCampValueAsString (const std::string &newCampValue)
 
std::string getPreviousCampValueAsString () const
 Return the old camp value as string. More...
 
void setPreviousCampValueAsString (const std::string &previousCampValue)
 
virtual uint32 getId () const override
 Return the unique operation identifier. More...
 
virtual size_t getMemoryConsumption () const override
 Return the memory consumption of this operation. More...
 
virtual void sealImpl () override
 Seal the operation after constructing it using the default constructor and explicitly using setters for all parameters. More...
 
virtual void undoImpl () override
 Undo the operation (common actions to always be executed) More...
 
virtual void redoImpl () override
 Redo the operation (common actions to always be executed) More...
 
- Public Member Functions inherited from qsf::editor::base::LayerOperation
virtual ~LayerOperation ()
 Destructor. More...
 
LayerManagergetLayerManager () const
 Return the used layer manager. More...
 
uint32 getLayerId () const
 Return the ID of the layer this operation is performed on. More...
 
void setLayerId (uint32 layerId)
 
LayergetLayer () const
 Return the layer this operation is performed on. More...
 
- Public Member Functions inherited from qsf::editor::base::MapOperation
virtual ~MapOperation ()
 Destructor. More...
 
uint32 getMapId () const
 Return the map of the operation. More...
 
void setMapId (uint32 mapId)
 
void setEnforcedMapId (uint32 mapId)
 
MapgetMap () const
 
- Public Member Functions inherited from qsf::editor::base::Operation
virtual ~Operation ()
 Destructor. More...
 
std::string getText () const
 Return the text of the operation. More...
 
void setText (const std::string &text)
 Set the text of the operation. More...
 
uint32 getUserId () const
 Return the ID of the user issuing the operation. More...
 
void setUserId (uint32 userId)
 Set the ID of the user issuing the operation. More...
 
bool isSealed () const
 
void seal ()
 Seal the operation after constructing it using the default constructor and explicitly using setters for all parameters. More...
 
void undo ()
 Undo the operation. More...
 
void redo ()
 Redo the operation. More...
 
virtual bool isReversible () const
 Return whether or not the operation will end up in the undo/redo stack. More...
 
virtual bool isLocal () const
 Return whether or not the operation is local only. More...
 
virtual bool isReplicated () const
 Return whether or not the operation is replicated by the server to all other relevant clients. More...
 
- Public Member Functions inherited from qsf::Object
virtual ~Object ()
 Destructor. More...
 
const camp::Class & getCampClass () const
 Return the CAMP class. More...
 
int getPropertyIndexById (const StringHash &propertyId) const
 Return the CAMP property index by using the unique class property ID. More...
 
uint32 getPropertyIdByIndex (int index) const
 Return the unique class property ID with the given index. More...
 
std::string getPropertyNameById (const StringHash &propertyId) const
 Return the CAMP property name by using the unique class property ID. More...
 
const camp::Property * getCampPropertyById (const StringHash &propertyId) const
 Return the CAMP property by using the unique class property ID. More...
 
void setPropertyValuesByString (const std::string &values)
 Set CAMP reflection property values by using a given string. More...
 
void setPropertiesToDefaultValues ()
 Set all CAMP reflection system properties to their default values. More...
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void serializeToBoostPTree (boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
bool deserializeFromBoostPTree (const boost::property_tree::ptree &pTree, const camp::Class &campClass, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL)
 
void serializeToBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL) const
 
void deserializeFromBinarySerializer (BinarySerializer &serializer, SerializationMode mode=MODE_MINIMAL, SerializationMethod serializationMethod=SERIALIZE_DIFFERENTIAL, bool setOverrideState=true)
 
virtual camp::Value getPropertyDefaultValue (const StringHash &propertyId) const
 
virtual PropertyOverrideState getPropertyOverrideState (const StringHash &propertyId) const
 
virtual bool setPropertyOverrideState (const StringHash &propertyId, PropertyOverrideState overrideState)
 
virtual void onPreDeserialize ()
 Called right before the object is deserialized using any of the above methods. Default implementation is empty. More...
 
virtual void onPostDeserialize ()
 Called right after the object was deserialized using any of the above methods. Default implementation is empty. More...
 
virtual ScriptgetAssociatedScript () const
 Return the script instance associated with this object instance. More...
 

Static Public Attributes

static const uint32 OPERATION_ID
 "qsf::editor::base::SetLayerPropertyOperation" unique operation ID More...
 

Additional Inherited Members

- Public Types inherited from qsf::Object
enum  PropertyOverrideState { PROPERTY_INVALID, PROPERTY_DEFAULT, PROPERTY_OVERRIDE, PROPERTY_REMOVED }
 
enum  SerializationMethod { SERIALIZE_FLAT, SERIALIZE_COMPLETE, SERIALIZE_DIFFERENTIAL, SERIALIZE_IGNORE_UNKNOWN }
 
enum  SerializationMode { MODE_MINIMAL, MODE_COMPATIBLE }
 
- Protected Member Functions inherited from qsf::editor::base::LayerOperation
 LayerOperation ()
 
- Protected Member Functions inherited from qsf::editor::base::MapOperation
 MapOperation ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::editor::base::Operation
 Operation ()
 Default constructor. More...
 
- Protected Member Functions inherited from qsf::Object
 Object ()
 Default constructor. More...
 
- Protected Attributes inherited from qsf::editor::base::LayerOperation
uint32 mLayerId
 The unique layer identifier, "qsf::getUninitialized<uint32>()" if invalid. More...
 
- Protected Attributes inherited from qsf::editor::base::Operation
CompoundOperationmParentOperation
 Parent compound operation, can be a null pointer, do not destroy the instance. More...
 

Detailed Description

Set layer property operation class.

Note
  • The unique class property identifier is generated by "qsf::StringHash" by using the class property name (e.g. qsf::StringHash("Position") generating the hash value 3091144222)
  • 64 bit are required to uniquely identify the property (layer -> property)
Todo:
  • TODO(fw): This is pretty similar to "qsf::editor::base::SetComponentProprtyOperation", could we unify both?

Definition at line 55 of file SetLayerPropertyOperation.h.

Constructor & Destructor Documentation

qsf::editor::base::SetLayerPropertyOperation::SetLayerPropertyOperation ( )
qsf::editor::base::SetLayerPropertyOperation::SetLayerPropertyOperation ( uint32  layerId,
uint32  propertyId,
const camp::Value &  newCampValue,
const camp::Value *  previousCampValue = nullptr 
)

Constructor.

Parameters
[in]layerIdThe unique layer identifier of the layer to change a property from
[in]propertyIdUnique (inside the layer) class property ID the CAMP property to manipulate
[in]newCampValueNew CAMP value to set
[in]previousCampValueOptional previous CAMP value to set, if null pointer the current property value will be used
virtual qsf::editor::base::SetLayerPropertyOperation::~SetLayerPropertyOperation ( )
virtual

Destructor.

Member Function Documentation

virtual uint32 qsf::editor::base::SetLayerPropertyOperation::getId ( ) const
overridevirtual

Return the unique operation identifier.

Returns
The unique operation identifier
Note
  • The unique operation identifier is generated by "qsf::StringHash" by using the class name

Implements qsf::editor::base::Operation.

virtual size_t qsf::editor::base::SetLayerPropertyOperation::getMemoryConsumption ( ) const
overridevirtual

Return the memory consumption of this operation.

Returns
The memory consumption in bytes of this operation
Note
  • The memory consumption of cooperative work operations is usually lower because there's no need to store data required for undoing an operation
  • The default implementation returns 0

Reimplemented from qsf::editor::base::LayerOperation.

std::string qsf::editor::base::SetLayerPropertyOperation::getNewCampValueAsString ( ) const

Return the new camp value as string.

std::string qsf::editor::base::SetLayerPropertyOperation::getPreviousCampValueAsString ( ) const

Return the old camp value as string.

uint32 qsf::editor::base::SetLayerPropertyOperation::getPropertyId ( ) const

Return the unique class property ID the CAMP property to manipulate.

Returns
Unique (inside the entity component) class property ID the CAMP property to manipulate
virtual void qsf::editor::base::SetLayerPropertyOperation::redoImpl ( )
overridevirtual

Redo the operation (common actions to always be executed)

Note
Must ensure to call it's parent's implementation.

Reimplemented from qsf::editor::base::Operation.

virtual void qsf::editor::base::SetLayerPropertyOperation::sealImpl ( )
overridevirtual

Seal the operation after constructing it using the default constructor and explicitly using setters for all parameters.

Note
Must ensure to call it's parent's implementation. Will only be called once.

Reimplemented from qsf::editor::base::Operation.

void qsf::editor::base::SetLayerPropertyOperation::setNewCampValueAsString ( const std::string &  newCampValue)
void qsf::editor::base::SetLayerPropertyOperation::setPreviousCampValueAsString ( const std::string &  previousCampValue)
void qsf::editor::base::SetLayerPropertyOperation::setPropertyId ( uint32  propertyId)
virtual void qsf::editor::base::SetLayerPropertyOperation::undoImpl ( )
overridevirtual

Undo the operation (common actions to always be executed)

Note
Must ensure to call it's parent's implementation.

Reimplemented from qsf::editor::base::Operation.

Member Data Documentation

const uint32 qsf::editor::base::SetLayerPropertyOperation::OPERATION_ID
static

"qsf::editor::base::SetLayerPropertyOperation" unique operation ID

Definition at line 63 of file SetLayerPropertyOperation.h.


The documentation for this class was generated from the following file: