Branch data Line data Source code
1 : : //-------------------------------------------------------------
2 : : //Class: GeomMeasureTool
3 : : //Description: Calculates measurements and statistics for a given entity.
4 : : //Author: David R. White
5 : : //Date: May 28, 2002
6 : : //-------------------------------------------------------------
7 : : #ifndef GEOM_MEASURE_TOOL_HPP
8 : : #define GEOM_MEASURE_TOOL_HPP
9 : : class RefEntity;
10 : : class RefVertex;
11 : : class RefEdge;
12 : : class RefFace;
13 : : class RefVolume;
14 : : class Body;
15 : : class RefGroup;
16 : : class TopologyEntity;
17 : : class CubitVector;
18 : : #include "DLIList.hpp"
19 : : template <class X> class DLIList;
20 : : class GeomPoint;
21 : : class GeomSeg;
22 : : #include "CGMGeomConfigure.h"
23 : : #include <vector>
24 : : #include <map>
25 : :
26 : : typedef DLIList <GeomPoint*> PointList;
27 : : typedef DLIList <PointList*> PointLoopList;
28 : : typedef DLIList <GeomSeg*> SegList;
29 : : typedef DLIList <SegList*> SegLoopList;
30 : :
31 : : const double GEOM_END_LOWER = 87.0;
32 : : const double GEOM_END_UPPER = 93.0;
33 : : const double GEOM_SIDE_LOWER = 177.0;
34 : : const double GEOM_SIDE_UPPER = 183.0;
35 : : const double GEOM_CORNER_LOWER = 267.0;
36 : : const double GEOM_CORNER_UPPER = 273.0;
37 : : const double GEOM_REVERSAL_LOWER = 355.0;
38 : :
39 : : struct dist_vert_struct
40 : : {
41 : : double dist;
42 : : RefVertex *v1;
43 : : RefVertex *v2;
44 : : RefVolume *vol2;
45 : : };
46 : :
47 : : class AreaHashTuple
48 : : {
49 : : public:
50 : 0 : AreaHashTuple()
51 : 0 : {}
52 : 0 : ~AreaHashTuple()
53 : 0 : {}
54 : : RefFace *myFace;
55 : : double myArea;
56 : : };
57 : :
58 : : //! Calculates measurements and statistics for a given entity.
59 : : class CUBIT_GEOM_EXPORT GeomMeasureTool
60 : : {
61 : : private:
62 : : static void get_edges_from_list(DLIList <RefEntity*> &entity_list,
63 : : DLIList <RefEdge*> &ref_edges );
64 : : static void get_faces_from_list(DLIList <RefEntity*> &entity_list,
65 : : DLIList <RefFace*> &ref_faces );
66 : : static void get_volumes_from_list(DLIList <RefEntity*> &entity_list,
67 : : DLIList <RefVolume*> &ref_volumes );
68 : : static void get_bodies_from_list(DLIList <RefVolume*> &entity_list,
69 : : DLIList <Body*> &ref_bodies );
70 : : ///
71 : : ///converts the entity list, and expands the list to get the edges,
72 : : ///faces or volumes of the entities.
73 : : ///
74 : :
75 : : static double dist_sq_point_data( CubitVector &curr_point,
76 : : GeomSeg *&curr_seg );
77 : : ///
78 : : /// finds the distance between the point and the segment. Function
79 : : /// used in the AbstractTree Nearest Neighbor calculation.
80 : :
81 : : static CubitStatus interior_angle(GeomSeg *first_seg,
82 : : GeomSeg *next_seg,
83 : : RefFace *face,
84 : : double &angle );
85 : : ///
86 : : /// measures the interior angle between the two connected segments.
87 : : /// Returns an error if the segments are not connected or if the
88 : : /// surface normal length is zero.
89 : : ///
90 : :
91 : : static void find_index(DLIList<AreaHashTuple*> *hash_table,
92 : : int table_size,
93 : : RefFace *ref_face,
94 : : AreaHashTuple *&curr_tuple );
95 : : ///
96 : : /// Finds the tuple for the given ref_face in the hash_table.
97 : : /// This function is used in find_adjacent_face_ratios.
98 : : ///
99 : :
100 : : static void get_adjacent_faces(RefFace* curr_face,
101 : : DLIList<RefFace*> &adjacent_faces);
102 : : ///
103 : : /// Finds the adjacent faces to this face by traversing the DAG.
104 : : ///
105 : :
106 : :
107 : : static CubitBoolean find_opposite_edge( RefEdge* ref_edge,
108 : : RefFace* ref_face,
109 : : RefEdge *&other_edge,
110 : : CubitVector &closest_point);
111 : : ///
112 : : /// finds the other edge which is about opposite to ref_edge. If
113 : : /// there are more than two loops, we return CUBIT_FALSE. If
114 : : /// there are two loops it finds the loop and curve on that loops,
115 : : /// that has the closest point to the mid point of ref_edge.
116 : : /// If there is just one loop, it turns on that loop to find the
117 : : /// opposite. There can be no convex vertex angles on the loop.
118 : : ///
119 : :
120 : : static CubitBoolean is_equal(double v1, double v2);
121 : : ///
122 : : /// Tests to see if the two double values are within CUBIT_RESABS.
123 : : /// Returns TRUE if they are, false if they aren't.
124 : : ///
125 : :
126 : : static RefFace* valid_start( DLIList <RefFace*> &all_faces );
127 : :
128 : : static void face_list_from_volume_list( DLIList <RefVolume*> &input_vols,
129 : : DLIList <RefFace*> &all_faces );
130 : :
131 : : public:
132 : : GeomMeasureTool()
133 : : {}
134 : :
135 : : ~GeomMeasureTool()
136 : : {}
137 : :
138 : : //! Determines if a surface is narrow.
139 : : static bool is_surface_narrow(RefFace *face, double small_curve_size);
140 : :
141 : : //! Determines points along which to make a curve for splitting a narrow surface.
142 : : static void find_split_points_for_narrow_regions(RefFace *face,
143 : : double size,
144 : : DLIList<CubitVector> &split_pos1_list,
145 : : DLIList<CubitVector> &split_pos2_list);
146 : :
147 : : //! Find the smallest, longest and average size of the curves. Also
148 : : //! compute the sum of all the curve. Do that for a list of RefEntity pointers.
149 : : static void measure_curve_length(DLIList <RefEntity*> &entity_list,
150 : : double &smallest,
151 : : RefEdge *&smallest_edge,
152 : : double &largest,
153 : : RefEdge *&largest_edge,
154 : : double &average,
155 : : double &sum);
156 : :
157 : : //! Find the smallest, longest and average size of the curves. Also
158 : : //! compute the sum of all the curve. Do that for a list of RefEdge pointers.
159 : : static void measure_curve_length(DLIList <RefEdge*> &ref_edges,
160 : : double &smallest,
161 : : RefEdge *&smallest_edge,
162 : : double &largest,
163 : : RefEdge *&largest_edge,
164 : : double &average,
165 : : double &sum);
166 : :
167 : : //! Finds the curve with the smallest length on the surface.
168 : : //! Also find the biggest change in curve lengths where
169 : : //! the ratio is the largest curve divided by the smallest curve.
170 : : static void measure_face_curves( RefFace *ref_face,
171 : : double &min_curve_length,
172 : : double &max_curve_ratio,
173 : : RefEdge *&min_ref_edge);
174 : :
175 : : //! Determines if a narrow region exists between the
176 : : //! passed-in edge and any other edge in the passed-in
177 : : //! face. 'tol' defines what is 'narrow'. A non-zero
178 : : //! int is returned if a narrow region exists.
179 : : static int narrow_region_exists(RefFace *face,
180 : : RefEdge *edge,
181 : : const double &tol);
182 : : //! Determines whether a narrow region exists between the two
183 : : //! passed-in edges on the passed-in face. 'tol' specifies what
184 : : //! 'narrow' is. The four lists that are returned contain points
185 : : //! at which the face can be split in order to separate off the
186 : : //! narrow region. The 'pos' lists contain split points on the
187 : : //! edges that are not on pre-existing vertices. If a split point
188 : : //! falls on a pre-existing vertex it will show up in the 'vert' list.
189 : : //! The points/vertices in the lists are ordered so that a point/vertex
190 : : //! in an 'e1' list will correspond with a point/vertex in an 'e2' list.
191 : : //! If a narrow region exists between the edges a non-zero value will
192 : : //! be returned.
193 : : static int narrow_region_exists(
194 : : RefEdge *e1,
195 : : RefEdge *e2,
196 : : RefFace *face,
197 : : const double &tol,
198 : : DLIList<CubitVector*> &e1_pos_list,
199 : : DLIList<CubitVector*> &e2_pos_list,
200 : : DLIList<RefVertex*> &e1_vert_list,
201 : : DLIList<RefVertex*> &e2_vert_list);
202 : : //! Determine if a narrow region exists on the given face. The passed-in
203 : : //! tolerance defines the narrow size. Returns a non-zero value
204 : : //! if a narrow region exists.
205 : : static int narrow_region_exists(RefFace *face,
206 : : const double &tol);
207 : : //! Checks to see if at the given position the two edges are close together and
208 : : //! have the same tangent. 'e1' is one of the edges. 'face' is the face that
209 : : //! the edges are on. 'pt_on_e1' is a position on 'e1'. 'pt_on_e1' will be
210 : : //! projected onto the other edge, 'e2', to look for closeness. 'tol_sq' is
211 : : //! the squared distance defining what is 'close'. The closest pt on 'e2' to
212 : : //! 'pt_on_e1' is returned. Returns a non-zero int if the two edges form a narrow region
213 : : //! at the given point.
214 : : static int is_narrow_region_at_point(RefEdge *e1,
215 : : RefFace *face,
216 : : const CubitVector &pt_on_e1,
217 : : RefEdge *e2,
218 : : const double &tol_sq,
219 : : CubitVector &closest);
220 : :
221 : : //! Find the smallest distance between multiple loops on the surface.
222 : : //! Find the smallest distance between two curves. This could be the length
223 : : //! of the smallest curve...
224 : : //! Also calculate the angles between curves on the faces.
225 : : //! The tolerance is used to specify the faceting to approximate the boundaries.
226 : : static CubitStatus measure_face_loops(RefFace *face,
227 : : double &min_distance_between_loops,
228 : : double &min_distance_in_one_loop,
229 : : double &min_angle, double &max_angle,
230 : : double tolerance);
231 : :
232 : : //! Find the smallest, largest and average area of the faces contained
233 : : //! in the entity list.. Also compute the sum of all the face area.
234 : : static void measure_face_area (DLIList <RefEntity*> &entity_list,
235 : : double &smallest,
236 : : RefFace *&smallest_face,
237 : : double &largest,
238 : : RefFace *&largest_face,
239 : : double &average,
240 : : double &sum);
241 : :
242 : : //! Find the smallest, largest and average area of the faces
243 : : //! in the face list.. Also compute the sum of all the face area.
244 : : static void measure_face_area (DLIList <RefFace*> &ref_faces,
245 : : double &smallest,
246 : : RefFace *&smallest_face,
247 : : double &largest,
248 : : RefFace *&largest_face,
249 : : double &average,
250 : : double &sum);
251 : :
252 : : //! Find the smallest, largest, and average volume. Compute the sum of all
253 : : //! the volumes for the volumes contained by the entities in the entity list.
254 : : static void measure_volume_volume (DLIList <RefEntity*> &entity_list,
255 : : double &smallest,
256 : : RefVolume *&smallest_volume,
257 : : double &largest,
258 : : RefVolume *&largest_volume,
259 : : double &average,
260 : : double &sum);
261 : :
262 : : //! Find the smallest, largest, and average volume. Compute the sum of all
263 : : //! the volumes in the list.
264 : : static void measure_volume_volume (DLIList <RefVolume*> &ref_volumes,
265 : : double &smallest,
266 : : RefVolume *&smallest_volume,
267 : : double &largest,
268 : : RefVolume *&largest_volume,
269 : : double &average,
270 : : double &sum);
271 : :
272 : : static void measure_face_area_and_hydraulic_radius(RefFace *curr_face,
273 : : double &face_area,
274 : : double &face_hydraulic_radius);
275 : :
276 : : static void measure_volume_volume_and_hydraulic_radius(RefVolume *curr_volume,
277 : : double &volume_volume,
278 : : double &volume_hydraulic_radius);
279 : :
280 : : static void angles_between_volume_surfaces(RefVolume *curr_volume,
281 : : double &min_angle,
282 : : double &max_angle,
283 : : RefFace *&face_min_1,
284 : : RefFace *&face_min_2,
285 : : RefFace *&face_max_1,
286 : : RefFace *&face_max_2);
287 : :
288 : : //! Given a list of volumes, return number of surface merged, unmerged,
289 : : //! and ratio between the two.
290 : : static void merged_unmerged_surface_ratio(DLIList <RefVolume*> &ref_volumes,
291 : : int &merged, int &unmerged,
292 : : double &ratio);
293 : :
294 : : //! From a list of volumes, find ones that intersect.
295 : : static void report_intersected_volumes(DLIList <RefVolume*> &volume_list,
296 : : DLIList <RefVolume*> &intersection_list);
297 : :
298 : : //! From a list of bodies, find ones that intersect.
299 : : static void report_intersected_bodies(DLIList <Body*> &ref_bodies,
300 : : DLIList <Body*> &intersection_list);
301 : :
302 : : //! Finds lists of surfaces sharing common curves. Lists are found in the returned RefGroup.
303 : : static void find_shells( DLIList <RefVolume*> &input_vols,
304 : : RefGroup *&owner_groups,
305 : : int &number_of_shells);
306 : :
307 : : //! Gets the points in ordered loops that are used to facet the boundary
308 : : //! of the surface.
309 : : static CubitStatus get_boundary_points( RefFace *ref_face,
310 : : PointLoopList &boundary_point_loops,
311 : : double seg_length_tol);
312 : :
313 : : //! Get the points that approximate the curve, use the graphics facets.
314 : : static CubitStatus get_curve_facets( RefEdge* curve,
315 : : PointList &segments,
316 : : double seg_length_tol );
317 : :
318 : : //! Converts the loops of points to line segments. Can fail if it
319 : : //! can't determine the owner of the line segment. The refface may
320 : : //! be needed to help determine ownership.
321 : : static CubitStatus convert_to_lines(PointLoopList &boundary_point_loops,
322 : : SegLoopList &boundary_line_loops,
323 : : RefFace *ref_face );
324 : :
325 : : //! Prints a summary of all of the surface information.
326 : : //! min curve length, max adjacent curve ratios, min angle, max angle,
327 : : //! min area, max area, min hydraulic radius, min distance between loops,
328 : : //! min distance between a single loop.
329 : : static void print_surface_measure_summary( DLIList <RefFace*> &ref_faces );
330 : :
331 : : //! Prints summary of all the volume information, including the
332 : : //! information of the
333 : : //! surfaces in the volumes.
334 : : static void print_volume_measure_summary(DLIList <RefVolume*> &ref_volumes);
335 : :
336 : : //! Finds the max ratio of adjacent face areas (big face area
337 : : //! divided by small face area);
338 : : static void find_adjacent_face_ratios(RefVolume *curr_volume,
339 : : double &max_face_ratio,
340 : : RefFace *&big_face,
341 : : RefFace *&small_face);
342 : :
343 : : //! Finds narrow surfaces in the specified volumes.
344 : : static void find_narrow_faces(DLIList<RefVolume*> &ref_vols,
345 : : double small_curve_size,
346 : : DLIList<RefFace*> &narrow_faces,
347 : : DLIList<RefFace*> &surfs_to_ignore);
348 : :
349 : : //! Finds the closed, narrow surfaces in the specified volumes.
350 : : static void find_closed_narrow_faces( DLIList <RefVolume*> &ref_vols,
351 : : double tol,
352 : : DLIList <RefFace*> &face_list);
353 : :
354 : : static void get_narrow_regions(DLIList <RefVolume*> &ref_vols,
355 : : double tol,
356 : : DLIList <RefFace*> &surfs_with_narrow_regions);
357 : :
358 : : //! Finds the curves with lengths less than the given tol in specified volume.
359 : : static RefEdge* find_first_small_curve(RefVolume* vol,
360 : : double tol);
361 : :
362 : : //! Finds the curves with lengths less than the given tol.
363 : : static void find_small_curves( DLIList <RefVolume*> &ref_vols,
364 : : double tol,
365 : : DLIList <RefEdge*> &small_curves,
366 : : DLIList <double> &small_lengths);
367 : :
368 : : //! Finds the curves with lengths less than the given tol.
369 : : static void find_surfs_with_narrow_regions( DLIList <RefVolume*> &ref_vols,
370 : : double tol,
371 : : DLIList <RefFace*> &surfs_with_narrow_regions);
372 : :
373 : : //! Finds the faces with areas less than the given ammount.
374 : : static void find_small_faces( DLIList <RefVolume*> &ref_vols,
375 : : double tol,
376 : : DLIList <RefFace*> &small_faces);
377 : :
378 : : //! Finds the faces with hydraulic radii less than tol.
379 : : //! The hydraulic radus is defined by 4*(A/P) where
380 : : //! A is the area of the surface and P is the total perimiter
381 : : //! length around the surface.
382 : : //! Also finds the % surfaces that are planar. And finds
383 : : //! the % surfaces that are planar and conical.
384 : : //! This is based on the geometry type, not some actual measurement.
385 : : static void find_small_faces_hydraulic_radius( DLIList <RefVolume*> &ref_vols,
386 : : double tol,
387 : : DLIList <RefFace*> &small_faces,
388 : : DLIList <double> &small_hyd_rad,
389 : : double &percent_planar,
390 : : double &percent_pl_co);
391 : :
392 : : //! Finds the volumes with volumes less than tol.
393 : : static void find_small_volumes( DLIList <RefVolume*> &ref_vols,
394 : : double tol,
395 : : DLIList <RefVolume*> &small_volumes);
396 : :
397 : : //! Measures the hydraulic radii for the volumes by 6*(V/A) where
398 : : //! V is the volume of the volume and A is the total area of all
399 : : //! the volume's surfaces. Volumes with small hydraulic radii (compared
400 : : //! to tol) are stored in the small_volumes list.
401 : : static void find_small_volumes_hydraulic_radius( DLIList <RefVolume*> &ref_vols,
402 : : double tol,
403 : : DLIList <RefVolume*> &small_volumes,
404 : : DLIList <double> &small_hyd_rad);
405 : :
406 : : //! For each surface in the volume, find the interior angles
407 : : //! defined by the curves in the surfaces that are either below or
408 : : //! greater than the the upper and lower bounds. The angles
409 : : //! and therefor bounds, are tracked in degrees.
410 : : //! Curves that fit into these categories are stored pairwise in the
411 : : //! large or small edge_angles lists. The corresponding angle
412 : : //! measurements are stored in the respective small and large angles lists.
413 : : static void find_interior_curve_angles( RefVolume* ref_volume,
414 : : double upper_bound,
415 : : double lower_bound,
416 : : DLIList <RefEdge*> &large_edge_angles,
417 : : DLIList <RefEdge*> &small_edge_angles,
418 : : DLIList <double> &large_angles,
419 : : DLIList <double> &small_angles,
420 : : int &total_interior,
421 : : int &total_fuzzy);
422 : :
423 : : //! Find the tangential meetings in the volume.
424 : : //! This specifically looks for surfaces that meet tangentially
425 : : //! that would be a problem. Usually these are surfaces that
426 : : //! come into a side 180 degrees and on top there is a
427 : : //! sharpe angle. Usually if there isn't a sharpe curve
428 : : //! angle these meetings are not bad.
429 : : //! Note that this function assumes that you are passing
430 : : //! in sets of curve edges that have small interior angles between them.
431 : : //! It also assumes that the edge pairs are ordered as they would
432 : : //! be found in the surfaces (first edge then next edge).
433 : : //! Basically, call the funciton, find_interior_curve_angles
434 : : //! before calling this function, and pass this function those results.
435 : : static void find_sharp_tangential_meets( RefVolume *ref_volume,
436 : : DLIList <RefEdge*> &small_angle_edge_pairs,
437 : : DLIList <RefFace*> &tangential_surface_pairs );
438 : :
439 : : //! Finds the large and small angles or rather the surfaces on the volumes
440 : : //! that make them.
441 : : static void find_dihedral_angles( DLIList<RefVolume*> &ref_vols,
442 : : double upper_bound,
443 : : double lower_bound,
444 : : DLIList <RefFace*> &large_face_angles,
445 : : DLIList <RefFace*> &small_face_angles,
446 : : DLIList <double> &large_angles,
447 : : DLIList <double> &small_angles,
448 : : int &total_interior,
449 : : int &total_fuzzy,
450 : : int &total_not_flat);
451 : :
452 : :
453 : : //! Finds the surfaces that have big and small angles compared to the upper
454 : : //! and lower bounds (these should be in degrees...).
455 : : //! The faces that make these angles are paired (one after the other)
456 : : //! in the lists large and small angles.
457 : : static void find_dihedral_angles( RefVolume *curr_volume,
458 : : double lower_bound,
459 : : double upper_bound,
460 : : DLIList <RefFace*> &large_face_angles,
461 : : DLIList <RefFace*> &small_face_angles,
462 : : DLIList <double> &large_angles,
463 : : DLIList <double> &small_angles,
464 : : int &total_interior,
465 : : int &total_fuzzy,
466 : : int &total_not_flat);
467 : :
468 : : //! Finds the surfaces with multiple loops that have small, relative
469 : : //! to tol, distances between the loops.
470 : : //! Note that all the lists are syncronized to be connected.
471 : : //! The pairs of close edges with the small_lengths and
472 : : //! the surfaces that they are on. The close_loop_faces list
473 : : //! may not contain distinct instances of faces, as they
474 : : //! may be repeated. Note that this will only find the
475 : : //! closest edge pair, within tol, for each loop.
476 : : static void find_close_loops(DLIList <RefVolume*> &ref_vols,
477 : : DLIList <RefEdge*> &close_edges,
478 : : DLIList <RefFace*> &close_loop_faces,
479 : : DLIList <double> &small_lengths,
480 : : double tol);
481 : :
482 : : //! Finds the edges of the loops that are within some tol. The
483 : : //! edges are stored in successive pairs in close_edges while
484 : : //! the actual distances are stored in the small_lengths list.
485 : : //! These lists are syncronized (and are assumed to be empty upon
486 : : //! entrance to the function).
487 : : static void find_close_loops(RefFace *face,
488 : : DLIList <RefEdge*> &close_edges,
489 : : DLIList <double> &small_lengths,
490 : : double tol);
491 : :
492 : : //! Measures the area of the curr_face. Uses
493 : : //! the GeomDataObserver class to cache the area on the face.
494 : : //! After calling this function, curr_face will have
495 : : //! a GeomDataObserver observing it. It will get removed if
496 : : //! the surface is altered or changed.
497 : : static double measure_area(RefFace* curr_face);
498 : :
499 : : //! This function simply gets the bad entities of the volume. This
500 : : //! assumes the volume is from some solid modelar where this function
501 : : //! is defined. If not, it will just be empty...
502 : : static void find_bad_geometry(RefVolume *volume,
503 : : DLIList <RefEntity*> &bad_ents);
504 : :
505 : : //@{
506 : : //! Find the irregular vertex valences.
507 : : //! Find things like vertices with valences greater than 4.
508 : : //! Assume for now that the volumes are not merged..
509 : : static void find_irregular_valence( DLIList <RefVolume*> &ref_volumes,
510 : : DLIList <RefVertex*> &irregular_vertices);
511 : : static void find_irregular_valence( RefVolume* ref_volume,
512 : : DLIList <RefVertex*> &irregular_vertices);
513 : : //@}
514 : :
515 : : //! Find fillets and rounds.
516 : : //!
517 : : //! ====IMPORTANT====
518 : : //! Calling functions BEWARE, YOU MUST DELETE THE LISTS OF
519 : : //! BLEND SURFACES IN THE BLEND GROUPS AFTER CALLING THIS FUNCTION!!!!
520 : : //! ====IMPORTANT====
521 : : static void find_blends( RefVolume *ref_volume,
522 : : DLIList <RefFace*> &blend_faces,
523 : : DLIList<DLIList<RefFace*>*> &blend_groups);
524 : :
525 : : //! Determines if a face is a blend surface, returns the
526 : : //! ref_edge on one side of the blend and other_edge on
527 : : //! the opposite side. For this type of blend, only ref_edge
528 : : //! must be tangentially meeting with another surface.
529 : : //! Other_edge must be oriented orthogonally to it and may
530 : : //! or may not blend with another surface. This assumes a
531 : : //! rectangular blend surface, without holes.
532 : : static CubitBoolean is_face_blend(RefFace *ref_face,
533 : : RefVolume *ref_volume,
534 : : RefEdge *&ref_edge,
535 : : RefEdge *&other_edge);
536 : :
537 : : //! Determines if a face is a vertex blend surface. It
538 : : //! assumes that a vertex blend will be tangent to all
539 : : //! adjoining surfaces and that the curvatures will be
540 : : //! shared at the edges.
541 : : static CubitBoolean is_vertex_blend(RefFace *ref_face,
542 : : RefVolume *ref_volume);
543 : :
544 : : //! Given a starting blend surface find a chain of blends from
545 : : //! that surface.
546 : : //!
547 : : //! Note that this function intentionally does _not_
548 : : //! clear the blend_face list so that additional chains can be added.
549 : : static CubitStatus find_blend_chains( RefFace *start_face,
550 : : std::vector<std::vector< RefFace*> > &blend_chains);
551 : :
552 : : //! should this one be private?
553 : : //! Given a blend surface and one of the cross curves, find the
554 : : //! blends connected along the edge in the one direction.
555 : : static void find_blends_from_edge( RefVolume* ref_volume,
556 : : RefFace *start_face,
557 : : RefEdge* start_edge,
558 : : std::vector <RefFace*> &blend_faces);
559 : :
560 : : //! Takes the area-weighted average of all display facet
561 : : //! centroids and updates the passed in CubitVector to be
562 : : //! that location. Also updates the tot_area variable to
563 : : //! give the total facet area for the passed in ref_face.
564 : : static CubitStatus get_centroid( RefFace *ref_face,
565 : : CubitVector ¢roid, double &tot_area );
566 : :
567 : : //! Finds averge center of specified surfaces.
568 : : static CubitStatus center( DLIList<RefFace*> ref_faces );
569 : :
570 : : //! Finds the 'n' closest vertex-vertex pairs and their distances apart.
571 : : static CubitStatus find_closest_vertex_vertex_pairs(
572 : : DLIList<RefVolume*> &vol_list,
573 : : int &num_to_return,
574 : : DLIList<RefVertex*> &vert_list1,
575 : : DLIList<RefVertex*> &vert_list2,
576 : : DLIList<double> &distances);
577 : :
578 : : //! Finds the 'n' closest vertex-curve pairs and their distances apart.
579 : : static CubitStatus find_closest_vertex_curve_pairs(
580 : : DLIList<RefVolume*> &vol_list,
581 : : int &num_to_return,
582 : : DLIList<RefVertex*> &vert_list,
583 : : DLIList<RefEdge*> &curve_list,
584 : : DLIList<double> &distances);
585 : :
586 : : //! Finds coincident vertex-vertex pairs where each vertex is in a separate volume.
587 : : //! The two vertices in a vertex-vertex pairs are within high_tol of each other.
588 : : static CubitStatus find_near_coincident_vertices_unique(
589 : : DLIList<RefVolume*> &ref_volumes,
590 : : double high_tol,
591 : : std::map <RefVertex*, DLIList<dist_vert_struct*>*> &vert_dist_map);
592 : :
593 : : //! Finds coincident vertex-vertex pairs where the vertices in the pair are
594 : : //! between low_tol and high_tol of one another.
595 : : static CubitStatus find_near_coincident_vertices(
596 : : DLIList<RefVolume*> &ref_volumes,
597 : : DLIList<RefVertex*> &ref_vertices_out,
598 : : DLIList<double> &distances,
599 : : double low_tol,
600 : : double high_tol,
601 : : bool filter_same_volume_cases = false);
602 : :
603 : : //! Finds coincident vertex-curve pairs where with distance between the
604 : : //! vertex and curve is greater than low_tol but less than high_tol.
605 : : static CubitStatus find_near_coincident_vertex_curve_pairs(
606 : : DLIList<RefVolume*> &ref_vols,
607 : : DLIList<RefEdge*> &ref_edges,
608 : : DLIList<RefVertex*> &ref_verts,
609 : : DLIList<double> &distances,
610 : : double low_tol,
611 : : double high_tol,
612 : : bool filter_same_volume_cases = false);
613 : :
614 : : //! Finds coincident vertex-surface pairs where with distance between the
615 : : //! vertex and surface is greater than low_tol but less than high_tol.
616 : : static CubitStatus find_near_coincident_vertex_surface_pairs(
617 : : DLIList<RefVolume*> &ref_vols,
618 : : DLIList<RefFace*> &ref_faces,
619 : : DLIList<RefVertex*> &ref_verts,
620 : : DLIList<double> &distances,
621 : : double low_tol,
622 : : double high_tol,
623 : : bool filter_same_volume_cases = false);
624 : :
625 : : };
626 : : #endif
627 : :
|