Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::Core::SetMaterialPropertyCommand< T > Struct Template Reference
Inheritance diagram for Cogs::Core::SetMaterialPropertyCommand< T >:
Cogs::Core::EditorCommand

Public Member Functions

 SetMaterialPropertyCommand (EditorState *state, MaterialInstanceHandle material, StringView key, T value)
 
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

MaterialInstanceHandle material
 
std::string key
 
value
 
previousValue
 

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

template<typename T>
struct Cogs::Core::SetMaterialPropertyCommand< T >

Definition at line 12 of file ResourceCommands.h.

Constructor & Destructor Documentation

◆ SetMaterialPropertyCommand()

template<typename T >
Cogs::Core::SetMaterialPropertyCommand< T >::SetMaterialPropertyCommand ( EditorState state,
MaterialInstanceHandle  material,
StringView  key,
value 
)
inline

Definition at line 14 of file ResourceCommands.h.

Member Function Documentation

◆ apply()

template<typename T >
void Cogs::Core::SetMaterialPropertyCommand< T >::apply ( )
inlineoverridevirtual

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 19 of file ResourceCommands.h.

◆ mergeWith()

template<typename T >
bool Cogs::Core::SetMaterialPropertyCommand< T >::mergeWith ( const EditorCommand )
inlineoverridevirtual

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 30 of file ResourceCommands.h.

References Cogs::Core::MaterialInstance::material.

◆ undo()

template<typename T >
void Cogs::Core::SetMaterialPropertyCommand< T >::undo ( )
inlineoverridevirtual

Implements Cogs::Core::EditorCommand.

Definition at line 25 of file ResourceCommands.h.

Member Data Documentation

◆ key

template<typename T >
std::string Cogs::Core::SetMaterialPropertyCommand< T >::key
private

Definition at line 44 of file ResourceCommands.h.

◆ material

template<typename T >
MaterialInstanceHandle Cogs::Core::SetMaterialPropertyCommand< T >::material
private

Definition at line 43 of file ResourceCommands.h.

◆ previousValue

template<typename T >
T Cogs::Core::SetMaterialPropertyCommand< T >::previousValue
private

Definition at line 46 of file ResourceCommands.h.

◆ value

template<typename T >
T Cogs::Core::SetMaterialPropertyCommand< T >::value
private

Definition at line 45 of file ResourceCommands.h.


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