~ubuntu-branches/debian/sid/3depict/sid

« back to all changes in this revision

Viewing changes to src/mesh.h

  • Committer: Bazaar Package Importer
  • Author(s): D Haley
  • Date: 2010-09-22 20:09:24 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100922200924-bkyorwswrntnst4d
Tags: 0.0.2-1
* New upstream version
* Enable parallel build

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef MESH_H
 
2
#define MESH_H
 
3
 
 
4
#include <vector>
 
5
#include <limits>
 
6
 
 
7
#include "basics.h"
 
8
 
 
9
class TriangleWithVertexNorm
 
10
{
 
11
        public:
 
12
                Point3D p[3];
 
13
                Point3D normal[3];      
 
14
 
 
15
                void computeACWNormal(Point3D &p) const;
 
16
                bool isDegenerate() const;
 
17
};
 
18
 
 
19
class TRIANGLE
 
20
{
 
21
        public:
 
22
                unsigned int vertices[3];
 
23
};
 
24
 
 
25
class Mesh
 
26
{
 
27
 
 
28
        public:
 
29
        std::vector<TRIANGLE> triangles;
 
30
        std::vector<Point3D> nodes;
 
31
        std::vector<Point3D> vertexNorm;
 
32
 
 
33
                void clear() { triangles.clear();nodes.clear();vertexNorm.clear();}
 
34
                //!Convert a raw triangle set into a mesh
 
35
                void convertRawTriangles(std::vector<TriangleWithVertexNorm> &rawTris,
 
36
                                float collapseTol);
 
37
 
 
38
                //Estimate the normals from the triangle data
 
39
                void estimateNormalsFromTris();
 
40
};
 
41
 
 
42
#endif