Changeset 2176
- Timestamp:
- 02/28/07 19:38:47 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 103 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2171 r2176 1838 1838 if (mNormalExecution) 1839 1839 { 1840 // notin the normal workflow1840 // problems using this function in the normal workflow 1841 1841 return; 1842 1842 } -
GTP/trunk/Lib/Vis/Preprocessing/include/Containers.h
r2168 r2176 3 3 4 4 #include <vector> 5 // using namespace std;5 // 6 6 7 7 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r2124 r2176 3 3 #include <assert.h> 4 4 #include <iostream> 5 using namespace std;6 5 #include "AxisAlignedBox3.h" 7 6 #include "Ray.h" … … 12 11 #include "VssRay.h" 13 12 13 14 using namespace std; 14 15 15 16 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r2124 r2176 255 255 // Writes a brief description of the object, indenting by the given 256 256 // number of spaces first. 257 virtual void Describe( ostream& app, int ind) const;257 virtual void Describe(std::ostream& app, int ind) const; 258 258 259 259 // For edge .. number <0..11> returns two incident vertices … … 434 434 435 435 // input and output operator with stream 436 friend ostream& operator<<(ostream &s, const AxisAlignedBox3 &A);437 friend istream& operator>>(istream &s, AxisAlignedBox3 &A);436 friend std::ostream& operator<<(std::ostream &s, const AxisAlignedBox3 &A); 437 friend std::istream& operator>>(std::istream &s, AxisAlignedBox3 &A); 438 438 439 439 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/Beam.cpp
r863 r2176 131 131 132 132 133 void BeamSampleStatistics::Print( ostream &app) const133 void BeamSampleStatistics::Print(std::ostream &app) const 134 134 { 135 135 app << "===== Beam sample statistics ===============\n"; -
GTP/trunk/Lib/Vis/Preprocessing/src/Beam.h
r863 r2176 6 6 #include "Statistics.h" 7 7 8 using namespace std;9 8 10 9 namespace GtpVisibilityPreprocessor { … … 47 46 } 48 47 49 void Print( ostream &app) const;48 void Print(std::ostream &app) const; 50 49 51 friend ostream &operator<<(ostream &s, const BeamSampleStatistics &stat)50 friend std::ostream &operator<<(std::ostream &s, const BeamSampleStatistics &stat) 52 51 { 53 52 stat.Print(s); -
GTP/trunk/Lib/Vis/Preprocessing/src/BitVectorPvs.h
r2117 r2176 6 6 #include "PvsBase.h" 7 7 8 using namespace std;9 8 10 9 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r2124 r2176 137 137 int maxRayContriNodes; 138 138 139 void Print( ostream &app) const;140 141 friend ostream &operator<<(ostream &s, const BvhStatistics &stat)139 void Print(std::ostream &app) const; 140 141 friend std::ostream &operator<<(std::ostream &s, const BvhStatistics &stat) 142 142 { 143 143 stat.Print(s); … … 241 241 } 242 242 243 ostream &Describe(ostream &s) { return s; }243 std::ostream &Describe(std::ostream &s) { return s; } 244 244 245 245 /////////////////////////////////// … … 283 283 void SetupChildLinks(BvhNode *front, BvhNode *back); 284 284 285 friend ostream &operator<<(ostream &s, const BvhInterior &A)285 friend std::ostream &operator<<(std::ostream &s, const BvhInterior &A) 286 286 { 287 287 return s << A.mBoundingBox; … … 1000 1000 bool mStoreRays; 1001 1001 // subdivision stats output file 1002 ofstream mSubdivisionStats;1002 std::ofstream mSubdivisionStats; 1003 1003 /// keeps track of cost during subdivision 1004 1004 float mTotalCost; -
GTP/trunk/Lib/Vis/Preprocessing/src/Camera.cpp
r1583 r2176 13 13 #include "SceneGraph.h" 14 14 15 using namespace std; 15 16 16 17 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Camera.h
r1583 r2176 67 67 68 68 bool 69 SnapImage(string filename,69 SnapImage(std::string filename, 70 70 KdTree *tree, 71 71 SceneGraph *sceneGraph -
GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.h
r1966 r2176 1 1 #ifndef _CombinedPreprocessor_H__ 2 2 #define _CombinedPreprocessor_H__ 3 4 #include <fstream>5 using namespace std;6 3 7 4 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/Containers.h
r2116 r2176 6 6 #include <map> 7 7 8 using namespace std;8 using std::vector; 9 9 10 10 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.h
r1004 r2176 71 71 char *description; 72 72 void *pointer; 73 friend ostream &operator <<(ostream &s, const COption &o) {73 friend std::ostream &operator <<(std::ostream &s, const COption &o) { 74 74 s<<o.name<<"\t"; 75 75 if (o.abbrev) … … 89 89 s<<"\t"; 90 90 if (o.description) 91 s<< endl<<o.description;91 s<<std::endl<<o.description; 92 92 return s; 93 93 } … … 184 184 185 185 /// This method is used as a help on available command line options. 186 virtual void PrintUsage( ostream &s) const;186 virtual void PrintUsage(std::ostream &s) const; 187 187 188 188 virtual void SetStaticOptions(); -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r2124 r2176 9 9 #include "TraversalTree.h" 10 10 11 12 using namespace std; 11 13 12 14 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h
r2124 r2176 4 4 #include <string> 5 5 #include <vector> 6 using namespace std;7 6 8 7 … … 39 38 { 40 39 protected: 41 st ring mFilename;40 std::string mFilename; 42 41 bool mWireframe; 43 42 bool mUseForcedMaterial; … … 48 47 public: 49 48 50 Exporter(const string filename):mFilename(filename), 49 Exporter(const std::string filename): 50 mFilename(filename), 51 51 mWireframe(false), 52 52 mUseForcedMaterial(false), … … 154 154 155 155 static Exporter * 156 GetExporter(const st ring filename);156 GetExporter(const std::string filename); 157 157 158 158 virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/FlexibleHeap.h
r1667 r2176 4 4 #include <vector> 5 5 6 using namespace std;7 6 8 7 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2116 r2176 2 2 #define __GLRENDERER_H 3 3 4 #include "ObjectPvs.h" 4 5 #include "Vector3.h" 5 6 #include "Containers.h" … … 7 8 #include "Renderer.h" 8 9 #include "Beam.h" 9 #include "ObjectPvs.h" 10 10 11 11 12 … … 25 26 class TransformedMeshInstance; 26 27 class TriangleIntersectable; 27 28 28 class BvhNode; 29 class SimpleRayContainer; 29 30 30 31 struct VssRayContainer; … … 166 167 167 168 inline const bool GetSnapErrorFrames() { return mSnapErrorFrames; } 168 inline const st ring GetSnapPrefix() { return mSnapPrefix; }169 inline const std::string GetSnapPrefix() { return mSnapPrefix; } 169 170 170 171 inline void SetSnapErrorFrames(bool snapframes) { mSnapErrorFrames = snapframes; } 171 inline void SetSnapPrefix(const st ring &pref) { mSnapPrefix = pref; }172 inline void SetSnapPrefix(const std::string &pref) { mSnapPrefix = pref; } 172 173 173 174 virtual void ClearErrorBuffer(); … … 228 229 bool mUseGlLists; 229 230 230 st ring mSnapPrefix;231 std::string mSnapPrefix; 231 232 232 233 GLUquadric *mSphere; -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2053 r2176 4 4 #include <fstream> 5 5 #include <stack> 6 using namespace std;7 6 8 7 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/Halton.h
r2105 r2176 3 3 4 4 #include <iostream> 5 using namespace std;6 5 7 6 namespace GtpVisibilityPreprocessor { … … 198 197 } 199 198 else { 200 cerr<<"Error generating Halton sequence."<<endl;199 std::cerr<<"Error generating Halton sequence."<<std::endl; 201 200 exit(1); 202 201 } -
GTP/trunk/Lib/Vis/Preprocessing/src/HashPvs.h
r2164 r2176 2 2 #define __HASHPVS_H 3 3 4 5 #include <hash_set> 4 //#include <hash_set> 6 5 #include "common.h" 7 6 #include <math.h> … … 11 10 12 11 13 using namespace std;14 15 12 namespace GtpVisibilityPreprocessor { 16 13 -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r2130 r2176 102 102 } 103 103 104 void Print( ostream &app) const;105 106 friend ostream &operator<<(ostream &s, const HierarchyStatistics &stat)104 void Print(std::ostream &app) const; 105 106 friend std::ostream &operator<<(std::ostream &s, const HierarchyStatistics &stat) 107 107 { 108 108 stat.Print(s); … … 154 154 155 155 156 void Print( ostream &app) const;157 158 friend ostream &operator<<(ostream &s, const HierarchySubdivisionStats &stat)156 void Print(std::ostream &app) const; 157 158 friend std::ostream &operator<<(std::ostream &s, const HierarchySubdivisionStats &stat) 159 159 { 160 160 stat.Print(s); … … 251 251 /** Print out statistics. 252 252 */ 253 void PrintHierarchyStatistics( ostream &stream) const;253 void PrintHierarchyStatistics(std::ostream &stream) const; 254 254 255 255 /** Returns the view space partition tree. … … 279 279 void ExportBoundingBoxes(OUT_STREAM &stream, const ObjectContainer &objects); 280 280 281 friend ostream &operator<<(ostream &s, const HierarchyManager &hm)281 friend std::ostream &operator<<(std::ostream &s, const HierarchyManager &hm) 282 282 { 283 283 hm.PrintHierarchyStatistics(s); … … 291 291 void EvaluateSubdivision(const VssRayContainer &sampleRays, 292 292 const ObjectContainer &objects, 293 const st ring &filename);294 295 void EvaluateSubdivision2( ofstream &splitsStats,293 const std::string &filename); 294 295 void EvaluateSubdivision2(std::ofstream &splitsStats, 296 296 const int splitsStepSize, 297 297 const bool useFilter, … … 532 532 /////////////////////////// 533 533 534 void ExportStats( ofstream &stats,534 void ExportStats(std::ofstream &stats, 535 535 SplitQueue &tQueue, 536 536 const ObjectContainer &objects); … … 644 644 //int mMinRenderCostDecrease; 645 645 646 ofstream mSubdivisionStats;646 std::ofstream mSubdivisionStats; 647 647 648 648 /// if the queue should be repaired after a subdivision steps -
GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.h
r2105 r2176 29 29 */ 30 30 IntelRayCaster(const Preprocessor &preprocessor, 31 const st ring externKdTree);31 const std::string externKdTree); 32 32 33 33 virtual ~IntelRayCaster(); … … 75 75 protected: 76 76 77 bool InitRayCast(const st ring externKdTree);77 bool InitRayCast(const std::string externKdTree); 78 78 }; 79 79 -
GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.h
r2003 r2176 5 5 #include "Containers.h" 6 6 #include <string> 7 using namespace std; 7 // 8 8 9 9 -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.cpp
r2066 r2176 1 1 #include "Intersectable.h" 2 3 using namespace std; 2 4 3 5 -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r2164 r2176 118 118 // vector3 &normal) = 0; 119 119 120 virtual ostream &Describe(ostream &s) = 0;120 virtual std::ostream &Describe(std::ostream &s) = 0; 121 121 122 122 ////////////////////////////////////// … … 140 140 /** Returns the name of the type of this intersectable 141 141 */ 142 static st ring GetTypeName(Intersectable *obj);142 static std::string GetTypeName(Intersectable *obj); 143 143 144 144 /** Returns normal from the face with the specified index. -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r2113 r2176 55 55 const int maxTries); 56 56 57 ostream &Describe(ostream &s);57 std::ostream &Describe(std::ostream &s); 58 58 59 59 int GetRandomEdgePoint(Vector3 &point, Vector3 &normal); … … 150 150 151 151 template<typename T> 152 ostream &IntersectableWrapper<T>::Describe(ostream &s)152 std::ostream &IntersectableWrapper<T>::Describe(std::ostream &s) 153 153 { 154 154 s << mItem; … … 176 176 177 177 178 typedef map<KdNode *, KdIntersectable *> KdIntersectableMap;178 typedef std::map<KdNode *, KdIntersectable *> KdIntersectableMap; 179 179 180 180 … … 220 220 public: 221 221 DummyIntersectable(const int item): 222 IntersectableWrapper<int>(item) { }222 IntersectableWrapper<int>(item) { SetId(item); } 223 223 224 224 int Type() const -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2124 r2176 10 10 #include "IntersectableWrapper.h" 11 11 12 13 using namespace std; 12 14 13 15 // $$JB HACK -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
r2117 r2176 3 3 4 4 #include <functional> 5 using namespace std; 5 // 6 6 7 7 #include "Containers.h" … … 83 83 84 84 void 85 Print( ostream &app) const;86 87 friend ostream &operator<<(ostream &s, const KdTreeStatistics &stat) {85 Print(std::ostream &app) const; 86 87 friend std::ostream &operator<<(std::ostream &s, const KdTreeStatistics &stat) { 88 88 stat.Print(s); 89 89 return s; … … 268 268 // comparator for the 269 269 struct less_priority : public 270 binary_function<const TraversalData, const TraversalData, bool> {270 std::binary_function<const TraversalData, const TraversalData, bool> { 271 271 272 272 bool operator()(const TraversalData a, const TraversalData b) { … … 425 425 CollectLeafPvs(); 426 426 427 bool ExportBinTree(const st ring &filename);428 bool LoadBinTree(const st ring &filename, ObjectContainer &object);427 bool ExportBinTree(const std::string &filename); 428 bool LoadBinTree(const std::string &filename, ObjectContainer &object); 429 429 430 430 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/Matrix4x4.h
r1001 r2176 3 3 4 4 #include <iostream> 5 using namespace std; 5 // 6 6 7 7 namespace GtpVisibilityPreprocessor { … … 100 100 101 101 // Overloaded output operator. 102 friend ostream& operator<< (ostream &s, const Matrix4x4 &M);102 friend std::ostream& operator<< (std::ostream &s, const Matrix4x4 &M); 103 103 }; 104 104 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1990 r2176 4 4 #include "Triangle3.h" 5 5 #include "ResourceManager.h" 6 7 using namespace std; 6 8 7 9 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r1763 r2176 3 3 4 4 #include <vector> 5 using namespace std; 5 // 6 6 #include "Intersectable.h" 7 7 #include "Plane3.h" … … 56 56 57 57 /// default vertex container for Mesh 58 typedef vector<Vector3> VertexContainer;58 typedef std::vector<Vector3> VertexContainer; 59 59 60 60 /// default patch container for Mesh … … 164 164 CastRayToSelectedFaces( 165 165 Ray &ray, 166 const vector<int> &faces,166 const std::vector<int> &faces, 167 167 Intersectable *instance 168 168 ); … … 213 213 bool CheckMesh() const; 214 214 215 void Print( ostream &app) const;216 217 virtual ostream &Describe(ostream &s) const {215 void Print(std::ostream &app) const; 216 217 virtual std::ostream &Describe(std::ostream &s) const { 218 218 return s<<"Mesh #vertices="<<(int)mVertices.size()<<" #faces="<<(int)mFaces.size(); 219 219 } … … 224 224 friend Mesh *CreateMeshFromBox(const AxisAlignedBox3 &box); 225 225 226 friend ostream& operator<< (ostream &s, const Vector3 &A);226 friend std::ostream& operator<< (std::ostream &s, const Vector3 &A); 227 227 228 228 protected: … … 234 234 235 235 // Overload << operator for C++-style output 236 inline ostream&237 operator<< ( ostream &s, const Mesh &A)236 inline std::ostream& 237 operator<< (std::ostream &s, const Mesh &A) 238 238 { 239 239 A.Print(s); … … 280 280 CastRay( 281 281 Ray &ray, 282 const vector<int> &faces282 const std::vector<int> &faces 283 283 ); 284 284 285 285 286 virtual ostream &Describe(ostream &s) {286 virtual std::ostream &Describe(std::ostream &s) { 287 287 s<<"MeshInstance Id="<<GetId(); 288 288 return mMesh->Describe(s); … … 323 323 virtual int CastRay(Ray &ray); 324 324 325 virtual int CastRay(Ray &ray, const vector<int> &faces);325 virtual int CastRay(Ray &ray, const std::vector<int> &faces); 326 326 327 327 virtual int Type() const { return TRANSFORMED_MESH_INSTANCE; } -
GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.cpp
r1486 r2176 5 5 #include "Mesh.h" 6 6 #include "MeshKdTree.h" 7 8 using namespace std; 7 9 8 10 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/MeshKdTree.h
r1486 r2176 3 3 4 4 #include <functional> 5 using namespace std; 5 // 6 6 7 7 #include "Containers.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.h
r2076 r2176 3 3 4 4 #include <vector> 5 using namespace std; 5 // 6 6 7 7 #include "common.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/MutualVisibility.cpp
r1867 r2176 1 1 #include <assert.h> 2 2 #include <stack> 3 using namespace std;4 3 #include "KdTree.h" 5 4 #include "AxisAlignedBox3.h" … … 10 9 #include "Triangle3.h" 11 10 #include "SceneGraph.h" 11 12 using namespace std; 12 13 13 14 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjExporter.cpp
r1694 r2176 4 4 #include "ObjExporter.h" 5 5 6 7 using namespace std; 6 8 7 9 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r2123 r2176 4 4 #include <map> 5 5 #include <math.h> 6 7 using namespace std;8 6 9 7 #include "Vector3.h" … … 18 16 #include "IntersectableWrapper.h" 19 17 18 19 using namespace std; 20 20 21 21 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp
r2123 r2176 8 8 #include "BvHierarchy.h" 9 9 10 using namespace std; 10 11 11 12 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.h
r2123 r2176 5 5 #include "PvsDefinitions.h" 6 6 7 using namespace std; 7 // 8 8 9 9 namespace GtpVisibilityPreprocessor { … … 25 25 float EvalPvsCost() const; 26 26 27 friend ostream &operator<<(ostream &s, const ObjectPvs &p)27 friend std::ostream &operator<<(std::ostream &s, const ObjectPvs &p) 28 28 { 29 29 ObjectPvsIterator pit = p.GetIterator(); … … 32 32 { 33 33 Intersectable *obj = pit.Next(); 34 cout << obj << " ";34 std::cout << obj << " "; 35 35 } 36 36 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp
r2130 r2176 5 5 #include <stdlib.h> 6 6 #include <iostream> 7 //#include <ext/algorithm>8 9 using namespace std;10 7 #include <xercesc/util/PlatformUtils.hpp> 11 8 … … 34 31 #include "BvHierarchy.h" 35 32 33 34 using namespace std; 36 35 37 36 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.h
r2119 r2176 18 18 ObjectsParser(): Parser() {} 19 19 20 bool ParseObjects(const st ring &filename,20 bool ParseObjects(const std::string &filename, 21 21 ObjectContainer &pvsObjects, 22 22 const ObjectContainer &preprocessorObjects); -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParserXerces.h
r2119 r2176 94 94 95 95 void StartBvhLeaf(AttributeList& attributes); 96 void StartBvhElement(st ring element, AttributeList& attributes);96 void StartBvhElement(std::string element, AttributeList& attributes); 97 97 98 98 void EndObjectSpaceHierarchy(); -
GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp
r2116 r2176 20 20 #include "VspTree.h" 21 21 22 using namespace std; 23 22 24 23 25 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.h
r1779 r2176 129 129 130 130 131 void Print( ostream &app) const;132 133 friend ostream &operator<<(ostream &s, const OspTreeStatistics &stat)131 void Print(std::ostream &app) const; 132 133 friend std::ostream &operator<<(std::ostream &s, const OspTreeStatistics &stat) 134 134 { 135 135 stat.Print(s); … … 830 830 float mEpsilon; 831 831 /// subdivision stats output file 832 ofstream mSubdivisionStats;832 std::ofstream mSubdivisionStats; 833 833 /// keeps track of cost during subdivision 834 834 float mTotalCost; -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.h
r1932 r2176 70 70 friend SimpleRay GetPlaneIntersection(const Plane3 &plane1, const Plane3 &plane2); 71 71 72 friend ostream &operator<<(ostream &s, const Plane3 &p) {72 friend std::ostream &operator<<(std::ostream &s, const Plane3 &p) { 73 73 s<<p.mNormal<<" "<<p.mD; 74 74 return s; … … 89 89 { 90 90 } 91 91 92 Plane3 GetPlane() const 92 93 { … … 104 105 bool mOrientation; 105 106 106 friend ostream &operator<<(ostream &s, const AxisAlignedPlane &p)107 friend std::ostream &operator<<(std::ostream &s, const AxisAlignedPlane &p) 107 108 { 108 109 s << "a: " << p.mAxis << " p: " << p.mPosition; -
GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
r1419 r2176 1 1 #include <iostream> 2 using namespace std;3 2 #include <ply.h> 4 3 #include <stdio.h> … … 8 7 #include "SceneGraph.h" 9 8 #include "Mesh.h" 9 10 using namespace std; 10 11 11 12 namespace GtpVisibilityPreprocessor { … … 54 55 55 56 bool 56 PlyParser::ParseSingleFile(const st ring filename,57 PlyParser::ParseSingleFile(const std::string filename, 57 58 SceneGraphNode *root) 58 59 { -
GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h
r1379 r2176 14 14 PlyParser():Parser() {} 15 15 16 bool ParseFile(const st ring filename,16 bool ParseFile(const std::string filename, 17 17 SceneGraphNode *root, 18 18 const bool loadMeshes = true, 19 vector<FaceParentInfo> *parents = NULL);19 std::vector<FaceParentInfo> *parents = NULL); 20 20 21 bool ParseFile(const st ring filename, ViewCellsManager &viewCells) { return false; }21 bool ParseFile(const std::string filename, ViewCellsManager &viewCells) { return false; } 22 22 23 23 bool 24 ParseSingleFile(const st ring filename,24 ParseSingleFile(const std::string filename, 25 25 SceneGraphNode *root); 26 26 -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.h
r2116 r2176 170 170 171 171 // Overload << operator for C++-style output 172 inline ostream&173 operator<< ( ostream &s, const Polygon3 &A)172 inline std::ostream& 173 operator<< (std::ostream &s, const Polygon3 &A) 174 174 { 175 175 VertexContainer::const_iterator it; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2115 r2176 3 3 4 4 #include <string> 5 using namespace std; 5 // 6 6 #include "Containers.h" 7 7 #include "Mesh.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2168 r2176 221 221 OptimizeForProcessor="3" 222 222 OptimizeForWindowsApplication="TRUE" 223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)";Timer;..\src\ ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src;..\src\ootl\src\include\ootl;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\cpp\include\;..\src\ootl\src\cpp\include\ootl\mswin"223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)";Timer;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\cpp\include\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src\cpp\include\ootl\mswin" 224 224 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PVS" 225 225 ExceptionHandling="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorFactory.h
r1486 r2176 3 3 4 4 #include <string> 5 using namespace std; 5 // 6 6 7 7 namespace GtpVisibilityPreprocessor { … … 18 18 does not exist. 19 19 */ 20 static Preprocessor *CreatePreprocessor(const st ring &preprocessorName);20 static Preprocessor *CreatePreprocessor(const std::string &preprocessorName); 21 21 22 22 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.h
r1926 r2176 3 3 4 4 #include <vector> 5 using namespace std; 5 // 6 6 namespace GtpVisibilityPreprocessor 7 7 { … … 15 15 { 16 16 public: 17 static vector<PreprocessorThread *> sThreads;17 static std::vector<PreprocessorThread *> sThreads; 18 18 19 19 PreprocessorThread(Preprocessor *p); -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r2117 r2176 8 8 9 9 10 using namespace std; 10 // 11 11 12 12 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/PvsBase.h
r2168 r2176 5 5 #include "Containers.h" 6 6 7 // using namespace std;7 // 8 8 9 9 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h
r2122 r2176 10 10 #ifdef USE_HASH_PVS 11 11 12 //#include "HashPvs2.h" 12 13 #include "HashPvs.h" 13 14 -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.cpp
r1883 r2176 2 2 #include "Plane3.h" 3 3 #include "VssRay.h" 4 5 using namespace std; 4 6 5 7 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h
r2105 r2176 72 72 Intersection sourceObject; 73 73 74 vector<Intersection> intersections;75 // vector<BspIntersection> bspIntersections;76 vector<KdLeaf *> kdLeaves;77 vector<Intersectable *> testedObjects;74 std::vector<Intersection> intersections; 75 // std::vector<BspIntersection> bspIntersections; 76 std::vector<KdLeaf *> kdLeaves; 77 std::vector<Intersectable *> testedObjects; 78 78 79 79 // various flags … … 244 244 245 245 private: 246 Vector3 loc, dir; // Describes ray origin and vector246 Vector3 loc, dir; // Describes ray origin and std::vector 247 247 248 248 // The inverted direction of the ray components. It is computed optionally … … 284 284 friend int MakeIntersectLine(const Plane3 &p, const Plane3 &q, Ray &ray); 285 285 286 friend ostream &operator<<(ostream &s, const Ray &r) {286 friend std::ostream &operator<<(std::ostream &s, const Ray &r) { 287 287 return s<<"Ray:loc="<<r.loc<<" dir="<<r.dir; 288 288 } … … 311 311 int GetEntryIndex(const Vector3 &direction) const; 312 312 313 friend ostream &operator<<(ostream &s, const PassingRaySet &set);313 friend std::ostream &operator<<(std::ostream &s, const PassingRaySet &set); 314 314 315 315 }; -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2164 r2176 7 7 #include "VssRay.h" 8 8 9 using namespace std; 9 // 10 10 11 11 -
GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.cpp
r1149 r2176 3 3 #include "VssRay.h" 4 4 #include "Plane3.h" 5 6 using namespace std; 5 7 6 8 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/RayInfo.h
r1692 r2176 3 3 4 4 #include <vector> 5 using namespace std; 5 6 6 7 7 namespace GtpVisibilityPreprocessor { … … 13 13 14 14 15 typedef vector<RayInfo> RayInfoContainer;15 typedef std::vector<RayInfo> RayInfoContainer; 16 16 17 17 -
GTP/trunk/Lib/Vis/Preprocessing/src/Rectangle3.h
r1772 r2176 3 3 4 4 #include <iostream> 5 using namespace std; 5 // 6 6 #include "Vector3.h" 7 7 … … 60 60 ) const; 61 61 62 friend ostream& operator<< (ostream &s, const Rectangle3 &r) {62 friend std::ostream& operator<< (std::ostream &s, const Rectangle3 &r) { 63 63 return s<<"Rectangle3:"<<r.mVertices[0]<<r.mVertices[1]<<r.mVertices[2]<<r.mVertices[3]; 64 64 } -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSampler.h
r871 r2176 3 3 4 4 #include <fstream> 5 using namespace std; 5 // 6 6 7 7 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.cpp
r1020 r2176 6 6 #include "ViewCellsManager.h" 7 7 8 9 using namespace std; 8 10 9 11 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/RenderSimulator.h
r860 r2176 44 44 } 45 45 46 void Print( ostream &app) const;46 void Print(std::ostream &app) const; 47 47 48 friend ostream &operator<<(ostream &s, const SimulationStatistics &stat)48 friend std::ostream &operator<<(std::ostream &s, const SimulationStatistics &stat) 49 49 { 50 50 stat.Print(s); -
GTP/trunk/Lib/Vis/Preprocessing/src/ResourceManager.h
r1197 r2176 91 91 } 92 92 93 bool ExportEntries(const st ring &filename)93 bool ExportEntries(const std::string &filename) 94 94 { 95 95 ofstream stream(filename.c_str(), ios::binary); -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
r2002 r2176 3 3 4 4 #include <fstream> 5 using namespace std; 5 // 6 6 7 7 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.h
r1900 r2176 116 116 117 117 void 118 Print( ostream &app) const;119 120 friend ostream &operator<<(ostream &s, const RssStatistics &stat) {118 Print(std::ostream &app) const; 119 120 friend std::ostream &operator<<(std::ostream &s, const RssStatistics &stat) { 121 121 stat.Print(s); 122 122 return s; … … 330 330 bool IsLeaf() const { return axis == -1; } 331 331 332 virtual void Print( ostream &s) const = 0;332 virtual void Print(std::ostream &s) const = 0; 333 333 334 334 virtual int GetAccessTime() { … … 399 399 } 400 400 401 virtual void Print( ostream &s) const {401 virtual void Print(std::ostream &s) const { 402 402 if (axis == 0) 403 403 s<<"x "; … … 454 454 virtual int Type() const { return ELeaf; } 455 455 456 virtual void Print( ostream &s) const {456 virtual void Print(std::ostream &s) const { 457 457 s<< 458 458 "L: rays="<<(int)rays.size()<< 459 " pvs="<<mPvsSize<<" importance="<<mImportance<< endl;459 " pvs="<<mPvsSize<<" importance="<<mImportance<<std::endl; 460 460 }; 461 461 … … 515 515 // comparator for the 516 516 struct less_contribution : public 517 binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> {517 std::binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> { 518 518 519 519 bool operator()(const RssTreeLeaf * a, const RssTreeLeaf *b) { … … 523 523 524 524 struct greater_contribution : public 525 binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> {525 std::binary_function<const RssTreeLeaf *, const RssTreeLeaf *, bool> { 526 526 527 527 bool operator()(const RssTreeLeaf * a, const RssTreeLeaf *b) { … … 570 570 // comparator for the 571 571 struct less_priority : public 572 binary_function<const TraversalData, const TraversalData, bool> {572 std::binary_function<const TraversalData, const TraversalData, bool> { 573 573 574 574 bool operator()(const TraversalData a, const TraversalData b) { … … 956 956 TraverseInternalNode( 957 957 RayTraversalData &data, 958 st ack<RayTraversalData> &tstack);958 std::stack<RayTraversalData> &tstack); 959 959 960 960 void … … 1094 1094 1095 1095 void 1096 PushRoots( priority_queue<TraversalData> &stack) const;1097 1098 void 1099 PushRoots(st ack<RssTreeNode *> &st) const;1100 1101 void 1102 PushRoots(st ack<RayTraversalData> &st, RssTreeNode::RayInfo &info) const;1096 PushRoots(std::priority_queue<TraversalData> &stack) const; 1097 1098 void 1099 PushRoots(std::stack<RssTreeNode *> &st) const; 1100 1101 void 1102 PushRoots(std::stack<RayTraversalData> &st, RssTreeNode::RayInfo &info) const; 1103 1103 1104 1104 void -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.h
r2168 r2176 3 3 4 4 #include <fstream> 5 // using namespace std;5 // 6 6 7 7 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r2168 r2176 3 3 4 4 #include <vector> 5 // using namespace std;5 // 6 6 7 7 #include "common.h" … … 280 280 281 281 // container for the distributions 282 282 std::vector<SamplingStrategy *> mDistributions; 283 283 284 284 MixtureDistribution(Preprocessor &preprocessor): -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp
r1958 r2176 6 6 #include "Intersectable.h" 7 7 8 9 using namespace std; 8 10 9 11 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.h
r2168 r2176 3 3 4 4 #include <string> 5 // using namespace std;5 // 6 6 7 7 #include "Containers.h" … … 31 31 ~SceneGraph(); 32 32 33 bool Export(const st ring filename);33 bool Export(const std::string filename); 34 34 35 35 int CollectObjects(ObjectContainer *instances); … … 43 43 /** Exports binary version of the scene. 44 44 */ 45 void ExportScene(const st ring filename);45 void ExportScene(const std::string filename); 46 46 47 47 /** Loads binary version of the scene. 48 48 */ 49 void LoadScene(const st ring filename);49 void LoadScene(const std::string filename); 50 50 51 51 SceneGraphNode *GetRoot(); -
GTP/trunk/Lib/Vis/Preprocessing/src/SimpleRay.h
r2116 r2176 74 74 } 75 75 76 friend ostream &operator<<(ostream &s, const SimpleRay &r)76 friend std::ostream &operator<<(std::ostream &s, const SimpleRay &r) 77 77 { 78 78 return s << "origin=" << r.mOrigin << " dir=" << r.mDirection; -
GTP/trunk/Lib/Vis/Preprocessing/src/SubdivisionCandidate.h
r2168 r2176 5 5 #include "FlexibleHeap.h" 6 6 7 // using namespace std;7 // 8 8 9 9 namespace GtpVisibilityPreprocessor { … … 11 11 class SubdivisionCandidate; 12 12 13 typedef vector<SubdivisionCandidate *> SubdivisionCandidateContainer;13 typedef std::vector<SubdivisionCandidate *> SubdivisionCandidateContainer; 14 14 typedef FlexibleHeap<SubdivisionCandidate *> SplitQueue; 15 15 -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2162 r2176 198 198 OptimizeForProcessor="3" 199 199 OptimizeForWindowsApplication="TRUE" 200 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface;..\src\sparsehash\src\; $(NOINHERIT)"200 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface;..\src\sparsehash\src\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;$(NOINHERIT)" 201 201 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PVS" 202 202 ExceptionHandling="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp
r2149 r2176 9 9 #include "Exporter.h" 10 10 11 12 using namespace std; 11 13 12 14 // $$JB HACK -
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h
r2168 r2176 3 3 4 4 #include <functional> 5 // using namespace std;5 // 6 6 7 7 #include "Containers.h" … … 87 87 } 88 88 89 void Print( ostream &app) const;90 91 friend ostream &operator<<(ostream &s, const TraversalTreeStatistics &stat)89 void Print(std::ostream &app) const; 90 91 friend std::ostream &operator<<(std::ostream &s, const TraversalTreeStatistics &stat) 92 92 { 93 93 stat.Print(s); … … 266 266 // comparator for the 267 267 struct less_priority: public 268 binary_function<const TraversalData, const TraversalData, bool>268 std::binary_function<const TraversalData, const TraversalData, bool> 269 269 { 270 270 bool operator()(const TraversalData a, const TraversalData b) -
GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.cpp
r1933 r2176 5 5 #include "Polygon3.h" 6 6 7 8 using namespace std; 7 9 8 10 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.h
r1933 r2176 32 32 int CastRay(const Ray &ray, float &t, const float nearestT, Vector3 &normal) const; 33 33 34 friend ostream& operator<< (ostream &s, const Triangle3 &A);35 friend istream& operator>> (istream &s, Triangle3 &A);34 friend std::ostream& operator<< (std::ostream &s, const Triangle3 &A); 35 friend std::istream& operator>> (std::istream &s, Triangle3 &A); 36 36 37 37 /** Checks if this triangle is ill-defined. … … 56 56 57 57 // Overload << operator for C++-style output 58 inline ostream&59 operator<< ( ostream &s, const Triangle3 &A)58 inline std::ostream& 59 operator<< (std::ostream &s, const Triangle3 &A) 60 60 { 61 61 return s << "(" << A.mVertices[0] << ", " << A.mVertices[1] << ", " << A.mVertices[2] << ")"; … … 63 63 64 64 // Overload >> operator for C++-style input 65 inline istream&66 operator>> ( istream &s, Triangle3 &A)65 inline std::istream& 66 operator>> (std::istream &s, Triangle3 &A) 67 67 { 68 68 char a; -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
r1627 r2176 3 3 #include <list> 4 4 #include <map> 5 using namespace std;6 5 7 6 #include "Vector3.h" … … 17 16 #include "Polygon3.h" 18 17 18 using namespace std; 19 19 20 20 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/Vector3.h
r2168 r2176 3 3 4 4 #include <iostream> 5 // using namespace std;5 // 6 6 #include <math.h> 7 7 #include "common.h" 8 8 9 //using std::ostream; 10 //using std::istream; 9 11 10 12 namespace GtpVisibilityPreprocessor { … … 14 16 class Vector2; 15 17 16 17 // HACK of returning vector components as array fields. 18 // HACK of returning std::vector components as array fields. 18 19 // NOT guarrantied to work with some strange variable allignment ! 19 20 #define __VECTOR_HACK … … 39 40 Vector3(const Vector3 &v) { x = v.x; y = v.y; z = v.z; } 40 41 41 // Functions to get at the vector components42 // Functions to get at the std::vector components 42 43 float& operator[] (int inx) { 43 44 #ifndef __VECTOR_HACK … … 80 81 void SetValue(const float a) { x = y = z = a; } 81 82 82 // returns the axis, where the vector has the largest value83 // returns the axis, where the std::vector has the largest value 83 84 int DrivingAxis(void) const; 84 85 85 // returns the axis, where the vector has the smallest value86 // returns the axis, where the std::vector has the smallest value 86 87 int TinyAxis(void) const; 87 88 … … 95 96 } 96 97 97 // normalizes the vector of unit size corresponding to givenvector98 // normalizes the std::vector of unit size corresponding to given std::vector 98 99 inline void Normalize(); 99 100 100 /** Returns false if this vector has a nan component.101 /** Returns false if this std::vector has a nan component. 101 102 */ 102 103 bool CheckValidity() const; … … 109 110 In fact it tries v x (0,0,1) an if the result is too small, 110 111 it definitely does v x (0,1,0). It will always work for 111 non-degenareted vector and is much faster than to use112 non-degenareted std::vector and is much faster than to use 112 113 TangentVectors. 113 114 114 @param v(in) The vector we want to find normal for.115 @return The normal vector to v.115 @param v(in) The std::vector we want to find normal for. 116 @return The normal std::vector to v. 116 117 */ 117 118 friend inline Vector3 ArbitraryNormal(const Vector3 &v); … … 140 141 void RightHandedBase(Vector3& U, Vector3& V) const; 141 142 142 /// Transforms a vector to the global coordinate frame.143 /// Transforms a std::vector to the global coordinate frame. 143 144 /** 144 145 Given a local coordinate frame (U,V,N) (i.e. U,V,N are 145 146 the x,y,z axes of the local coordinate system) and 146 a vector 'loc' in the local coordiante system, this147 function returns a the coordinates of the same vector147 a std::vector 'loc' in the local coordiante system, this 148 function returns a the coordinates of the same std::vector 148 149 in global frame (i.e. frame (1,0,0), (0,1,0), (0,0,1). 149 150 */ … … 153 154 const Vector3& N); 154 155 155 /// Transforms a vector to a local coordinate frame.156 /// Transforms a std::vector to a local coordinate frame. 156 157 /** 157 158 Given a local coordinate frame (U,V,N) (i.e. U,V,N are 158 159 the x,y,z axes of the local coordinate system) and 159 a vector 'loc' in the global coordiante system, this160 function returns a the coordinates of the same vector160 a std::vector 'loc' in the global coordiante system, this 161 function returns a the coordinates of the same std::vector 161 162 in the local frame. 162 163 */ … … 166 167 const Vector3& N); 167 168 168 /// the magnitude=size of the vector169 /// the magnitude=size of the std::vector 169 170 friend inline float Magnitude(const Vector3 &v); 170 /// the squared magnitude of the vector .. for efficiency in some cases171 /// the squared magnitude of the std::vector .. for efficiency in some cases 171 172 friend inline float SqrMagnitude(const Vector3 &v); 172 173 /// Magnitude(v1-v2) … … 175 176 friend inline float SqrDistance(const Vector3 &v1, const Vector3 &v2); 176 177 177 // creates the vector of unit size corresponding to givenvector178 // creates the std::vector of unit size corresponding to given std::vector 178 179 friend inline Vector3 Normalize(const Vector3 &A); 179 180 180 // Rotate a normal vector.181 // Rotate a normal std::vector. 181 182 friend Vector3 PlaneRotate(const Matrix4x4 &, const Vector3 &); 182 183 183 184 // construct view vectors .. DirAt is the main viewing direction 184 // Viewer is the coordinates of viewer location, UpL is the vector.185 // Viewer is the coordinates of viewer location, UpL is the std::vector. 185 186 friend void ViewVectors(const Vector3 &DirAt, const Vector3 &Viewer, 186 187 const Vector3 &UpL, Vector3 &ViewV, … … 224 225 friend inline Vector3 CrossProd (const Vector3 &A, const Vector3 &B); 225 226 226 friend ostream& operator<< (ostream &s, const Vector3 &A);227 friend istream& operator>> (istream &s, Vector3 &A);227 friend std::ostream& operator<< (std::ostream &s, const Vector3 &A); 228 friend std::istream& operator>> (std::istream &s, Vector3 &A); 228 229 229 230 friend void Minimize(Vector3 &min, const Vector3 &candidate); … … 477 478 478 479 // Overload << operator for C++-style output 479 inline ostream&480 operator<< ( ostream &s, const Vector3 &A)480 inline std::ostream& 481 operator<< (std::ostream &s, const Vector3 &A) 481 482 { 482 483 return s << "(" << A.x << ", " << A.y << ", " << A.z << ")"; … … 484 485 485 486 // Overload >> operator for C++-style input 486 inline istream&487 operator>> ( istream &s, Vector3 &A)487 inline std::istream& 488 operator>> (std::istream &s, Vector3 &A) 488 489 { 489 490 char a; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r2124 r2176 74 74 } 75 75 76 void Print( ostream &app) const;77 78 friend ostream &operator<<(ostream &s, const ViewCellsStatistics &stat)76 void Print(std::ostream &app) const; 77 78 friend std::ostream &operator<<(std::ostream &s, const ViewCellsStatistics &stat) 79 79 { 80 80 stat.Print(s); … … 132 132 133 133 134 void Print( ostream &app) const;135 136 friend ostream &operator<<(ostream &s, const ViewCellsTreeStats &stat)134 void Print(std::ostream &app) const; 135 136 friend std::ostream &operator<<(std::ostream &s, const ViewCellsTreeStats &stat) 137 137 { 138 138 stat.Print(s); … … 540 540 /** Export statistics of this view cell tree. 541 541 */ 542 void ExportStats(const st ring &mergeStats);542 void ExportStats(const std::string &mergeStats); 543 543 544 544 /** Sets root of hierarchy. … … 685 685 /** Update stats for the log. 686 686 */ 687 void UpdateStats( ofstream &stats,687 void UpdateStats(std::ofstream &stats, 688 688 const ViewCellsTreeStats &vcStats); 689 689 … … 723 723 float mMergeMaxCostRatio; 724 724 725 typedef priority_queue<MergeCandidate> MergeQueue;725 typedef std::priority_queue<MergeCandidate> MergeQueue; 726 726 727 727 MergeQueue mMergeQueue; … … 846 846 } 847 847 848 void Print( ostream &app) const;849 850 friend ostream &operator<<(ostream &s, const MergeStatistics &stat)848 void Print(std::ostream &app) const; 849 850 friend std::ostream &operator<<(std::ostream &s, const MergeStatistics &stat) 851 851 { 852 852 stat.Print(s); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
r1923 r2176 93 93 bool Valid() const; 94 94 95 friend ostream &operator<<(ostream &s, const BspNodeGeometry &a)95 friend std::ostream &operator<<(std::ostream &s, const BspNodeGeometry &a) 96 96 { 97 97 PolygonContainer::const_iterator it, it_end = a.mPolys.end(); 98 98 99 99 for (it = a.mPolys.begin(); it != it_end; ++ it) 100 s << *(*it) << endl;101 return s << endl;100 s << *(*it) << std::endl; 101 return s << std::endl; 102 102 } 103 103 … … 259 259 } 260 260 261 void Print( ostream &app) const;262 263 friend ostream &operator<<(ostream &s, const BspTreeStatistics &stat)261 void Print(std::ostream &app) const; 262 263 friend std::ostream &operator<<(std::ostream &s, const BspTreeStatistics &stat) 264 264 { 265 265 stat.Print(s); … … 394 394 void SetupChildLinks(BspNode *b, BspNode *f); 395 395 396 friend ostream &operator<<(ostream &s, const BspInterior &A)396 friend std::ostream &operator<<(std::ostream &s, const BspInterior &A) 397 397 { 398 398 return s << A.mPlane; … … 1084 1084 1085 1085 //int mSplits; 1086 ofstream mSubdivisionStats;1086 std::ofstream mSubdivisionStats; 1087 1087 1088 1088 ViewCellsTree *mViewCellsTree; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2170 r2176 24 24 #include "SamplingStrategy.h" 25 25 #include "SceneGraph.h" 26 27 26 #include "PerfTimer.h" 28 27 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r2168 r2176 7 7 #include "Containers.h" 8 8 #include "ViewCell.h" 9 //#include "ootl_map.hpp" 9 10 10 11 11 namespace GtpVisibilityPreprocessor { … … 183 183 /** Prints out statistics of the view cells. 184 184 */ 185 virtual void PrintStatistics( ostream &s) const;185 virtual void PrintStatistics(std::ostream &s) const; 186 186 187 187 /** Post processes view cells givemŽa number of rays. … … 297 297 ViewCell *GetViewCell(const int idx) const {return mViewCells[idx];} 298 298 299 virtual void PrintPvsStatistics( ostream &s);299 virtual void PrintPvsStatistics(std::ostream &s); 300 300 301 301 /** Updates pvs of the view cell hierarchy if necessary. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2123 r2176 5 5 #include <stdlib.h> 6 6 #include <iostream> 7 //#include <ext/algorithm>8 9 using namespace std;10 7 #include <xercesc/util/PlatformUtils.hpp> 11 8 … … 38 35 #include "HierarchyManager.h" 39 36 37 38 using namespace std; 40 39 41 40 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.h
r2123 r2176 18 18 ViewCellsParser(): Parser() {} 19 19 20 bool ParseViewCellsFile(const st ring &filename,20 bool ParseViewCellsFile(const std::string &filename, 21 21 ViewCellsManager **viewCells, 22 22 ObjectContainer &pvsObjects, -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r2123 r2176 8 8 #include "Mesh.h" 9 9 #include "BoundingBoxConverter.h" 10 #include <hash_map> 11 10 12 #include "PerfTimer.h" 11 #include <hash_map>12 13 13 14 namespace GtpVisibilityPreprocessor { … … 183 184 void EndBoundingBoxes(); 184 185 185 void StartBspElement(st ring element, AttributeList& attributes);186 void StartVspElement(st ring element, AttributeList& attributes);186 void StartBspElement(std::string element, AttributeList& attributes); 187 void StartVspElement(std::string element, AttributeList& attributes); 187 188 188 189 void StartViewSpaceHierarchy(AttributeList& attributes); … … 197 198 void StartViewCellHierarchyElement(const std::string &element, AttributeList& attributes); 198 199 199 void StartOspElement(st ring element, AttributeList& attributes);200 void StartOspElement(std::string element, AttributeList& attributes); 200 201 201 202 void StartOspLeaf(AttributeList& attributes); … … 206 207 void StartBvhLeaf(AttributeList& attributes); 207 208 void StartBvhInterior(AttributeList& attributes); 208 void StartBvhElement(st ring element, AttributeList& attributes);209 void StartBvhElement(std::string element, AttributeList& attributes); 209 210 210 211 void EndViewSpaceHierarchyInterior(); -
GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp
r2017 r2176 17 17 #include "Triangle3.h" 18 18 19 20 using namespace std; 19 21 20 22 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h
r1667 r2176 863 863 864 864 /// subdivision stats output file 865 ofstream mSubdivisionStats;865 std::ofstream mSubdivisionStats; 866 866 float mTotalCost; 867 867 int mTotalPvsSize; -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2170 r2176 22 22 #include "OspTree.h" 23 23 24 #if USE_SSE 25 #include <xmmintrin.h> 26 #endif 24 27 25 28 … … 3500 3503 } 3501 3504 3502 3503 } 3505 #if 0 3506 void VspTree::TraverseRayPacket(RayBundle &rays); 3507 { 3508 float splitPos [3]; 3509 float dist[3]; 3510 3511 const int allValid = 1xf; 3512 int mask = all_valid; 3513 3514 int comparisonResult = 0; 3515 3516 while (!node->IsLeaf()) 3517 { 3518 comparisonResult = 0; 3519 3520 for (int i = 0; i < 4; ++ i) 3521 { 3522 splitPos[i] = node->splitPos; 3523 dist[i] = (splitpos[i] rp.origin[i][axis]) / (rp.dir[i][axis]); 3524 3525 comparisonresult |= ((dist[i] <= tnear[i]) << i); 3526 } 3527 3528 comparisonresult &= mask; 3529 3530 if (comparisonresult == allValid) 3531 { 3532 node = node->far; 3533 continue 3534 } 3535 3536 comparisonresult = 0; 3537 3538 for (int i = 0; i < 4; ++ i){ 3539 3540 comparisonresult |= (dist[i] >= tfar[i]); 3541 } 3542 3543 comparisonresult &= mask; 3544 3545 if (comparisonresult == allValid) 3546 { 3547 node = node->near; 3548 continue; 3549 } 3550 3551 if (comparisonresult) 3552 { 3553 3554 Push( node->far, dist[0...3], tfar[0...3] ) 3555 3556 node = node->near; 3557 3558 mask = 0; 3559 3560 for (int i = 0; i < 4; ++ i) 3561 { 3562 bool b = (tnear[i] < tfar[i]); 3563 mask |= b; 3564 3565 if (b) 3566 { 3567 tfar[i] = dist[i]; 3568 } 3569 3570 } 3571 3572 } 3573 } 3574 #endif 3575 /* 3576 struct RayPacket 3577 { 3578 union { float ox[4]; __m128 ox4; }; 3579 union { float oy[4]; __m128 oy4; }; 3580 union { float oz[4]; __m128 oz4; }; 3581 union { float dx[4]; __m128 dx4; }; 3582 union { float dy[4]; __m128 dy4; }; 3583 union { float dz[4]; __m128 dz4; }; 3584 }; 3585 */ 3586 void VspTree::TraverseRayPacket()//RayBundle &rays) 3587 { 3588 #if USE_SSE 3589 VspNode *node; 3590 3591 RayPacket rp; 3592 3593 __m128 mask; 3594 __m128 tf4; 3595 __m128 tn4; 3596 //const int offs[4] = { (RP->dcell[0] >= 0)?1:0, (RP->dcell[4] >= 0)?1:0, (RP->dcell[8] >= 0)?1:0, 0 }; 3597 3598 const int offs[4] = { 0, 0, 0, 0 }; 3599 3600 while (!node->IsLeaf()) 3601 { 3602 VspInterior *interior = static_cast<VspInterior *>(node); 3603 3604 float pos = interior->GetPosition(); 3605 const __m128 spos = _mm_load_ps(&pos); 3606 3607 const int aidx = interior->GetAxis(); 3608 const __m128 d4;// = _mm_mul_ps( _mm_sub_ps( spos, RP->oc4[aidx] ), RP->rdc4[aidx] ); 3609 3610 VspNode* ln = interior->GetBack();// + offs[aidx]; 3611 3612 if (!_mm_movemask_ps( _mm_and_ps( _mm_cmpgt_ps( d4, tn4 ), mask ) )) 3613 { 3614 node = ln; 3615 continue; 3616 } 3617 3618 node = interior->GetBack();// + (offs[aidx]^1); 3619 3620 if (_mm_movemask_ps( _mm_and_ps( _mm_cmplt_ps( d4, tf4 ), mask ) )) 3621 { 3622 const __m128 mask2 = _mm_cmpgt_ps( d4, tn4 ); 3623 const __m128 mask3 = _mm_cmplt_ps( d4, tf4 ); 3624 3625 //m_Stack[stackptr].tf4 = tf4; 3626 3627 tf4 = _mm_or_ps( _mm_and_ps( mask3, d4 ), _mm_andnot_ps( mask3, tf4 ) ); 3628 3629 //m_Stack[stackptr].node = (KdTreeNode*)ln; 3630 //m_Stack[stackptr].mask = mask; 3631 //m_Stack[stackptr++].tn4 = _mm_or_ps( _mm_and_ps( mask2, d4 ), _mm_andnot_ps( mask2, tn4 ) ); 3632 mask = _mm_cmplt_ps( tn4, tf4 ); 3633 } 3634 } 3635 #endif 3636 3637 } 3638 3639 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r2170 r2176 132 132 } 133 133 134 void Print( ostream &app) const;135 136 friend ostream &operator<<(ostream &s, const VspTreeStatistics &stat)134 void Print(std::ostream &app) const; 135 136 friend std::ostream &operator<<(std::ostream &s, const VspTreeStatistics &stat) 137 137 { 138 138 stat.Print(s); … … 278 278 void SetupChildLinks(VspNode *front, VspNode *back); 279 279 280 friend ostream &operator<<(ostream &s, const VspInterior &A)280 friend std::ostream &operator<<(std::ostream &s, const VspInterior &A) 281 281 { 282 282 return s << A.mPlane.mAxis << " " << A.mPlane.mPosition; … … 1077 1077 int CompressObjects(VspLeaf *leaf); 1078 1078 1079 void TraverseRayPacket(); 1080 1079 1081 protected: 1080 1082 … … 1159 1161 1160 1162 /// subdivision stats output file 1161 ofstreammSubdivisionStats;1163 std::ofstream mSubdivisionStats; 1162 1164 /// keeps track of cost during subdivision 1163 1165 float mTotalCost; -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h
r2168 r2176 3 3 4 4 #include <fstream> 5 // using namespace std;5 // 6 6 7 7 #include "Preprocessor.h" -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.cpp
r2173 r2176 315 315 316 316 void 317 VssRayContainer::PrintStatistics( ostream &s)317 VssRayContainer::PrintStatistics(std::ostream &s) 318 318 { 319 319 … … 329 329 330 330 s<<"##### VSS RAY STAT ##########\n"; 331 s<<"#RAYS\n"<<(int)size()<< endl;332 s<<"#AVG_RAY_PVS_CONTRIBUTION\n"<<sumContributions/(float)size()<< endl;331 s<<"#RAYS\n"<<(int)size()<<std::endl; 332 s<<"#AVG_RAY_PVS_CONTRIBUTION\n"<<sumContributions/(float)size()<<std::endl; 333 333 s<<"#AVG_RAY_RELATIVE_PVS_CONTRIBUTION\n"<<sumRelContributions/ 334 (float)size()<< endl;334 (float)size()<<std::endl; 335 335 336 336 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VssRay.h
r2168 r2176 7 7 #include "Containers.h" 8 8 9 // using namespace std;9 // 10 10 11 11 … … 208 208 mRefCount++; 209 209 else { 210 cerr<<"Trying to unref already deleted ray!"<<endl;210 std::cerr<<"Trying to unref already deleted ray!"<<std::endl; 211 211 exit(1); 212 212 } … … 249 249 KdNode **node) const; 250 250 251 friend ostream& operator<< (ostream &s, const VssRay &vssRay);251 friend std::ostream& operator<< (std::ostream &s, const VssRay &vssRay); 252 252 253 253 }; … … 286 286 287 287 // Overload << operator for C++-style output 288 inline ostream&289 operator<< ( ostream &s, const VssRay &vssRay)288 inline std::ostream& 289 operator<< (std::ostream &s, const VssRay &vssRay) 290 290 { 291 291 return s … … 320 320 struct VssRayContainer : public vector<VssRay *> 321 321 { 322 void PrintStatistics( ostream &s);322 void PrintStatistics(std::ostream &s); 323 323 int SelectRays(const int number, VssRayContainer &selected, const bool copy=false) const; 324 324 int -
GTP/trunk/Lib/Vis/Preprocessing/src/VssTree.h
r2105 r2176 99 99 100 100 void 101 Print( ostream &app) const;102 103 friend ostream &operator<<(ostream &s, const VssStatistics &stat) {101 Print(std::ostream &app) const; 102 103 friend std::ostream &operator<<(std::ostream &s, const VssStatistics &stat) { 104 104 stat.Print(s); 105 105 return s; … … 303 303 bool IsLeaf() const { return axis == -1; } 304 304 305 virtual void Print( ostream &s) const = 0;305 virtual void Print(std::ostream &s) const = 0; 306 306 307 307 virtual int GetAccessTime() { … … 369 369 } 370 370 371 virtual void Print( ostream &s) const {371 virtual void Print(std::ostream &s) const { 372 372 if (axis == 0) 373 373 s<<"x "; … … 422 422 virtual int Type() const { return ELeaf; } 423 423 424 virtual void Print( ostream &s) const {425 s<< endl<<"L: r="<<(int)rays.size()<<endl;424 virtual void Print(std::ostream &s) const { 425 s<<std::endl<<"L: r="<<(int)rays.size()<<std::endl; 426 426 }; 427 427 … … 478 478 // comparator for the 479 479 struct less_contribution : public 480 binary_function<const VssTreeLeaf *, const VssTreeLeaf *, bool> {480 std::binary_function<const VssTreeLeaf *, const VssTreeLeaf *, bool> { 481 481 482 482 bool operator()(const VssTreeLeaf * a, const VssTreeLeaf *b) { … … 486 486 487 487 struct greater_contribution : public 488 binary_function<const VssTreeLeaf *, const VssTreeLeaf *, bool> {488 std::binary_function<const VssTreeLeaf *, const VssTreeLeaf *, bool> { 489 489 490 490 bool operator()(const VssTreeLeaf * a, const VssTreeLeaf *b) { … … 532 532 // comparator for the 533 533 struct less_priority : public 534 binary_function<const TraversalData, const TraversalData, bool> {534 std::binary_function<const TraversalData, const TraversalData, bool> { 535 535 536 536 bool operator()(const TraversalData a, const TraversalData b) { … … 866 866 TraverseInternalNode( 867 867 RayTraversalData &data, 868 st ack<RayTraversalData> &tstack);868 std::stack<RayTraversalData> &tstack); 869 869 870 870 void -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp
r2124 r2176 15 15 #include "Beam.h" 16 16 17 18 using namespace std; 19 17 20 namespace GtpVisibilityPreprocessor { 18 21 … … 101 104 result = ExportRays(*ri, color); 102 105 if (!result) { 103 cerr<<"Error while exporting rays!\n";106 std::cerr<<"Error while exporting rays!\n"; 104 107 break; 105 108 } -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r2116 r2176 5 5 #include <stdlib.h> 6 6 #include <iostream> 7 using namespace std;8 7 #include <xercesc/util/PlatformUtils.hpp> 9 8 … … 33 32 #include <assert.h> 34 33 #include "Polygon3.h" 34 35 36 using namespace std; 35 37 36 38 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
r1379 r2176 16 16 17 17 bool ParseFile( 18 const st ring filename,18 const std::string filename, 19 19 SceneGraphNode *root, 20 20 const bool loadMeshes = false, 21 21 vector<FaceParentInfo> *parents = NULL); 22 22 23 bool ParseFile(const st ring filename, ViewCellsManager &viewCells);23 bool ParseFile(const std::string filename, ViewCellsManager &viewCells); 24 24 25 25 /// height of a loaded view cell -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParserXerces.h
r1379 r2176 36 36 }; 37 37 38 typedef map<string, int, ltstr> ResourceDefinitions;38 typedef std::map<std::string, int, ltstr> ResourceDefinitions; 39 39 40 40 // ----------------------------------------------------------------------- … … 90 90 bool mLoadMeshes; 91 91 92 typedef st ack<Matrix4x4> TrafoStack;92 typedef std::stack<Matrix4x4> TrafoStack; 93 93 94 94 bool mUsingMeshDefinition; -
GTP/trunk/Lib/Vis/Preprocessing/src/common.cpp
r2123 r2176 22 22 #include <sys/timeb.h> 23 23 #endif 24 25 26 using namespace std; 24 27 25 28 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/common.h
r2123 r2176 20 20 #include <fstream> 21 21 #include <limits.h> 22 23 using namespace std;24 22 25 23 … … 253 251 // This routine is located in main.cpp, for lack of a better place. 254 252 // ------------------------------------------------------------------- 255 void indent( ostream &app, int ind);253 void indent(std::ostream &app, int ind); 256 254 257 255 // --------------------------------------------------------- … … 335 333 336 334 // manipulator 337 inline ostream &DEBUGINFO(ostream &s ) {338 return s<<"FILE "<<__FILE__<<",LINE "<<__LINE__<< endl;335 inline std::ostream &DEBUGINFO( std::ostream &s ) { 336 return s<<"FILE "<<__FILE__<<",LINE "<<__LINE__<<std::endl; 339 337 } 340 338 … … 492 490 493 491 // debug stream 494 extern ofstream Debug;492 extern std::ofstream Debug; 495 493 496 494 -
GTP/trunk/Lib/Vis/Preprocessing/src/gzstream.h
r1264 r2176 35 35 #include <iostream> 36 36 #include <fstream> 37 using namespace std;38 37 39 38 #ifdef GZSTREAM_NAMESPACE … … 50 49 51 50 52 //#define STREAMBUF std::streambuf53 //#define ISTREAM std::istream54 //#define OSTREAM std::ostream51 #define STREAMBUF std::streambuf 52 #define ISTREAM std::istream 53 #define OSTREAM std::ostream 55 54 56 #define STREAMBUF streambuf57 #define ISTREAM istream58 #define OSTREAM ostream55 //#define STREAMBUF streambuf 56 //#define ISTREAM istream 57 //#define OSTREAM ostream 59 58 60 59 class gzstreambuf : public STREAMBUF { … … 88 87 }; 89 88 90 class gzstreambase : virtual public ios {89 class gzstreambase : virtual public std::ios { 91 90 92 91 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2161 r2176 5 5 #endif 6 6 7 #define NOMINMAX 7 8 #include <windows.h> 8 9 #include <stdio.h> … … 15 16 #include "Preprocessor.h" 16 17 #include "common.h" 17 18 18 #include "PreprocessorThread.h" 19 19 #include "ObjExporter.h" 20 20 #include "SceneGraph.h" 21 21 #include "GlobalLinesRenderer.h" 22 //#include "PvsDefinitions.h" 22 23 23 24 24 #include "ViewCellsManager.h" … … 218 218 } 219 219 220 Debug << "using pvs type " << PVS_TYPE << endl;220 //Debug << "using pvs type " << PVS_TYPE << endl; 221 221 222 222 /////////////
Note: See TracChangeset
for help on using the changeset viewer.