Biomechanical Joint Model
 Author: Anderson Maciel

mesh.h

Go to the documentation of this file.
00001 /*@#---------------------------------------------------------------------------
00002  PROJECT            : PHD THESIS
00003  MODULE             : PHYSICALLY-BASED DEFORMATION
00004 
00005  FILE               : mesh.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_MESH_H
00023 #define MC_MESH_H
00024 
00025 #include <LinAlg/linalg.h>
00026 #include <RayCasting/ray.h>
00027 
00028 #include "primitive.h"
00029 #include "private_marching_cubes.h"
00030 
00031 #include <vector>
00032 
00033 //namespace MarchingCubes {
00034 
00035 class Mesh : public Primitive
00036 {
00037 public:   
00038    Mesh(const VECArray &vertlist, const VECArray &normlist, 
00039         const vector<int> &trilist, const vector<int> &normIndex);
00040 
00041    Mesh(const Mesh &mesh) : Primitive(mesh), vertices(mesh.vertices), normals(mesh.normals), 
00042          faces(mesh.faces), normalIndex(mesh.normalIndex), bbox_h(mesh.bbox_h) {};
00043 
00044    virtual bool intersectedBy(Ray &ray) const;
00045    virtual REAL getDistance(const VEC &X) const;
00046    virtual BBox getBoundingBox();
00047    virtual void findIntersection(const VEC &P1, const VEC &P2, REAL valp1, REAL valp2, 
00048                                  VEC &P, VEC &N) const;
00049 private:
00050    bool intersectedBy(Ray &ray, REAL &u, REAL &v, int &tri_idx) const;
00051 
00052 private:
00053    VECArray  vertices;       // list of vertices
00054    VECArray  normals; 
00055    vector<int> faces;        // indices of triangles 
00056    vector<int> normalIndex;  // indices of normals (may be different from vertices indices)
00057 
00058    BBoxHierarchy bbox_h;
00059 };
00060 
00061 //}
00062 #endif
00063 

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