File: cmesh.h

package info (click to toggle)
meshlab 1.3.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 20,900 kB
  • ctags: 33,325
  • sloc: cpp: 224,813; ansic: 8,170; xml: 119; makefile: 78
file content (47 lines) | stat: -rw-r--r-- 1,236 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef CLOTH_MESH_H
#define CLOTH_MESH_H

#include <vcg/simplex/vertex/base.h>
#include <vcg/simplex/face/base.h>
#include <vcg/simplex/face/pos.h>
#include <vcg/simplex/face/topology.h>
#include <vcg/complex/complex.h>
#include <vcg/complex/algorithms/update/normal.h>

#include <vector>

using namespace vcg;
          
class CVertex;
class CEdge;
class CFace;

class CEdge {
  public:
   CVertex *v[2];         
   CFace *f;
   bool operator<(const CEdge& t) const {
      if(v[0] < t.v[0]) return true;
      if(v[0] > t.v[0]) return false;
      return v[1] < t.v[1];
   }
   bool operator==(const CEdge& t) const {
      return v[0] == t.v[0] && v[1] == t.v[1];
   }
};

class CVertex: public
      VertexSimp2<CVertex, CEdge, CFace,
                  vcg::vert::Coord3f, vert::Normal3f, vert::BitFlags, vert::Mark,
                  vert::VFAdj, 
                  vert::Qualityf> {
  public:     
   float color;
};

class CFace: public FaceSimp2 <CVertex, CEdge, CFace, face::VertexRef, 
                               face::BitFlags, face::VFAdj, face::FFAdj > {};
                       
class CMesh: public tri::TriMesh< std::vector<CVertex>, std::vector<CFace> > {};

#endif