- Timestamp:
- 04/29/06 19:11:23 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 79 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r828 r863 12 12 #include "VisibilityManager.h" 13 13 #include "ViewCellsManager.h" 14 15 //class GtpVisibilityPreprocessor::ViewCellsManager; 14 16 15 17 … … 118 120 void InitVisibilityCulling(Camera *cam); 119 121 122 /** Finds object corresponding to this bounding box in the scene. 123 */ 124 MovableObject *FindCorrespondingObject(const AxisAlignedBox &box); 125 126 /** Identifies objects in the scene and gives them unique ids that 127 correspond to preprocessor ids. 128 */ 129 void IdentifyObjects(GtpVisibilityPreprocessor::ObjectContainer &objects); 130 120 131 /// the interface to the scene hierarchy. 121 132 OctreeHierarchyInterface *mHierarchyInterface; … … 164 175 /// Always execute the vertex program of a pass, e.g., for the depth pass or item buffer 165 176 bool mExecuteVertexProgramForAllPasses; 166 177 /// if hierarchical culling is currently in use 167 178 bool mIsHierarchicalCulling; 168 179 169 ViewCellsManager *mViewCellsManager;180 GtpVisibilityPreprocessor::ViewCellsManager *mViewCellsManager; 170 181 }; 171 182 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreTypeConverter.h
r860 r863 1 1 #ifndef _OgreTypeConverter_H__ 2 2 #define _OgreTypeConverter_H__ 3 3 4 #include "OgreAxisAlignedBox.h" 4 5 #include "AxisAlignedBox3.h" 5 #include "OgreAxisAlignedBox.h"6 6 #include "Vector3.h" 7 #include "OgreVector3.h"8 7 9 8 10 9 namespace Ogre { 11 10 12 11 /** 13 Class which converts our types to OGRE types12 Class which converts preprocessor types to OGRE types 14 13 */ 15 14 class __declspec(dllexport) OgreTypeConverter 16 15 { 17 16 public: 18 17 /** Converts Ogre AABB to preprocessor AABB. 18 */ 19 19 static GtpVisibilityPreprocessor::AxisAlignedBox3 ConvertFromOgre(const AxisAlignedBox &box); 20 /** Converts Ogre vector to preprocessor vector. 21 */ 20 22 static GtpVisibilityPreprocessor::Vector3 ConvertFromOgre(const Vector3 &v); 21 23 /** Converts preprocessor AABB to Ogre AABB. 24 */ 22 25 static AxisAlignedBox ConvertToOgre(const GtpVisibilityPreprocessor::AxisAlignedBox3 &box); 26 /** Converts preprocessor vector to Ogre vector. 27 */ 23 28 static Vector3 ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v); 24 29 }; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityOctreeSceneManager.h
r828 r863 104 104 void InitVisibilityCulling(Camera *cam); 105 105 106 107 106 108 /// the interface to the scene hierarchy. 107 109 OctreeHierarchyInterface *mHierarchyInterface; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj
r860 r863 88 88 EnableFiberSafeOptimizations="TRUE" 89 89 OptimizeForProcessor="2" 90 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\ include"90 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src" 91 91 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE" 92 92 StringPooling="TRUE" … … 198 198 </File> 199 199 <File 200 RelativePath="..\include\OgreMeshInstance.h"> 201 </File> 202 <File 200 203 RelativePath="..\include\OgreOcclusionQueriesQueryManager.h"> 201 204 </File> … … 234 237 Name="Source Files" 235 238 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 239 <File 240 RelativePath="..\src\OgreMeshInstance.cpp"> 241 </File> 236 242 <File 237 243 RelativePath="..\src\OgreOcclusionQueriesQueryManager.cpp"> -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r860 r863 1 1 #include "OgreOcclusionCullingSceneManager.h" 2 2 #include "OgreVisibilityOptionsManager.h" 3 #include "OgreTypeConverter.h" 3 4 #include <OgreMath.h> 4 5 #include <OgreIteratorWrappers.h> … … 9 10 #include <OgreEntity.h> 10 11 #include <OgreSubEntity.h> 12 #include <OgreIteratorWrappers.h> 11 13 #include "VspBspTree.h" 12 #include <OgreIteratorWrappers.h> 14 #include "Containers.h" 15 #include "ViewCellsManager.h" 13 16 14 17 namespace Ogre { … … 38 41 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 39 42 40 //mDisplayNodes = true; 41 //mShowBoundingBoxes = true; 42 //mShowBoxes = true; 43 //std::stringstream d; d << "here555"; 44 //mDummyLog.open(""); 45 43 #if 0 44 mDisplayNodes = true; 45 mShowBoundingBoxes = true; 46 mShowBoxes = true; 47 #endif 46 48 // TODO: set maxdepth to reasonable value 47 49 mMaxDepth = 50; … … 836 838 } 837 839 838 /*bool OcclusionCullingSceneManager::CompareBoundingBoxes(const AxisAlignedBox &boxa, 839 const AxisAlignedBox &boxb) 840 { 841 } 842 */ 843 void OcclusionCullingSceneManager::LoadViewCells(string filename) 844 { 845 ObjectContainer objects; 846 mViewCellsManager->LoadViewCells(filename, &objects); 847 848 AxisAlignedBox box; 840 841 MovableObject *OcclusionCullingSceneManager::FindCorrespondingObject(const AxisAlignedBox &box) 842 { 849 843 list<SceneNode *> sceneNodeList; 850 844 … … 853 847 list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end(); 854 848 855 for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(); ++ sit) 849 bool overlap = false; 850 851 MovableObject *bestFittingObj = NULL; 852 float bestFit = 0.0; 853 854 // find the bbox which is closest to the current bbox 855 for (sit = sceneNodeList.begin(); sit != sceneNodeList.end(), !overlap; ++ sit) 856 856 { 857 857 SceneNode *sn = *sit; 858 858 SceneNode::ObjectIterator oit = sn->getAttachedObjectIterator(); 859 859 860 861 860 while (oit.hasMoreElements()) 861 { 862 862 MovableObject *mo = oit.getNext(); 863 AxisAlignedBox bbox = mo->getWorldBoundingBox(); 864 // CompareBoundingBoxes(*oit, box); 865 } 863 const AxisAlignedBox bbox = mo->getWorldBoundingBox(); 864 865 const float overlap = GtpVisibilityPreprocessor::FactorOfOverlap( 866 OgreTypeConverter::ConvertFromOgre(bbox), 867 OgreTypeConverter::ConvertFromOgre(box)); 868 869 if (overlap > bestFit) 870 { 871 bestFit = overlap; 872 bestFittingObj = mo; 873 874 // perfect fit => object found 875 if (overlap > (1.0 - GtpVisibilityPreprocessor::Limits::Small)) 876 break; 877 } 878 } 879 } 880 881 return bestFittingObj; 882 } 883 884 885 void OcclusionCullingSceneManager::LoadViewCells(string filename) 886 { 887 GtpVisibilityPreprocessor::ObjectContainer objects; 888 // identify the corresponding Ogre meshes using the bounding boxes 889 IdentifyObjects(objects); 890 891 // load the view cells assigning the found objects to the pvss 892 mViewCellsManager->LoadViewCells(filename, &objects); 893 } 894 895 896 void OcclusionCullingSceneManager::IdentifyObjects(GtpVisibilityPreprocessor::ObjectContainer &objects) 897 { 898 const string bboxesFilename = "boxes.out"; 899 900 GtpVisibilityPreprocessor::IndexedBoundingBoxContainer iboxes; 901 mViewCellsManager->LoadBoundingBoxes(bboxesFilename, iboxes); 902 903 GtpVisibilityPreprocessor::IndexedBoundingBoxContainer:: 904 const_iterator iit, iit_end = iboxes.end(); 905 906 for (iit = iboxes.begin(); iit != iit_end; ++ iit) 907 { 908 const GtpVisibilityPreprocessor::AxisAlignedBox3 box = (*iit).second; 909 const AxisAlignedBox currentBox = OgreTypeConverter::ConvertToOgre(box); 910 911 MovableObject *mo = FindCorrespondingObject(currentBox); 912 913 //objects.push_back(mi); 866 914 } 867 915 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp
r860 r863 2 2 3 3 4 GtpVisibilityPreprocessor::AxisAlignedBox3 Ogre::OgreTypeConverter::ConvertFromOgre(const Ogre::AxisAlignedBox &box) 4 namespace Ogre 5 5 { 6 7 GtpVisibilityPreprocessor::AxisAlignedBox3 OgreTypeConverter::ConvertFromOgre(const AxisAlignedBox &box) 8 { 9 const GtpVisibilityPreprocessor::Vector3 bmin = ConvertFromOgre(box.getMinimum()); 10 const GtpVisibilityPreprocessor::Vector3 bmax = ConvertFromOgre(box.getMaximum()); 11 12 return GtpVisibilityPreprocessor::AxisAlignedBox3(bmin, bmax); 6 13 } 7 14 8 GtpVisibilityPreprocessor::Vector3 Ogre ::OgreTypeConverter::ConvertFromOgre(const Ogre::Vector3 &v)15 GtpVisibilityPreprocessor::Vector3 OgreTypeConverter::ConvertFromOgre(const Vector3 &v) 9 16 { 17 return GtpVisibilityPreprocessor::Vector3(v.x, v.y, v.z); 10 18 } 11 19 12 Ogre::AxisAlignedBox Ogre::OgreTypeConverter::ConvertToOgre(const GtpVibilityPreprocessor::AxisAlignedBox3 &box)20 AxisAlignedBox OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::AxisAlignedBox3 &box) 13 21 { 22 const Vector3 bmin = ConvertToOgre(box.Min()); 23 const Vector3 bmax = ConvertToOgre(box.Max()); 24 25 return AxisAlignedBox(bmin, bmax); 14 26 } 15 27 16 Ogre::Vector3 Ogre::OgreTypeConverter::ConvertToOgre(const GtpVibilityPreprocessor::Vector3 &v)28 Vector3 OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v) 17 29 { 30 return Vector3(v.getX(), v.getY(), v.getZ()); 18 31 } 32 } -
GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h
r68 r863 9 9 class ViewCell; 10 10 class HierarchyNode; 11 11 12 /** Container for Mesh pointers primarily for the use within the kDTree and 12 13 BSP hierarchies */ … … 18 19 BSP hierarchies */ 19 20 typedef vector<HierarchyNode *> NodeContainer; 21 20 22 }; 21 22 23 23 24 #endif // _Container_H__ -
GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj
r860 r863 76 76 RuntimeTypeInfo="TRUE" 77 77 UsePrecompiledHeader="0" 78 WarningLevel=" 3"78 WarningLevel="2" 79 79 Detect64BitPortabilityProblems="TRUE" 80 80 DebugInformationFormat="3"/> -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r860 r863 9 9 #include "Mesh.h" 10 10 11 usingnamespace GtpVisibilityPreprocessor {11 namespace GtpVisibilityPreprocessor { 12 12 13 13 #define FATAL Debug -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r860 r863 8 8 #include "Containers.h" 9 9 10 namespace GtpVisibilityPreprocessor { 11 10 12 class Ray; 11 13 class Polygon3; 12 14 class Mesh; 13 15 14 / / --------------------------------------------------------15 //CAABox class.16 //This is a box in 3-space, defined by min and max17 //corner vectors. Many useful operations are defined18 //on this19 // -------------------------------------------------------- 16 /** 17 CAABox class. 18 This is a box in 3-space, defined by min and max 19 corner vectors. Many useful operations are defined 20 on this 21 */ 20 22 class AxisAlignedBox3 21 23 { 22 24 protected: 23 25 Vector3 mMin, mMax; 24 26 public: 25 27 // Constructors. … … 34 36 // max(center + Vector3(radius)) {} 35 37 36 // initialization to the non existing bounding box 38 /** initialization to the non existing bounding box 39 */ 37 40 void Initialize() { 38 41 mMin = Vector3(MAXFLOAT); … … 40 43 } 41 44 42 // The center of the box 45 /** The center of the box 46 */ 43 47 Vector3 Center() const { return 0.5 * (mMin + mMax); } 44 48 45 // The diagonal of the box 49 /** The diagonal of the box 50 */ 46 51 Vector3 Diagonal() const { return (mMax -mMin); } 47 52 … … 110 115 void Include (const PolygonContainer &polys); 111 116 void Include(Mesh *mesh); 112 // Expand the axis-aligned box to include given values in particular axis 117 118 /** Expand the axis-aligned box to include given values in particular axis. 119 */ 113 120 void Include(const int &axis, const float &newBound); 114 121 … … 123 130 friend inline bool OverlapS(const AxisAlignedBox3 &,const AxisAlignedBox3 &); 124 131 125 // Overlap returns 1 if the two axis-aligned boxes overlap for a given 126 // epsilon. If eps > 0.0, then the boxes has to have the real intersection 127 // box, if eps < 0.0, then the boxes need not intersect really, they 128 // can be at eps distance in the projection 132 /** Overlap returns 1 if the two axis-aligned boxes overlap for a given 133 epsilon. If eps > 0.0, then the boxes has to have the real intersection 134 box, if eps < 0.0, then the boxes need not intersect really, they 135 can be at eps distance in the projection. 136 */ 129 137 friend inline bool Overlap(const AxisAlignedBox3 &, 130 const AxisAlignedBox3 &, 131 float eps); 132 133 // Includes returns true if a includes b (completely 138 const AxisAlignedBox3 &, 139 float eps); 140 141 /** Returns 'factor' of overlap of first box with the second box. i.e., a number 142 between 0 (no overlap) and 1 (same box). 143 */ 144 friend inline float FactorOfOverlap(const AxisAlignedBox3 &, const AxisAlignedBox3 &); 145 146 /** Includes returns true if a includes b (completely) 147 */ 134 148 bool Includes(const AxisAlignedBox3 &b) const; 135 149 136 150 virtual int IsInside(const Vector3 &v) const; 137 151 138 // Test if the box is really sensefull 152 /** Test if the box makes sense. 153 */ 139 154 virtual bool IsCorrect(); 140 155 141 // To answer true requires the box of real volume of non-zero value 156 /** To answer true requires the box of real volume of non-zero value. 157 */ 142 158 bool IsSingularOrIncorrect() const; 143 159 144 // When the box is not of non-zero or negative surface area 160 /** When the box is not of non-zero or negative surface area. 161 */ 145 162 bool IsCorrectAndNotPoint() const; 146 163 147 // Returns true when the box degenerates to a point 164 /** Returns true when the box degenerates to a point. 165 */ 148 166 bool IsPoint() const; 149 167 168 /** Scales the box with the factor. 169 */ 150 170 void Scale(const float scale) { 151 171 Vector3 newSize = Size()*(scale*0.5f); … … 155 175 } 156 176 177 /** Returns the square of the minimal and maximal distance to 178 a point on the box. 179 */ 157 180 void 158 181 GetSqrDistances(const Vector3 &point, … … 348 371 @returns true if ray hits the bounding box. 349 372 */ 350 bool GetRaySegment(const Ray &ray, 351 float &minT, 352 float &maxT) const; 373 bool GetRaySegment(const Ray &ray, float &minT, float &maxT) const; 353 374 354 375 /** If the boxes are intersecting on a common face, this function … … 519 540 } 520 541 542 inline float FactorOfOverlap(const AxisAlignedBox3 &box1, const AxisAlignedBox3 &box2) 543 { 544 const AxisAlignedBox3 isect = Intersect(box1, box2); 545 return isect.GetVolume() / box1.GetVolume(); 546 } 521 547 522 548 inline int operator==(const AxisAlignedBox3 &A, const AxisAlignedBox3 &B) … … 526 552 527 553 528 554 } 529 555 530 556 -
GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp
r860 r863 4 4 #include "Polygon3.h" 5 5 6 usingnamespace GtpVisibilityPreprocessor {6 namespace GtpVisibilityPreprocessor { 7 7 8 8 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h
r860 r863 8 8 using namespace std; 9 9 10 namespace GtpVisibilityPreprocessor { 11 10 12 class KdNode; 11 13 class Intersectable; 12 14 class Mesh; 13 15 14 namespace GtpVisibilityPreprocessor {15 16 16 17 // the values need for rss tree update computed already inside the glrendererbuffer -
GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp
r860 r863 14 14 15 15 16 usingnamespace GtpVisibilityPreprocessor {16 namespace GtpVisibilityPreprocessor { 17 17 18 18 -
GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h
r860 r863 76 76 }; 77 77 78 } 78 }; 79 79 80 80 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
r860 r863 18 18 19 19 struct IndexedBoundingBox; 20 struct VisibilityPoint; 20 21 21 struct VisibilityPoint;22 22 23 23 /** Container storing polygons used during BSP tree construction. -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r860 r863 20 20 #include "Vector3.h" 21 21 22 23 using namespace GtpVisibilityPreprocessor { 22 using namespace std; 23 24 namespace GtpVisibilityPreprocessor { 25 26 24 27 25 28 Environment *environment = NULL; … … 269 272 // new option 270 273 options[numOptions].type = type; 271 options[numOptions].name = strdup(name);274 options[numOptions].name = ::strdup(name); 272 275 // assign abbreviation, if requested 273 276 if (abbrev != NULL) { 274 options[numOptions].abbrev =strdup(abbrev);277 options[numOptions].abbrev = ::strdup(abbrev); 275 278 } 276 279 // assign default value, if requested 277 280 if (defValue != NULL) { 278 options[numOptions].defaultValue =strdup(defValue);281 options[numOptions].defaultValue = ::strdup(defValue); 279 282 if (!CheckType(defValue, type)) { 280 283 Debug << "Internal error: Inconsistent type and default value in option " … … 610 613 if (options[i].type == optString) { 611 614 delete options[i].value; 612 options[i].value =strdup(value);615 options[i].value = ::strdup(value); 613 616 } 614 617 else { -
GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.cpp
r860 r863 1 1 #include "ExactPreprocessor.h" 2 2 3 usingnamespace GtpVisibilityPreprocessor {3 namespace GtpVisibilityPreprocessor { 4 4 5 5 bool -
GTP/trunk/Lib/Vis/Preprocessing/src/ExactPreprocessor.h
r860 r863 2 2 #define _ExactPreprocessor_H__ 3 3 4 5 #include "Preprocessor.h" 6 7 4 8 namespace GtpVisibilityPreprocessor { 5 9 6 #include "Preprocessor.h"7 10 8 11 /** Exact visibility preprocessing. The implementation is based on 6D BSP and -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r860 r863 3 3 #include "VrmlExporter.h" 4 4 5 usingnamespace GtpVisibilityPreprocessor {5 namespace GtpVisibilityPreprocessor { 6 6 7 7 Exporter * -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h
r860 r863 6 6 using namespace std; 7 7 8 namespace GtpVisibilityPreprocessor { 8 9 9 10 10 #include "Material.h" 11 11 #include "Containers.h" 12 12 #include "VssRay.h" 13 14 namespace GtpVisibilityPreprocessor { 13 15 14 16 class KdTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
r860 r863 18 18 #include "Beam.h" 19 19 20 usingnamespace GtpVisibilityPreprocessor {20 namespace GtpVisibilityPreprocessor { 21 21 22 22 #define USE_FIXEDPOINT_T 0 -
GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.h
r860 r863 14 14 15 15 class ViewCell; 16 //class BspViewCell;17 16 class Plane3; 18 17 class FromPointVisibilityTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r860 r863 16 16 #include <QVBoxLayout> 17 17 18 usingnamespace GtpVisibilityPreprocessor {18 namespace GtpVisibilityPreprocessor { 19 19 20 20 static CGcontext sCgContext = NULL; -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r860 r863 11 11 #include "Renderer.h" 12 12 #include "Beam.h" 13 14 class QWidget; 13 15 14 16 namespace GtpVisibilityPreprocessor { … … 22 24 class Beam; 23 25 class KdTree; 24 class QWidget;25 26 class GlRendererBuffer; 26 27 class BeamSampleStatistics; … … 428 429 extern GlDebuggerWidget *debuggerWidget; 429 430 430 } 431 }; 431 432 432 433 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/Halton.cpp
r860 r863 2 2 #include "Halton.h" 3 3 4 usingnamespace GtpVisibilityPreprocessor {4 namespace GtpVisibilityPreprocessor { 5 5 6 6 // global halton generator -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r860 r863 8 8 #include "Beam.h" 9 9 10 11 12 namespace GtpVisibilityPreprocessor { 13 10 14 int KdNode::mailID = 1; 11 12 using namespace GtpVisibilityPreprocessor {13 14 15 15 16 KdNode::KdNode(KdInterior *parent):mParent(parent), mailbox(0) -
GTP/trunk/Lib/Vis/Preprocessing/src/Material.cpp
r860 r863 2 2 #include "Material.h" 3 3 4 usingnamespace GtpVisibilityPreprocessor {4 namespace GtpVisibilityPreprocessor { 5 5 6 6 -
GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.cpp
r860 r863 6 6 using namespace std; 7 7 8 usingnamespace GtpVisibilityPreprocessor {8 namespace GtpVisibilityPreprocessor { 9 9 10 10 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r860 r863 4 4 #include "Triangle3.h" 5 5 6 usingnamespace GtpVisibilityPreprocessor {6 namespace GtpVisibilityPreprocessor { 7 7 8 8 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r860 r863 9 9 #include "AxisAlignedBox3.h" 10 10 #include "Material.h" 11 #include "Containers.h" 12 11 13 12 14 namespace GtpVisibilityPreprocessor { … … 51 53 VertexIndexContainer mVertexIndices; 52 54 }; 55 56 57 58 /// default vertex container for Mesh 59 typedef vector<Vector3> VertexContainer; 60 61 /// vertex index container 62 typedef vector<short> VertexIndexContainer; 53 63 54 64 /// default patch container for Mesh -
GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp
r860 r863 6 6 #include "MeshKdTree.h" 7 7 8 usingnamespace GtpVisibilityPreprocessor {8 namespace GtpVisibilityPreprocessor { 9 9 10 10 -
GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp
r860 r863 11 11 #include "SceneGraph.h" 12 12 13 usingnamespace GtpVisibilityPreprocessor {13 namespace GtpVisibilityPreprocessor { 14 14 15 15 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h
r860 r863 3 3 4 4 #include <string> 5 using namespace std;6 5 7 6 namespace GtpVisibilityPreprocessor { … … 16 15 Parser() {} 17 16 18 virtual bool ParseFile(const st ring filename,17 virtual bool ParseFile(const std::string filename, 19 18 SceneGraphNode **root, 20 19 const bool loadPolygonsAsMeshes = false) {return false;}; -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp
r860 r863 3 3 4 4 5 usingnamespace GtpVisibilityPreprocessor {5 namespace GtpVisibilityPreprocessor { 6 6 7 7 -
GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
r860 r863 9 9 #include "Mesh.h" 10 10 11 usingnamespace GtpVisibilityPreprocessor {11 namespace GtpVisibilityPreprocessor { 12 12 13 13 // int facesPerMesh = 100000000; -
GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h
r860 r863 5 5 #include "Containers.h" 6 6 7 usingnamespace GtpVisibilityPreprocessor {7 namespace GtpVisibilityPreprocessor { 8 8 9 9 class ViewCellsManager; -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
r860 r863 6 6 7 7 8 usingnamespace GtpVisibilityPreprocessor {8 namespace GtpVisibilityPreprocessor { 9 9 10 10 -
GTP/trunk/Lib/Vis/Preprocessing/src/Polytope.cpp
r860 r863 1 1 #include "Polytope.h" 2 2 3 usingnamespace GtpVisibilityPreprocessor {3 namespace GtpVisibilityPreprocessor { 4 4 5 5 /************************************************ -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r860 r863 14 14 #include "PlyParser.h" 15 15 16 usingnamespace GtpVisibilityPreprocessor {16 namespace GtpVisibilityPreprocessor { 17 17 18 18 -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.cpp
r860 r863 8 8 9 9 10 usingnamespace GtpVisibilityPreprocessor {10 namespace GtpVisibilityPreprocessor { 11 11 12 12 -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp
r860 r863 2 2 #include "Pvs.h" 3 3 4 usingnamespace GtpVisibilityPreprocessor {4 namespace GtpVisibilityPreprocessor { 5 5 6 6 int -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp
r860 r863 3 3 #include "VssRay.h" 4 4 5 usingnamespace GtpVisibilityPreprocessor {5 namespace GtpVisibilityPreprocessor { 6 6 7 7 // ========================================================= -
GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
r860 r863 4 4 #include "Plane3.h" 5 5 6 usingnamespace GtpVisibilityPreprocessor {6 namespace GtpVisibilityPreprocessor { 7 7 8 8 RayInfo::RayInfo(): mRay(NULL), mMinT(0), -
GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.cpp
r860 r863 1 1 #include "Rectangle3.h" 2 2 3 usingnamespace GtpVisibilityPreprocessor {3 namespace GtpVisibilityPreprocessor { 4 4 5 5 -
GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h
r860 r863 1 1 #ifndef __RECTANGLE3_H 2 2 #define __RECTANGLE3_H 3 3 4 #include <iostream> 4 5 using namespace std; -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp
r860 r863 8 8 9 9 10 usingnamespace GtpVisibilityPreprocessor {10 namespace GtpVisibilityPreprocessor { 11 11 12 12 -
GTP/trunk/Lib/Vis/Preprocessing/src/Renderer.cpp
r860 r863 1 1 #include "Renderer.h" 2 2 3 usingnamespace GtpVisibilityPreprocessor {3 namespace GtpVisibilityPreprocessor { 4 4 5 5 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r860 r863 13 13 #include "GlRenderer.h" 14 14 15 usingnamespace GtpVisibilityPreprocessor {15 namespace GtpVisibilityPreprocessor { 16 16 17 17 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
r860 r863 5 5 using namespace std; 6 6 7 8 7 #include "Preprocessor.h" 9 8 #include "VssRay.h" 9 10 namespace GtpVisibilityPreprocessor { 11 12 10 13 class RssTree; 11 14 class RssTreeLeaf; 12 15 13 namespace GtpVisibilityPreprocessor {14 16 15 17 /** Sampling based visibility preprocessing. The implementation is based on heuristical … … 141 143 142 144 143 } 145 }; 144 146 145 147 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r860 r863 30 30 31 31 32 usingnamespace GtpVisibilityPreprocessor {32 namespace GtpVisibilityPreprocessor { 33 33 34 34 -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h
r860 r863 1081 1081 }; 1082 1082 1083 } 1084 1085 #endif // __ LSDS_KDTREE_H__1086 1083 }; 1084 1085 #endif // __RSSTREE_H__ 1086 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp
r860 r863 11 11 12 12 13 usingnamespace GtpVisibilityPreprocessor {13 namespace GtpVisibilityPreprocessor { 14 14 15 15 -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r860 r863 7 7 8 8 9 usingnamespace GtpVisibilityPreprocessor {9 namespace GtpVisibilityPreprocessor { 10 10 11 11 -
GTP/trunk/Lib/Vis/Preprocessing/src/Tetrahedron3.cpp
r860 r863 2 2 3 3 4 usingnamespace GtpVisibilityPreprocessor {4 namespace GtpVisibilityPreprocessor { 5 5 6 6 -
GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp
r860 r863 1 1 #include "Triangle3.h" 2 2 3 usingnamespace GtpVisibilityPreprocessor {3 namespace GtpVisibilityPreprocessor { 4 4 5 5 float -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
r860 r863 13 13 #include "Environment.h" 14 14 15 usingnamespace GtpVisibilityPreprocessor {15 namespace GtpVisibilityPreprocessor { 16 16 17 17 #define ROTATE_SCENE 0 -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h
r860 r863 3 3 4 4 #include <string> 5 using namespace std;6 5 #include "Parser.h" 7 6 … … 16 15 UnigraphicsParser(): Parser() {} 17 16 18 virtual bool ParseFile(const st ring filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false);17 virtual bool ParseFile(const std::string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 19 18 20 19 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.cpp
r860 r863 3 3 #include "Halton.h" 4 4 5 usingnamespace GtpVisibilityPreprocessor {5 namespace GtpVisibilityPreprocessor { 6 6 7 7 // Given min a vector to minimize and a candidate vector, replace -
GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h
r860 r863 7 7 #include "common.h" 8 8 9 9 10 namespace GtpVisibilityPreprocessor { 10 11 … … 12 13 class Matrix4x4; 13 14 class Vector2; 15 14 16 15 17 // HACK of returning vector components as array fields. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r860 r863 13 13 #include <stack> 14 14 15 usingnamespace GtpVisibilityPreprocessor {15 namespace GtpVisibilityPreprocessor { 16 16 17 17 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r860 r863 15 15 #include <stack> 16 16 17 usingnamespace GtpVisibilityPreprocessor {17 namespace GtpVisibilityPreprocessor { 18 18 19 19 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r860 r863 16 16 #include "RssPreprocessor.h" 17 17 18 usingnamespace GtpVisibilityPreprocessor {18 namespace GtpVisibilityPreprocessor { 19 19 20 20 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r860 r863 31 31 #include "ViewCellsManager.h" 32 32 33 usingnamespace GtpVisibilityPreprocessor {33 namespace GtpVisibilityPreprocessor { 34 34 35 35 … … 132 132 } 133 133 134 inline bool vlt(ViewCell *v1, ViewCell *v2)134 inline static bool vlt(ViewCell *v1, ViewCell *v2) 135 135 { 136 136 return v1->mId < v2->mId; … … 297 297 298 298 ObjectContainer::iterator oit = 299 lower_bound(mObjects->begin(), mObjects->end(), &dummyInst, ilt);299 lower_bound(mObjects->begin(), mObjects->end(), (Intersectable *)&dummyInst, ilt); 300 300 301 301 Intersectable *obj = *oit; … … 444 444 else 445 445 { 446 // add to invalid view space 446 447 if (mViewCellsManager->GetType() == ViewCellsManager::VSP_BSP) 447 448 { -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r860 r863 15 15 #include "Beam.h" 16 16 17 usingnamespace GtpVisibilityPreprocessor {17 namespace GtpVisibilityPreprocessor { 18 18 19 19 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r860 r863 18 18 #include "Beam.h" 19 19 20 usingnamespace GtpVisibilityPreprocessor {20 namespace GtpVisibilityPreprocessor { 21 21 22 22 #define USE_FIXEDPOINT_T 0 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r860 r863 10 10 #include "RayInfo.h" 11 11 #include "ViewCellBsp.h" 12 13 namespace GtpVisibilityPreprocessor { 12 14 13 15 class ViewCell; … … 25 27 class ViewCellsTree; 26 28 27 namespace GtpVisibilityPreprocessor {28 29 29 30 /** -
GTP/trunk/Lib/Vis/Preprocessing/src/VspKdTree.cpp
r860 r863 28 28 #include "ViewCellBsp.h" 29 29 30 usingnamespace GtpVisibilityPreprocessor {30 namespace GtpVisibilityPreprocessor { 31 31 32 32 // Static variables -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r860 r863 15 15 #include "ViewCellBsp.h" 16 16 17 usingnamespace GtpVisibilityPreprocessor {17 namespace GtpVisibilityPreprocessor { 18 18 19 19 bool use2dSampling = false; -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp
r860 r863 2 2 #include "AxisAlignedBox3.h" 3 3 4 usingnamespace GtpVisibilityPreprocessor {4 namespace GtpVisibilityPreprocessor { 5 5 6 6 // Static variables … … 106 106 bool 107 107 VssRay::Intersects(const AxisAlignedBox3 &box, 108 109 108 float &tmin, 109 float &tmax) const 110 110 { 111 111 if (!ComputeMinMaxT(box, tmin, tmax)) … … 124 124 bool 125 125 VssRay::IntersectsSphere(const Vector3 ¢er, 126 127 128 126 const float sqrRadius, 127 Vector3 &point, 128 float &t) const 129 129 { 130 130 // compute ray/plane intersection … … 141 141 point = GetOrigin() + t*dir; 142 142 143 return ::SqrDistance(point, center) < sqrRadius;143 return GtpVisibilityPreprocessor::SqrDistance(point, center) < sqrRadius; 144 144 } 145 145 … … 239 239 selected.push_back(*it); 240 240 241 return selected.size();241 return (int)selected.size(); 242 242 } 243 243 … … 255 255 selected.push_back(ray); 256 256 } 257 return selected.size();258 } 259 260 } 257 return (int)selected.size(); 258 } 259 260 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
r860 r863 320 320 }; 321 321 322 } 322 }; 323 323 324 324 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.cpp
r860 r863 25 25 #include "Ray.h" 26 26 27 usingnamespace GtpVisibilityPreprocessor {27 namespace GtpVisibilityPreprocessor { 28 28 29 29 #define DEBUG_SPLIT_COST 0 … … 1836 1836 if (1) { 1837 1837 // return GetAvgRayContribution(); 1838 return GetPvsSize();1838 return (float)GetPvsSize(); 1839 1839 } else { 1840 1840 // return GetAvgRayContribution()*mEntropyImportance; -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h
r860 r863 924 924 925 925 int 926 CollectRays(VssRayContainer &rays 927 ); 926 CollectRays(VssRayContainer &rays); 928 927 929 928 }; 930 929 931 } 930 }; 932 931 933 932 #endif // __LSDS_KDTREE_H__ -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
r860 r863 15 15 #include "Beam.h" 16 16 17 usingnamespace GtpVisibilityPreprocessor {17 namespace GtpVisibilityPreprocessor { 18 18 19 19 -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h
r860 r863 147 147 }; 148 148 149 } 149 }; 150 150 151 151 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r860 r863 30 30 #include "ViewCellsManager.h" 31 31 32 usingnamespace GtpVisibilityPreprocessor {32 namespace GtpVisibilityPreprocessor { 33 33 34 34 -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
r860 r863 12 12 { 13 13 public: 14 14 X3dParser():Parser(), mViewCellHeight(5.0f) {} 15 15 16 17 16 bool ParseFile(const string filename, SceneGraphNode **root, const bool loadPolygonsAsMeshes = false); 17 bool ParseFile(const string filename, ViewCellsManager &viewCells); 18 18 19 20 21 /// height of a loaded view cell 22 float mViewCellHeight; 19 /// height of a loaded view cell 20 float mViewCellHeight; 23 21 }; 24 22 25 } 23 }; 26 24 27 25 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp
r542 r863 23 23 #endif 24 24 25 namespace GtpVisibilityPreprocessor { 25 26 26 27 … … 46 47 Real Limits::Threshold = 1e-6f; 47 48 Real Limits::Small = 0.01f; 48 Real Limits::Infinity = 1e20 ;49 Real Limits::Infinity = 1e20f; 49 50 50 51 … … 284 285 return false; 285 286 } 286 #endif 287 288 #endif 289 290 } -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r860 r863 19 19 #include <iostream> 20 20 #include <fstream> 21 #include <limits.h> 21 22 22 23 using namespace std; 23 24 24 #include <limits.h> 25 26 27 namespace GtpVisibilityPreprocessor { 28 25 29 26 30 … … 475 479 GetPath(const char *s); 476 480 477 #endif 478 479 480 481 482 483 484 485 486 487 488 481 } 482 483 #endif 484 485 486 487 488 489 490 491 492 493 494 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r840 r863 24 24 #include <crtdbg.h> 25 25 26 26 using namespace GtpVisibilityPreprocessor; 27 27 28 28 int
Note: See TracChangeset
for help on using the changeset viewer.