Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
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
;
10
class
UnstructuredMapping
;
11
class
EdgeCurve;
12
class
NurbsMapping
;
13
14
#include "
FaceInfo.h
"
15
16
template
<
class
T>
class
GeometricADT
;
17
typedef
class
GeometricADT
<int>
IntADT
;
18
typedef
class
GeometricADT
<
EdgeInfo
*>
EdgeInfoADT
;
19
20
class
CompositeTopology
21
{
22
public
:
23
24
enum
EdgeCurveStatusEnum
25
{
26
edgeCurveIsNotMerged
=0,
// was 0
27
edgeCurveIsSplit
,
// was -1
28
edgeCurveIsMerged
,
// was 1
29
edgeCurveIsRemoved
,
// was 2
30
edgeCurveIsNotDefined
31
};
32
33
CompositeTopology
(
CompositeSurface
&
cs
);
34
~CompositeTopology
();
35
36
int
37
cleanup
();
38
39
CompositeTopology
&
40
operator =
(
const
CompositeTopology
& X );
41
42
int
43
update
();
44
45
int
46
getNumberOfEdgeCurves
();
47
48
EdgeCurveStatusEnum
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
60
UnstructuredMapping
*
61
getTriangulation
()
const
{
return
globalTriangulationForVisibleSurfaces
==0 ?
62
globalTriangulation
:
globalTriangulationForVisibleSurfaces
; }
63
64
int
65
buildTriangulationForVisibleSurfaces
();
66
67
bool
68
topologyDetermined
(){
return
signForNormal
.getLength(0)>0; }
// ** fix this ***
69
70
const
IntegerArray
&
71
getSignForNormal
()
const
{
return
signForNormal
;}
72
73
int
74
getEdgeFromEndPoints
(
real
*x0,
real
*x1);
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
82
UnstructuredMapping
*
83
getTriangulationSurface
(
int
s
) {
return
(
triangulationSurface
?
triangulationSurface
[s]:
NULL
);}
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
109
adjustEndPoints
();
110
bool
111
checkConsistency
(
bool
quiet =
false
);
112
113
int
114
initializeTopology
();
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,
126
GenericGraphicsInterface
& gi );
127
128
int
129
buildEdgeCurves
(
GenericGraphicsInterface
& gi );
130
131
// build grid points on edge curves to be used with the triangulation.
132
int
133
buildEdgeCurveBoundaryNodes
();
134
135
// kkc moved to public interface
136
//int
137
//buildEdgeCurveSearchTree( int & debug );
138
139
int
140
getAnotherEdge
(
EdgeInfo
* &edgeChosen,
141
GenericGraphicsInterface
& gi,
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
158
splitAndMergeEdgeCurves
(
GenericGraphicsInterface
& gi,
int
& debug );
159
160
int
161
splitEdge
(
EdgeInfo
**er,
real
rSplit,
int
& debug,
bool
mergeNewEdges =
true
);
162
163
int
164
triangulateCompositeSurface
(
int
& debug,
GenericGraphicsInterface
& gi,
GraphicsParameters
& params);
165
166
int
167
buildSubSurfaceTriangulation
(
int
s
,
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,
180
GenericGraphicsInterface
& gi,
181
GraphicsParameters
& params);
182
183
int
184
printEdgeCurveInfo
(
GenericGraphicsInterface
& gi);
185
186
void
187
printInfoForAnEdgeCurve
(
EdgeInfo
* e );
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
195
CompositeSurface
&
cs
;
196
198
UnstructuredMapping
*
globalTriangulation
;
200
UnstructuredMapping
*
globalTriangulationForVisibleSurfaces
;
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
209
real
mergeTolerance
;
211
real
splitToleranceFactor
;
213
real
deltaS
;
214
real
curvatureTolerance
;
215
real
curveResolutionTolerance
;
216
218
real
boundingBoxExtension
;
219
220
real
maximumArea
;
221
222
real
maxDist
;
// default max distance from midpoint of edge to surface
223
bool
improveTri
;
224
226
int
minNumberOfPointsOnAnEdge
;
227
228
IntegerArray
signForNormal
;
229
230
EdgeInfoADT *
searchTree
;
231
232
ArraySimple<real>
boundingBox
;
233
235
UnstructuredMapping
**
triangulationSurface
;
236
238
bool
triangulationIsValid
;
239
240
bool
edgeCurvesAreBuilt
;
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
244
real
maximumMergeDistance
;
245
real
averageMergeDistance
;
246
real
minimumUnmergedDistance
;
247
248
// end point variables
249
int
numberOfEndPoints
;
250
EdgeInfoArray
masterEdge
;
// pointer to the master edge
251
realArray
endPoint
;
// point coordinates
252
253
FaceInfo
*
faceInfoArray
;
// virtual topology datastructure
254
int
numberOfFaces
;
255
256
EdgeInfoArray
unusedEdges
;
257
};
258
259
260
261
#endif
Generated on Fri Jan 4 2013 10:17:50 for Overture by
1.8.3