![]() |
ufe
3.2
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 |
typedef bool(* | RemoveObserverItemType) (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
typedef bool(* | RemoveObserverPathType) (const Path &path, const Observer::Ptr &obs) |
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 (double x, double y, double z)=0 |
TranslateUndoableCommand::Ptr | translateCmd () |
virtual void | translate (double x, double y, double z) |
virtual Vector3d | translation () const =0 |
virtual RotateUndoableCommand::Ptr | rotateCmd (double x, double y, double z)=0 |
RotateUndoableCommand::Ptr | rotateCmd () |
virtual void | rotate (double x, double y, double z) |
virtual Vector3d | rotation () const =0 |
virtual ScaleUndoableCommand::Ptr | scaleCmd (double x, double y, double z)=0 |
ScaleUndoableCommand::Ptr | scaleCmd () |
virtual void | scale (double x, double y, double z) |
virtual Vector3d | scale () const =0 |
virtual TranslateUndoableCommand::Ptr | rotatePivotCmd (double x, double y, double z)=0 |
TranslateUndoableCommand::Ptr | rotatePivotCmd () |
virtual void | rotatePivot (double x, double y, double z) |
virtual Vector3d | rotatePivot () const =0 |
virtual TranslateUndoableCommand::Ptr | scalePivotCmd (double x, double y, double z)=0 |
TranslateUndoableCommand::Ptr | scalePivotCmd () |
virtual void | scalePivot (double x, double y, double z) |
virtual Vector3d | scalePivot () const =0 |
virtual TranslateUndoableCommand::Ptr | translateRotatePivotCmd (double x, double y, double z) |
TranslateUndoableCommand::Ptr | translateRotatePivotCmd () |
virtual void | translateRotatePivot (double x, double y, double z) |
virtual Vector3d | rotatePivotTranslation () const |
virtual TranslateUndoableCommand::Ptr | translateScalePivotCmd (double x, double y, double z) |
TranslateUndoableCommand::Ptr | translateScalePivotCmd () |
virtual void | translateScalePivot (double x, double y, double z) |
virtual Vector3d | scalePivotTranslation () const |
virtual RotateUndoableCommand::Ptr | rotateAxisCmd (double x, double y, double z) |
RotateUndoableCommand::Ptr | rotateAxisCmd () |
virtual void | rotateAxis (double x, double y, double z) |
virtual Vector3d | rotateAxis () const |
virtual ShearUndoableCommand::Ptr | shearCmd (double xy, double xz, double yz) |
ShearUndoableCommand::Ptr | shearCmd () |
virtual void | shear (double xy, double xz, double yz) |
virtual Vector3d | shear () const |
virtual SetMatrix4dUndoableCommand::Ptr | setMatrixCmd (const Matrix4d &m)=0 |
virtual void | setMatrix (const Matrix4d &m) |
virtual Matrix4d | matrix () 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 Ptr | editTransform3d (const SceneItem::Ptr &item, const EditTransform3dHint &hint=EditTransform3dHint()) |
static bool | addObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | removeObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | removeObserver (const Path &path, 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 runtimes 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 runtime 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 89 of file transform3d.h.
typedef std::shared_ptr<Transform3d> Ufe::Transform3d::Ptr |
Definition at line 92 of file transform3d.h.
typedef bool(* Ufe::Transform3d::RemoveObserverItemType) (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
Definition at line 137 of file transform3d.h.
typedef bool(* Ufe::Transform3d::RemoveObserverPathType) (const Path &path, const Observer::Ptr &obs) |
Definition at line 151 of file transform3d.h.
Ufe::Transform3d::Transform3d | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
static |
Add observation on the argument item for Transform3d changes.
|
static |
Convenience method that calls the Ufe::Transform3d::editTransform3d() method on the Transform3d handler for the item. Returns a null pointer if the argument is null, or has an empty path.
item | SceneItem on which to create Transform3d interface. |
hint | Contextual information for Transform3d interface creation. |
Matrix4d Ufe::Transform3d::exclusiveMatrix | ( | ) | const |
|
static |
|
static |
path | Path to verify if being observed. |
|
static |
Helper query for runtimes, to determine if any path they are responsible for is being observed.
runTimeId | runtime Id to find observers on. |
Matrix4d Ufe::Transform3d::inclusiveMatrix | ( | ) | const |
|
pure virtual |
Retrieve the object's local transform matrix.
|
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 |
|
static |
Remove observation on the argument path for transform changes. This method can remove observation from a Path when the corresponding SceneItem is already invalid.
path | path to remove observation on. |
obs | Observer to remove. |
|
inlinevirtual |
Rotate object to given value. Default implementation calls rotateCmd() and executes the returned command, if non-null
x | value to rotate on the X-axis, in degrees. |
y | value to rotate on the Y-axis, in degrees. |
z | value to rotate on the Z-axis, in degrees. |
Definition at line 242 of file transform3d.h.
|
inlinevirtual |
Set the rotate axis to given value. Default implementation calls rotateAxisCmd() and executes the returned command, if non-null.
x | value to rotate on the X-axis, in degrees. |
y | value to rotate on the Y-axis, in degrees. |
z | value to rotate on the Z-axis, in degrees. |
Definition at line 434 of file transform3d.h.
|
inlinevirtual |
Retrieve the Euler angle XYZ rotation axis, in degrees.
Definition at line 443 of file transform3d.h.
|
inlinevirtual |
Create an undoable command to set the rotate axis, an extra rotation to adjust the local axis prior to applying the rotate attribute. Euler angle rotation order is XYZ. The command is not executed. The default implementation in this class is to return a null pointer.
x | value to rotate on the X-axis, in degrees. |
y | value to rotate on the Y-axis, in degrees. |
z | value to rotate on the Z-axis, in degrees. |
Definition at line 420 of file transform3d.h.
|
inline |
Definition at line 426 of file transform3d.h.
|
pure virtual |
Create an undoable rotate command. Euler angle rotation order is XYZ. The command is not executed.
x | value to rotate on the X-axis, in degrees. |
y | value to rotate on the Y-axis, in degrees. |
z | value to rotate on the Z-axis, in degrees. |
|
inline |
Definition at line 234 of file transform3d.h.
|
inlinevirtual |
Translate the rotate pivot point. Default implementation calls rotatePivotCmd() and executes the returned command, if non-null.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
Definition at line 298 of file transform3d.h.
|
pure virtual |
Retrieve the rotate pivot point for the object.
|
pure virtual |
Create an undoable command to translate the rotate pivot point. The command is not executed.
x | X-axis translation. |
y | Y-axis translation. |
z | Z-axis translation. |
|
inline |
Definition at line 290 of file transform3d.h.
|
inlinevirtual |
Retrieve the rotate pivot correction for the object. The default implementation in this class is to return a zero vector.
Definition at line 371 of file transform3d.h.
|
pure virtual |
Retrieve the rotation value set for the object, in degrees. Euler angle rotation order is XYZ.
|
inlinevirtual |
Scale object to given values. Default implementation calls scaleCmd() and executes the returned command, if non-null.
x | value to scale on the X-axis. |
y | value to scale on the Y-axis. |
z | value to scale on the Z-axis. |
Definition at line 270 of file transform3d.h.
|
pure virtual |
Retrieve the scale value set for the object.
|
pure virtual |
Create an undoable scale command. The command is not executed.
x | value to scale on the X-axis. |
y | value to scale on the Y-axis. |
z | value to scale on the Z-axis. |
|
inline |
Definition at line 262 of file transform3d.h.
|
inlinevirtual |
Translate the scale pivot point. Default implementation calls scalePivotCmd() and executes the returned command, if non-null.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
Definition at line 326 of file transform3d.h.
|
pure virtual |
Retrieve the scale pivot point for the object.
|
pure virtual |
Create an undoable command to translate the scale pivot point. The command is not executed.
x | X-axis translation. |
y | Y-axis translation. |
z | Z-axis translation. |
|
inline |
Definition at line 318 of file transform3d.h.
|
inlinevirtual |
Retrieve the scale pivot correction for the object. The default implementation in this class is to return a zero vector.
Definition at line 408 of file transform3d.h.
|
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.
|
inlinevirtual |
Set the object's local transform to the argument matrix. Implementation in this class executes the command returned by setMatrixCmd(), if non-null.
m | Complete local transformation for the object. |
Definition at line 492 of file transform3d.h.
|
pure virtual |
Create an undoable command to set the object's local transform to the argument matrix. The command is not executed.
m | Complete local transformation for the object. |
|
inlinevirtual |
Change the shear. Default implementation calls shearCmd() and executes the returned command, if non-null.
xy | xy shearing. |
xz | xz shearing. |
yz | yz shearing. |
Definition at line 468 of file transform3d.h.
|
inlinevirtual |
Retrieve the shear for the object. The default implementation in this class is to return a zero vector.
Definition at line 478 of file transform3d.h.
|
inlinevirtual |
Create an undoable command to change the shearing in (xy, xz, yz). The command is not executed. The default implementation in this class is to return a null pointer.
xy | xy shearing. |
xz | xz shearing. |
yz | yz shearing. |
Definition at line 454 of file transform3d.h.
|
inline |
Definition at line 460 of file transform3d.h.
|
static |
Convenience method that calls the Ufe::Transform3dHandler::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 on which to create Transform3d interface. |
|
inlinevirtual |
Translate object to the given position. Default implementation calls translateCmd() and executes the returned command, if non-null.
x | value to translate to the X-axis. |
y | value to translate to the Y-axis. |
z | value to translate to the Z-axis. |
Definition at line 214 of file transform3d.h.
|
pure virtual |
Create an undoable translate command. The command is not executed.
x | X-axis translation. |
y | Y-axis translation. |
z | Z-axis translation. |
|
inline |
Definition at line 206 of file transform3d.h.
|
inlinevirtual |
Change the rotate pivot correction. Default implementation calls translateRotatePivotCmd() and executes the returned command, if non-null.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
Definition at line 361 of file transform3d.h.
|
inlinevirtual |
Create an undoable command to change the rotate pivot correction. This is used when it is desired to move the rotate pivot point without affecting the overall transformation matrix. The command is not executed. The default implementation in this class is to return a null pointer.
x | X-axis translation. |
y | Y-axis translation. |
z | Z-axis translation. |
Definition at line 346 of file transform3d.h.
|
inline |
Definition at line 352 of file transform3d.h.
|
inlinevirtual |
Change the scale pivot correction. Default implementation calls translateScalePivotCmd() and executes the returned command, if non-null.
x | value to translate on the X-axis. |
y | value to translate on the Y-axis. |
z | value to translate on the Z-axis. |
Definition at line 398 of file transform3d.h.
|
inlinevirtual |
Create an undoable command to change the scale pivot correction. This is used when it is desired to move the scale pivot point without affecting the overall transformation matrix. The command is not executed. The default implementation in this class is to return a null pointer.
x | X-axis translation. |
y | Y-axis translation. |
z | Z-axis translation. |
Definition at line 384 of file transform3d.h.
|
inline |
Definition at line 390 of file transform3d.h.
|
pure virtual |
Retrieve the translate value set for the object.