GEL  2
GEL is a library for Geometry and Linear Algebra
/Users/jab/Documents/Teaching/02585/GEL2_and_demos/GEL/src/Geometry/TriMesh.h
00001 #ifndef __GEOMETRY_TRIMESH_H__
00002 #define __GEOMETRY_TRIMESH_H__
00003 
00004 #include <CGLA/Mat4x4f.h>
00005 #include "IndexedFaceSet.h"
00006 #include "Material.h"
00007 
00008 namespace Geometry
00009 {
00010 
00011 
00020         class TriMesh 
00021         {
00022                 public:
00023                 
00024                 // ------- DATA -------
00025 
00027                 std::string name;
00028                 
00030                 IndexedFaceSet geometry;
00031 
00033                 IndexedFaceSet normals;
00034 
00036                 IndexedFaceSet texcoords;
00037 
00039                 std::vector<int> mat_idx;
00040 
00042                 std::vector<int> tex_idx;
00043 
00045                 std::vector<Material> materials;
00046 
00047                 // -------- FUNCTIONS -----------
00048 
00050                 bool get_bbox(CGLA::Vec3f& p0, CGLA::Vec3f& p7) const;
00051 
00053                 bool get_bsphere(CGLA::Vec3f& c, float& r) const;
00054 
00056                 bool has_normals() const 
00057                 {
00058                         return normals.no_faces()>0;
00059                 }
00060                 
00062                 int find_material(const std::string&) const;
00063 
00065                 void compute_normals();
00066 
00068     void transform(CGLA::Mat4x4f m);
00069         };
00070 
00071 
00072 }
00073 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations