cherish
Public Member Functions | Protected Member Functions | List of all members
entity::EditableWire Class Reference

A scene graph class that contains all the geometric entities for camera pose drawing. More...

#include <EditableWire.h>

Inheritance diagram for entity::EditableWire:

Public Member Functions

 EditableWire (double fov2)
 
osg::Vec3f getEye3D () const
 
osg::Vec3f getEye2D () const
 
osg::Vec3f getFocal2D () const
 
osg::Vec3f getCenter3D () const
 
osg::Vec3f getRight2D () const
 
osg::Vec3f getRight3D () const
 
osg::Vec3f getUp () const
 
double getFOV2 () const
 
void getCenter2D (osg::Vec2f &p1, osg::Vec2f &p2) const
 
osg::Vec3f getCenter2D () const
 
const osg::Geode * getGeode () const
 
void editEye (double u, double v)
 
void editCenter (double theta)
 
void editFocal (double angle)
 
void unselect ()
 
void pick (int index)
 
void unpick ()
 

Protected Member Functions

void setColorFocal (const osg::Vec4f &color)
 
void setColorEyeDefaults ()
 
void setColorCenterDefaults ()
 
void updateGeometry (osg::Geometry *geom)
 
void move (double u, double v)
 
void rotate (double theta)
 
void translate (double d)
 
void expand (double a)
 

Detailed Description

A scene graph class that contains all the geometric entities for camera pose drawing.

The EditableWire has a shape of triangle and it indicates a camera pose:

(center) |

— (focal)
\ /

\ / o (eye)

Constructor & Destructor Documentation

§ EditableWire()

entity::EditableWire::EditableWire ( double  fov2)

Constructor to initialize the scene graph and to set default colors.

Parameters
fov2is the current FOV within Cherish environment (OpenGL parameter that can be extracted from GLWidget).

Member Function Documentation

§ editCenter()

void entity::EditableWire::editCenter ( double  theta)

A method to edit the center position of the camera pose, i.e., the camera look direction.

Parameters
thetais the rotation angle from the current position.

§ editEye()

void entity::EditableWire::editEye ( double  u,
double  v 
)

A method to edit the position of the camera eye (point of the triangular wire).

§ editFocal()

void entity::EditableWire::editFocal ( double  angle)

A method to edit focal distance of the camera pose.

Parameters
distanceis the new distance from camera eye. Note, the distance can never be smaller than certain threshold, e.g., 0.2.

§ getCenter2D() [1/2]

void entity::EditableWire::getCenter2D ( osg::Vec2f &  p1,
osg::Vec2f &  p2 
) const

A method to obtain local coordinates of the center points.

Parameters
p1is the input parameter for eye location,
p2is the input parameter for center location.

§ getCenter2D() [2/2]

osg::Vec3f entity::EditableWire::getCenter2D ( ) const
Returns
camera's center position.

§ getCenter3D()

osg::Vec3f entity::EditableWire::getCenter3D ( ) const
Returns
global center of the camera pose wire.

§ getEye2D()

osg::Vec3f entity::EditableWire::getEye2D ( ) const
Returns
local eye position of the camera pose wire.

§ getEye3D()

osg::Vec3f entity::EditableWire::getEye3D ( ) const
Returns
global eye of the camera pose wire.

§ getFocal2D()

osg::Vec3f entity::EditableWire::getFocal2D ( ) const
Returns
local position of the second focal point (first being the eye, third is symmetrical to the second one).

§ getFOV2()

double entity::EditableWire::getFOV2 ( ) const
Returns
full angle - field of view, in degrees.

§ getGeode()

const osg::Geode * entity::EditableWire::getGeode ( ) const
Returns
const pointer on geode node which contains all the drawables (i.e. return geode parent).

§ getRight2D()

osg::Vec3f entity::EditableWire::getRight2D ( ) const
Returns
2D right direction vector

§ getRight3D()

osg::Vec3f entity::EditableWire::getRight3D ( ) const
Returns
3D right vector

§ getUp()

osg::Vec3f entity::EditableWire::getUp ( ) const
Returns
global up vector.

§ move()

void entity::EditableWire::move ( double  u,
double  v 
)
protected

A method to move all the geometries to another place. Normally called from editEye().

Parameters
uis the new u local coordinate
vis the new v local coordinate

§ pick()

void entity::EditableWire::pick ( int  index)

A method to set up selected color for a geometry.

Parameters
indexis the given geometry index, e.g., 1 for eye, 2 for center, and 3 for focal geometry.

§ rotate()

void entity::EditableWire::rotate ( double  theta)
protected

A method to rotate all the geometries on a given angle. Normally called from editCenter().

Parameters
thetais the rotation angle. The rotation is performed around the camera's eye position.

§ setColorCenterDefaults()

void entity::EditableWire::setColorCenterDefaults ( )
protected

A method to set up default colors to center geometry.

§ setColorEyeDefaults()

void entity::EditableWire::setColorEyeDefaults ( )
protected

A method to set up default colors to eye geometry.

§ setColorFocal()

void entity::EditableWire::setColorFocal ( const osg::Vec4f &  color)
protected

Set a given color to the whole focal geometry.

Parameters
coloris the color input.

§ translate()

void entity::EditableWire::translate ( double  d)
protected

A method to translate the focal geometry along the center line of camera pose wire.

Parameters
dis the new distance between the camera eye and the new position of the focal geometry. The method also updates the new length of the focal geometry since it is based on the distance from an eye.

§ unpick()

void entity::EditableWire::unpick ( )

A method to set up the selected geometry to unselected default color.

§ unselect()

void entity::EditableWire::unselect ( )

A method to set up defult colors for all the geometries.

§ updateGeometry()

void entity::EditableWire::updateGeometry ( osg::Geometry *  geom)
protected

A method to update geometries after new colors are assigned.


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