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 camera interface. More...
#include <camera.h>
Public Types | |
enum | Projection { Perspective , Orthographic } |
typedef std::shared_ptr< Camera > | Ptr |
typedef bool(* | RemoveObserverItemType) (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
typedef bool(* | RemoveObserverPathType) (const Path &path, const Observer::Ptr &obs) |
Static Public Member Functions | |
static Ptr | camera (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 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 camera interface.
This base class defines the interface that runtimes can implement for cameras.
To determine the transform of a camera attach a transform3d interface to the scene item, or to the first ancestor scene item which is a Transform3d.
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.
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, Camera interface objects should be obtained and used within a local scope, and not stored. Camera interfaces should be considered stateless, and can be bound to new selection items.
typedef std::shared_ptr<Camera> Ufe::Camera::Ptr |
typedef bool(* Ufe::Camera::RemoveObserverItemType) (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
typedef bool(* Ufe::Camera::RemoveObserverPathType) (const Path &path, const Observer::Ptr &obs) |
Ufe::Camera::Camera | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
static |
|
static |
Convenience method that calls the Ufe::CameraHandler::camera() method on the Camera handler for the item. Returns a null pointer if the argument is null, is an empty path or if the item does not support the Camera interface.
|
pure virtual |
Retrieve the far clip plane for the camera
|
inlinevirtual |
Set the far clip plane. Default implementation calls farClipPlaneCmd() and executes the returned command, if non-null.
fcp | the new far clip plane. |
|
pure virtual |
Create an undoable command to set the far clip plane. The command is not executed.
fcp | the new far clip plane. |
|
pure virtual |
Retrieve the focal length for the camera
|
inlinevirtual |
Set the focal length. Default implementation calls focalLengthCmd() and executes the returned command, if non-null.
fl | the new focal length in millimeters. |
|
pure virtual |
Create an undoable command to set the focal length. The command is not executed.
fl | the new focal length in millimeters. |
|
pure virtual |
Retrieve the focus distance for the camera
|
inlinevirtual |
Set the focus distance. Default implementation calls focusDistanceCmd() and executes the returned command, if non-null.
fd | the new focus distance in millimeters. |
|
pure virtual |
Create an undoable command to set the focus distance. The command is not executed.
fd | the new focus distance in millimeters. |
|
pure virtual |
Retrieve the fStop for the camera
|
inlinevirtual |
Set the fStop. Default implementation calls fStopCmd() and executes the returned command, if non-null.
fs | the new fStop in millimeters. |
|
pure virtual |
Create an undoable command to set the fStop. The command is not executed.
fs | the new fStop in millimeters. |
|
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. |
|
pure virtual |
Retrieve the horizontal aperture for the camera
|
inlinevirtual |
Set the horizontal aperture. Default implementation calls horizontalApertureCmd() and executes the returned command, if non-null.
ha | the new horizontal aperture in inches. |
|
pure virtual |
Create an undoable command to set the horizontal aperture. The command is not executed.
ha | the new horizontal aperture in inches. |
|
pure virtual |
Retrieve the horizontal aperture offset for the camera
|
inlinevirtual |
Set the horizontal aperture offset. Default implementation calls horizontalApertureOffsetCmd() and executes the returned command, if non-null.
hao | the new horizontal aperture offset in inches. |
|
pure virtual |
Create an undoable command to set the horizontal aperture offset. The command is not executed.
hao | the new horizontal aperture offset in inches. |
|
static |
|
pure virtual |
Retrieve the near clip plane for the camera
|
inlinevirtual |
Set the near clip plane. Default implementation calls nearClipPlaneCmd() and executes the returned command, if non-null.
ncp | the new near clip plane. |
|
pure virtual |
Create an undoable command to set the near clip plane. The command is not executed.
ncp | the new near clip plane. |
|
static |
Notify all observers of the item with this path. If no observer exists, does nothing.
path | Path to use on the notify action. |
|
pure virtual |
Retrieve the projection for the camera
|
inlinevirtual |
Set the projection. Default implementation calls projectionCmd() and executes the returned command, if non-null.
p | the new projection. |
|
pure virtual |
Create an undoable command to set the projection. The command is not executed.
p | the new projection. |
|
static |
|
static |
|
pure virtual |
|
pure virtual |
Retrieve the vertical aperture for the camera
|
inlinevirtual |
Set the vertical aperture. Default implementation calls verticalApertureCmd() and executes the returned command, if non-null.
va | the new vertical aperture in inches. |
|
pure virtual |
Create an undoable command to set the vertical aperture. The command is not executed.
va | the new vertical aperture in inches. |
|
pure virtual |
Retrieve the vertical aperture offset for the camera
|
inlinevirtual |
Set the vertical aperture offset. Default implementation calls verticalApertureOffsetCmd() and executes the returned command, if non-null.
vao | the new vertical aperture offset in inches. |
|
pure virtual |
Create an undoable command to set the vertical aperture offset. The command is not executed.
vao | the new vertical aperture offset in inches. |