HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_CameraParms Class Reference

#include <UT_CameraParms.h>

Public Member Functions

 UT_CameraParms ()
 
void setDefaults ()
 
bool operator== (const UT_CameraParms &other) const
 
bool operator!= (const UT_CameraParms &other) const
 
UT_CameraParmsoperator+= (const UT_CameraParms &other)
 
UT_CameraParmsoperator*= (const fpreal multiplier)
 same as above but multiplies float parameters by multiplier More...
 
UT_Options getOptions () const
 
void setFromOptions (const UT_Options *options)
 
bool save (UT_JSONWriter &w) const
 
bool save (UT_JSONValue &v) const
 
bool load (UT_JSONParser &p)
 
fpreal getAspectRatio () const
 
void getWindowSize (fpreal &x, fpreal &y) const
 
void getWindowCenter (fpreal &x, fpreal &y) const
 
void setWindow (fpreal x, fpreal y, fpreal sizex, fpreal sizey)
 sets the window from a window offset and a window size More...
 
bool isOrthographic () const
 returns true if the camera is orthographic More...
 

Static Public Member Functions

static const char * getProjectionToken (OBJ_ProjectionType projection)
 
static OBJ_ProjectionType getProjectionEnum (const char *token)
 
static bool save3DCamera (UT_JSONWriter &w, const UT_Vector3D &position, const UT_Matrix3D &transform, const UT_CameraParms &parms)
 
static bool load3DCamera (UT_JSONParser &p, UT_Vector3D &position, UT_Matrix3D &transform, UT_CameraParms &parms)
 

Public Attributes

fpreal focal
 
fpreal aperture
 
fpreal pixelaspect
 
fpreal focusdistance
 
fpreal fstop
 
fpreal imagingdistance
 
fpreal cropx [2]
 
fpreal cropy [2]
 
fpreal winx [2]
 
fpreal winy [2]
 
fpreal clipnear
 
fpreal clipfar
 
fpreal shutteropen
 
fpreal shutterclose
 
fpreal orthozoom
 
fpreal guidescale
 
exint resx
 
exint resy
 
OBJ_ProjectionType projection
 
UT_OptionsHolder metadata
 

Detailed Description

Definition at line 33 of file UT_CameraParms.h.

Constructor & Destructor Documentation

UT_CameraParms::UT_CameraParms ( )
inline

Definition at line 36 of file UT_CameraParms.h.

Member Function Documentation

fpreal UT_CameraParms::getAspectRatio ( ) const
inline

Convenience functions

Definition at line 157 of file UT_CameraParms.h.

UT_Options UT_CameraParms::getOptions ( ) const

Methods to get and set the parameters with UT_Options.

static OBJ_ProjectionType UT_CameraParms::getProjectionEnum ( const char *  token)
static
static const char* UT_CameraParms::getProjectionToken ( OBJ_ProjectionType  projection)
static
void UT_CameraParms::getWindowCenter ( fpreal x,
fpreal y 
) const
inline

Convenience functions

Definition at line 167 of file UT_CameraParms.h.

void UT_CameraParms::getWindowSize ( fpreal x,
fpreal y 
) const
inline

Convenience functions

Definition at line 161 of file UT_CameraParms.h.

bool UT_CameraParms::isOrthographic ( ) const
inline

returns true if the camera is orthographic

Definition at line 185 of file UT_CameraParms.h.

bool UT_CameraParms::load ( UT_JSONParser p)

Methods to serialize the parameters to a JSON stream:

"aperture":41.42136,
"pixelaspect":1,
"clipnear": 0.001
"clipfar" :1000000,
"cropmax":[1,1],
"cropmin":[0,0],
"focal":50,
"focusdistance":10,
"fstop":22.1,
"orthozoom":1,
"guidescale": 1,
"imagingdistance": 1,
"projection":"perspective",
"resolutionx" :320,
"resolutiony" : 243,
"shutteropen" : 0
"shutterclose": 0,
"windowmax":[1,1],
"windowmin":[0,0]
"metadata": {}
static bool UT_CameraParms::load3DCamera ( UT_JSONParser p,
UT_Vector3D position,
UT_Matrix3D transform,
UT_CameraParms parms 
)
static

Methods to serialize a 3D camera to a JSON stream:

{
"camera":{
"aperture":41.42136,
"aspect":1,
"clipnear": 0.001,
"clipfar": 1000000,
"cropmax":[1,1],
"cropmin":[0,0],
"focal":50,
"focusdistance":10,
"fstop":22.1,
"orthozoom":1,
"guidescale":1,
"imagingdistance": 1
"projection":"perspective",
"resolutionx":320,
"resolutiony":243,
"shutteropen":0,
"shutterclose":0,
"windowmax":[1,1],
"windowmin":[0,0]
"metadata": {}
},
"position":[0,0,0],
"transform":[1,0,0,0,1,0,0,0,1]
}
bool UT_CameraParms::operator!= ( const UT_CameraParms other) const
inline

Definition at line 99 of file UT_CameraParms.h.

