ufe 5.5
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 Types inherited from Ufe::Transform3dRead | |
typedef std::shared_ptr< Transform3dRead > | Ptr |
Public Member Functions | |
Transform3d () | |
Constructor. More... | |
Transform3d (const Transform3d &)=default | |
Default copy constructor. More... | |
virtual | ~Transform3d () override |
Destructor. More... | |
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) |
Public Member Functions inherited from Ufe::Transform3dRead | |
Transform3dRead () | |
Constructor. More... | |
Transform3dRead (const Transform3dRead &)=default | |
Default copy constructor. More... | |
virtual | ~Transform3dRead () |
Destructor. More... | |
virtual const Path & | path () const =0 |
virtual SceneItem::Ptr | sceneItem () const =0 |
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) |
Static Public Member Functions inherited from Ufe::Transform3dRead | |
static Ptr | transform3dRead (const SceneItem::Ptr &item) |
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 153 of file transform3d.h.
typedef std::shared_ptr<Transform3d> Ufe::Transform3d::Ptr |
Definition at line 156 of file transform3d.h.
typedef bool(* Ufe::Transform3d::RemoveObserverItemType) (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
Definition at line 201 of file transform3d.h.
typedef bool(* Ufe::Transform3d::RemoveObserverPathType) (const Path &path, const Observer::Ptr &obs) |
Definition at line 215 of file transform3d.h.
Ufe::Transform3d::Transform3d | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
overridevirtual |
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. |
|
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. |
|
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 |
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. |
|
static |
|
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 300 of file transform3d.h.
|
inlinevirtual |
Retrieve the Euler angle XYZ rotation axis, in degrees.
Definition at line 501 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 492 of file transform3d.h.
|
inline |
Definition at line 484 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 478 of file transform3d.h.
|
inline |
Definition at line 292 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. |
|
pure virtual |
Retrieve the rotate pivot point for the object.
|
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 356 of file transform3d.h.
|
inline |
Definition at line 348 of file transform3d.h.
|
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. |
|
inlinevirtual |
Retrieve the rotate pivot correction for the object. The default implementation in this class is to return a zero vector.
Definition at line 429 of file transform3d.h.
|
pure virtual |
Retrieve the rotation value set for the object, in degrees. Euler angle rotation order is XYZ.
|
pure virtual |
Retrieve the scale value set for the object.
|
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 328 of file transform3d.h.
|
inline |
Definition at line 320 of file transform3d.h.
|
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. |
|
pure virtual |
Retrieve the scale pivot point for the object.
|
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 384 of file transform3d.h.
|
inline |
Definition at line 376 of file transform3d.h.
|
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. |
|
inlinevirtual |
Retrieve the scale pivot correction for the object. The default implementation in this class is to return a zero vector.
Definition at line 466 of file transform3d.h.
|
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 550 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 |
Retrieve the shear for the object. The default implementation in this class is to return a zero vector.
Definition at line 536 of file transform3d.h.
|
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 526 of file transform3d.h.
|
inline |
Definition at line 518 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 512 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 272 of file transform3d.h.
|
inline |
Definition at line 264 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. |
|
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 419 of file transform3d.h.
|
inline |
Definition at line 410 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 404 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 456 of file transform3d.h.
|
inline |
Definition at line 448 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 442 of file transform3d.h.
|
pure virtual |
Retrieve the translate value set for the object.