Overture  Version 25
CompositeTopology.h
Go to the documentation of this file.
1 #ifndef COMPOSITE_TOPOLOGY_H
2 #define COMPOSITE_TOPOLOGY_H
3 
4 #define AP_EXPERIMENT
5 
6 #include "Mapping.h"
7 #include "ArraySimple.h"
8 
9 class CompositeSurface;
11 class EdgeCurve;
12 class NurbsMapping;
13 
14 #include "FaceInfo.h"
15 
16 template<class T> class GeometricADT;
17 typedef class GeometricADT<int> IntADT;
19 
21 {
22 public:
23 
25 {
27  edgeCurveIsSplit, // was -1
31 };
32 
35 
36 int
37 cleanup();
38 
40 operator =( const CompositeTopology & X );
41 
42 int
43 update();
44 
45 int
47 
49 getEdgeCurveStatus(int number);
50 
51 Mapping&
52 getEdgeCurve(int number);
53 
54 int
55 getNearestEdge(real x[3]);
56 
57 int
58 findBoundaryCurves(int & numberOfBoundaryCurves, Mapping **& boundaryCurves );
59 
63 
64 int
66 
67 bool
68 topologyDetermined(){ return signForNormal.getLength(0)>0; } // ** fix this ***
69 
70 const IntegerArray &
71 getSignForNormal() const { return signForNormal;}
72 
73 int
75 
76 virtual int
77 get( const GenericDataBase & dir, const aString & name); // get from a database file
78 virtual int
79 put( GenericDataBase & dir, const aString & name) const; // put to a database file
80 
81 // kkc
84 
85 // kkc
86  void setMaximumArea(real maxa);
87  //kkc
88  real getMaximumArea() const;
89  // kkc
90  void setDeltaS(real ds);
91  real getDeltaS() const;
92  // kkc
93  bool computeTopology(GenericGraphicsInterface & gi, int debug=0);
94  // kkc
95  void invalidateTopology();
96 
97 // kkc moved to public interface for unstructured mesh generation (need to project onto these!)
98 EdgeInfo *
99 edgeFromNumber(int n);
100 // kkc moved to public interface
101 int
102 buildEdgeCurveSearchTree( int & debug );
103 
104 protected:
105 
106 void
107 setupAllEdges();
108 void
110 bool
111 checkConsistency(bool quiet = false);
112 
113 int
115 
116 int
117 computeNumberOfGridPoints( real arcLength, realArray & x, real & maxCurvature );
118 
119 int
120 buildEdgeSegment(Mapping & trimCurve,
121  Mapping & surface,
122  NurbsMapping *&edge,
123  int & numberOfGridPoints,
124  real & arcLength,
125  int & debug,
127 
128 int
130 
131 // build grid points on edge curves to be used with the triangulation.
132 int
134 
135 // kkc moved to public interface
136 //int
137 //buildEdgeCurveSearchTree( int & debug );
138 
139 int
140 getAnotherEdge(EdgeInfo* &edgeChosen,
142  const aString & question,
143  const aString & cancel );
144 
145 int
146 merge( EdgeInfo * e, int debug );
147 int
148 mergeEdgeCurves(EdgeInfo & e, EdgeInfo & e2, int debug=0); // try to force a merge
149 // workhorse, should not be called directly
150 bool
151 mergeTwoEdges(EdgeInfo *e, EdgeInfo *eMin, int orientation, real tolerance, int debug);
152 
153 // try to join adjacent edge curves into one.
154 int
155 joinEdgeCurves(EdgeInfo &e1, bool toNext, int debug =0);
156 
157 int
159 
160 int
161 splitEdge( EdgeInfo **er, real rSplit, int & debug, bool mergeNewEdges = true );
162 
163 int
165 
166 int
168  IntegerArray & numberOfBoundaryNodes,
169  realArray * rCoordinates,
170  IntegerArray *edgeNodeInfop,
171  IntegerArray *boundaryNodeInfop,
172  int & totalNumberOfNodes,
173  int & totalNumberOfFaces,
174  int & totalNumberOfElements,
175  real & totalTimeToBuildSeparateTriangulations,
176  real & totalTriangleTime,
177  real & totalNurbTime,
178  real & totalResolutionTime,
179  int & debug,
181  GraphicsParameters& params);
182 
183 int
185 
186 void
188 
189 // kkc moved to public interface for unstructured mesh generation (need to project onto these!)
190 //EdgeInfo *
191 //edgeFromNumber(int n);
192 void
193 unMergeEdge(EdgeInfo & e);
194 
196 
201 
203 EdgeInfo **allEdges; // pointer array to all boundary and master EdgeInfo's
204 int numberOfUniqueEdgeCurves; // number of boundary and master EdgeInfo's
205 
206 int numberOfEdgeCurves; // number of EdgeInfos created
207 
216 
219 
221 
222 real maxDist; // default max distance from midpoint of edge to surface
224 
227 
229 
230 EdgeInfoADT *searchTree;
231 
233 
236 
239 
241 bool mergedCurvesAreValid; // set to true when merged curves are consistent with current parameters
242 bool recomputeEdgeCurveBoundaryNodes; // set to true if user changes deltaS
243 
247 
248 // end point variables
250 EdgeInfoArray masterEdge; // pointer to the master edge
251 realArray endPoint; // point coordinates
252 
253 FaceInfo * faceInfoArray; // virtual topology datastructure
255 
257 };
258 
259 
260 
261 #endif