Changeset 721 for GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include
- Timestamp:
- 03/31/06 17:29:32 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include
- Files:
-
- 10 added
- 2 deleted
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboard.h
r700 r721 6 6 namespace BBC { 7 7 8 class _BBCExport Billboard { 8 // Forward declarations 9 class Billboard; 10 11 namespace boost 12 { 13 void intrusive_ptr_add_ref(Billboard * p); 14 void intrusive_ptr_release(Billboard * p); 15 }; 16 17 18 class _BBCExport Billboard 19 { 20 private: 21 long references; 22 friend void boost::intrusive_ptr_add_ref(Billboard * p); 23 friend void boost::intrusive_ptr_release(Billboard * p); 24 9 25 public: 10 26 Billboard(); 11 27 12 ~Billboard();28 virtual ~Billboard(); 13 29 14 30 … … 25 41 protected: 26 42 27 BillboardClusterData *mBillboardClusterData;43 BillboardClusterDataPtr mBillboardClusterData; 28 44 29 45 public: 30 46 31 void setBillboardClusterData(BillboardClusterData *value);47 void setBillboardClusterData(BillboardClusterDataPtr value); 32 48 33 BillboardClusterData *getBillboardClusterData();49 BillboardClusterDataPtr getBillboardClusterData(); 34 50 35 51 }; 36 52 53 // class specific addref/release implementation 54 // the two function overloads must be in the boost namespace on most compilers: 55 namespace boost 56 { 57 inline void intrusive_ptr_add_ref(Billboard * p) 58 { 59 // increment reference count of object *p 60 ++(p->references); 61 } 62 63 64 65 inline void intrusive_ptr_release(Billboard * p) 66 { 67 // decrement reference count, and delete object when reference count reaches 0 68 if (--(p->references) == 0) 69 delete p; 70 } 71 } // namespace boost 72 73 typedef ::boost::intrusive_ptr<Billboard> BillboardPtr; 74 37 75 } 38 76 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloud.h
r709 r721 13 13 BillboardCloud(); 14 14 15 ~BillboardCloud();15 virtual ~BillboardCloud(); 16 16 17 17 18 18 protected: 19 std::vector<Billboard *> mBillboardList;19 std::vector<BillboardPtr> mBillboardList; 20 20 21 std::vector<BillboardGroup *> mBillboardGroupList;21 std::vector<BillboardGroupPtr> mBillboardGroupList; 22 22 23 23 public: 24 std::vector<Billboard *>* getBillboardList();24 std::vector<BillboardPtr>* getBillboardList(); 25 25 26 void setBillboardList(std::vector<Billboard *> &value);26 void setBillboardList(std::vector<BillboardPtr> &value); 27 27 28 void addBillboard(Billboard *value);28 void addBillboard(BillboardPtr value); 29 29 30 30 void removeBillboard(unsigned int value); 31 31 32 Billboard *getBillboard(unsigned int value);32 BillboardPtr getBillboard(unsigned int value); 33 33 34 34 unsigned int BillboardCloud::getNumBillboards(); … … 42 42 unsigned int getNumBillboardGroups(); 43 43 44 BillboardGroup *getBillboardGroup(unsigned int iBillboardGroup);44 BillboardGroupPtr getBillboardGroup(unsigned int iBillboardGroup); 45 45 46 void addBillboardGroup(BillboardGroup *value);46 void addBillboardGroup(BillboardGroupPtr value); 47 47 48 48 void removeBillboardGroup(unsigned int value); 49 49 50 50 protected: 51 Entity *mEntity;51 EntityPtr mEntity; 52 52 53 53 54 54 public: 55 Entity *getEntity();55 EntityPtr getEntity(); 56 56 57 void setEntity(Entity *value);57 void setEntity(EntityPtr value); 58 58 59 59 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloudGenerator.h
r700 r721 11 11 class _BBCExport BillboardCloudGenerator { 12 12 public: 13 14 BillboardCloudGenerator(); 15 16 virtual ~BillboardCloudGenerator(); 17 13 18 void generate(); 14 19 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloudSerializer.h
r700 r721 17 17 BillboardCloudSerializer(); 18 18 19 ~BillboardCloudSerializer();19 virtual ~BillboardCloudSerializer(); 20 20 21 21 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloudUVMapper.h
r709 r721 66 66 void removeClusterList(unsigned int iClusterList); 67 67 68 void clear();68 void shutdown(); 69 69 70 70 unsigned int getNumClusterLists(); … … 74 74 BillboardCloudUVMapper(); 75 75 76 ~BillboardCloudUVMapper();76 virtual ~BillboardCloudUVMapper(); 77 77 78 78 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardClusterData.h
r700 r721 6 6 namespace BBC { 7 7 8 class _BBCExport BillboardClusterData { 8 // Fordward declaration... 9 class BillboardClusterData; 10 11 namespace boost 12 { 13 void intrusive_ptr_add_ref(BillboardClusterData * p); 14 void intrusive_ptr_release(BillboardClusterData * p); 15 }; 16 17 class _BBCExport BillboardClusterData 18 { 19 private: 20 long references; 21 friend void boost::intrusive_ptr_add_ref(BillboardClusterData * p); 22 friend void boost::intrusive_ptr_release(BillboardClusterData * p); 23 9 24 public: 10 25 BillboardClusterData(); 11 26 12 ~BillboardClusterData();27 virtual ~BillboardClusterData(); 13 28 14 29 void setNormal(Ogre::Vector3 value); … … 20 35 float getD(); 21 36 22 EntityCluster *getEntityCluster();37 EntityClusterPtr getEntityCluster(); 23 38 24 void setEntityCluster(EntityCluster *value);39 void setEntityCluster(EntityClusterPtr value); 25 40 26 41 virtual void readBillboardClusterData(TiXmlNode *parentNode); … … 47 62 48 63 protected: 49 EntityCluster *mEntityCluster;64 EntityClusterPtr mEntityCluster; 50 65 51 66 Ogre::Vector3 mAxisX; … … 70 85 }; 71 86 87 // class specific addref/release implementation 88 // the two function overloads must be in the boost namespace on most compilers: 89 namespace boost 90 { 91 inline void intrusive_ptr_add_ref(BillboardClusterData * p) 92 { 93 // increment reference count of object *p 94 ++(p->references); 95 } 96 97 98 99 inline void intrusive_ptr_release(BillboardClusterData * p) 100 { 101 // decrement reference count, and delete object when reference count reaches 0 102 if (--(p->references) == 0) 103 delete p; 104 } 105 } // namespace boost 106 107 typedef ::boost::intrusive_ptr<BillboardClusterData> BillboardClusterDataPtr; 108 72 109 } 73 110 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardGroup.h
r709 r721 6 6 namespace BBC { 7 7 8 class BillboardGroup { 8 typedef struct 9 { 10 unsigned int billboardHandle; 11 unsigned int width; 12 unsigned int height; 13 Ogre::Vector2 min; 14 Ogre::Vector2 max; 15 } BillboardGroupedInfo; 16 17 // Forward declarations 18 class BillboardGroup; 19 20 21 namespace boost 22 { 23 void intrusive_ptr_add_ref(BillboardGroup * p); 24 void intrusive_ptr_release(BillboardGroup * p); 25 }; 26 27 class BillboardGroup 28 { 29 private: 30 long references; 31 friend void boost::intrusive_ptr_add_ref(BillboardGroup * p); 32 friend void boost::intrusive_ptr_release(BillboardGroup * p); 33 9 34 protected: 10 35 std::vector<unsigned int> mBillboardHandleList; 11 36 12 37 public: 38 39 BillboardGroup(); 40 41 virtual ~BillboardGroup(); 42 13 43 unsigned int getBillboardHandle(unsigned int iBillboard); 14 44 … … 19 49 }; 20 50 51 // class specific addref/release implementation 52 // the two function overloads must be in the boost namespace on most compilers: 53 namespace boost 54 { 55 inline void intrusive_ptr_add_ref(BillboardGroup * p) 56 { 57 // increment reference count of object *p 58 ++(p->references); 59 } 60 61 62 63 inline void intrusive_ptr_release(BillboardGroup * p) 64 { 65 // decrement reference count, and delete object when reference count reaches 0 66 if (--(p->references) == 0) 67 delete p; 68 } 69 } // namespace boost 70 71 typedef ::boost::intrusive_ptr<BillboardGroup> BillboardGroupPtr; 72 21 73 } 22 74 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntity.h
r700 r721 4 4 #include <BBCPrerequisites.h> 5 5 #include <BBCSubEntity.h> 6 #include <BBCMesh.h> 6 7 7 8 namespace BBC { 8 9 10 // Forward declarations 11 class Entity; 12 13 14 namespace boost 15 { 16 void intrusive_ptr_add_ref(Entity * p); 17 void intrusive_ptr_release(Entity * p); 18 }; 19 9 20 class _BBCExport Entity 10 21 { 22 private: 23 long references; 24 friend void boost::intrusive_ptr_add_ref(Entity * p); 25 friend void boost::intrusive_ptr_release(Entity * p); 26 11 27 protected: 12 28 13 typedef std::vector<SubEntity *> SubEntityList;29 typedef std::vector<SubEntityPtr> SubEntityList; 14 30 15 31 unsigned int mEntityHandle; … … 19 35 SubEntityList mSubEntityList; 20 36 21 Ogre::Mesh *mMesh;37 MeshPtr mMesh; 22 38 23 39 public: … … 25 41 Entity(); 26 42 27 ~Entity();43 virtual ~Entity(); 28 44 29 45 void createSubEntity(); 30 46 31 void addSubEntity(SubEntity *value);47 void addSubEntity(SubEntityPtr value); 32 48 33 SubEntity *getSubEntity(unsigned int index);49 SubEntityPtr getSubEntity(unsigned int index); 34 50 35 51 void removeSubEntity(unsigned int index); 36 52 37 virtual Ogre::Mesh*getMesh();53 virtual MeshPtr getMesh(); 38 54 39 virtual void setMesh( Ogre::Mesh *value);55 virtual void setMesh(MeshPtr value); 40 56 41 57 void loadMesh(bool mergeSubMeshes); … … 65 81 }; 66 82 83 // class specific addref/release implementation 84 // the two function overloads must be in the boost namespace on most compilers: 85 namespace boost 86 { 87 inline void intrusive_ptr_add_ref(Entity * p) 88 { 89 // increment reference count of object *p 90 ++(p->references); 91 } 92 93 94 95 inline void intrusive_ptr_release(Entity * p) 96 { 97 // decrement reference count, and delete object when reference count reaches 0 98 if (--(p->references) == 0) 99 delete p; 100 } 101 } // namespace boost 102 103 typedef ::boost::intrusive_ptr<Entity> EntityPtr; 104 67 105 } 68 106 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityCluster.h
r700 r721 11 11 namespace BBC { 12 12 13 class _BBCExport EntityCluster { 13 // Forward declarations 14 class EntityCluster; 15 16 17 namespace boost 18 { 19 void intrusive_ptr_add_ref(EntityCluster * p); 20 void intrusive_ptr_release(EntityCluster * p); 21 }; 22 23 class _BBCExport EntityCluster 24 { 25 private: 26 long references; 27 friend void boost::intrusive_ptr_add_ref(EntityCluster * p); 28 friend void boost::intrusive_ptr_release(EntityCluster * p); 29 14 30 public: 15 31 EntityCluster(); 16 32 17 ~EntityCluster();33 virtual ~EntityCluster(); 18 34 19 EntityClusterData* getEntityClusterData(unsigned int value);35 void removeEntityClusterData(unsigned int value); 20 36 21 void addEntityClusterData(EntityClusterData *value); 37 EntityClusterDataPtr getEntityClusterData(unsigned int value); 38 39 void addEntityClusterData(EntityClusterDataPtr value); 22 40 23 41 void removeEntitClusterData(unsigned int value); 24 42 25 EntityDistribution *getEntityDistribution();43 EntityDistributionPtr getEntityDistribution(); 26 44 27 void setEntityDistribution(EntityDistribution *value);45 void setEntityDistribution(EntityDistributionPtr value); 28 46 29 47 protected: 30 48 31 EntityDistribution *mEntityDistribution;49 EntityDistributionPtr mEntityDistribution; 32 50 33 std::vector<EntityClusterData *> mEntityClusterDataList;51 std::vector<EntityClusterDataPtr> mEntityClusterDataList; 34 52 35 53 std::vector<unsigned int> mBillboarHandle; 36 54 37 Entity *mEntity;55 EntityPtr mEntity; 38 56 39 57 unsigned int mBillboardHandle; … … 41 59 public: 42 60 43 Entity *getEntity();61 EntityPtr getEntity(); 44 62 45 void setEntity(Entity *value);63 void setEntity(EntityPtr value); 46 64 47 65 unsigned int getNumEntitiesClusterData(); … … 55 73 }; 56 74 75 // class specific addref/release implementation 76 // the two function overloads must be in the boost namespace on most compilers: 77 namespace boost 78 { 79 inline void intrusive_ptr_add_ref(EntityCluster * p) 80 { 81 // increment reference count of object *p 82 ++(p->references); 83 } 84 85 86 87 inline void intrusive_ptr_release(EntityCluster * p) 88 { 89 // decrement reference count, and delete object when reference count reaches 0 90 if (--(p->references) == 0) 91 delete p; 92 } 93 } // namespace boost 94 95 typedef ::boost::intrusive_ptr<EntityCluster> EntityClusterPtr; 96 97 57 98 } 58 99 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityClusterData.h
r700 r721 6 6 namespace BBC { 7 7 8 class _BBCExport EntityClusterData { 8 // Fordward declaration... 9 class EntityClusterData; 10 11 namespace boost 12 { 13 void intrusive_ptr_add_ref(EntityClusterData * p); 14 void intrusive_ptr_release(EntityClusterData * p); 15 }; 16 17 class _BBCExport EntityClusterData 18 { 19 private: 20 long references; 21 friend void boost::intrusive_ptr_add_ref(EntityClusterData * p); 22 friend void boost::intrusive_ptr_release(EntityClusterData * p); 23 9 24 public: 10 25 EntityClusterData(); 11 26 12 ~EntityClusterData();27 virtual ~EntityClusterData(); 13 28 14 void setEntity(Entity *value);29 void setEntity(EntityPtr value); 15 30 16 Entity *getEntity();31 EntityPtr getEntity(); 17 32 18 33 protected: 19 Entity *mEntity;34 EntityPtr mEntity; 20 35 21 36 }; 22 37 38 // class specific addref/release implementation 39 // the two function overloads must be in the boost namespace on most compilers: 40 namespace boost 41 { 42 inline void intrusive_ptr_add_ref(EntityClusterData * p) 43 { 44 // increment reference count of object *p 45 ++(p->references); 46 } 47 48 49 50 inline void intrusive_ptr_release(EntityClusterData * p) 51 { 52 // decrement reference count, and delete object when reference count reaches 0 53 if (--(p->references) == 0) 54 delete p; 55 } 56 } // namespace boost 57 58 typedef ::boost::intrusive_ptr<EntityClusterData> EntityClusterDataPtr; 59 23 60 } 24 61 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityDistribution.h
r700 r721 6 6 namespace BBC { 7 7 8 class _BBCExport EntityDistribution { 8 // Forward declarations 9 class EntityDistribution; 10 11 12 namespace boost 13 { 14 void intrusive_ptr_add_ref(EntityDistribution * p); 15 void intrusive_ptr_release(EntityDistribution * p); 16 }; 17 18 class _BBCExport EntityDistribution 19 { 20 private: 21 long references; 22 friend void boost::intrusive_ptr_add_ref(EntityDistribution * p); 23 friend void boost::intrusive_ptr_release(EntityDistribution * p); 24 9 25 protected: 10 std::vector<Entity *> mEntityList;26 std::vector<EntityPtr> mEntityList; 11 27 12 28 public: 13 Entity* getEntity(unsigned int value);29 EntityDistribution(); 14 30 15 void addEntity(Entity *value); 31 virtual ~EntityDistribution(); 32 33 EntityPtr getEntity(unsigned int value); 34 35 void addEntity(EntityPtr value); 16 36 17 37 void removeEntity(unsigned int value); … … 20 40 }; 21 41 42 43 // class specific addref/release implementation 44 // the two function overloads must be in the boost namespace on most compilers: 45 namespace boost 46 { 47 inline void intrusive_ptr_add_ref(EntityDistribution * p) 48 { 49 // increment reference count of object *p 50 ++(p->references); 51 } 52 53 54 55 inline void intrusive_ptr_release(EntityDistribution * p) 56 { 57 // decrement reference count, and delete object when reference count reaches 0 58 if (--(p->references) == 0) 59 delete p; 60 } 61 } // namespace boost 62 63 typedef ::boost::intrusive_ptr<EntityDistribution> EntityDistributionPtr; 64 22 65 } 23 66 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityDistributionGenerator.h
r700 r721 13 13 EntityDistribution *mEntityDistribution; 14 14 15 Entity *mEntity;15 EntityPtr mEntity; 16 16 17 17 public: … … 20 20 void init(); 21 21 22 Entity *getEntity();22 EntityPtr getEntity(); 23 23 24 void setEntity(Entity *value);24 void setEntity(EntityPtr value); 25 25 26 26 void setDistribution(EntityDistribution *value); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCEntityDistributionSerializer.h
r700 r721 10 10 class _BBCExport EntityDistributionSerializer: public BBC::XmlSerializer { 11 11 protected: 12 Entity *mEntity;12 EntityPtr mEntity; 13 13 14 14 public: 15 Entity *getEntity();15 EntityPtr getEntity(); 16 16 17 void setEntity(Entity *value);17 void setEntity(EntityPtr value); 18 18 19 19 void generate(); … … 23 23 EntityDistributionSerializer(); 24 24 25 ~EntityDistributionSerializer();25 virtual ~EntityDistributionSerializer(); 26 26 27 27 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCManager.h
r700 r721 4 4 #include <BBCPrerequisites.h> 5 5 #include <BBCSingleton.h> 6 7 //#include <ExampleFrameListener.h>8 6 9 7 namespace BBC { … … 19 17 static Manager* getSingletonPtr(void); 20 18 21 void initRenderWindow(); 22 23 Ogre::Mesh* loadMesh(Ogre::String name); 19 Ogre::Mesh* loadMesh(Ogre::String folderName, Ogre::String fileName); 24 20 25 21 Ogre::Mesh* loadXMLMesh(Ogre::String name); 26 27 void loadResources();28 22 29 23 void saveMesh(Ogre::String name); … … 40 34 41 35 protected: 42 Ogre::Root* mOgreRoot; 43 Ogre::MeshSerializer *mMeshSerializer; 44 Ogre::XMLMeshSerializer *mXMLMeshSerializer; 45 Ogre::DefaultHardwareBufferManager *mDefaultHardwareBufferManager; 46 Ogre::RenderWindow *mWnd; 47 Ogre::SceneManager *mScene; 48 Ogre::RenderSystem *mRSys; 49 Ogre::Camera *mCam; 50 Ogre::Viewport *mView; 51 Ogre::Math *mMath; 52 //ExampleFrameListener *mFrameListener; 36 53 37 }; 54 38 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCOgreMeshSerializer.h
r700 r721 4 4 #include <BBCPrerequisites.h> 5 5 #include <BBCEntity.h> 6 #include <BBCMesh.h> 6 7 7 8 namespace BBC { … … 14 15 virtual ~OgreMeshSerializer(); 15 16 16 void setEntity(Entity *entity);17 void setEntity(EntityPtr entity); 17 18 18 Entity *getEntity();19 EntityPtr getEntity(); 19 20 20 21 void exportMesh(const Ogre::String& fileName, bool mergeSubMeshes, bool tangents); … … 22 23 protected: 23 24 24 Entity *mEntity;25 EntityPtr mEntity; 25 26 26 void buildMesh( Ogre::Mesh*pMesh, bool mergeSubmeshes);27 void buildMesh(MeshPtr pMesh, bool mergeSubmeshes); 27 28 28 void generateEntityAABB( Ogre::Mesh*pMesh);29 void generateEntityAABB(MeshPtr pMesh); 29 30 30 void exportSubMeshes( Ogre::Mesh*pMesh);31 void exportSubMeshes(MeshPtr pMesh); 31 32 32 void exportSubMesh( Ogre::Mesh* pMesh, SubEntity *subEntity);33 void exportSubMesh(MeshPtr pMesh, SubEntityPtr subEntity); 33 34 34 template <typename T> void writeIndexes(T* buf, SubEntity *subEntity);35 template <typename T> void writeIndexes(T* buf, SubEntityPtr subEntity); 35 36 36 37 void createVertexBuffer(Ogre::VertexData* vd, unsigned short bufIdx, UniqueVertexList *uniqueVertexList); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCPrerequisites.h
r700 r721 23 23 #include <OgreVertexBoneAssignment.h> 24 24 #include <OgreAxisAlignedBox.h> 25 26 25 #include <OgreKeyEvent.h> 27 26 #include <OgreEventListeners.h> … … 31 30 #include <OgrePixelFormat.h> 32 31 #include <OgreGpuProgram.h> 32 #include <OgreSharedPtr.h> 33 34 #include <OBA.h> 35 36 #include <boost/smart_ptr.hpp> 33 37 34 38 //#include <ospace/stl/hashset.h> … … 36 40 37 41 #define _BBCExport __declspec( dllexport ) 42 38 43 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCSingleton.h
r700 r721 1 #ifndef __ SINGLETON_H__2 #define __ SINGLETON_H__1 #ifndef __BBCSINGLETON_H__ 2 #define __BBCSINGLETON_H__ 3 3 4 4 namespace BBC { -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCSubEntity.h
r700 r721 5 5 6 6 namespace BBC { 7 7 8 8 class _BBCExport UniqueVertex 9 9 { … … 24 24 typedef std::vector<UniqueVertex> UniqueVertexList; 25 25 26 class _BBCExport SubEntity { 27 public: 26 // Fordward declaration 27 class SubEntity; 28 29 namespace boost 30 { 31 void intrusive_ptr_add_ref(SubEntity * p); 32 void intrusive_ptr_release(SubEntity * p); 33 }; 34 35 class _BBCExport SubEntity 36 { 37 private: 38 long references; 39 40 friend void boost::intrusive_ptr_add_ref(SubEntity * p); 41 42 friend void boost::intrusive_ptr_release(SubEntity * p); 43 44 protected: 28 45 29 46 typedef std::vector<unsigned short int> TextureCoordSetsDimensions; 47 30 48 typedef std::vector<Ogre::Vector3> Indices; 31 32 protected:33 49 34 50 UniqueVertexList mUniqueVertexList; … … 56 72 SubEntity(); 57 73 58 ~SubEntity();74 virtual ~SubEntity(); 59 75 60 76 void enableTangents(bool value); … … 129 145 130 146 void generateAABBox(); 147 148 const char *GetClassName(void) const; 149 131 150 }; 151 152 // class specific addref/release implementation 153 // the two function overloads must be in the boost namespace on most compilers: 154 namespace boost 155 { 156 inline void intrusive_ptr_add_ref(SubEntity * p) 157 { 158 // increment reference count of object *p 159 ++(p->references); 160 } 161 162 163 164 inline void intrusive_ptr_release(SubEntity * p) 165 { 166 // decrement reference count, and delete object when reference count reaches 0 167 if (--(p->references) == 0) 168 delete p; 169 } 170 } // namespace boost 171 172 typedef ::boost::intrusive_ptr<SubEntity> SubEntityPtr; 132 173 133 174 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCXmlSerializer.h
r700 r721 11 11 XmlSerializer(); 12 12 13 ~XmlSerializer();13 virtual ~XmlSerializer(); 14 14 15 15 protected: 16 16 Ogre::String mFilename; 17 17 18 TiXmlDocument *mFile; 19 18 20 bool mLoaded; 19 21 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMG.h
r700 r721 1 #ifndef _LBBC_H 2 #define _LBBC_H 3 4 #include <LBBCPrerequisites.h> 5 #include <LBBCRoot.h> 6 #include <LBBCLeaves.h> 7 #include <LBBCLeafKdTreeClusterData.h> 8 #include <LBBCSampleConfigFile.h> 1 #ifndef _IMG_H 2 #define _IMG_H 9 3 10 4 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBBox.h
r700 r721 27 27 class BBox: public Ogre::AxisAlignedBox { 28 28 public: 29 inline BBox() { BBox::StartBoundingBox(); }29 BBox(); 30 30 31 inline void StartBoundingBox() { 32 mMinimum.x = BOUNDINGBOX_MAXVALUE; 33 mMinimum.y = BOUNDINGBOX_MAXVALUE; 34 mMinimum.z = BOUNDINGBOX_MAXVALUE; 35 mMaximum.x = -BOUNDINGBOX_MAXVALUE; 36 mMaximum.y = -BOUNDINGBOX_MAXVALUE; 37 mMaximum.z = -BOUNDINGBOX_MAXVALUE; 38 }; 31 ~BBox(); 39 32 40 inline Ogre::Vector3 GetMinimum() { return mMinimum; } 33 void StartBoundingBox(); 41 34 42 // 43 // Vector3 * GetMinimum() 44 // { 45 // Vector3 *Vector3; 46 // 47 // Ogre::Vector3 v = mMinimum; 48 // Vector3.x = v.x; 49 // Vector3.y = v.y; 50 // Vector3.z = v.z; 51 // 52 // return v; 53 // } 54 55 inline Ogre::Vector3 GetMaximum() { return mMaximum;}; 35 Ogre::Vector3 GetMinimum(); 56 36 57 // 58 // Vector3 GetMaximum() 59 // { 60 // 61 // Vector3 Vector3; 62 // Ogre::Vector3 v = mMaximum; 63 // Vector3.x = v.x; 64 // Vector3.y = v.y; 65 // Vector3.z = v.z; 66 // return Vector3; 67 // } 68 // 69 inline void AddBoundingVector3(float x, float y, float z) { 70 if (x < mMinimum.x) mMinimum.x = x; if (x > mMaximum.x) mMaximum.x = x; 71 if (y < mMinimum.y) mMinimum.y = y; if (y > mMaximum.y) mMaximum.y = y; 72 if (z < mMinimum.z) mMinimum.z = z; if (z > mMaximum.z) mMaximum.z = z; 73 }; 37 Ogre::Vector3 GetMaximum(); 74 38 75 inline void Print() { 76 printf("\nValor de la Caixa: (%.4f, %.4f, %.4f) - (%.4f, %.4f, %.4f)\n\n", mMinimum.x, mMinimum.y, mMinimum.z, mMaximum.x, mMaximum.y, mMaximum.z); 77 }; 39 void AddBoundingVector3(float x, float y, float z); 78 40 79 //Ogre::Vector3* GetCorner (int corner) const 80 inline Ogre::Vector3 * GetCorner(int corner) const { 81 82 //if (corner < 0 || corner > 7) return Ogre::Vector3 (-1111111111, -1111111111, -1111111111); 83 //return Ogre::AxisAlignedBox::getAllCorners ()[corner]; 84 //printf("\nGetCorner: %d", corner); 85 86 if (corner < 0 || corner > 7) return NULL; 87 88 Ogre::Vector3 *vector; 89 switch (corner) 90 { 91 /* 92 case BOX_CORNER_xyz: return vector = new Ogre::Vector3(mMinimum.x, mMinimum.y, mMinimum.z ); 93 case BOX_CORNER_xyZ: return vector = new Ogre::Vector3(mMinimum.x, mMinimum.y, mMaximum.z ); 94 case BOX_CORNER_xYz: return vector = new Ogre::Vector3(mMinimum.x, mMaximum.y, mMinimum.z ); 95 case BOX_CORNER_xYZ: return vector = new Ogre::Vector3(mMinimum.x, mMaximum.y, mMaximum.z ); 96 case BOX_CORNER_Xyz: return vector = new Ogre::Vector3(mMaximum.x, mMinimum.y, mMinimum.z ); 97 case BOX_CORNER_XyZ: return vector = new Ogre::Vector3(mMaximum.x, mMinimum.y, mMaximum.z ); 98 case BOX_CORNER_XYz: return vector = new Ogre::Vector3(mMaximum.x, mMaximum.y, mMinimum.z ); 99 case BOX_CORNER_XYZ: return vector = new Ogre::Vector3(mMaximum.x, mMaximum.y, mMaximum.z ); 100 */ 101 case BOX_CORNER_xyz: vector = new Ogre::Vector3(mMinimum.x, mMinimum.y, mMinimum.z ); break; 102 case BOX_CORNER_xyZ: vector = new Ogre::Vector3(mMinimum.x, mMinimum.y, mMaximum.z ); break; 103 case BOX_CORNER_xYz: vector = new Ogre::Vector3(mMinimum.x, mMaximum.y, mMinimum.z ); break; 104 case BOX_CORNER_xYZ: vector = new Ogre::Vector3(mMinimum.x, mMaximum.y, mMaximum.z ); break; 105 case BOX_CORNER_Xyz: vector = new Ogre::Vector3(mMaximum.x, mMinimum.y, mMinimum.z ); break; 106 case BOX_CORNER_XyZ: vector = new Ogre::Vector3(mMaximum.x, mMinimum.y, mMaximum.z ); break; 107 case BOX_CORNER_XYz: vector = new Ogre::Vector3(mMaximum.x, mMaximum.y, mMinimum.z ); break; 108 case BOX_CORNER_XYZ: vector = new Ogre::Vector3(mMaximum.x, mMaximum.y, mMaximum.z ); break; 109 } 110 111 //vector->Print(); 112 return vector; 113 }; 41 void Print(); 114 42 115 inline bool intersects(Ogre::Vector3 * v) { 116 return Ogre::AxisAlignedBox::intersects(*v); 117 }; 43 Ogre::Vector3 GetCorner(int corner) const; 118 44 119 ~BBox();45 bool intersects(Ogre::Vector3 v); 120 46 121 47 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBox2d.h
r700 r721 2 2 #define _IMGBOX2D_H 3 3 4 #include "IMGBBox.h"4 #include <IMGBBox.h> 5 5 6 6 namespace IMG { 7 7 8 8 //* this class represents a 2d bound box for a texture 9 class Box2d { 10 public: 11 inline Box2d() { 12 mMinimum.x = BOUNDINGBOX_MAXVALUE; 13 mMinimum.y = BOUNDINGBOX_MAXVALUE; 14 15 mMaximum.x = -BOUNDINGBOX_MAXVALUE; 16 mMaximum.y = -BOUNDINGBOX_MAXVALUE; 17 }; 9 class Box2d 10 { 11 public: 12 Box2d(); 18 13 19 // GametoolsError -- Isma 17/08/2005 20 inline Box2d & operator =(const Box2d & p) { 21 mMinimum = p.mMinimum; 22 mMaximum = p.mMaximum; 23 }; 14 ~Box2d(); 24 15 25 inline Ogre::Vector2 GetMinimum() { 26 return mMinimum; 27 }; 16 // GametoolsError -- Isma 17/08/2005 17 Box2d & Box2d::operator =(const Box2d & p) 18 { 19 mMinimum = p.mMinimum; 20 mMaximum = p.mMaximum; 21 return (*this); 22 } 28 23 29 inline Ogre::Vector2 GetMaximum() { 30 return mMaximum; 31 }; 24 Ogre::Vector2 GetMinimum(); 32 25 33 inline void SetBoundBox(float x, float y, float X, float Y) { 34 mMinimum.x = x; 35 mMinimum.y = y; 36 mMaximum.x = X; 37 mMaximum.y = Y; 38 }; 26 Ogre::Vector2 GetMaximum(); 39 27 40 inline void AddBoundingVector3(float x, float y) { 41 if (x < mMinimum.x) mMinimum.x = x; if (x > mMaximum.x) mMaximum.x = x; 42 if (y < mMinimum.y) mMinimum.y = y; if (y > mMaximum.y) mMaximum.y = y; 43 }; 28 void SetBoundBox(float x, float y, float X, float Y); 44 29 45 inline void Print() { 46 printf("\nValor de la Caixa: (%.4f, %.4f) - (%.4f, %.4f)", mMinimum.x, mMinimum.y, mMaximum.x, mMaximum.y); 47 }; 30 void AddBoundingVector3(float x, float y); 48 31 49 inline Ogre::Vector2 * GetCorner(int corner) const { 50 51 //if (corner < 0 || corner > 7) return Ogre::Vector3 (-1111111111, -1111111111, -1111111111); 52 //return Ogre::AxisAlignedBox::getAllCorners ()[corner]; 53 //printf("\nGetCorner: %d", corner); 54 55 if (corner < 0 || corner > 4) return NULL; 56 57 Ogre::Vector2 *vector; 58 switch (corner) 59 { 60 case BOX_CORNER_xy: vector = new Ogre::Vector2(mMinimum.x, mMinimum.y ); break; 61 case BOX_CORNER_xY: vector = new Ogre::Vector2(mMinimum.x, mMaximum.y ); break; 62 case BOX_CORNER_Xy: vector = new Ogre::Vector2(mMaximum.x, mMinimum.y ); break; 63 case BOX_CORNER_XY: vector = new Ogre::Vector2(mMaximum.x, mMaximum.y ); break; 64 65 } 66 67 return vector; 68 }; 32 void Print(); 69 33 70 inline bool In(int w, int h) { 71 if (w <= (mMaximum.x - mMinimum.x) && 72 h <= (mMaximum.y - mMinimum.y)) return true; 73 74 return false; 75 }; 34 Ogre::Vector2 GetCorner(int corner) const; 76 35 77 inline bool FitPerfect(int w, int h) { 78 if (w == (mMaximum.x - mMinimum.x) && 79 h == (mMaximum.y - mMinimum.y)) return true; 80 81 return false; 82 }; 36 bool In(int w, int h); 83 37 84 ~Box2d();38 bool FitPerfect(int w, int h); 85 39 86 pr ivate:40 protected: 87 41 Ogre::Vector2 mMinimum, mMaximum; 88 42 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBsp.h
r700 r721 9 9 class Bsp { 10 10 public: 11 inline Bsp() : root(NULL), countleaf(0), counttotal(0){};11 Bsp(); 12 12 13 inline void SetRoot(NodeBsp * node) { 14 root = node; 15 counttotal++; 16 }; 13 virtual ~Bsp(); 17 14 18 inline void Print() { 19 printf("\nImprimint Arbre BSP, num nodes leaf: %d, totals: %d", countleaf, counttotal); 20 Print(root); 21 }; 15 void SetRoot(NodeBspPtr node); 22 16 23 inline void PrintLeaf() { 24 PrintLeaf(root); 25 }; 17 void Print(); 26 18 27 inline NodeBsp * Insert(int w, int h, int idcluster) { 28 //printf("\nInsret dins Bsp: %d, %d", w, h); 29 30 NodeBsp *node = root->Insert (w,h); 31 32 //printf("\nNode on s'insertarà finalment éS: "); node->Print(); 33 34 if (idcluster != -1) 35 { 36 node->SetId (idcluster); 37 countleaf++; 38 } 39 else counttotal++; 40 41 //Copiar pixels de la imatge al node 42 43 return node; 44 }; 19 void PrintLeaf(); 45 20 46 inline NodeBsp * Get(int i) { 47 return root->Get (root, i); 48 }; 21 NodeBspPtr Insert(int w, int h, int idcluster); 49 22 23 NodeBspPtr Get(int i); 50 24 51 pr ivate:52 NodeBsp *root;25 protected: 26 NodeBspPtr root; 53 27 54 28 int countleaf; … … 56 30 int counttotal; 57 31 58 inline void Print(NodeBsp * node) { 59 if (!node) return; 60 node->Print(); 61 Print(node->GetChild(0)); 62 Print(node->GetChild(1)); 63 }; 32 void Print(NodeBspPtr node); 64 33 65 inline void PrintLeaf(NodeBsp * node) { 66 if (!node) return; 67 68 69 if (node->GetChild(0) == NULL && node->GetChild(1) == NULL) node->Print(); 70 71 PrintLeaf (node->GetChild(0)); 72 PrintLeaf (node->GetChild(1)); 73 74 }; 75 76 77 public: 78 ~Bsp(); 34 void PrintLeaf(NodeBspPtr node); 79 35 80 36 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGCluster.h
r700 r721 2 2 #define _IMGCLUSTER_H 3 3 4 #include "IMGPrerequisites.h" 5 #include "IMGBBox.h" 6 #include "IMGBox2d.h" 7 #include "IMGPlane3.h" 4 #include <IMGPrerequisites.h> 5 #include <IMGBBox.h> 6 #include <IMGBox2d.h> 7 #include <IMGPlane3.h> 8 #include <IMGCluster2d.h> 8 9 9 namespace IMG { class Cluster2d; } 10 namespace IMG 11 { 10 12 11 namespace IMG { 12 13 class Cluster { 13 class Cluster 14 { 14 15 public: 15 16 Cluster(); … … 19 20 Cluster(const Cluster & p); 20 21 21 // Gametools -- Isma 17/08/2005 22 //void Insert (Triangle *t); 23 // Gametools -- Isma 17/08/2005 24 //* return the patchs that the point is in 25 //int CalculaPatch (Vector3 &point); 26 inline void SetNormal(Ogre::Vector3* n) { normal = *n; }; 22 void SetNormal(Ogre::Vector3* n); 27 23 28 inline Ogre::Vector3* GetNormal() { return &normal; };24 Ogre::Vector3* GetNormal(); 29 25 30 inline BBox* GetBound() { return bound; };26 BBox* GetBound(); 31 27 32 inline Box2d* GetBspNodeBound() { return bspnodebound; };28 Box2d* GetBspNodeBound(); 33 29 34 inline void SetBspNodeBound(Box2d* box) { 35 bspnodebound = box; 36 }; 30 void SetBspNodeBound(Box2d* box); 37 31 38 32 void Print(); … … 41 35 int AxisProjected(); 42 36 43 in line int GetId() const { return id; };37 int GetId() const; 44 38 45 inline void SetId(int id_) { id = id;};39 void SetId(int id_); 46 40 47 //Vector3 * GetVector3s() const{ return Vector3s;} 48 //Vector3 * GetVector3s(); 49 //Vector3 * GetVector3s() { return Vector3s_triangle_text; } 50 inline std::vector<Ogre::Vector3>* GetVector3sVector() { return &Vector3s_vector; }; 41 std::vector<Ogre::Vector3>* GetVector3sVector(); 51 42 52 inline Ogre::Vector3* GetVector3sTex() const { return Vector3s_triangle_text;};43 Ogre::Vector3* GetVector3sTex() const; 53 44 54 // Gametools -- Isma 17/08/200555 //bool CreatePatches(bool dinamic = false);56 // Gametools -- Isma 17/08/200557 //Listid *GetPatchList() { return &patchlistid;}58 //Listid *GetTriangleList(){ return &trianglelistid; }59 // Gametools -- Isma 17/08/200560 //int GetIdPatch (unsigned int i)61 //{62 // if (i > patchlistid.GetSize()) return -1;63 //64 // return patchlistid.Get(i);65 //}66 // Gametools -- Isma 17/08/200567 //int GetIdTriangle (unsigned int i)68 //{69 // if (i > trianglelistid.GetSize()) return -1;70 //71 // return trianglelistid.Get(i);72 //}73 45 void Finish(); 74 46 75 inline void SetPlane(Ogre::Vector3* normal, Ogre::Vector3 * point) { 76 plane.normal = *normal; 77 plane.normal = -plane.normal; 78 plane.d = -normal->dotProduct (*point); 79 //plane.d = normal->dotProduct (*point); 80 }; 47 void SetPlane(Ogre::Vector3* normal, Ogre::Vector3 * point); 81 48 82 inline Plane3 * GetPlane() { return &plane; };49 Plane3 * GetPlane(); 83 50 84 51 //* Return the increment in U (lumel increment in x). For patchs calculation … … 91 58 Ogre::Vector3 GetOrigin(); 92 59 93 //94 // void CreateVector3s()95 // {96 //97 // //Vector3s = new Vector3[4];98 // //Vector3s_triangle_text = new Vector3[4];99 // }100 //101 60 bool PointIn(Ogre::Vector3 & point); 102 61 103 Ogre::Real *pointeru[4]; //coordentate u for obscurancemap 104 Ogre::Real *pointerv[4]; //coordentate v for obscurancemap 105 Ogre::Vector2 *uv; //Vector3 coordenates for the original texture 62 Ogre::Real *pointeru[4]; 63 64 Ogre::Real *pointerv[4]; 65 66 Ogre::Vector2 *uv; 106 67 107 68 private: 108 BBox *bound;69 BBox bound; 109 70 110 Box2d *bspnodebound;71 Box2d bspnodebound; 111 72 112 73 static unsigned int ID_CLUSTER; … … 117 78 118 79 std::vector<Ogre::Vector3> Vector3s_vector; 80 119 81 Ogre::Vector3 *Vector3s; 82 120 83 Ogre::Vector3 *Vector3s_triangle_text; 121 84 … … 130 93 Plane3 plane; 131 94 132 // Gametools -- Isma 17/08/2005133 //Listid patchlistid;134 //Listid trianglelistid;135 int CalcPatch(Ogre::Vector3 & point);136 137 138 95 public: 139 ~Cluster();96 virtual ~Cluster(); 140 97 141 98 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGCluster2d.h
r700 r721 2 2 #define _IMGCLUSTER2D_H 3 3 4 #include "IMGCluster.h"4 #include <IMGPrerequisites.h> 5 5 6 6 namespace IMG { 7 7 8 class Cluster; 9 8 10 class Cluster2d { 9 11 public: 10 inline Cluster2d() { 11 Vector3s = NULL; 12 cluster =NULL; 13 normal = NULL; 14 }; 12 Cluster2d(); 13 14 virtual ~Cluster2d(); 15 15 16 16 //* Create a 2d polygon from a polygon 3d. The projecte polygon is belong the dominant normal. … … 21 21 void Print(); 22 22 23 inline Ogre::Vector2 * GetVector3s() { return Vector3s; }23 Ogre::Vector2 * GetVector3s(); 24 24 25 inline std::vector<Ogre::Vector2> * GetVector3sVector() { return &Vector3s2_vector; }25 std::vector<Ogre::Vector2> * GetVector3sVector(); 26 26 27 inline Ogre::Vector3 * GetNormal() { return normal; }27 Ogre::Vector3 * GetNormal(); 28 28 29 protected: 29 30 30 private:31 31 unsigned int id; 32 32 … … 34 34 35 35 Ogre::Vector2 *Vector3s; 36 36 37 std::vector<Ogre::Vector2> Vector3s2_vector; 37 38 38 39 Ogre::Vector3 *normal; 39 40 public:41 ~Cluster2d();42 40 43 41 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGClusterList.h
r709 r721 7 7 namespace IMG { 8 8 9 //* 10 // ClusterList 11 //* 12 class ClusterList { 9 class ClusterList 10 { 13 11 public: 14 inline ClusterList() { 15 list.reserve(100); 16 }; 12 ClusterList(); 17 13 18 //std::vector<Polygon*> * GetList() { return &list;} //return the pointer to the list of voxels 19 inline std::vector<Cluster> * GetList() { return &list;}; 14 virtual ~ClusterList(); 15 16 std::vector<Cluster> * GetList(); 20 17 21 18 //return the pointer to the list of voxels 22 inline unsigned int GetSize() const { return list.size(); }19 unsigned int GetSize() const; 23 20 24 21 //return the number of elements of list 25 inline Cluster * Get(unsigned int i) { 26 if (i <= list.size()) return &list[i]; 27 //if (i <= list.size()) return list[i]; 28 return NULL; 29 }; 22 Cluster * Get(unsigned int i); 30 23 31 24 bool Insert(Cluster * p); … … 34 27 35 28 36 private: 29 protected: 30 37 31 std::vector<Cluster> list; 38 39 public:40 ~ClusterList();41 32 42 33 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGNodeBsp.h
r700 r721 7 7 namespace IMG { 8 8 9 class NodeBsp { 9 // Fordward declaration... 10 class NodeBsp; 11 12 typedef ::boost::intrusive_ptr<NodeBsp> NodeBspPtr; 13 14 namespace boost 15 { 16 void intrusive_ptr_add_ref(NodeBsp * p); 17 void intrusive_ptr_release(NodeBsp * p); 18 }; 19 20 class NodeBsp 21 { 10 22 public: 11 23 NodeBsp(); 12 24 13 Box2d * GetBound();25 virtual ~NodeBsp(); 14 26 15 inline void SetBound(Box2d * box) { bound = box; };27 Box2d* GetBound(); 16 28 17 inline NodeBsp * GetChild(int i) { return child[i]; };29 void SetBound(Box2d *box); 18 30 19 inline void SetId(int id_) { id = id_; };31 NodeBspPtr GetChild(int i); 20 32 21 inline unsigned int GetId() const { return id; };33 void SetId(int id_); 22 34 23 inline void SetChild(NodeBsp * node, int i) { child[i] = node; }; 35 unsigned int GetId() const; 36 37 void SetChild(NodeBspPtr node, int i); 24 38 25 39 void Print(); 26 40 27 //void SetPlane (Plane3 *pla) { plane = pla; } 28 //Plane3 * GetPlane () { return plane; } 29 NodeBsp * Insert(int w, int h); 41 NodeBspPtr Insert(int w, int h); 30 42 31 inline NodeBsp * Get(NodeBsp * node, int i) { 32 if (!node) return NULL; 33 if (node->GetId() == i ) return node; 34 35 NodeBsp *nod; 36 if (nod = node->GetChild(0)->Get (node->GetChild(0), i)) return nod; 37 38 return node->GetChild(0)->Get (node->GetChild(1), i); 39 40 }; 43 NodeBspPtr Get(NodeBspPtr node, int i); 41 44 45 protected: 42 46 43 private:44 47 bool fit; 45 48 46 Box2d *bound;49 Box2d bound; 47 50 48 NodeBsp *child[2];51 NodeBspPtr child[2]; 49 52 50 53 static unsigned int ID; … … 52 55 int id; 53 56 57 private: 58 59 long references; 54 60 55 public: 56 ~NodeBsp(); 61 friend void boost::intrusive_ptr_add_ref(NodeBsp * p); 57 62 63 friend void boost::intrusive_ptr_release(NodeBsp * p); 58 64 }; 65 66 // class specific addref/release implementation 67 // the two function overloads must be in the boost namespace on most compilers: 68 namespace boost 69 { 70 inline void intrusive_ptr_add_ref(NodeBsp * p) 71 { 72 // increment reference count of object *p 73 ++(p->references); 74 } 75 76 77 78 inline void intrusive_ptr_release(NodeBsp * p) 79 { 80 // decrement reference count, and delete object when reference count reaches 0 81 if (--(p->references) == 0) 82 delete p; 83 } 84 } // namespace boost 59 85 60 86 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGPlane3.h
r700 r721 2 2 #define _IMGPLANE3_H 3 3 4 #include "IMGPrerequisites.h"4 #include <IMGPrerequisites.h> 5 5 6 6 namespace IMG { … … 9 9 public: 10 10 //a plane's interface 11 //Plane(); 12 //~Plane(); 13 inline Plane3 & operator =(const Plane3 & p) { 14 normal.x = p.normal.x; 15 normal.y = p.normal.y; 16 normal.z = p.normal.z; 17 d = p.d; 18 return *this; 19 }; 11 Plane3(); 20 12 21 inline Ogre::Vector3 * GetNormal() { 22 Ogre::Vector3 *v = new Ogre::Vector3; 23 v->x = normal.x; 24 v->y = normal.y; 25 v->z = normal.z; 26 return v; 27 }; 13 virtual ~Plane3(); 28 14 29 inline void SetNormal(float x, float y, float z) { 30 normal.x = x; 31 normal.y = y; 32 normal.z = z; 33 }; 15 Plane3 & operator =(const Plane3 & p); 34 16 35 inline void SetDistance(float dist) { 36 d = dist; 37 }; 17 Ogre::Vector3 * GetNormal(); 38 18 39 inline float GetDistance() const { return d;};19 void SetNormal(float x, float y, float z); 40 20 41 inline void Print() { 42 printf("\nPrintant pla: (%.4f, %.4f, %.4f, %.4f)", normal.x, normal.y, normal.z, d); 43 }; 21 void SetDistance(float dist); 44 22 45 ~Plane3(); 23 float GetDistance() const; 24 25 void Print(); 46 26 47 27 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGPrerequisites.h
r700 r721 9 9 #include <OgreAxisAlignedBox.h> 10 10 11 #include <boost/smart_ptr.hpp> 12 11 13 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBC.h
r700 r721 7 7 #include <LBBCLeafKdTreeClusterData.h> 8 8 #include <LBBCSampleConfigFile.h> 9 #include <LBBCBillboardViewMode.h> 10 #include <LBBCClusterViewMode.h> 9 11 10 12 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCBillboardKMeansClusterData.h
r700 r721 1 #ifndef _LBBCBILLBOARDKM EANSCLUSTERDATA_H2 #define _LBBCBILLBOARDKM EANSCLUSTERDATA_H1 #ifndef _LBBCBILLBOARDKMeansCLUSTERDATA_H 2 #define _LBBCBILLBOARDKMeansCLUSTERDATA_H 3 3 4 4 #include <BBC.h> 5 #include <LBBCLeafKMeansClusterData.h> 6 #include <LBBCLeaf.h> 5 7 6 8 namespace LBBC { … … 10 12 BillboardKMeansClusterData(); 11 13 12 ~BillboardKMeansClusterData(); 14 virtual ~BillboardKMeansClusterData(); 15 16 virtual void readBillboardClusterData(TiXmlNode *parentNode); 17 18 virtual void writeBillboardClusterData(TiXmlNode *parentNode); 19 20 virtual void generateBillboardBoundingQuad(); 13 21 14 22 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCBillboardKdTreeClusterData.h
r700 r721 1 #ifndef _LBBCBILLBOARDK DTREECLUSTERDATA_H2 #define _LBBCBILLBOARDK DTREECLUSTERDATA_H1 #ifndef _LBBCBILLBOARDKdTreeCLUSTERDATA_H 2 #define _LBBCBILLBOARDKdTreeCLUSTERDATA_H 3 3 4 4 #include <BBC.h> 5 #include <LBBCLeafKdTreeClusterData.h>6 #include <LBBCLeaf.h>7 5 8 6 namespace LBBC { … … 12 10 BillboardKdTreeClusterData(); 13 11 14 ~BillboardKdTreeClusterData(); 15 16 virtual void readBillboardClusterData(TiXmlNode *parentNode); 17 18 virtual void writeBillboardClusterData(TiXmlNode *parentNode); 19 20 virtual void generateBillboardBoundingQuad(); 12 virtual ~BillboardKdTreeClusterData(); 21 13 22 14 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKMeansClusterGenerator.h
r700 r721 1 #ifndef _LBBCKMEANSCLUSTERGENERATOR_H 2 #define _LBBCKMEANSCLUSTERGENERATOR_H 3 1 #ifndef _LBBCKMeansCLUSTERGENERATOR_H 2 #define _LBBCKMeansCLUSTERGENERATOR_H 4 3 5 4 #include <BBC.h> 5 #include <LBBCLeafKMeansClusterData.h> 6 #include <LBBCBillboardKMeansClusterData.h> 7 #include <LBBCLeaf.h> 8 #include <LBBCLeafDistribution.h> 6 9 7 10 namespace LBBC { 8 11 9 class _BBCExport KMeansClusterGenerator : public BBC::BillboardCloudGenerator { 12 class _BBCExport KMeansClusterGenerator: public BBC::BillboardCloudGenerator 13 { 10 14 public: 11 15 void generate(); … … 13 17 void init(); 14 18 19 void setAlpha(float value); 20 21 float getAlpha(); 22 23 void initializeBillboardCloud(); 24 25 BBC::BillboardPtr createBillboard(); 26 27 void initializeBillboardClusterData(BBC::BillboardPtr billboard); 28 29 void initializeRandomBillboard(BBC::BillboardPtr billboard); 30 31 void splitLeafDistribution(); 32 33 void assignLeafBillboard(Leaf *leaf, BBC::BillboardPtr billboard); 34 35 void recomputeBillboardCloud(); 36 37 void recomputeBillboard(BBC::BillboardPtr billboard); 38 39 void iterativeRecomputeBillboardCloud(); 40 41 unsigned int findBestBillboard(Leaf *leaf); 42 43 void generateBillboardCloudBounds(); 44 45 void setNumIterations(unsigned int value); 46 47 unsigned int getNumIterations(); 48 15 49 KMeansClusterGenerator(); 16 50 17 ~KMeansClusterGenerator();51 virtual ~KMeansClusterGenerator(); 18 52 19 53 protected: 20 54 21 class Cell 22 { 23 protected: 24 Cell *right; 25 Cell *left; 26 Ogre::Vector4 min; 27 Ogre::Vector4 max; 28 29 public: 30 Cell() 31 { 32 right = NULL; 33 left = NULL; 34 } 55 float mAlpha; 35 56 36 void setLeftChild(Cell *lChild) 37 { 38 left = lChild; 39 } 57 float mEpsilonYN; 40 58 41 void setRightChild(Cell *rChild) 42 { 43 right = rChild; 44 } 45 46 Cell* getRightChild() 47 { 48 return right; 49 } 50 51 Cell* getLeftChild() 52 { 53 return left; 54 } 55 56 Ogre::Vector4 getMin() 57 { 58 return min; 59 } 60 61 Ogre::Vector4 getMax() 62 { 63 return max; 64 } 65 66 void setMax(Ogre::Vector4 vmax) 67 { 68 max = vmax; 69 } 70 71 void setMin(Ogre::Vector4 vmin) 72 { 73 min = vmin; 74 } 75 }; 76 59 float mNumIterations; 77 60 }; 78 61 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKMeansClusterSerializer.h
r700 r721 1 #ifndef _LBBCKM EANSCLUSTERSERIALIZER_H2 #define _LBBCKM EANSCLUSTERSERIALIZER_H1 #ifndef _LBBCKMeansCLUSTERSERIALIZER_H 2 #define _LBBCKMeansCLUSTERSERIALIZER_H 3 3 4 4 #include <BBC.h> 5 #include <LBBCBillboardKMeansClusterData.h> 6 7 #include <string> 5 8 6 9 namespace LBBC { … … 10 13 KMeansClusterSerializer(); 11 14 12 ~KMeansClusterSerializer();15 virtual ~KMeansClusterSerializer(); 13 16 14 17 virtual void writeBillboardCloud(TiXmlDocument *document); 15 18 16 19 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKdTreeClusterGenerator.h
r700 r721 1 #ifndef _LBBCKDTREECLUSTERGENERATOR_H 2 #define _LBBCKDTREECLUSTERGENERATOR_H 1 #ifndef _LBBCKdTreeCLUSTERGENERATOR_H 2 #define _LBBCKdTreeCLUSTERGENERATOR_H 3 3 4 4 5 #include <BBC.h> 5 #include <LBBCLeafKdTreeClusterData.h>6 #include <LBBCBillboardKdTreeClusterData.h>7 #include <LBBCLeaf.h>8 #include <LBBCLeafDistribution.h>9 6 10 7 namespace LBBC { … … 16 13 void init(); 17 14 18 void setAlpha(float value);19 20 float getAlpha();21 22 void initializeBillboardCloud();23 24 BBC::Billboard* createBillboard();25 26 void initializeBillboardClusterData(BBC::Billboard *billboard);27 28 void initializeRandomBillboard(BBC::Billboard *billboard);29 30 void splitLeafDistribution();31 32 void assignLeafBillboard(Leaf *leaf, BBC::Billboard *billboard);33 34 void recomputeBillboardCloud();35 36 void recomputeBillboard(BBC::Billboard *billboard);37 38 void iterativeRecomputeBillboardCloud();39 40 unsigned int findBestBillboard(Leaf *leaf);41 42 void generateBillboardCloudBounds();43 44 void setNumIterations(unsigned int value);45 46 unsigned int getNumIterations();47 48 15 KdTreeClusterGenerator(); 49 16 50 ~KdTreeClusterGenerator();17 virtual ~KdTreeClusterGenerator(); 51 18 52 19 protected: 53 20 54 float mAlpha; 21 class Cell 22 { 23 protected: 24 Cell *right; 25 Cell *left; 26 Ogre::Vector4 min; 27 Ogre::Vector4 max; 28 29 public: 30 Cell() 31 { 32 right = NULL; 33 left = NULL; 34 } 55 35 56 float mEpsilonYN; 36 void setLeftChild(Cell *lChild) 37 { 38 left = lChild; 39 } 57 40 58 float mNumIterations; 41 void setRightChild(Cell *rChild) 42 { 43 right = rChild; 44 } 45 46 Cell* getRightChild() 47 { 48 return right; 49 } 50 51 Cell* getLeftChild() 52 { 53 return left; 54 } 55 56 Ogre::Vector4 getMin() 57 { 58 return min; 59 } 60 61 Ogre::Vector4 getMax() 62 { 63 return max; 64 } 65 66 void setMax(Ogre::Vector4 vmax) 67 { 68 max = vmax; 69 } 70 71 void setMin(Ogre::Vector4 vmin) 72 { 73 min = vmin; 74 } 75 }; 76 59 77 }; 60 78 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKdTreeClusterSerializer.h
r700 r721 1 #ifndef _LBBCK DTREECLUSTERSERIALIZER_H2 #define _LBBCK DTREECLUSTERSERIALIZER_H1 #ifndef _LBBCKdTreeCLUSTERSERIALIZER_H 2 #define _LBBCKdTreeCLUSTERSERIALIZER_H 3 3 4 4 #include <BBC.h> 5 #include <LBBCBillboardKdTreeClusterData.h>6 7 #include <string>8 5 9 6 namespace LBBC { … … 13 10 KdTreeClusterSerializer(); 14 11 15 ~KdTreeClusterSerializer();12 virtual ~KdTreeClusterSerializer(); 16 13 17 virtualvoid writeBillboardCloud(TiXmlDocument *document);14 void writeBillboardCloud(TiXmlDocument *document); 18 15 19 16 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeaf.h
r700 r721 81 81 Leaf(); 82 82 83 ~Leaf();83 virtual ~Leaf(); 84 84 85 85 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeafDistribution.h
r700 r721 19 19 LeafDistribution(); 20 20 21 ~LeafDistribution();21 virtual ~LeafDistribution(); 22 22 23 23 void setMinD(float value); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeafDistributionGenerator.h
r700 r721 14 14 LeafDistributionGenerator(); 15 15 16 ~LeafDistributionGenerator();16 virtual ~LeafDistributionGenerator(); 17 17 18 18 void generateAverageLeafNormal(Leaf *leaf); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeafDistributionSerializer.h
r700 r721 13 13 LeafDistributionSerializer(); 14 14 15 ~LeafDistributionSerializer();15 virtual ~LeafDistributionSerializer(); 16 16 17 17 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeafKMeansClusterData.h
r700 r721 1 #ifndef _LBBCLEAFKM EANSCLUSTERDATA_H2 #define _LBBCLEAFKM EANSCLUSTERDATA_H1 #ifndef _LBBCLEAFKMeansCLUSTERDATA_H 2 #define _LBBCLEAFKMeansCLUSTERDATA_H 3 3 4 4 #include <BBCEntityClusterData.h> … … 10 10 LeafKMeansClusterData(); 11 11 12 ~LeafKMeansClusterData(); 12 virtual ~LeafKMeansClusterData(); 13 14 protected: 13 15 14 16 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeafKdTreeClusterData.h
r700 r721 1 #ifndef _LBBCLEAFK DTREECLUSTERDATA_H2 #define _LBBCLEAFK DTREECLUSTERDATA_H1 #ifndef _LBBCLEAFKdTreeCLUSTERDATA_H 2 #define _LBBCLEAFKdTreeCLUSTERDATA_H 3 3 4 4 #include <BBCEntityClusterData.h> … … 10 10 LeafKdTreeClusterData(); 11 11 12 ~LeafKdTreeClusterData(); 13 14 protected: 12 virtual ~LeafKdTreeClusterData(); 15 13 16 14 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCLeaves.h
r700 r721 11 11 Leaves(); 12 12 13 ~Leaves();13 virtual ~Leaves(); 14 14 15 15 protected: 16 16 bool mMeshLoaded; 17 17 18 Ogre::Mesh *mMesh;18 BBC::EntityPtr mEntity; 19 19 20 20 BBC::BillboardCloud *mBillboardCloud; 21 21 22 22 public: 23 Ogre::Mesh* getMesh();23 BBC::EntityPtr getEntity(); 24 24 25 void set Mesh(Ogre::Mesh *value);25 void setEntity(BBC::EntityPtr value); 26 26 27 27 void load(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCManager.h
r709 r721 2 2 #define _LBBCMANAGER_H 3 3 4 #include <BBC.h>5 4 #include <LBBCPrerequisites.h> 6 5 #include <LBBCLeaves.h> … … 22 21 ~Manager(); 23 22 24 void runSample(Ogre::String sampleConfigFile); 23 void runSampleConfigFile(); 24 25 void loadSampleConfigFile(Ogre::String sampleConfigFile); 25 26 26 27 SampleConfigFile* getSampleConfigFile(); 28 29 void setSampleConfigFile(SampleConfigFile *sampleConfigFile); 27 30 28 31 void generateEntityDistribution(); … … 72 75 BBC::OgreMeshSerializer *mOgreMeshSerializer; 73 76 74 SampleConfigFile mSampleCf;77 SampleConfigFile *mSampleConfigFile; 75 78 76 Ogre::ConfigFile mCf; 79 Ogre::ConfigFile *mConfigFile; 80 77 81 }; 78 82 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCSampleConfigFile.h
r709 r721 10 10 SampleConfigFile(); 11 11 12 ~SampleConfigFile();12 virtual ~SampleConfigFile(); 13 13 14 14 bool getEntityDistributionMerged();
Note: See TracChangeset
for help on using the changeset viewer.