Changeset 1327


Ignore:
Timestamp:
09/07/06 18:19:15 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp

    r1315 r1327  
    55 
    66 
     7AxisAlignedBox3 FaceIntersectable::GetBox() const 
     8{        
     9        return mItem->GetBoundingBox(); 
     10} 
    711 
     12 
     13int FaceIntersectable::CastRay(Ray &ray) 
     14{       // TODO matt 
     15        return 0; 
     16} 
    817         
     18template<typename T> 
     19bool IntersectableWrapper<T>::IsConvex() const 
     20{ 
     21        return true; 
    922} 
     23 
     24template<typename T> 
     25bool IntersectableWrapper<T>::IsWatertight() const 
     26{ 
     27        return true; 
     28} 
     29 
     30template<typename T> 
     31float IntersectableWrapper<T>::IntersectionComplexity() 
     32{ 
     33        return 1.0f; 
     34} 
     35 
     36template<typename T> 
     37int IntersectableWrapper<T>::NumberOfFaces() const 
     38{ 
     39        return 0; 
     40} 
     41 
     42template<typename T> 
     43int IntersectableWrapper<T>::GetRandomSurfacePoint(Vector3 &point, 
     44                                                                                                Vector3 &normal) 
     45{ 
     46        return 0; 
     47} 
     48 
     49template<typename T> 
     50int IntersectableWrapper<T>::GetRandomVisibleSurfacePoint(Vector3 &point, 
     51                                                                                                           Vector3 &normal, 
     52                                                                                                           const Vector3 &viewpoint, 
     53                                                                                                           const int maxTries) 
     54{ 
     55        return 0; 
     56} 
     57   
     58template<typename T> 
     59ostream &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  
    5252  } 
    5353   
     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 
    5468  /// list of vertex pointers 
    5569  VertexIndexContainer mVertexIndices;   
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp

    r1315 r1327  
    109109 
    110110        mesh->mFaces = faces; 
    111  
    112111        // can't do cleanup because coupling with kdf file for intel ray tracer 
    113112        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         }*/ 
    126113 
    127114        return mesh; 
     
    153140                return false; 
    154141         
     142        map<int, Vector3> hashTable; // table associating indices with vectors 
     143         
    155144        VertexContainer vertices; // table for vertices 
    156         map<int, Vector3> hashTable; // table associating indices with vectors 
    157145        FaceContainer faces; 
    158146 
     147        SceneGraphNode *root = new SceneGraphNode; 
     148 
    159149        char str[100]; 
    160          
    161         SceneGraphNode *root = new SceneGraphNode; 
    162  
    163150        int meshGrouping; 
    164151        Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); 
     
    172159                case 'v': 
    173160                        { 
    174                                 float x,y,z; 
    175                                 //cout << "v"; 
    176  
     161                                float x,y,z; //cout << "v"; 
     162                                 
    177163                                // vertex  
    178164                                sscanf(str + 1, "%f %f %f", &x, &y, &z); 
     
    185171                                Face *face = LoadFace(str, vertices, hashTable); 
    186172                                if (!face) break; 
    187 #if 1 
     173#if 0 
    188174                                faces.push_back(face); 
    189175                                if (faces.size() >= nMaxFaces) 
     
    203189                                } 
    204190#else 
     191                                cout << "f"; 
    205192                                root->mGeometry.push_back(new FaceIntersectable(face)); 
    206193                                hashTable.clear(); 
Note: See TracChangeset for help on using the changeset viewer.