Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuParallelCamera Class Reference

This class creates a camera class for orthogonal projections. More...

#include <vuParallelCamera.h>

Inheritance diagram for vuParallelCamera:

Inheritance graph
[legend]
Collaboration diagram for vuParallelCamera:

Collaboration graph
[legend]
List of all members.

Public Member Functions

vuCameraType getType (void)
 vuParallelCamera ()
 Default constructor - set initial values.
 vuParallelCamera (const vuParallelCamera &c)
 copy constructor
virtual ~vuParallelCamera ()
 Destructor.
float getXRange (void)
 set X size of the viewing box
void setXRange (float xrng)
 set X size of the viewing box
float getYRange (void)
 set Y size of the viewing box
void setYRange (float yrng)
 set Y size of the viewing box
void setNear (float near)
 this will set the near clipping plane of this camera to be 'near' away from the camera's position
float getNear ()
 This will return the distance to the near clipping plane from the eye of the camera.
void setFar (float far)
 This will set the far clipping plane of this camera to be 'far' away from the camera's position.
float getFar ()
 This will return the distance of the far clipping plane to the eye of the camera.
void init (void)
 Initialize the camera for the current position.
void glInit ()
 setup perpective projection for OpenGL according to the settings of the camera
vuRay getRay (float xpixel, float ypixel)
 Get the ray through pixel (xpixel, ypixel).
float getDistance (const vuVector &point) const
 returns the distance of a point from the projection plane
vuVectorproject (vuVector &point) const
 projects a point to the plane
virtual void TakeSnapShot (char *Shot)
 this will record a snapshot to Shot instead of the file that recordings are being written to.
virtual void TakeSnapShot ()
 this will record the current state to the next line of the file that is being recorded to
void TakeSnapShotOrtho (char *Shot)
 This will take a persp snap shot??? this function is wrong and will be fixed later.
virtual int RestoreShot (char *Shot)
 this will restore the snapshot saved in Shot
int RestoreShotOrtho (char *Shot)
 This will restore the extra members of parallelcamera that are not contained in a basic camera.
virtual int RestoreNextShot ()
 this will restore the next line of the file that has been loaded into this camera by load
virtual int RestorePreviousShot ()
 this will restore the previous line of the file that has been loaded into this camera by load
virtual char * get_id ()
 This will return a ptr to a string containing a copy of the valid header fromat for this type of camera.
virtual bool verify_id (char *id)
 This will return true if id is an appropriate header, false otherwise.
virtual vuParallelCameraoperator= (const vuParallelCamera &rhs)
 Assignment operator.
virtual vuCameracreate_new ()
 This will create a new vuParallelCamera and return the pointer to this newly created parallel camera (cast as a vuCamera).
virtual vuCameraset_equal_to_interp (vuCamera *cam1, vuCamera *cam2, float t1, float t2)
virtual vuCameraoperator * (float t)
 Multiplication Operator,.
virtual vuCameraoperator *= (float t)
 Multiplication/Assignment operator,.
virtual vuCameraoperator+ (vuParallelCamera &rhs)
 Addition Operator,.
virtual vuCameraoperator+= (vuParallelCamera &rhs)
 Addition/Assignment operator,.
virtual vuCameraoperator+ (vuParallelCamera *rhs)
 Addition operator,.
virtual vuCameraoperator+= (vuParallelCamera *rhs)
 Addition/Assignment operator,.
virtual vuParallelCameraoperator= (vuParallelCamera *rhs)
 Assignment Operator,.

Protected Attributes

float m_XRange
 The.
float m_YRange
float m_XScale
float m_YScale
 The x and y scaling factors.
float m_Near
 The near clipping plane.
float m_Far
 the far clipping plane
vuVector m_XStep
 Distance between adjacent x pixels.
vuVector m_YStep
 Distance between adjacent y pixels.

Friends

ostream & operator<< (ostream &out, vuParallelCamera &cam)
 This will get the current state of cam and write it to the stream, "out".
istream & operator>> (istream &in, vuParallelCamera &cam)
 This will take the state store in the stream "in" and set cam equal to that state.
vuCameraoperator * (float t, vuParallelCamera &cam)
 Multiplication operator,.

Detailed Description

This class creates a camera class for orthogonal projections.

Derived from vuCamera.

Definition at line 30 of file vuParallelCamera.h.


Constructor & Destructor Documentation

vuParallelCamera::vuParallelCamera  ) 
 

Default constructor - set initial values.

Definition at line 16 of file vuParallelCamera.cpp.

References setXRange(), and setYRange().

Here is the call graph for this function:

vuParallelCamera::vuParallelCamera const vuParallelCamera c  ) 
 

copy constructor

This will only copy the state data, this will not copy loaded files or recording information.

Definition at line 33 of file vuParallelCamera.cpp.

References vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_UpVector, vuCamera::m_Width, m_XRange, m_XScale, m_XStep, m_YRange, m_YScale, and m_YStep.

vuParallelCamera::~vuParallelCamera  )  [virtual]
 

Destructor.

Definition at line 55 of file vuParallelCamera.cpp.

References vuCamera::clear_lines().

Here is the call graph for this function:


Member Function Documentation

vuCamera * vuParallelCamera::create_new  )  [virtual]
 

This will create a new vuParallelCamera and return the pointer to this newly created parallel camera (cast as a vuCamera).

Reimplemented from vuCamera.

Definition at line 402 of file vuParallelCamera.cpp.

Referenced by operator *(), operator *(), and operator+().

char * vuParallelCamera::get_id  )  [virtual]
 

This will return a ptr to a string containing a copy of the valid header fromat for this type of camera.

Reimplemented from vuCamera.

Definition at line 364 of file vuParallelCamera.cpp.

Referenced by verify_id().

float vuParallelCamera::getDistance const vuVector point  )  const
 

returns the distance of a point from the projection plane

Definition at line 192 of file vuParallelCamera.cpp.

float vuParallelCamera::getFar  ) 
 

This will return the distance of the far clipping plane to the eye of the camera.

Definition at line 117 of file vuParallelCamera.cpp.

Referenced by operator+(), operator+=(), operator=(), and set_equal_to_interp().

float vuParallelCamera::getNear  ) 
 

This will return the distance to the near clipping plane from the eye of the camera.

Definition at line 101 of file vuParallelCamera.cpp.

Referenced by operator+(), operator+=(), operator=(), and set_equal_to_interp().

vuRay vuParallelCamera::getRay float  xpixel,
float  ypixel
[virtual]
 

Get the ray through pixel (xpixel, ypixel).

Reimplemented from vuCamera.

Definition at line 151 of file vuParallelCamera.cpp.

References vuRay::m_Direction, vuRay::m_Position, and m_XStep.

vuCameraType vuParallelCamera::getType void   )  [inline, virtual]
 

Reimplemented from vuCamera.

Definition at line 34 of file vuParallelCamera.h.

float vuParallelCamera::getXRange void   ) 
 

set X size of the viewing box

Definition at line 60 of file vuParallelCamera.cpp.

Referenced by vuBCCSheetSplatter::glOnMouse(), vuBCCSheetSplatter::glResize(), operator+(), operator+=(), operator=(), and set_equal_to_interp().

float vuParallelCamera::getYRange void   ) 
 

set Y size of the viewing box

Definition at line 76 of file vuParallelCamera.cpp.

Referenced by vuBCCSheetSplatter::glOnMouse(), operator+(), operator+=(), operator=(), and set_equal_to_interp().

void vuParallelCamera::glInit  )  [virtual]
 

setup perpective projection for OpenGL according to the settings of the camera

Reimplemented from vuCamera.

Definition at line 184 of file vuParallelCamera.cpp.

References m_XRange, and m_YRange.

void vuParallelCamera::init void   )  [virtual]
 

Initialize the camera for the current position.

This function has to be called everytime the position or orientation of the camera changes. We may can integrate this into wrapped setPosition... functions.

Reimplemented from vuCamera.

Definition at line 126 of file vuParallelCamera.cpp.

References vuVector::cross, m_XRange, m_XStep, m_YRange, m_YStep, and vuVector::makeUnit().

Referenced by Scanner::_renderView(), and vuBCCSheetSplatter::glOnMouse().

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator * float  t  )  [virtual]
 

Multiplication Operator,.

This will multiply each component of this camera by t and store the result in a new camera (which it will create). It will then return a pointer to this camera (recast as a vucamera pointer).

Reimplemented from vuCamera.

Definition at line 412 of file vuParallelCamera.cpp.

References create_new(), m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), setYRange(), and temp_cam_vpac_cgs__.

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator *= float  t  )  [virtual]
 

Multiplication/Assignment operator,.

This will multiply each component of this camera by t and return a pointer to this camera

Reimplemented from vuCamera.

Definition at line 442 of file vuParallelCamera.cpp.

References m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), and setYRange().

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator+ vuParallelCamera rhs  )  [virtual]
 

Addition operator,.

This will add each component of the camera pointed to by rhs to this camera and store the result in a newly created perspective camera and will return a pointer to this newly created perspective camera (recast as a vuCamera).

Definition at line 560 of file vuParallelCamera.cpp.

References create_new(), getFar(), vuCamera::getHeight(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), getXRange(), getYRange(), m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), setYRange(), and temp_cam_vpac_cgs__.

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator+ vuParallelCamera rhs  )  [virtual]
 

Addition Operator,.

This will add each component of rhs with each component of this, store the result in a newly created camera and return a pointer to that camera (recast as a vuCamera pointer).

Definition at line 502 of file vuParallelCamera.cpp.

References create_new(), getFar(), vuCamera::getHeight(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), getXRange(), getYRange(), m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), setYRange(), and temp_cam_vpac_cgs__.

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator+= vuParallelCamera rhs  )  [virtual]
 

Addition/Assignment operator,.

This will add each component of the camera pointed to by rhs to this camera and will return a pointer to this camera.

Definition at line 590 of file vuParallelCamera.cpp.

References getFar(), vuCamera::getHeight(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), getXRange(), getYRange(), m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), and setYRange().

Here is the call graph for this function:

vuCamera * vuParallelCamera::operator+= vuParallelCamera rhs  )  [virtual]
 

Addition/Assignment operator,.

This will add each component of rhs to this camera and will then return a pointer to this camera.

Definition at line 532 of file vuParallelCamera.cpp.

References getFar(), vuCamera::getHeight(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getUpVector(), vuCamera::getWidth(), getXRange(), getYRange(), m_Far, m_Near, m_XRange, m_YRange, setFar(), vuCamera::setHeight(), vuCamera::setLookAtVector(), setNear(), vuCamera::setPosition(), vuCamera::setUpVector(), vuCamera::setWidth(), setXRange(), and setYRange().

Here is the call graph for this function:

vuParallelCamera * vuParallelCamera::operator= vuParallelCamera rhs  )  [virtual]
 

Assignment Operator,.

This will assign each component of the camera pointed to by rhs to this camera and return a pointer to this camera.

Definition at line 656 of file vuParallelCamera.cpp.

References getFar(), vuCamera::getHeight(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getRightVector(), vuCamera::getUpVector(), vuCamera::getWidth(), getXRange(), getYRange(), m_Far, m_Near, m_XRange, m_XStep, m_YRange, and m_YStep.

Here is the call graph for this function:

vuParallelCamera & vuParallelCamera::operator= const vuParallelCamera rhs  )  [virtual]
 

Assignment operator.

Definition at line 166 of file vuParallelCamera.cpp.

References vuCamera::m_Height, vuCamera::m_LookAtVector, vuCamera::m_Position, vuCamera::m_UpVector, vuCamera::m_Width, m_XStep, and m_YStep.

vuVector & vuParallelCamera::project vuVector point  )  const
 

projects a point to the plane

Returns:
first two components contain x and y component of local camera coordinate system. z component is distance to projection plane (not normalized)

Definition at line 197 of file vuParallelCamera.cpp.

References vuVector::cross, vuVector::dot, and vuVector::getData().

Here is the call graph for this function:

int vuParallelCamera::RestoreNextShot  )  [virtual]
 

this will restore the next line of the file that has been loaded into this camera by load

Please refer to virtual int RestoreNextShot for a complete description of this function

Reimplemented from vuCamera.

Definition at line 340 of file vuParallelCamera.cpp.

References vuCamera::IsNextAvailable(), and RestoreShot().

Here is the call graph for this function:

int vuParallelCamera::RestorePreviousShot  )  [virtual]
 

this will restore the previous line of the file that has been loaded into this camera by load

Please refer to virtual int RestorePreviousShot for a complete description of this function

Reimplemented from vuCamera.

Definition at line 350 of file vuParallelCamera.cpp.

References vuCamera::IsNextAvailable(), and RestoreShot().

Here is the call graph for this function:

int vuParallelCamera::RestoreShot char *  Shot  )  [virtual]
 

this will restore the snapshot saved in Shot

Reimplemented from vuCamera.

Definition at line 281 of file vuParallelCamera.cpp.

References clear_blanks(), get_next_comma(), vuCamera::RestoreShotBasic(), and RestoreShotOrtho().

Referenced by operator>>(), RestoreNextShot(), and RestorePreviousShot().

Here is the call graph for this function:

int vuParallelCamera::RestoreShotOrtho char *  Shot  ) 
 

This will restore the extra members of parallelcamera that are not contained in a basic camera.

Definition at line 292 of file vuParallelCamera.cpp.

References clear_blanks(), get_next_close(), get_next_comma(), get_next_open(), vuVector::load(), m_Far, m_Near, m_XRange, m_XScale, m_XStep, m_YRange, m_YScale, and m_YStep.

Referenced by RestoreShot().

Here is the call graph for this function:

vuCamera * vuParallelCamera::set_equal_to_interp vuCamera cam1,
vuCamera cam2,
float  t1,
float  t2
[virtual]
 

Reimplemented from vuCamera.

Definition at line 618 of file vuParallelCamera.cpp.

References getFar(), vuCamera::getLookAtVector(), getNear(), vuCamera::getPosition(), vuCamera::getRightVector(), vuCamera::getUpVector(), getXRange(), getYRange(), m_Far, vuCamera::m_Height, m_Near, vuCamera::m_Width, m_XRange, m_XStep, m_YRange, and m_YStep.

Here is the call graph for this function:

void vuParallelCamera::setFar float  far  ) 
 

This will set the far clipping plane of this camera to be 'far' away from the camera's position.

Definition at line 107 of file vuParallelCamera.cpp.

References m_Far.

Referenced by operator *(), operator *(), operator *=(), operator+(), and operator+=().

void vuParallelCamera::setNear float  near  ) 
 

this will set the near clipping plane of this camera to be 'near' away from the camera's position

Definition at line 91 of file vuParallelCamera.cpp.

References m_Near.

Referenced by operator *(), operator *(), operator *=(), operator+(), and operator+=().

void vuParallelCamera::setXRange float  xrng  ) 
 

set X size of the viewing box

Definition at line 65 of file vuParallelCamera.cpp.

References m_XRange, and m_XScale.

Referenced by vuBCCSheetSplatter::glOnMouse(), operator *(), operator *(), operator *=(), operator+(), operator+=(), Scanner::Scanner(), and vuParallelCamera().

void vuParallelCamera::setYRange float  yrng  ) 
 

set Y size of the viewing box

Definition at line 81 of file vuParallelCamera.cpp.

References m_YRange, and m_YScale.

Referenced by vuBCCSheetSplatter::glOnMouse(), vuBCCSheetSplatter::glResize(), operator *(), operator *(), operator *=(), operator+(), operator+=(), Scanner::Scanner(), and vuParallelCamera().

void vuParallelCamera::TakeSnapShot  )  [virtual]
 

this will record the current state to the next line of the file that is being recorded to

Reimplemented from vuCamera.

Definition at line 221 of file vuParallelCamera.cpp.

void vuParallelCamera::TakeSnapShot char *  Shot  )  [virtual]
 

this will record a snapshot to Shot instead of the file that recordings are being written to.

Reimplemented from vuCamera.

Definition at line 210 of file vuParallelCamera.cpp.

References vuCamera::TakeSnapShotBasic(), and TakeSnapShotOrtho().

Referenced by operator<<().

Here is the call graph for this function:

void vuParallelCamera::TakeSnapShotOrtho char *  Shot  ) 
 

This will take a persp snap shot??? this function is wrong and will be fixed later.

Definition at line 235 of file vuParallelCamera.cpp.

References m_Far, m_Near, m_XRange, m_XScale, m_XStep, m_YRange, m_YScale, m_YStep, and vuVector::save().

Referenced by TakeSnapShot().

Here is the call graph for this function:

bool vuParallelCamera::verify_id char *  id  )  [virtual]
 

This will return true if id is an appropriate header, false otherwise.

Reimplemented from vuCamera.

Definition at line 370 of file vuParallelCamera.cpp.

References get_id().

Here is the call graph for this function:


Friends And Related Function Documentation

vuCamera* operator * float  t,
vuParallelCamera cam
[friend]
 

Multiplication operator,.

This will multiply each component of cam by t and will store the result in a newly created parallel camera, and will return a pointer to that camera

Definition at line 473 of file vuParallelCamera.cpp.

ostream& operator<< ostream &  out,
vuParallelCamera cam
[friend]
 

This will get the current state of cam and write it to the stream, "out".

Definition at line 376 of file vuParallelCamera.cpp.

istream& operator>> istream &  in,
vuParallelCamera cam
[friend]
 

This will take the state store in the stream "in" and set cam equal to that state.

Definition at line 388 of file vuParallelCamera.cpp.


Member Data Documentation

float vuParallelCamera::m_Far [protected]
 

the far clipping plane

Definition at line 182 of file vuParallelCamera.h.

Referenced by operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), setFar(), and TakeSnapShotOrtho().

float vuParallelCamera::m_Near [protected]
 

The near clipping plane.

Definition at line 181 of file vuParallelCamera.h.

Referenced by operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), setNear(), and TakeSnapShotOrtho().

float vuParallelCamera::m_XRange [protected]
 

The.

Definition at line 178 of file vuParallelCamera.h.

Referenced by glInit(), init(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), setXRange(), TakeSnapShotOrtho(), and vuParallelCamera().

float vuParallelCamera::m_XScale [protected]
 

Definition at line 180 of file vuParallelCamera.h.

Referenced by RestoreShotOrtho(), setXRange(), TakeSnapShotOrtho(), and vuParallelCamera().

vuVector vuParallelCamera::m_XStep [protected]
 

Distance between adjacent x pixels.

Definition at line 184 of file vuParallelCamera.h.

Referenced by getRay(), init(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), TakeSnapShotOrtho(), and vuParallelCamera().

float vuParallelCamera::m_YRange [protected]
 

Definition at line 179 of file vuParallelCamera.h.

Referenced by glInit(), init(), operator *(), operator *(), operator *=(), operator+(), operator+=(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), setYRange(), TakeSnapShotOrtho(), and vuParallelCamera().

float vuParallelCamera::m_YScale [protected]
 

The x and y scaling factors.

Definition at line 180 of file vuParallelCamera.h.

Referenced by RestoreShotOrtho(), setYRange(), TakeSnapShotOrtho(), and vuParallelCamera().

vuVector vuParallelCamera::m_YStep [protected]
 

Distance between adjacent y pixels.

Definition at line 185 of file vuParallelCamera.h.

Referenced by init(), operator=(), RestoreShotOrtho(), set_equal_to_interp(), TakeSnapShotOrtho(), and vuParallelCamera().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:22:00 2004 for vuVolume by  doxygen 1.3.9.1