#include <vpscene.h>
Public Member Functions | |
VPScene () | |
virtual | ~VPScene () |
std::list< const VPLight * > | GetLights () |
std::list< VPCamera * > | GetCameras () |
std::list< const VPSceneNode * > | GetObjects () |
void | AddLight (VPLight *newLight) |
Adds a light to the list of lights. | |
void | AddLight (const VPLight &newLight) |
Adds a light to the list of lights. | |
void | AddCamera (VPCamera *newCamera) |
Add a camera to the list of cameras. | |
void | AddObject (VPSceneNode *newObjectPtr) |
Add a object to the scene. | |
const VPLight * | GetLight (const std::string &lightName) |
const VPCamera * | GetCamera (const std::string &cameraName) |
const VPSceneNode * | GetObject (const std::string &objectName) |
VPColor | GetBackgroundColor () |
void | SetBackgroundColor (VPColor color) |
virtual bool | DrawOGL () const |
Sets projection and draws graphics objects using OpenGL commands. | |
bool | DrawLightsOGL () const |
Set lights using OpenGL commands. | |
VPCamera * | GetCurrentCamera () const |
Returns the current camera in the scene or NULL if no camera exists. | |
void | UseNextCamera () |
Sets the current camera to the next camera in list of cameras. | |
void | UsePreviousCamera () |
Sets the current camera to the previous camera in the list of cameras. | |
void | SetAllCamerasAspectRatio (float newAspectRatio) |
Set the aspect ratio of all cameras. | |
void | ComputeBoundingBox () |
Computes the axis aligned bounding box of all objects. | |
const VPBoundingBox & | GetBoundingBox () const |
Returns the scene bounding box. | |
unsigned int | GetNumLights () const |
Returns the number of light in the scene. | |
void | MakeCameraViewAll () |
Fits the whole scene to drawing region. | |
void | SetDescription (const std::string &newDescr) |
Sets the scene description. | |
const std::string & | GetDescription () |
Returns the scene description. | |
Protected Attributes | |
std::list< const VPLight * > | lights |
Separate lights (not treated as common objects). | |
std::list< VPCamera * > | cameras |
std::list< const VPSceneNode * > | objects |
VPColor | background |
A Scene is a complete viewable object with objects, lights, cameras and background color.
Definition at line 23 of file vpscene.h.
|
Definition at line 54 of file vpscene.cpp. References background, VPColor::BLACK(), and cameras. |
|
Definition at line 59 of file vpscene.cpp. |
|
Add a camera to the list of cameras. The first added camera is made the current camera. Other cameras are added to end of the list of cameras. Currently, it is not a good idea to share a camera between different scenes, because viewers change the aspect ratio of their scenes. Definition at line 98 of file vpscene.cpp. References cameras. |
|
Adds a light to the list of lights. This version creates an internal copy of the light, so that the application programmer may free the light's memory space. Definition at line 92 of file vpscene.cpp. References VPMemoryObj::autoDelete, and lights. |
|
Adds a light to the list of lights. This version only copies the light pointer to the internal list. The application programmer should keep the memory space untouched while the scene uses it. Definition at line 88 of file vpscene.cpp. References lights. |
|
Add a object to the scene. The object's address is added to the scene's list. The application programmer is responsible for freeing memory at the end of scene's life cycle. Definition at line 104 of file vpscene.cpp. References objects. |
|
Computes the axis aligned bounding box of all objects.
Definition at line 213 of file vpscene.cpp. References VPGraphicObj::GetRecursiveBoundingBox(), VPBoundingBox::MergeWith(), and objects. |
|
Set lights using OpenGL commands. Lights may be drawn apart from other scene components because they need not be drawn at every rendering cicle.
Definition at line 172 of file vpscene.cpp. References lights. Referenced by DrawOGL(). |
|
Sets projection and draws graphics objects using OpenGL commands. This method is intended to be executed at every rendering cicle. It does not draw lights (from the "lights" list), because they need not be drawn at every rendering cicle.
Definition at line 146 of file vpscene.cpp. References background, DrawLightsOGL(), VPColor::GetScaled(), and objects. |
|
Definition at line 138 of file vpscene.cpp. References background. |
|
Returns the scene bounding box.
|
|
|
|
Definition at line 80 of file vpscene.cpp. References cameras. |
|
Returns the current camera in the scene or NULL if no camera exists.
Definition at line 187 of file vpscene.cpp. |
|
Returns the scene description.
|
|
|
|
Definition at line 76 of file vpscene.cpp. References lights. |
|
Returns the number of light in the scene.
Definition at line 99 of file vpscene.h. References lights. |
|
|
|
Definition at line 84 of file vpscene.cpp. References objects. |
|
Fits the whole scene to drawing region. Changes current camera's position and clipping planes so that the whole scene fits the viewer window. Definition at line 236 of file vpscene.cpp. References cameras, VPBoundingBox::GetCenter(), VPBoundingBox::GetGreaterX(), VPBoundingBox::GetGreaterY(), VPBoundingBox::GetGreaterZ(), VPBoundingBox::GetSmallerX(), VPBoundingBox::GetSmallerY(), VPBoundingBox::GetSmallerZ(), VPBoundingBox::ProcessCenter(), and VPPoint4D::Y(). |
|
Set the aspect ratio of all cameras.
Definition at line 206 of file vpscene.cpp. References cameras. |
|
Definition at line 142 of file vpscene.cpp. References background. |
|
Sets the scene description.
|
|
Sets the current camera to the next camera in list of cameras.
Definition at line 194 of file vpscene.cpp. References cameras. |
|
Sets the current camera to the previous camera in the list of cameras.
Definition at line 200 of file vpscene.cpp. References cameras. |
|
Definition at line 119 of file vpscene.h. Referenced by DrawOGL(), GetBackgroundColor(), SetBackgroundColor(), and VPScene(). |
|
Definition at line 117 of file vpscene.h. Referenced by AddCamera(), GetCameras(), GetCurrentCamera(), MakeCameraViewAll(), SetAllCamerasAspectRatio(), UseNextCamera(), UsePreviousCamera(), and VPScene(). |
|
Separate lights (not treated as common objects).
Definition at line 114 of file vpscene.h. Referenced by AddLight(), DrawLightsOGL(), GetLights(), GetNumLights(), and ~VPScene(). |
|
Definition at line 118 of file vpscene.h. Referenced by AddObject(), ComputeBoundingBox(), DrawOGL(), GetObjects(), and ~VPScene(). |