Ignore:
Timestamp:
04/28/06 18:42:54 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r704 r860  
    99#include "Mesh.h" 
    1010 
     11using namespace GtpVisibilityPreprocessor { 
     12 
    1113#define FATAL Debug 
    1214#define FATAL_ABORT exit(1) 
     
    5456        for (it = newpoly.mVertices.begin(); it != it_end; ++ it) 
    5557                Include(*it); 
     58} 
     59 
     60void 
     61AxisAlignedBox3::Include(const PolygonContainer &polys) 
     62{ 
     63        PolygonContainer::const_iterator it, it_end = polys.end(); 
     64 
     65        for (it = polys.begin(); it != it_end; ++ it) 
     66                Include(*(*it)); 
    5667} 
    5768 
     
    20382049 
    20392050 
    2040 void AxisAlignedBox3::AddBoxToMesh(Mesh *mesh) const 
     2051void IncludeBoxInMesh(const AxisAlignedBox3 &box, Mesh &mesh) 
    20412052{ 
    20422053        // add 6 vertices of the box 
    2043         int index = (int)mesh->mVertices.size(); 
     2054        int index = (int)mesh.mVertices.size(); 
    20442055         
    2045         for (int i=0; i < 8; i++)  
     2056        for (int i=0; i < 8; ++ i)  
    20462057        { 
    20472058                Vector3 v; 
    2048                 GetVertex(i, v); 
    2049                 mesh->mVertices.push_back(v); 
     2059                box.GetVertex(i, v); 
     2060                mesh.mVertices.push_back(v); 
    20502061        } 
    20512062         
    2052         mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 
    2053         mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 
    2054         mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
     2063        mesh.AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 
     2064        mesh.AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 
     2065        mesh.AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
    20552066         
    2056         mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
    2057         mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
    2058         mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
     2067        mesh.AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
     2068        mesh.AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
     2069        mesh.AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
    20592070} 
    20602071 
     
    21112122 
    21122123} 
     2124 
     2125} 
Note: See TracChangeset for help on using the changeset viewer.