Biomechanical Joint Model
 Author: Anderson Maciel

marching_cubes.h

Go to the documentation of this file.
00001 /*@#---------------------------------------------------------------------------
00002  PROJECT            : PHD THESIS
00003  MODULE             : PHYSICALLY-BASED DEFORMATION
00004 
00005  FILE               : marching_cubes.h
00006  CREATION DATE      : Thu Nov 11 11:30:03 MET 1999
00007  CREATION AUTHOR(S) : aubel 
00008  ------------------------------------------------------------------------------
00009  KEYWORD(S)         : marching cubes, voxelisation, volume
00010  DEFINED TYPE(S)    : 
00011  RELATED TYPE(S)    : 
00012 
00013  FUNCTIONALITY      : 
00014  ------------------------------------------------------------------------------
00015  LANGAGE            : Ansi C++
00016  SYSTEM             : UNIX V 6.x / SGI
00017  GRAPHIC LIBRARY    : SGI  
00018  ------------------------------------------------------------------------------
00019  PROJECT DIRECTOR   : D. THALMANN
00020  LAB                : EPFL- LIG
00021  --------------------------------------------------------------------------#@*/
00022 #ifndef MC_MARCHING_CUBES_H
00023 #define MC_MARCHING_CUBES_H
00024 
00025 #include <LinAlg/linalg.h>
00026 #include "private_marching_cubes.h"
00027 #include "hash_map.h"
00028 
00029 #include <vector>
00030 #include <list>
00031 
00032 //namespace MarchingCubes{
00033 
00034    //struct Triangle;
00035    //class marchingCubes;
00036 
00037    class Quadric;
00038    class Blob;
00039    class Ellipsoids;
00040    class Metaballs_Shen;
00041    class Metaballs_exp;
00042    class MetaballsSphere;
00043    class MetaballsSphere_exp;
00044    class Mesh;
00045 
00046 //   using namespace LinAlg;
00047 //   using namespace RayCasting;
00048 //   using namespace std;
00049 //};
00050 
00051 
00052 struct Triangle {
00053    int indices[3];
00054 };
00055 
00056 
00057 class marchingCubes
00058 {
00059 public:   
00060    marchingCubes( vector<Primitive*> primitives, REAL resolution);
00061    
00062    vector<VEC> getVertices() const { return vertlist; };
00063    vector<VEC> getNormals() const { return normlist; };
00064    vector<Triangle> getTriangles() const { return trilist; };
00065 
00066 private:
00067    idx3 findSeedVoxel();
00068    int  polygonise(GridCell &cube);
00069    void computeVoxelFieldValues(GridCell &cell, const idx3 &id);
00070    void constructSurface(list<idx3> &voxlist);
00071 
00072 private:
00073    vector<VEC> vertlist, normlist;
00074    vector<Triangle> trilist;
00075    const vector<Primitive*> primlist;
00076    VEC LL, UR;
00077    REAL res;
00078 
00079    HashMap<Voxel> surf;
00080    HashMap<Edge>  edges;
00081 };
00082 
00083 
00084 
00085 
00086 #endif

Generated on Thu Dec 1 10:13:38 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5