Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::Core::RotateCommand Struct Reference
Inheritance diagram for Cogs::Core::RotateCommand:
Cogs::Core::EditorCommand

Public Member Functions

 RotateCommand (EditorState *state, const EntityIds &entityIds, glm::quat rotation)
 
void apply () override
 Run the command.
 
void undo () override
 
bool mergeWith (const EditorCommand *command) override
 
- Public Member Functions inherited from Cogs::Core::EditorCommand
 EditorCommand (EditorState *state, Context *context)
 
virtual void apply ()=0
 Run the command.
 
virtual void undo ()=0
 
virtual void redo ()
 
virtual bool mergeWith (const EditorCommand *)
 
virtual MeshHandle applyMesh (MeshHandle)
 Workaround for having extendable mesh processing available without linking (e.g command -> RR).
 
virtual void close ()
 Close command, i.e. prevent merging with another command.
 
bool isClosed () const
 
bool merge (const EditorCommand *command)
 Merge into this if not this is closed.
 

Private Attributes

EntityIds entityIds
 
glm::quat rotation
 
std::vector< glm::quat > previousRotations
 

Additional Inherited Members

- Public Attributes inherited from Cogs::Core::EditorCommand
std::vector< ParsedValueoptions
 Options passed to the command when running in batch mode.
 
bool permanentUndo = false
 True if cannot Redo after Undo.
 
- Protected Attributes inherited from Cogs::Core::EditorCommand
EditorStatestate = nullptr
 
Contextcontext = nullptr
 

Detailed Description

Definition at line 166 of file EditorCommand.h.

Constructor & Destructor Documentation

◆ RotateCommand()

Cogs::Core::RotateCommand::RotateCommand ( EditorState state,
const EntityIds &  entityIds,
glm::quat  rotation 
)
inline

Definition at line 168 of file EditorCommand.h.

Member Function Documentation

◆ apply()

void Cogs::Core::RotateCommand::apply ( )
overridevirtual

Run the command.

In batch scripts this method is called for all type of commands. In interactive mode this method is not called for model commands (subclasses of ModalEditorCommand)

Implements Cogs::Core::EditorCommand.

Definition at line 248 of file EditorCommand.cpp.

References Cogs::ComponentModel::Entity::getComponent(), and Cogs::Core::TransformComponent::rotation.

◆ mergeWith()

bool Cogs::Core::RotateCommand::mergeWith ( const EditorCommand )
overridevirtual

Check if the action in the given command should be merged into this. I.e. Multiple field-changes commands merged info one for undoing all-in-one. Client code shall use

See also
merge(EditorCommand * command)

Reimplemented from Cogs::Core::EditorCommand.

Definition at line 272 of file EditorCommand.cpp.

◆ undo()

void Cogs::Core::RotateCommand::undo ( )
overridevirtual

Implements Cogs::Core::EditorCommand.

Definition at line 261 of file EditorCommand.cpp.

Member Data Documentation

◆ entityIds

EntityIds Cogs::Core::RotateCommand::entityIds
private

Definition at line 176 of file EditorCommand.h.

◆ previousRotations

std::vector<glm::quat> Cogs::Core::RotateCommand::previousRotations
private

Definition at line 179 of file EditorCommand.h.

◆ rotation

glm::quat Cogs::Core::RotateCommand::rotation
private

Definition at line 177 of file EditorCommand.h.


The documentation for this struct was generated from the following files: