AlCamera

A base class that encapsulates behavior of perspective

Synopsis

#include <AlCamera.h>
class AlCamera : public AlObject
virtual ~AlCamera();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
virtual AlCamera* asCameraPtr();
virtual const char* name() const;
virtual statusCode setName( const char* );
statusCode addImagePlane( const char * );
AlImagePlane* firstImagePlane( void );
statusCode applyIteratorToImagePlanes( AlIterator*, int& );
AlWindow* firstWindow( void );
AlWindow* nextWindow( AlWindow *lastWindow );
statusCode nextWindowD( AlWindow *lastWindow );
statusCode nearClippingPlane( double& ) const;
statusCode farClippingPlane( double& ) const;
statusCode setNearClippingPlane( double );
statusCode setFarClippingPlane( double );
statusCode stereoView(boolean&, double&) const;
statusCode setStereoView(boolean, double);
statusCode motionBlur(boolean&) const;
statusCode setMotionBlur(boolean);

Description

This class used to represent all the functionality of Alias perspective cameras. When the AlWindow class was developed and it became possible to get and set the window associated with a camera, it became necessary not only to provide an interface to orthographic cameras as well, but also to separate the differences in functionality into two child classes. The AlCamera class remains as a base class, providing access to the behavior that all cameras share. In places where AlCameras were formerly used, it is possible to easily convert old code simply by substituting AlPerspectiveCamera for AlCamera almost everywhere. (A few other small modifications may be necessary).

Any camera can have image planes attached to it. To create an image plane on a camera, use the addImagePlane command.

If a window is associated with this camera (which will always be the case for orthographic cameras, but not so for perspective cameras) the firstWindow() function will return it.

Summary

AlCamera::~AlCamera()

Description

Deletes an AlCamera wrapper object.

AlObject *AlCamera::copyWrapper() const

Description

This method makes a copy of the AlCamera. The returned AlCamera will reference the same data as the original.

statusCode AlCamera::deleteObject()

Description

Abstract base class function, always returns sFailure.

AlObjectType AlCamera::type() const

Description

Returns the class identifier 'kCameraType'.

AlCamera* AlCamera::asCameraPtr()

Description

This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.

const char* AlCamera::name() const

Description

Returns a pointer to this camera's name.

statusCode AlCamera::setName( const char *newName )

Description

Changes the camera's name to the given name. If the given name is not a unique one, then a unique name is generated based on the given name and assigned to the camera. In this case, a status code of sNameChangedToUniqueOne is returned. A copy of the argument string is made, so you are responsible for deleting it.

Arguments

< const char *newName - is the name to be given to the camera.

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

sInvalidArgument - given pointer is NULL

statusCode AlCamera::addImagePlane( const char * fname )

Description

Builds an image from an image file and attaches it to the camera.

Arguments

fname - the name of the image to attach to the camera

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

sInvalidArgument - given pointer is NULL

AlImagePlane* AlCamera::firstImagePlane( void )

Description

Returns the first image plane attached to this camera.

statusCode AlCamera::applyIteratorToImagePlanes( AlIterator* iter, int& rc )

Description

Applies an iterator to each image that is attached to this camera.

Arguments

iter - the iterator to apply

> rc - the return variable for the return value of the last iterator's application

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

sInvalidArgument - given pointer is NULL

AlWindow *AlCamera::firstWindow( void )

Description

Returns the first window attached to this camera

AlWindow *AlCamera::nextWindow( AlWindow *window )

Description

Returns the next window attached to this camera

statusCode AlCamera::nextWindowD( AlWindow *lastWindow )

Description

Destructively points the given wrapper to the next window attached to this camera.

Arguments

< lastWindow - Window from which to walk forward

Return codes

sSuccess - the wrapper now points to the next object in the list

sFailure - there is no next window

sInvalidObject - the camera is invalid

sInvalidArgument - the given window is invalid

statusCode AlCamera::nearClippingPlane( double& ncp ) const

Description

Returns the distance from the eye positon to the near clipping plane.

Arguments

> ncp - return variable for the distance to the clipping plane

Return code

sSuccess - plane was retrieved

sInvalidObject - if the camera is not valid

statusCode AlCamera::farClippingPlane( double& fcp ) const

Description

Returns the distance from the eye position to the far clipping plane.

Arguments

> fcp - return variable for the distance to the clipping plane

Return code

sSuccess - plane was retrieved

sInvalidObject - if the camera is not valid

statusCode AlCamera::setNearClippingPlane( double newNearDistance )

Description

Sets the distance between the eye position to the near clipping plane. The new distance to the near clipping plane must be SMALLER than the distance to the far clipping plane.

Arguments

< double newNearDistance - is the new distance to the clipping plane

Return code

sSuccess - plane was set

sInvalidArgument - new near dist was greater than current far dist

sInvalidObject - if the camera is not valid

statusCode AlCamera::setFarClippingPlane( double newFarDistance)

Description

Sets the distance to the far clipping plane. The new distance to the far clipping plane must be larger than the near clipping plane.

Arguments

< double newFarDistance - is the new distance to the clipping plane

Return code

sSuccess - plane was set

sInvalidArgument - new far dist was less than current near dist

sInvalidObject - if the camera is not valid

statusCode AlCamera::stereoView(boolean& stereoEnabled, double& eyeOffset) const

Description

Returns the camera stereo view information

Arguments

> boolean& stereoEnabled - TRUE if stereo view is enabled, FALSE if not.

> double& eyeOffset - ocular separation

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

statusCode AlCamera::setStereoView(boolean stereoEnabled, double eyeOffset)

Description

Sets the camera stereo view information

Arguments

< boolean stereoEnabled - TRUE to enable stereo viewing, FALSE to disable it

< double eyeOffset - ocular separation

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

statusCode AlCamera::motionBlur( boolean& blur) const

Description

Returns the camera motion blur information Returns TRUE if motion blur is on.

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid

statusCode AlCamera::setMotionBlur( boolean blurEnabled )

Description

Sets the camera motion blur information

Arguments

< boolean blurEnabled - TRUE to enable motion blur

Return codes

sSuccess - if successful

sInvalidObject - if the camera is not valid





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.