#include <PaintBrushManipulator.h>
Inherits AzToolsFramework::BaseManipulator, AzToolsFramework::ManipulatorSpace, AzToolsFramework::GlobalPaintBrushSettingsNotificationBus::Handler, and AzToolsFramework::EditorPickModeNotificationBus::Handler.
Public Member Functions | |
AZ_RTTI (PaintBrushManipulator, "{0621CB58-21FD-474A-A296-5B1192E714E7}", BaseManipulator) | |
AZ_CLASS_ALLOCATOR (PaintBrushManipulator, AZ::SystemAllocator) | |
PaintBrushManipulator (const PaintBrushManipulator &)=delete | |
PaintBrushManipulator & | operator= (const PaintBrushManipulator &)=delete |
void | Draw (const ManipulatorManagerState &managerState, AzFramework::DebugDisplayRequests &debugDisplay, const AzFramework::CameraState &cameraState, const ViewportInteraction::MouseInteraction &mouseInteraction) override |
Draw the current manipulator state. | |
bool | HandleMouseInteraction (const ViewportInteraction::MouseInteractionEvent &mouseInteraction) |
Handle mouse events. | |
AZStd::vector< AzToolsFramework::ActionOverride > | PopulateActionsImpl () |
Returns the actions that we want any Component Mode using the Paint Brush Manipulator to support. | |
Public Member Functions inherited from AzToolsFramework::BaseManipulator | |
AZ_CLASS_ALLOCATOR_DECL | BaseManipulator (const BaseManipulator &)=delete |
BaseManipulator & | operator= (const BaseManipulator &)=delete |
bool | OnLeftMouseDown (const ViewportInteraction::MouseInteraction &interaction, float rayIntersectionDistance) |
void | OnLeftMouseUp (const ViewportInteraction::MouseInteraction &interaction) |
bool | OnRightMouseDown (const ViewportInteraction::MouseInteraction &interaction, float rayIntersectionDistance) |
void | OnRightMouseUp (const ViewportInteraction::MouseInteraction &interaction) |
void | OnMouseMove (const ViewportInteraction::MouseInteraction &interaction) |
void | OnMouseWheel (const ViewportInteraction::MouseInteraction &interaction) |
bool | OnMouseOver (ManipulatorId manipulatorId, const ViewportInteraction::MouseInteraction &interaction) |
void | Register (ManipulatorManagerId managerId) |
void | Unregister () |
Unregister itself from the manipulator manager it was registered with. | |
void | SetBoundsDirty () |
Bounds will need to be recalculated next time we render. | |
bool | Registered () const |
Is this manipulator currently registered with a manipulator manager. | |
bool | PerformingAction () const |
Is the manipulator in the middle of an action (between mouse down and mouse up). | |
bool | MouseOver () const |
Is the mouse currently over the manipulator (intersecting manipulator bound). | |
ManipulatorId | GetManipulatorId () const |
The unique id of this manipulator. | |
ManipulatorManagerId | GetManipulatorManagerId () const |
The unique id of the manager this manipulator was registered with. | |
const UniqueEntityComponentIds & | EntityComponentIdPairs () const |
Returns all EntityComponentIdPairs associated with this manipulator. | |
void | AddEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) |
Add an entity and component the manipulator is responsible for. | |
UniqueEntityComponentIds::iterator | RemoveEntityId (AZ::EntityId entityId) |
UniqueEntityComponentIds::iterator | RemoveEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) |
Remove a specific component (via a EntityComponentIdPair) being affected by this manipulator. | |
bool | HasEntityId (AZ::EntityId entityId) const |
Is this entity currently being tracked by this manipulator. | |
bool | HasEntityComponentIdPair (const AZ::EntityComponentIdPair &entityComponentIdPair) const |
Is this entity component pair currently being tracked by this manipulator. | |
void | ForwardMouseOverEvent (const ViewportInteraction::MouseInteraction &interaction) |
Public Member Functions inherited from AzToolsFramework::ManipulatorSpace | |
const AZ::Transform & | GetSpace () const |
void | SetSpace (const AZ::Transform &space) |
const AZ::Vector3 & | GetNonUniformScale () const |
void | SetNonUniformScale (const AZ::Vector3 &nonUniformScale) |
AZ::Transform | ApplySpace (const AZ::Transform &localTransform) const |
Calculates a transform combining the space and local transform, taking non-uniform scale into account. | |
Static Public Member Functions | |
static AZStd::shared_ptr< PaintBrushManipulator > | MakeShared (const AZ::Transform &worldFromLocal, const AZ::EntityComponentIdPair &entityComponentIdPair, PaintBrushColorMode colorMode) |
A Manipulator must only be created and managed through a shared_ptr. | |
static void | RegisterActions () |
Initializes the actions that we want any Component Mode using the Paint Brush Manipulator to support. | |
static void | BindActionsToMode (AZ::Uuid componentModeTypeId) |
Adds the actions that we want any Component Mode using the Paint Brush Manipulator to support to the mode provided. | |
static void | BindActionsToMenus () |
Adds the actions that we want any Component Mode using the Paint Brush Manipulator to support to the Edit menu. | |
static void | AdjustSize (float sizeDelta) |
Adjusts the size of the paintbrush. | |
static void | AdjustHardnessPercent (float hardnessPercentDelta) |
Adjusts the paintbrush hardness percent. | |
Additional Inherited Members | |
Public Types inherited from AzToolsFramework::BaseManipulator | |
using | UniqueEntityIds = AZStd::unordered_set< AZ::EntityId > |
using | UniqueEntityComponentIds = AZStd::unordered_set< AZ::EntityComponentIdPair > |
Static Public Attributes inherited from AzToolsFramework::BaseManipulator | |
static const AZ::Color | s_defaultMouseOverColor |
Protected Member Functions inherited from AzToolsFramework::BaseManipulator | |
BaseManipulator ()=default | |
Protected constructor. | |
void | Invalidate () |
Called when unregistering - users of manipulators should not call it directly. | |
virtual void | InvalidateImpl () |
The implementation to override in a derived class for Invalidate. | |
virtual void | OnLeftMouseDownImpl (const ViewportInteraction::MouseInteraction &, float) |
void | AttachLeftMouseDownImpl () |
virtual void | OnRightMouseDownImpl (const ViewportInteraction::MouseInteraction &, float) |
void | AttachRightMouseDownImpl () |
virtual void | OnLeftMouseUpImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnLeftMouseUp. | |
virtual void | OnRightMouseUpImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnRightMouseUp. | |
virtual void | OnMouseMoveImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseMove. | |
virtual void | OnMouseOverImpl (ManipulatorId, const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseOver. | |
virtual void | OnMouseWheelImpl (const ViewportInteraction::MouseInteraction &) |
The implementation to override in a derived class for OnMouseWheel. | |
virtual void | SetBoundsDirtyImpl () |
The implementation to override in a derived class for SetBoundsDirty. | |
virtual void | Draw (const ManipulatorManagerState &managerState, AzFramework::DebugDisplayRequests &debugDisplay, const AzFramework::CameraState &cameraState, const ViewportInteraction::MouseInteraction &mouseInteraction)=0 |
Rendering for the manipulator - it is recommended drawing be delegated to a ManipulatorView. | |
PaintBrushManipulator contains the core logic for managing the paintbrush in the Editor. It uses the global paintbrush settings for painting and provides logic for converting mouse events into paintbrush actions. It also draws the paintbrush circles in the viewport and provides the UX for switching paint modes. The PaintBrushManipulator relies on a PaintBrush instance to do the actual painting logic and on a component-specific Component Mode to manage the usage of the PaintBrushManipulator (and PaintBrush) to apply the painted values to a specific data source and to save the data appropriately.
|
overridevirtual |
Draw the current manipulator state.
Implements AzToolsFramework::BaseManipulator.