| VRS - The Virtual Rendering System |
| version 3.3 |
00001 #ifndef GREENSPACECOMPOSITE_H 00002 #define GREENSPACECOMPOSITE_H 00003 00004 #include <vrs/environment/config.h> 00005 #include <vrs/environment/greenspace.h> 00006 #include <vrs/container/array.h> 00007 00008 00009 namespace VRS { 00010 class Facet; 00011 class Shape; 00012 } 00013 00014 namespace EnvironmentRenderer { 00015 00016 class VRS_ENV_API GreenSpaceComposite : public VRS::Shape 00017 { 00018 public: 00022 GreenSpaceComposite(double alphaTestValue = 0.5, double distance = 100.0); 00023 00025 void setAlphaTestValue(double alphaTestValue); 00026 double getAlphaTestValue() const; 00027 00029 void setDisplayDistance(double distance); 00030 double getDisplayDistance() const; 00031 00045 void applyChanges(bool rebuildAll = false); 00046 00048 bool getRebuildAll() const; 00049 00051 void append(VRS::SO<GreenSpace> greenspace); 00052 00054 GreenSpace* remove(unsigned int index); 00055 bool remove(VRS::SO<GreenSpace> gs); 00056 00058 void clear(); 00059 00061 VRS::SO<VRS::Iterator<VRS::SO<GreenSpace> > > getGreenSpaces() const; 00062 00064 unsigned int size() const; 00065 00068 VRS::SO<GreenSpace> component(unsigned int index) const; 00069 00073 VRS::Bounds boundingBox() const; 00074 00075 00077 bool needsUpdate() const; 00078 void setBoundingBox(const VRS::Bounds &bounds); 00079 00080 VRS_TYPEINFO(GreenSpaceComposite, VRS::Shape); 00081 VRS_SERIALIZABLE(GreenSpaceComposite); 00082 00083 private: 00084 VRS::SO<VRS::Array<VRS::SO<GreenSpace> > > m_components; 00085 mutable bool m_needsUpdate; 00086 bool m_rebuildAll; 00087 00088 double m_alphaTestValue; 00089 double m_displayDistance; 00090 00091 VRS::Bounds m_boundingBox; 00092 }; 00093 00094 inline bool GreenSpaceComposite::getRebuildAll() const 00095 { 00096 return m_rebuildAll; 00097 } 00098 00099 inline unsigned int GreenSpaceComposite::size() const { 00100 return m_components->size(); 00101 } 00102 00103 inline void GreenSpaceComposite::setBoundingBox(const VRS::Bounds &bounds) 00104 { 00105 m_boundingBox = bounds; 00106 } 00107 00108 inline double GreenSpaceComposite::getAlphaTestValue() const 00109 { 00110 return m_alphaTestValue; 00111 } 00112 00113 inline double GreenSpaceComposite::getDisplayDistance() const 00114 { 00115 return m_displayDistance; 00116 } 00117 00118 } // namepsace EnvironmentRenderer 00119 00120 #endif // GREENSPACECOMPOSITE_H 00121