![]() |
ufe
1.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
|
Abstract base class for 3D transform interface. More...
#include <transform3d.h>
Public Types | |
typedef std::shared_ptr< Transform3d > | Ptr |
Public Member Functions | |
Transform3d () | |
Constructor. More... | |
Transform3d (const Transform3d &)=default | |
Default copy constructor. More... | |
virtual | ~Transform3d () |
Destructor. More... | |
virtual const Path & | path () const =0 |
virtual SceneItem::Ptr | sceneItem () const =0 |
virtual TranslateUndoableCommand::Ptr | translateCmd ()=0 |
virtual void | translate (double x, double y, double z)=0 |
virtual Vector3d | translation () const =0 |
virtual RotateUndoableCommand::Ptr | rotateCmd ()=0 |
virtual void | rotate (double x, double y, double z)=0 |
virtual ScaleUndoableCommand::Ptr | scaleCmd ()=0 |
virtual void | scale (double x, double y, double z)=0 |
virtual TranslateUndoableCommand::Ptr | rotatePivotTranslateCmd ()=0 |
virtual void | rotatePivotTranslate (double x, double y, double z)=0 |
virtual Vector3d | rotatePivot () const =0 |
virtual TranslateUndoableCommand::Ptr | scalePivotTranslateCmd ()=0 |
virtual void | scalePivotTranslate (double x, double y, double z)=0 |
virtual Vector3d | scalePivot () const =0 |
Matrix4d | inclusiveMatrix () const |
Matrix4d | exclusiveMatrix () const |
virtual Matrix4d | segmentInclusiveMatrix () const =0 |
virtual Matrix4d | segmentExclusiveMatrix () const =0 |
Static Public Member Functions | |
static Ptr | transform3d (const SceneItem::Ptr &item) |
static bool | addObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | removeObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static std::size_t | nbObservers (const SceneItem::Ptr &item) |
static bool | hasObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | hasObservers (const Path &path) |
static bool | hasObservers (Rtid runTimeId) |
static void | notify (const Path &path) |
Abstract base class for 3D transform interface.
This base class defines the interface that run-times can implement to transform objects in 3D, for a given selection item. These include operations like:
Each operation has two calls, one with undo capability, and one without. Providing undo capability typically involves code complexity, and using undo capability incurs run-time cost in processing and memory. Therefore, non- interactive use of this interface should use calls without undo capability.
All operations on the item are done in its local coordinate system, and are absolute. It is the responsibility of the application to convert operations done in any other coordinate system (e.g. world, or another object's coordinate system) back into a UFE item's local coordinates. Similarly, the application must convert relative transformations back into absolute for the UFE item.
As with the rest of UFE, observation is done through the Observer Pattern. Observers can be added to an individual scene item, to be notified when an object's transformation changes.
To avoid the memory-consuming "one proxy object per scene object" approach, Transform3d interface objects should be obtained and used within a local scope, and not stored. Transform3d interfaces should be considered stateless, and can be bound to new selection items.
Definition at line 83 of file transform3d.h.
typedef std::shared_ptr<Transform3d> Ufe::Transform3d::Ptr |
Definition at line 86 of file transform3d.h.
Ufe::Transform3d::Transform3d | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
static |
Add observation on the argument item for Transform3d changes.
Matrix4d Ufe::Transform3d::exclusiveMatrix | ( | ) | const |
|
static |
|
static |
path | Path to verify if being observed. |
|
static |
Helper query for run-times, to determine if any path they are responsible for is being observed.
runTimeId | run-time Id to find observers on. |
Matrix4d Ufe::Transform3d::inclusiveMatrix | ( | ) | const |
|
static |
|
static |
Notify all observers of the item with this path. If no observer exists, does nothing.
path | Path to use on the notify action. |
|
static |
|
pure virtual |
Rotate object to given value.
x | value to rotate on the X-axis. |
y | value to rotate on the Y-axis. |
z | value to rotate on the Z-axis. |
|
pure virtual |
Create an undoable rotate command
|
pure virtual |
Retrieve the rotate pivot point for the object.
|
pure virtual |
Translate the rotate pivot point.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
|
pure virtual |
Create an undoable command to translate the rotate pivot point.
|
pure virtual |
Scale object to given values.
x | value to scale on the X-axis. |
y | value to scale on the Y-axis. |
z | value to scale on the Z-axis. |
|
pure virtual |
Create an undoable scale command
|
pure virtual |
Retrieve the scale pivot point for the object.
|
pure virtual |
Translate the scale pivot point.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
|
pure virtual |
Create an undoable command to translate the scale pivot point.
|
pure virtual |
|
pure virtual |
Retrieve the exclusive Matrix of the object, for all objects in the tail segment of the object's path, excluding the object itself. The tail segment exclusive matrix and inclusive matrices of other segments of a path are multiplied together by exclusiveMatrix(), from head to tail, to obtain the full transformation. In the case of a trivial single segment path, the segmentExclusiveMatrix and the exclusiveMatrix are the same.
|
pure virtual |
Retrieve the inclusive Matrix of the object, for all objects in the tail segment of the object's path, including the object itself. The segment inclusive matrices of a path are multiplied together by inclusiveMatrix(), from head to tail, to obtain the full transformation. In the case of a trivial single segment path, the segmentInclusiveMatrix and the inclusiveMatrix are the same.
|
static |
Convenience method that calls the Transform3d method on the Transform3d handler for the item. Returns a null pointer if the argument is null, or has an empty path.
item | SceneItem's Transform3d to retrieve |
|
pure virtual |
Translate object to the given position.
x | value to translate to the X-axis. |
y | value to translate to the Y-axis. |
z | value to translate to the Z-axis. |
|
pure virtual |
Create an undoable translate command
|
pure virtual |
Retrieve the translate value set for the object.