- Timestamp:
- 09/07/06 18:19:15 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
r1315 r1327 5 5 6 6 7 AxisAlignedBox3 FaceIntersectable::GetBox() const 8 { 9 return mItem->GetBoundingBox(); 10 } 7 11 12 13 int FaceIntersectable::CastRay(Ray &ray) 14 { // TODO matt 15 return 0; 16 } 8 17 18 template<typename T> 19 bool IntersectableWrapper<T>::IsConvex() const 20 { 21 return true; 9 22 } 23 24 template<typename T> 25 bool IntersectableWrapper<T>::IsWatertight() const 26 { 27 return true; 28 } 29 30 template<typename T> 31 float IntersectableWrapper<T>::IntersectionComplexity() 32 { 33 return 1.0f; 34 } 35 36 template<typename T> 37 int IntersectableWrapper<T>::NumberOfFaces() const 38 { 39 return 0; 40 } 41 42 template<typename T> 43 int IntersectableWrapper<T>::GetRandomSurfacePoint(Vector3 &point, 44 Vector3 &normal) 45 { 46 return 0; 47 } 48 49 template<typename T> 50 int IntersectableWrapper<T>::GetRandomVisibleSurfacePoint(Vector3 &point, 51 Vector3 &normal, 52 const Vector3 &viewpoint, 53 const int maxTries) 54 { 55 return 0; 56 } 57 58 template<typename T> 59 ostream &IntersectableWrapper<T>::Describe(ostream &s) 60 { 61 s << mItem; 62 return s; 63 } 64 65 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h
r1292 r1327 52 52 } 53 53 54 AxisAlignedBox3 GetBoundingBox() const 55 { 56 VertexIndexContainer::const_iterator vit, vit_end = (int)mVertexIndices.size(); 57 AxisAlignedBox3 box; 58 box.Initialize(); 59 60 for (vit = mVertexIndices.begin(); vit != vit_end; ++ vit) 61 { 62 box.Include(*vit); 63 } 64 65 return box; 66 } 67 54 68 /// list of vertex pointers 55 69 VertexIndexContainer mVertexIndices; -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r1315 r1327 109 109 110 110 mesh->mFaces = faces; 111 112 111 // can't do cleanup because coupling with kdf file for intel ray tracer 113 112 mesh->Preprocess(false); 114 115 /*for (int i = 0; i < faces.size(); ++ i)116 {117 Debug << "face: ";118 119 for (int j = 0; j < faces[i]->mVertexIndices.size(); ++ j)120 {121 Debug << "i " << faces[i]->mVertexIndices[j] << " " << endl;122 Debug << "v " << mesh->mVertices[faces[i]->mVertexIndices[j]] << " ";123 }124 Debug << endl;125 }*/126 113 127 114 return mesh; … … 153 140 return false; 154 141 142 map<int, Vector3> hashTable; // table associating indices with vectors 143 155 144 VertexContainer vertices; // table for vertices 156 map<int, Vector3> hashTable; // table associating indices with vectors157 145 FaceContainer faces; 158 146 147 SceneGraphNode *root = new SceneGraphNode; 148 159 149 char str[100]; 160 161 SceneGraphNode *root = new SceneGraphNode;162 163 150 int meshGrouping; 164 151 Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); … … 172 159 case 'v': 173 160 { 174 float x,y,z; 175 //cout << "v"; 176 161 float x,y,z; //cout << "v"; 162 177 163 // vertex 178 164 sscanf(str + 1, "%f %f %f", &x, &y, &z); … … 185 171 Face *face = LoadFace(str, vertices, hashTable); 186 172 if (!face) break; 187 #if 1173 #if 0 188 174 faces.push_back(face); 189 175 if (faces.size() >= nMaxFaces) … … 203 189 } 204 190 #else 191 cout << "f"; 205 192 root->mGeometry.push_back(new FaceIntersectable(face)); 206 193 hashTable.clear();
Note: See TracChangeset
for help on using the changeset viewer.