Logo Search packages:      
Sourcecode: 3depict version File versions  Download package

Scene Class Reference

#include <scene.h>

List of all members.

Detailed Description

The scene class brings together elements such as objects, lights, and cameras.

Definition at line 54 of file scene.h.

Public Member Functions

unsigned int addCam (Camera *)
 Add a camera.
void addDrawable (const DrawableObj *)
 Add a drawable object.
void addLight (const Light *)
 Add a light.
void addRefDrawable (const DrawableObj *)
 Add a drawble to the refernce only section.
void addSelectionDevices (const std::vector< SelectionDevice * > &d)
 Add selection devices to the scene.
void applyDevice (float startX, float startY, float curX, float curY, unsigned int keyFlags, unsigned int mouseflags, bool permanent=true)
 Apply the device given the following start and end.
void clearAll ()
 clear rendering vectors
void clearBindings ()
 Clear object bindings vector.
void clearCams ()
 Clear camera vector.
void clearDevices ()
 Clear the current selection devices.
void clearLights ()
 Clear lights vector.
void clearObjs ()
 Clear drawing objects vector.
void clearRefObjs ()
 Clear the reference object vector.
CameracloneActiveCam () const
 Clone the active camera.
void commitTempCam ()
 Make the temp camera permanent.
void discardTempCam ()
 Discard the temporary camera.
void draw ()
 Draw the objects in the active window. May adjust cameras and compute bounding as needed.
unsigned int duplicateCameras (vector< Camera * > &cams) const
 Duplicates the internal camera vector. return value is active camera.
void ensureVisible (unsigned int direction)
 Modify the active camera position to ensure that scene is visible.
void finaliseCam ()
 Call if user has stopped interacting with camera briefly.
CameragetActiveCam ()
 get the active camera
unsigned int getActiveCamId () const
 Return the unique ID of the active camera.
Point3D getActiveCamLoc () const
 get the active camera's location
void getCameraIDs (vector< std::pair< unsigned int, std::string > > &idVec) const
 Return ALL the camera unique IDs.
void getCamProperties (unsigned int uniqueID, CameraProperties &p) const
 Get the camera properties for a given camera.
unsigned int getLastHover () const
 Return the last object over whichthe cursor was hovered.
unsigned int getLastSelected () const
 Get the last selected object from call to glSelect().
void getModifiedBindings (std::vector< std::pair< const Filter *, SelectionBinding > > &bindings) const
 Return any devices that have been modified since their creation.
unsigned int getNumCams () const
 Get the number of cameras (excluding tmp cam).
CameragetTempCam ()
 Return pointer to active camera. Must init a temporary camera first! (use setTempCam).
unsigned int glSelect (bool storeSelection=true)
 perform an openGL selection rendering pass. Return
bool haveTempCam () const
 Are we using a temporary camera?
bool isDefaultCam () const
 True if the current camera is the default (0th) camera.
void removeCam (unsigned int uniqueCamID)
 remove a camera object
void removeDrawable (unsigned int)
 remove a drawable object
void restrictView (float xS, float yS, float xFin, float yFin)
 Restrict the openGL drawing view when using the camera.
 Scene ()
void setActiveCam (unsigned int uniqueCamID)
 set the active camera
void setAlpha (bool newAlpha)
 Set whether to use alpha blending.
void setAspect (float newAspect)
 Set the aspect ratio of the output window. Required.
bool setCamProperty (unsigned int uniqueID, unsigned int key, const std::string &value)
 Set the camera properties for a given camera. returns true if property set is OK.
void setDefaultCam ()
 Set the active camera to the first entry. Only to be called if getNumCams > 0.
void setFrustrumControl (bool enabled=true)
 Enable/disable frustrum control (prevents objects leaving the frustrum by resizing them).
void setHoverMode (bool hMode)
 Set the hover mode to control drawing.
unsigned int setLastHover (unsigned int hover)
 Return the last object over whichthe cursor was hovered.
void setLighting (bool newLight)
 Set whether to enable lighting.
void setSelectionMode (bool selMode)
 Set selection mode true=select on, false=select off.
void setTempCam ()
 Construct (or refresh) a temporary camera.
void setViscontrol (VisController *v)
 Set the vis control.
void setWinSize (unsigned int x, unsigned int y)
 Set window size.
void unrestrictView ()
 Disable view restriction.
virtual ~Scene ()

Private Member Functions

void applyGLExtentions ()
void computeSceneLimits ()
 Computes the bounding box for the scene.

Private Attributes

unsigned int activeCam
 Which camera are we using.
float b
BoundCube boundCube
 Cube that holds the scene bounds.
std::vector< Camera * > cameras
 Vector of camera stats.
bool cameraSet
 Is there a camera set?
UniqueIDHandler camIDs
 Camera id storage and handling.
bool frustrumControl
 OpenGL Frustrum control active? (prevents far-clipping of data).
float g
bool hoverMode
 Tells us if we are in hover mode (should we draw hover overlays?).
unsigned int lastHovered
 Last hoeverd object.
unsigned int lastSelected
 Last selected object from call to glSelect(). -1 if last call failed to identify an item.
std::vector< Light const * > lights
 Lights for use when drawing.
std::vector< DrawableObj const * > objects
 Objects that will be used for drawing.
float outWinAspect
 Aspect ratio of output window (x/y) -- needed for cams.
float r
 Blank canvas colour.
std::vector< const DrawableObj * > refObjects
 Objects used for drawing that will not be destroyed.
std::vector< SelectionDevice * > selectionDevices
 Bindings for interactive object properties.
bool selectionMode
 Tells the scene if we are in selection mode or not.
 Temporary override camera.
TexturePool texPool
 Texture pool.
bool useAlpha
 Should alpha belnding be used?
bool useLighting
 Should lighting calculations be performed?
bool viewRestrict
 Is the camera to be restricted to only draw a particular portion of the viewport?
float viewRestrictEnd [2]
float viewRestrictStart [2]
 Viscontroller. Needed for notification of updates during selection binding.
unsigned int winX
 Size of window in px (needed if doing 2D drawing).
unsigned int winY

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

Generated by  Doxygen 1.6.0   Back to index