class CODCommand: public MvcCommand
This is the base class for all command objects in Objective Views. A command encapsulates an action that is performed on a set of components in a CODModel object. Commands are implemented in derived classes that override the Execute and Unexecute methods. A pointer to the CODModel object is passed into the constructor CODCommand. Command objects support several methods for adding and removing components. Pointers to the components affected by the command are stored in the m_setComponents member.
Defined in: OdCommand.h
See Also
VIEWS_API CODCommand(CODModel* pModel)
Constructor.
VIEWS_API virtual ~CODCommand()
Destructor.
CODModel* m_pModel
The model the components are in.
CODComponentSet m_setComponents
The components to perform the command on.
int m_nUpdateType
The type of update to be performed.
VIEWS_API virtual BOOL Unexecute()
Undo the command.
VIEWS_API virtual sfl::MvcCommand* Inverse() const
Create a command that is the inverse of this command.
VIEWS_API virtual int GetUpdateType() const
Gets the type of update to be performed.
VIEWS_API virtual void SetUpdateType(const int nUpdateType)
Sets the type of update to be performed.
VIEWS_API virtual void GetUpdateSet(CODComponentSet& setUpdate) const
Returns a list of components that are affected by this command.
VIEWS_API CODComponentSet* GetComponents()
Returns a pointer to the list of components directly acted upon by this command
VIEWS_API virtual void AddComponent(CODComponent* pComp)
Adds a component to the list of affected components.
VIEWS_API virtual void AddComponents(CODComponentSet* pCompSet)
Adds multiple components to the list of affected components.
VIEWS_API virtual void RemoveComponent(CODComponent* pComp)
Removes a component to the list of affected components.
VIEWS_API virtual void RemoveAllComponents()
Removes all of the components from the list of affected components.
VIEWS_API CODModel* GetModel()
Returns a pointer to the model the components are in.