EditorTool

Inherited: None

Description

The EditorTool class is an abstract base class that defines the interface for editor tools in the application. It provides common functionality and virtual methods that must be implemented by specific tool implementations.

Example:

class MoveTool : public EditorTool {
public:
    std::string icon() const override {
        return ":/Images/editor/Move.png";
    }

    std::string name() const override {
        return "Move Tool";
    }

    std::string toolTip() const override {
        return "Moves selected objects";
    }

    std::string shortcut() const override {
        return "Shift+T";
    }

    void update(bool center, bool local, bool snap) override {
        // Implement move tool logic
    }

    // ... other overrides as needed
};

Public Methods

void

beginControl ()

bool

blockSelection () const

void

cancelControl ()

std::string

component () const

void

endControl ()

int

panel ()

std::string

shortcut () const

std::string

toolTip () const

void

update (bool center, bool local, bool snap)

Static Methods

None

Methods Description

void EditorTool::beginControl ()

Called when the tool begins active control. Can be used to store the initial state of controlled Component.


bool EditorTool::blockSelection () const

Determines whether the tool blocks regular selection behavior (default returns false).


void EditorTool::cancelControl ()

Cancels the current control operation. Can be used to restore the state of contolled Component.

See also EditorTool::beginControl().


std::string EditorTool::component () const

Returns the associated component type for the tool (default implementation returns empty string).


void EditorTool::endControl ()

Called when the tool ends active control. Can be used to store current operation to Undo/Redo system.


int EditorTool::panel ()

Returns a custom panel widget for tool options (default implementation returns nullptr).


std::string EditorTool::shortcut () const

Returns the keyboard shortcut for the tool (default implementation returns empty string).


std::string EditorTool::toolTip () const

Returns the tooltip text for the tool (default implementation returns empty string).


void EditorTool::update (bool center, bool local, bool snap)

Updates the controled Component state and performs any necessary operations. Parameter center used for center-based or origin-based transformations. Parameter local used for local space or world space coordinates. Parameter snap enables stepping transform operations.