UT_CameraParms& UT_CameraParms::operator*= ( const fpreal  multiplier)

same as above but multiplies float parameters by multiplier

UT_CameraParms& UT_CameraParms::operator+= ( const UT_CameraParms other)

adds the float parameters together which means everything but

  • resolution
  • metadata
  • projection
bool UT_CameraParms::operator== ( const UT_CameraParms other) const
bool UT_CameraParms::save ( UT_JSONWriter w) const

Methods to serialize the parameters to a JSON stream:

"aperture":41.42136,
"pixelaspect":1,
"clipnear": 0.001
"clipfar" :1000000,
"cropmax":[1,1],
"cropmin":[0,0],
"focal":50,
"focusdistance":10,
"fstop":22.1,
"orthozoom":1,
"guidescale": 1,
"imagingdistance": 1,
"projection":"perspective",
"resolutionx" :320,
"resolutiony" : 243,
"shutteropen" : 0
"shutterclose": 0,
"windowmax":[1,1],
"windowmin":[0,0]
"metadata": {}
bool UT_CameraParms::save ( UT_JSONValue v) const

Methods to serialize the parameters to a JSON stream:

"aperture":41.42136,
"pixelaspect":1,
"clipnear": 0.001
"clipfar" :1000000,
"cropmax":[1,1],
"cropmin":[0,0],
"focal":50,
"focusdistance":10,
"fstop":22.1,
"orthozoom":1,
"guidescale": 1,
"imagingdistance": 1,
"projection":"perspective",
"resolutionx" :320,
"resolutiony" : 243,
"shutteropen" : 0
"shutterclose": 0,
"windowmax":[1,1],
"windowmin":[0,0]
"metadata": {}
static bool UT_CameraParms::save3DCamera ( UT_JSONWriter w,
const UT_Vector3D position,
const UT_Matrix3D transform,
const UT_CameraParms parms 
)
static

Methods to serialize a 3D camera to a JSON stream:

{
"camera":{
"aperture":41.42136,
"aspect":1,
"clipnear": 0.001,
"clipfar": 1000000,
"cropmax":[1,1],
"cropmin":[0,0],
"focal":50,
"focusdistance":10,
"fstop":22.1,
"orthozoom":1,
"guidescale":1,
"imagingdistance": 1
"projection":"perspective",
"resolutionx":320,
"resolutiony":243,
"shutteropen":0,
"shutterclose":0,
"windowmax":[1,1],
"windowmin":[0,0]
"metadata": {}
},
"position":[0,0,0],
"transform":[1,0,0,0,1,0,0,0,1]
}
void UT_CameraParms::setDefaults ( )
void UT_CameraParms::setFromOptions ( const UT_Options options)

Methods to get and set the parameters with UT_Options.

void UT_CameraParms::setWindow ( fpreal  x,
fpreal  y,
fpreal  sizex,
fpreal  sizey 
)
inline

sets the window from a window offset and a window size

Definition at line 173 of file UT_CameraParms.h.

Member Data Documentation

fpreal UT_CameraParms::aperture

Definition at line 42 of file UT_CameraParms.h.

fpreal UT_CameraParms::clipfar

Definition at line 51 of file UT_CameraParms.h.

fpreal UT_CameraParms::clipnear

Definition at line 51 of file UT_CameraParms.h.

fpreal UT_CameraParms::cropx[2]

Definition at line 47 of file UT_CameraParms.h.

fpreal UT_CameraParms::cropy[2]

Definition at line 48 of file UT_CameraParms.h.

fpreal UT_CameraParms::focal

Definition at line 41 of file UT_CameraParms.h.

fpreal UT_CameraParms::focusdistance

Definition at line 44 of file UT_CameraParms.h.

fpreal UT_CameraParms::fstop

Definition at line 45 of file UT_CameraParms.h.

fpreal UT_CameraParms::guidescale

Definition at line 55 of file UT_CameraParms.h.

fpreal UT_CameraParms::imagingdistance

Definition at line 46 of file UT_CameraParms.h.

UT_OptionsHolder UT_CameraParms::metadata

Definition at line 60 of file UT_CameraParms.h.

fpreal UT_CameraParms::orthozoom

Definition at line 54 of file UT_CameraParms.h.

fpreal UT_CameraParms::pixelaspect

Definition at line 43 of file UT_CameraParms.h.

OBJ_ProjectionType UT_CameraParms::projection

Definition at line 59 of file UT_CameraParms.h.

exint UT_CameraParms::resx

Definition at line 57 of file UT_CameraParms.h.

exint UT_CameraParms::resy

Definition at line 57 of file UT_CameraParms.h.

fpreal UT_CameraParms::shutterclose

Definition at line 53 of file UT_CameraParms.h.

fpreal UT_CameraParms::shutteropen

Definition at line 52 of file UT_CameraParms.h.

fpreal UT_CameraParms::winx[2]

Definition at line 49 of file UT_CameraParms.h.

fpreal UT_CameraParms::winy[2]

Definition at line 50 of file UT_CameraParms.h.


The documentation for this class was generated from the following file: