Ignore:
Timestamp:
09/12/06 17:39:08 (18 years ago)
Author:
mattausch
Message:

worked on triangle processing. logical units will be created by grouping objects
using their visibility definitions.

File:
1 edited

Legend:

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

    r1328 r1344  
    1010 
    1111Polygon3::Polygon3():  
    12 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
     12mMaterial(NULL),  
     13mParent(NULL),  
     14mPiercingRays(0) 
    1315, mPlane(NULL) 
    1416{ 
    15         // mostly there will be triangles 
    16         //mVertices.reserve(3); 
    1717} 
    1818 
    1919Polygon3::Polygon3(const VertexContainer &vertices):  
    20 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
     20mMaterial(NULL),  
     21mParent(NULL),  
     22mPiercingRays(0) 
    2123, mPlane(NULL) 
    2224{ 
     
    2729 
    2830Polygon3::Polygon3(MeshInstance *parent):  
    29 mMaterial(NULL), mParent(parent), mPiercingRays(0) 
     31mMaterial(NULL),  
     32mParent(parent),  
     33mPiercingRays(0) 
    3034, mPlane(NULL) 
    3135{} 
     
    3337 
    3438Polygon3::Polygon3(Face *face, Mesh *parentMesh): 
    35 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 
    36 , mPlane(NULL) 
     39mMaterial(NULL),  
     40mParent(NULL),  
     41mPiercingRays(0),  
     42mPlane(NULL) 
    3743{        
    3844        mVertices.reserve(face->mVertexIndices.size()); 
    3945         
    40         VertexIndexContainer::iterator it = face->mVertexIndices.begin(); 
    41         for (; it != face->mVertexIndices.end();  ++it) 
     46        VertexIndexContainer::iterator it, it_end = face->mVertexIndices.end(); 
     47 
     48        for (it = face->mVertexIndices.begin(); it != it_end;  ++ it) 
    4249        { 
    4350                mVertices.push_back(parentMesh->mVertices[*it]); 
     
    5461#else 
    5562        if (!mPlane) 
     63        { 
    5664                mPlane = new Plane3(mVertices[0], mVertices[1], mVertices[2]); 
     65        } 
     66 
    5767        return *mPlane; 
    5868#endif 
     
    6575                                                           mVertices[0] - mVertices[1])); 
    6676} 
     77 
    6778 
    6879void Polygon3::Split(const Plane3 &partition,  
     
    7283{ 
    7384        Vector3 ptA = mVertices.back(); 
    74          
    7585        int sideA = partition.Side(ptA, epsilon); 
    76          
    77         VertexContainer::const_iterator it; 
    78          
    79         Vector3 lastSplit; 
    80  
    8186        bool foundSplit = false; 
    82  
     87    Vector3 lastSplit; 
     88                 
    8389        //-- find line - plane intersections 
    84         for (it = mVertices.begin(); it != mVertices.end(); ++ it) 
     90 
     91        VertexContainer::const_iterator it, it_end = mVertices.end(); 
     92 
     93        for (it = mVertices.begin(); it != it_end; ++ it) 
    8594        { 
    8695                Vector3 ptB = *it; 
Note: See TracChangeset for help on using the changeset viewer.