source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/vrip/Mesh.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.7 KB
Line 
1/*
2
3Brian Curless
4
5Computer Graphics Laboratory
6Stanford University
7
8---------------------------------------------------------------------
9
10Copyright (1997) The Board of Trustees of the Leland Stanford Junior
11University. Except for commercial resale, lease, license or other
12commercial transactions, permission is hereby given to use, copy,
13modify this software for academic purposes only.  No part of this
14software or any derivatives thereof may be used in the production of
15computer models for resale or for use in a commercial
16product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
17CONCERNING THIS SOFTWARE.  No support is implied or provided.
18
19*/
20
21
22#ifndef _MESH_
23#define _MESH_
24
25#include "Linear.h"
26#include "BBox3f.h"
27
28typedef uchar vec3uc[3];
29
30
31struct Triangle {
32    int vindex1, vindex2, vindex3;
33    Vec3f norm;
34};
35
36
37struct Vertex {
38    Vec3f coord;
39    Vec3f norm;
40
41    float confidence;
42    uchar red, green, blue;
43
44    Triangle **tris;
45    uchar numTris;
46    uchar maxTris;
47
48    Vertex **verts;
49    float *edgeLengths;
50    uchar numVerts;
51    uchar maxVerts;
52
53    float distToBoundary;
54
55    uchar count;
56    uchar on_edge;
57    uchar holeFill;
58    signed char stepsToEdge;
59};
60
61
62class Mesh {
63
64  public:
65
66    int numVerts;
67    Vertex *verts;
68
69    int numTris;
70    Triangle *tris;
71
72    int isWarped;
73    int isRightMirrorOpen;
74    int hasConfidence;
75    int hasColor;
76
77    Quaternion quat;
78    Vec3f trans;
79
80    BBox3f bbox;
81
82    Mesh();
83    ~Mesh();
84
85    void initNormals();
86    void computeTriNormals();
87    void computeVertNormals();
88
89    void computeBBox();
90};
91
92void doConfidence(Mesh *mesh, int perspective=0);
93
94void reallocTris(Vertex *v);
95
96void reallocVerts(Vertex *v);
97
98Mesh *cleanMesh(Mesh *inMesh);
99
100#endif
101
Note: See TracBrowser for help on using the repository browser.