Rev | Line | |
---|
[37] | 1 | /* |
---|
| 2 | |
---|
| 3 | Brian Curless |
---|
| 4 | |
---|
| 5 | Computer Graphics Laboratory |
---|
| 6 | Stanford University |
---|
| 7 | |
---|
| 8 | --------------------------------------------------------------------- |
---|
| 9 | |
---|
| 10 | Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
| 11 | University. Except for commercial resale, lease, license or other |
---|
| 12 | commercial transactions, permission is hereby given to use, copy, |
---|
| 13 | modify this software for academic purposes only. No part of this |
---|
| 14 | software or any derivatives thereof may be used in the production of |
---|
| 15 | computer models for resale or for use in a commercial |
---|
| 16 | product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
| 17 | CONCERNING 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 | |
---|
| 28 | typedef uchar vec3uc[3]; |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | struct Triangle { |
---|
| 32 | int vindex1, vindex2, vindex3; |
---|
| 33 | Vec3f norm; |
---|
| 34 | }; |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | struct 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 | |
---|
| 62 | class 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 | |
---|
| 92 | void doConfidence(Mesh *mesh, int perspective=0); |
---|
| 93 | |
---|
| 94 | void reallocTris(Vertex *v); |
---|
| 95 | |
---|
| 96 | void reallocVerts(Vertex *v); |
---|
| 97 | |
---|
| 98 | Mesh *cleanMesh(Mesh *inMesh); |
---|
| 99 | |
---|
| 100 | #endif |
---|
| 101 | |
---|
Note: See
TracBrowser
for help on using the repository browser.