Katana Plug-in APIs 0.1
Public Member Functions

Foundry::Katana::ViewerAPI::ViewportCameraPluginBase Class Reference

Interface for a camera. More...

#include <FnViewportCamera.h>

Inheritance diagram for Foundry::Katana::ViewerAPI::ViewportCameraPluginBase:
Foundry::Katana::ViewerAPI::ViewportCamera Foundry::Katana::ViewerAPI::ViewportCameraWrapper

List of all members.

Public Member Functions

ViewportWrapperPtr getViewport ()
 Gets the Viewport.
const double * getViewMatrix ()
 Gets the View Matrix for this camera.
Matrix44d getViewMatrix44d ()
 Gets the View Matrix for this camera.
void setViewMatrix (const double *matrix)
 Sets the View Matrix for this camera.
const double * getProjectionMatrix ()
 Gets the Projection Matrix for this camera.
Matrix44d getProjectionMatrix44d ()
 Gets the Projection Matrix for this camera.
void setProjectionMatrix (const double *matrix)
 Sets the Projection Matrix for this camera.
double getCenterOfInterest ()
 Gets the center of interest for this camera.
void setCenterOfInterest (double coi)
 Sets the center of interest for this camera.
double getFOV ()
 Gets the field of view for this camera.
void setFOV (double fov)
 Sets the field of view for this camera.
double getOrthographicWidth ()
 Gets the orthographic camera dimensions (if applicable)
void setOrthographicWidth (double width)
 Sets the orthographic width of the camera.
void getNearFar (double &near, double &far)
 Gets the near and far plane distances for this camera.
void setNearFar (double near, double far)
 Sets the near and far plane distances for this camera.
void getScreenWindow (double &left, double &right, double &bottom, double &top)
 Gets the screen window dimensions for this camera.
void setScreenWindow (double left, double right, double bottom, double top)
 Sets the screen window dimensions for this camera.
bool hasLocationPath ()
 Returns true if this camera is controlled by a location.
std::string getLocationPath ()
 Gets the location path if this camera is controlled by one.
void setLocationPath (const std::string &locationPath)
 Sets the location that will control this camera.
Vec3d getOrigin ()
 Gets the camera origin.
Vec3d getDirection ()
 Gets the camera look direction.
Vec3d getUp ()
 Gets the camera up direction.
Vec3d getLeft ()
 Gets the camera left direction.
bool isInteractionDisabled ()
 Checks whether the camera has been flagged as non-interactive.
void disableInteraction (bool disabled)
 Flags the camera as non-interactive.

Detailed Description

Interface for a camera.

A ViewportCamera is an important component of a Viewport that is used by the Viewport, ViewportLayers and Manipulators to determine the view and projection matrices, and also to perform useful functions such as projecting points between world and window spaces. A Viewport requires a reference to a single ViewportCamera, however multiple viewports can reference the same camera if required. A camera can optionally be controlled by a location (see hasLocationPath(), getLocationPath() and setLocationPath).

This is a virtual base class to be extended in your plug-in. In addition to implementing all the pure virtual functions in this class, you must also implement this static method in your derived class:

 // Returns a new instance of your derived class.
 static ViewportCamera* create();

To indicate an error to the caller, your implementation may throw an exception derived from std::exception.

ViewportCamera is the class that plugins should extend and implement.

ViewportCameraWrapper is the class that allows other plugin types to access the ViewportCamera plugin.

ViewportCameraPluginBase is the base class that provides the common methods between ViewportCamera and ViewportCameraWrapper.


Member Function Documentation

void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::disableInteraction ( bool  disabled)

Flags the camera as non-interactive.

Parameters:
disabledSet it to true to disable interaction or false to re-enable it.
double Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getCenterOfInterest ( )

Gets the center of interest for this camera.

Returns:
The distance along the cameras look direction to the center of interest.
std::string Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getLocationPath ( )

Gets the location path if this camera is controlled by one.

A camera that is controlled by a location has its properties (including the transform) defined by a location produced by the ViewerDelegate.

Returns:
The location path that controls this camera or an empty string if it is not controlled by any location.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getNearFar ( double &  near,
double &  far 
)

Gets the near and far plane distances for this camera.

Parameters:
nearWill be set to the distance to the near clipping plane.
farWill be set to the distance to the far clipping plane.
double Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getOrthographicWidth ( )

Gets the orthographic camera dimensions (if applicable)

Returns:
The orthographic width, or 0 in not applicable.
const double* Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getProjectionMatrix ( )

Gets the Projection Matrix for this camera.

Returns:
The 4x4 Projection Matrix represented by 16 doubles.
Matrix44d Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getProjectionMatrix44d ( )

Gets the Projection Matrix for this camera.

Returns:
The 4x4 Projection Matrix.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getScreenWindow ( double &  left,
double &  right,
double &  bottom,
double &  top 
)

Gets the screen window dimensions for this camera.

Parameters:
leftWill be set to the left position of the screen window.
rightWill be set to the right position of the screen window.
bottomWill be set to the bottom position of the screen window.
topWill be set to the top position of the screen window.
const double* Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getViewMatrix ( )

Gets the View Matrix for this camera.

Returns:
The 4x4 Viewer Matrix represented by 16 doubles.
Matrix44d Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getViewMatrix44d ( )

Gets the View Matrix for this camera.

Returns:
The 4x4 View Matrix.
ViewportWrapperPtr Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::getViewport ( )

Gets the Viewport.

Returns:
The Viewport that created and manages this layer.
bool Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::hasLocationPath ( )

Returns true if this camera is controlled by a location.

A camera that is controlled by a location has its properties (including the transform) defined by a location produced by the ViewerDelegate.

bool Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::isInteractionDisabled ( )

Checks whether the camera has been flagged as non-interactive.

Layers that wish to start an interaction should check for this predicate before making any change to the camera.

Returns:
True if interaction has been explicitly disabled.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setCenterOfInterest ( double  coi)

Sets the center of interest for this camera.

Parameters:
coiThe distance along the cameras look direction to the center of interest.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setFOV ( double  fov)

Sets the field of view for this camera.

Parameters:
fovThe field of view angle in degrees.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setLocationPath ( const std::string &  locationPath)

Sets the location that will control this camera.

A camera that is controlled by a location has its properties (including the transform) defined by a location produced by the ViewerDelegate.

void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setNearFar ( double  near,
double  far 
)

Sets the near and far plane distances for this camera.

Parameters:
nearThe distance to the near clipping plane.
farThe distance to the far clipping plane.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setOrthographicWidth ( double  width)

Sets the orthographic width of the camera.

Parameters:
widthThe new orthographic width.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setProjectionMatrix ( const double *  matrix)

Sets the Projection Matrix for this camera.

Parameters:
matrixThe 4x4 Projection Matrix represented by 16 doubles.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setScreenWindow ( double  left,
double  right,
double  bottom,
double  top 
)

Sets the screen window dimensions for this camera.

Parameters:
leftThe left position of the screen window.
rightThe right position of the screen window.
bottomThe bottom position of the screen window.
topThe top position of the screen window.
void Foundry::Katana::ViewerAPI::ViewportCameraPluginBase::setViewMatrix ( const double *  matrix)

Sets the View Matrix for this camera.

Parameters:
matrixThe 4x4 Viewer Matrix represented by 16 doubles.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator