00001 00002 00003 00004 00005 // ChangeLog is at the implementation file 00006 00007 #ifndef __VPSCENE_H 00008 #define __VPSCENE_H 00009 00010 #include "vplight.h" 00011 #include "vpcamera.h" 00012 #include "vpcolor.h" // for background color 00013 #include "vpscenenode.h" 00014 #include "vpboundingbox.h" 00015 #include <string> //STL include 00016 #include <list> //STL include 00017 00023 class VPScene { 00024 public: 00025 VPScene(); 00026 virtual ~VPScene(); 00027 std::list<const VPLight*> GetLights(); 00028 std::list<VPCamera*> GetCameras(); 00029 std::list<const VPSceneNode*> GetObjects(); 00030 00032 00036 void AddLight(VPLight* newLight); 00037 00039 00042 void AddLight(const VPLight& newLight); 00043 00045 00050 void AddCamera(VPCamera* newCamera); 00051 00053 00057 void AddObject(VPSceneNode* newObjectPtr); 00058 00059 const VPLight* GetLight(const std::string& lightName); 00060 const VPCamera* GetCamera(const std::string& cameraName); 00061 const VPSceneNode* GetObject(const std::string& objectName); 00062 VPColor GetBackgroundColor(); 00063 void SetBackgroundColor(VPColor color); 00064 00066 00071 virtual bool DrawOGL() const; 00072 00074 00078 bool DrawLightsOGL() const; 00079 00081 VPCamera* GetCurrentCamera() const; 00082 00084 void UseNextCamera(); 00085 00087 void UsePreviousCamera(); 00088 00090 void SetAllCamerasAspectRatio(float newAspectRatio); 00091 00093 void ComputeBoundingBox(); 00094 00096 const VPBoundingBox& GetBoundingBox() const { return bbox; } 00097 00099 unsigned int GetNumLights() const { return lights.size(); } 00100 00102 00105 void MakeCameraViewAll(); 00106 00108 void SetDescription(const std::string& newDescr) { description = newDescr; } 00109 00111 const std::string& GetDescription() { return description; } 00112 protected: 00114 std::list<const VPLight*> lights; 00115 // FixMe: Viewers should manipulate a local copy of the current camera, allowing 00116 // pointers to be const. 00117 std::list<VPCamera*> cameras; 00118 std::list<const VPSceneNode*> objects; 00119 VPColor background; 00120 private: 00121 // FixMe: Viewers should manipulate a local copy of the current camera, a different 00122 // method to switch between cameras should be developed. 00123 std::list<VPCamera*>::const_iterator currentCamera; 00124 VPBoundingBox bbox; 00125 std::string description; 00126 }; 00127 00128 #endif // __VPSCENE_H