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

Public Member Functions

 SetTexturePropertyCommand (EditorState *state, MaterialInstanceHandle material, StringView key, TextureHandle texture)
 
void apply () override
 Run the command.
 
void undo () 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
 
TextureHandle texture
 
TextureHandle previousTexture
 

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

Constructor & Destructor Documentation

◆ SetTexturePropertyCommand()

Cogs::Core::SetTexturePropertyCommand::SetTexturePropertyCommand ( EditorState state,
MaterialInstanceHandle  material,
StringView  key,
TextureHandle  texture 
)
inline

Definition at line 51 of file ResourceCommands.h.

Member Function Documentation

◆ apply()

void Cogs::Core::SetTexturePropertyCommand::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 28 of file ResourceCommands.cpp.

References Cogs::Core::MaterialInstance::getTextureProperty(), Cogs::Core::MaterialInstance::material, and Cogs::Core::MaterialInstance::setTextureProperty().

◆ undo()

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

Implements Cogs::Core::EditorCommand.

Definition at line 38 of file ResourceCommands.cpp.

Member Data Documentation

◆ key

std::string Cogs::Core::SetTexturePropertyCommand::key
private

Definition at line 59 of file ResourceCommands.h.

◆ material

MaterialInstanceHandle Cogs::Core::SetTexturePropertyCommand::material
private

Definition at line 58 of file ResourceCommands.h.

◆ previousTexture

TextureHandle Cogs::Core::SetTexturePropertyCommand::previousTexture
private

Definition at line 62 of file ResourceCommands.h.

◆ texture

TextureHandle Cogs::Core::SetTexturePropertyCommand::texture
private

Definition at line 60 of file ResourceCommands.h.


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