source: golgotha/src/maxtool/sdk_inc/meshadj.h @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/**********************************************************************
2 *<
3        FILE: meshadj.h
4
5        DESCRIPTION: Adjacency list for meshes.
6
7        CREATED BY: Rolf Berteig
8
9        HISTORY:
10
11 *>     Copyright (c) 1994, All Rights Reserved.
12 **********************************************************************/
13
14#ifndef __MESHADJ__
15#define __MESHADJ__
16
17#include "export.h"
18
19#define UNDEFINED       0xffffffff
20
21class MEdge {
22        public:
23                DWORD f[2];
24                DWORD v[2];             
25        };
26
27class AdjEdgeList {
28        public:
29                DWORDTab *list;         // 1 DWORDTab per vertex. The Tab is a list of indices into the edge list, 1 for each edge adjacent to the vertex
30                Tab<MEdge> edges;       // Table of edges
31                int nverts;                     // size of 'list'.
32
33                DllExport AdjEdgeList(Mesh& amesh);
34                DllExport ~AdjEdgeList();
35                AdjEdgeList& operator=(AdjEdgeList& a) {assert(0);return *this;}
36                DllExport void AddEdge( DWORD fi, DWORD v1, DWORD v2 );
37                DWORDTab& operator[](int i) { return list[i]; }
38                DllExport int FindEdge(DWORD v0, DWORD v1);
39                DllExport int FindEdge(DWORDTab& vmap,DWORD v0, DWORD v1);             
40                DllExport void TransferEdges(DWORD from,DWORD to,DWORD except1,DWORD except2,DWORD del);
41                DllExport void RemoveEdge(DWORD from,DWORD e);
42        };
43
44class AdjFace {
45        public:
46                DWORD f[3];
47                AdjFace() {f[0] = f[1] = f[2] = UNDEFINED;}
48        };
49
50class AdjFaceList {
51        public:
52                Tab<AdjFace> list;
53
54                AdjFace& operator[](int i) {return list[i];}
55                DllExport AdjFaceList(Mesh& mesh,AdjEdgeList& el);
56        };
57
58class FaceElementList {
59        public:
60                // For each face, which element is it in
61                DWORDTab elem;
62                DWORD count;
63                DllExport FaceElementList(Mesh &mesh,AdjFaceList& af);
64                DWORD operator[](int i) {return elem[i];}
65        };
66
67class FaceClusterList {
68        public:
69                // Cluster #, one for each face - non-selected faces have UNDEFINED for their id.
70                DWORDTab clust;
71                DWORD count;
72       
73                // This version separates cluster also using a minimum angle and optionally the selection set
74                FaceClusterList(Mesh *mesh, AdjFaceList& adj,float angle,BOOL useSel=TRUE);             
75
76                // Uses selection set
77                FaceClusterList(BitArray& fsel, AdjFaceList& adj);             
78                               
79                DWORD operator[](int i) { return clust[i]; }           
80        };
81
82#endif //__MESHADJ__
Note: See TracBrowser for help on using the repository browser.