![]() |
ufe 6.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 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) |
Public Member Functions | |
Camera () | |
Constructor. More... | |
Camera (const Camera &)=default | |
Default copy constructor. More... | |
virtual | ~Camera () |
Destructor. More... | |
virtual const Path & | path () const =0 |
virtual SceneItem::Ptr | sceneItem () const =0 |
virtual HorizontalApertureUndoableCommand::Ptr | horizontalApertureCmd (float ha)=0 |
virtual void | horizontalAperture (float ha) |
virtual float | horizontalAperture () const =0 |
virtual VerticalApertureUndoableCommand::Ptr | verticalApertureCmd (float va)=0 |
virtual void | verticalAperture (float va) |
virtual float | verticalAperture () const =0 |
virtual HorizontalApertureOffsetUndoableCommand::Ptr | horizontalApertureOffsetCmd (float hao)=0 |
virtual void | horizontalApertureOffset (float hao) |
virtual float | horizontalApertureOffset () const =0 |
virtual VerticalApertureOffsetUndoableCommand::Ptr | verticalApertureOffsetCmd (float vao)=0 |
virtual void | verticalApertureOffset (float vao) |
virtual float | verticalApertureOffset () const =0 |
virtual FStopUndoableCommand::Ptr | fStopCmd (float fs)=0 |
virtual void | fStop (float fs) |
virtual float | fStop () const =0 |
virtual FocalLengthUndoableCommand::Ptr | focalLengthCmd (float fl)=0 |
virtual void | focalLength (float fl) |
virtual float | focalLength () const =0 |
virtual FocusDistanceUndoableCommand::Ptr | focusDistanceCmd (float fd)=0 |
virtual void | focusDistance (float fd) |
virtual float | focusDistance () const =0 |
virtual NearClipPlaneUndoableCommand::Ptr | nearClipPlaneCmd (float ncp)=0 |
virtual void | nearClipPlane (float ncp) |
virtual float | nearClipPlane () const =0 |
virtual FarClipPlaneUndoableCommand::Ptr | farClipPlaneCmd (float fcp)=0 |
virtual void | farClipPlane (float fcp) |
virtual float | farClipPlane () const =0 |
virtual ProjectionUndoableCommand::Ptr | projectionCmd (Projection p)=0 |
virtual void | projection (Projection p) |
virtual Projection | projection () const =0 |
virtual bool | renderable () const =0 |
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 |
Retrieve the renderable state for the camera
|
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. |