root/cgm/cgm_apps/ccapi/geom/RefFace_ccapi.cpp @ 1040

Revision 1040, 30.2 KB (checked in by tautges, 2 years ago)

Version 10.2 of cgm.

Line 
1/**
2 * \file RefFace_ccapi.cpp
3 *
4 * \brief C api to classes in RefFace class
5 *
6 * \author Tim Tautges
7 *
8 * \date 7/2000
9 *
10 */
11
12#include "RefFace_ccapi.h"
13#include "RefFace.hpp"
14#include "CubitDefines.h"
15#include "DLLoopList.hpp"
16#include "DLCoEdgeLoopList.hpp"
17#include "DLRefEdgeLoopList.hpp"
18#include "DLRefVertLoopList.hpp"
19#include "DLCoFaceList.hpp"
20#include "DLRefVertexList.hpp"
21#include "DLRefEdgeList.hpp"
22#include "DLRefVolumeList.hpp"
23#include "DLCubitFacetList.hpp"
24#include "copy_defines.h"
25
26    /* topology */
27
28  CubitStatus RefFace_get_co_faces(void *this_ref_face,  /* DLCoFaceList& */ void ***co_faces_found_list, int *co_faces_found_list_size,
29                                     /* RefVolume * */ void *input_ref_volume_ptr )
30{
31  RefFace *temp_ref_face = (RefFace *) this_ref_face;
32  RefVolume *temp_input_ref_volume_ptr = (RefVolume *) input_ref_volume_ptr;
33
34  DLCoFaceList temp_list;
35
36  CubitStatus status = temp_ref_face->get_co_faces(temp_list, temp_input_ref_volume_ptr);
37  COPY_LIST_TO_ARRAY(temp_list, *co_faces_found_list, *co_faces_found_list_size);
38
39  return status; 
40}
41    //R CubitStatus
42    //R- CubitSuccess/CubitFailure
43    //O co_faces_found_list
44    //O-Populates the co_faces_found_list with the CoFaces that are
45    //-associated with this RefFace.  Because the input RefVolume is sent
46    //-in it fills the list just with the CoFaces that are associated with
47    //-this RefVolume.  Note that usually there will be only one CoFace with
48    //-the RefVolume but with HardSurfaces there may be more (2).
49
50  CubitStatus RefFace_ordered_loops(void *this_ref_face,  /* DLLoopList& */ void ***loop_list, int *loop_list_size )
51{
52  RefFace *temp_ref_face = (RefFace *) this_ref_face;
53
54  DLLoopList temp_list;
55
56  CubitStatus status = temp_ref_face->ordered_loops(temp_list);
57  COPY_LIST_TO_ARRAY(temp_list, *loop_list, *loop_list_size);
58
59  return status; 
60}
61    //- Gets the loops in order from outside to inside.
62    //- This function is used for all the loop extracting from the refface,
63    //- i.e., nodes, ref-edges, ref-vertices.  This function orders the
64    //- loops based on the angle metric calculation.  I believe this metric
65    //- is actually currently calculated in AcisGeometryEngine but I see
66    //- no reason that it should be done there.  I believe it could be
67    //- done in the Loop class.
68
69  int RefFace_co_edge_loops (void *this_ref_face,  /* DLCoEdgeLoopList& */ void ***co_edge_loops, int *co_edge_loops_size )
70{
71  RefFace *temp_ref_face = (RefFace *) this_ref_face;
72
73  DLCoEdgeLoopList temp_list;
74
75  int status = temp_ref_face->co_edge_loops(temp_list);
76  COPY_LIST_TO_ARRAY(temp_list, *co_edge_loops, *co_edge_loops_size);
77
78  return status; 
79}
80    //- Returns a list of lists.  Each of the included lists contains a list
81    //- of CoEdges and represents an ordered list of CoEdges associated
82    //- with each of the Loops of this RefFace.
83 
84  int RefFace_ref_edge_loops (void *this_ref_face,  /* DLRefEdgeLoopList& */ void ***ref_edge_loops, int *ref_edge_loops_size )
85{
86  RefFace *temp_ref_face = (RefFace *) this_ref_face;
87
88  DLRefEdgeLoopList temp_list;
89
90  int status = temp_ref_face->ref_edge_loops(temp_list);
91  COPY_LIST_TO_ARRAY(temp_list, *ref_edge_loops, *ref_edge_loops_size);
92
93  return status; 
94}
95    //- Returns a list of lists.  Each of the included lists contains a list
96    //- of RefEdges and represents an ordered list of RefEdges associated
97    //- with each of the Loops of this RefFace.
98    //- NOTE: All of the ref_edge_lists in ref_edge_loops will
99    //-       need to be deleted by the *calling* function. 
100 
101  void RefFace_ref_vertex_loops(void *this_ref_face,  /* DLRefVertLoopList& */ void ***ref_vert_loop_list, int *ref_vert_loop_list_size)
102{
103  RefFace *temp_ref_face = (RefFace *) this_ref_face;
104
105  DLRefVertLoopList temp_list;
106
107  temp_ref_face->ref_vertex_loops(temp_list);
108  COPY_LIST_TO_ARRAY(temp_list, *ref_vert_loop_list, *ref_vert_loop_list_size);
109}
110    //- Returns a list of lists.  Each of the included lists contains a list
111    //- of RefVertex'es and represents an ordered list of RefVertex'es
112    //- associated with each of the Loops of this RefFace. 
113    //- NOTE: All of the ref_vertex_lists in the ref_vert_loop_list will
114    //-       need to be deleted by the *calling* function.
115 
116  int RefFace_number_of_Loops (void *this_ref_face)
117{
118  RefFace *temp_ref_face = (RefFace *) this_ref_face;
119
120  return temp_ref_face->number_of_Loops();
121}
122    //- Returns the number of Loops associated with this RefFace
123 
124 
125    /* RefVolume* */ void *RefFace_ref_volume(void *this_ref_face)
126{
127  RefFace *temp_ref_face = (RefFace *) this_ref_face;
128
129  return temp_ref_face->ref_volume();
130}
131    //- Return the first RefVolume pointer to the volume which owns
132    //- this RefFace
133    //- Note: There may be more than one RefVolume that owns this RefFace.
134    //-       This method just gets the first in the list.
135
136  void RefFace_hard_points(void *this_ref_face,  /* DLRefVertexList& */ void ***new_hard_point_list, int *new_hard_point_list_size )
137{
138  RefFace *temp_ref_face = (RefFace *) this_ref_face;
139
140  DLRefVertexList temp_list;
141 
142  temp_ref_face->hard_points(temp_list);
143  COPY_LIST_TO_ARRAY(temp_list, *new_hard_point_list, *new_hard_point_list_size);
144}
145    //- Populate the input DLRefVertexList with the list of hard points
146    //- that are defined for this RefFace
147 
148  int RefFace_adjoins (void *this_ref_face,  /* RefFace* */ void *input_face_ptr )
149{
150  RefFace *temp_ref_face = (RefFace *) this_ref_face;
151
152  RefFace *temp_input_face_ptr = (RefFace *) input_face_ptr;
153 
154  return temp_ref_face->adjoins(temp_input_face_ptr);
155}
156    //- Returns CUBIT_TRUE if this RefFace adjoins (is connected via a RefEdge)
157    //- the input RefFace
158 
159/* RefEdge* */ void *RefFace_common_ref_edge (void *this_ref_face,  /* RefFace* */ void *input_face_ptr )
160{
161  RefFace *temp_ref_face = (RefFace *) this_ref_face;
162
163  RefFace *temp_input_face_ptr = (RefFace *) input_face_ptr;
164 
165  return temp_ref_face->common_ref_edge(temp_input_face_ptr);
166}
167    //- Returns a common RefEdge* if this RefFace shares one with the
168    //- input RefFace
169
170  EntityType RefFace_get_grouping_entity_type(void *) 
171{ return Loop_TYPE;}
172    //R EntityType
173    //R- The type of the corresponding GroupingEntity type.
174    //- This function returns the type of the corresponding
175    //- GroupingEntity .
176 
177  EntityType RefFace_get_sense_entity_type(void *) 
178{ return CoFace_TYPE;}
179    //R EntityType
180    //R- The type of SenseEntity associated with this object
181    //- This function returns the type of SenseEntity associated with
182    //- this BasicTopologyEntity.
183 
184  EntityType RefFace_get_child_ref_entity_type(void *) 
185{ return RefEdge_TYPE;}
186    //R EntityType
187    //R- A type value.
188    //- This function returns the type of the child RefEntity of 
189    //- RefFace, which is the type value of the RefEdge class.
190 
191  EntityType RefFace_get_parent_ref_entity_type(void *) 
192{ return RefVolume_TYPE;}
193    //R EntityType
194    //R- A type value.
195    //- This function returns the type of the parent RefEntity of 
196    //- RefFace, which is the type value of the RefVolume class.
197 
198  EntityType RefFace_get_topology_bridge_type(void *) 
199{ return Surface_TYPE;}
200    //R EntityType
201    //R- The type of GeometryEntity associated with this object
202    //- This function returns the type of GeometryEntity associated with
203    //- this BasicTopologyEntity.
204
205/* CoFace* */ void *RefFace_get_matching_CoFace(void *this_ref_face, /* RefVolume* */ void *ref_volume_ptr)
206{
207  RefFace *temp_ref_face = (RefFace *) this_ref_face;
208
209  RefVolume *temp_ref_volume_ptr = (RefVolume *) ref_volume_ptr;
210 
211  return temp_ref_face->get_matching_CoFace(temp_ref_volume_ptr);
212}
213    //R CoFace*
214    //R- Returned CoFace pointer
215    //I ref_volume_ptr
216    //I- The RefVolume to which matching is done.
217    //- This function returns the CoFace that is associated with both "this"
218    //- RefFace as well as with the input RefVolume.  The function is useful
219    //- when a merge operation has resulted in a RefFace that is shared by
220    //- more than 1 RefVolume (most often, two). In this case, the RefFace
221    //- would be associated with more than one CoFace, each belonging to a
222    //- different RefVolume.
223    //- If there is no match (i.e., this RefFace is not associated with the
224    //- input RefVolume) then a NULL pointer is returned.
225 
226    /*  geometry */
227
228  CubitVectorStruct RefFace_center_point(void *this_ref_face)
229{
230  RefFace *temp_ref_face = (RefFace *) this_ref_face;
231
232  return temp_ref_face->center_point();
233}
234    //- Return the approximate (spatial) center of this RefFace
235 
236  CubitSense RefFace_sense_1(void *this_ref_face, /* RefVolume* */ void *volume)
237{
238  RefFace *temp_ref_face = (RefFace *) this_ref_face;
239
240  RefVolume *temp_volume = (RefVolume *) volume;
241 
242  return temp_ref_face->sense(temp_volume);
243}
244    //-Determines the sense of "this" with respect to the passed-in volume.
245               
246  CubitSense RefFace_sense_2(void *this_ref_face, /* RefFace* */ void *face_ptr)
247{
248  RefFace *temp_ref_face = (RefFace *) this_ref_face;
249
250  RefFace *temp_face_ptr = (RefFace *) face_ptr;
251 
252  return temp_ref_face->sense(temp_face_ptr);
253}
254    //-Determine the relative sense of the passed face with respect to
255    //-this face using the senses of common RefEdges.  i.e. if
256    //-CUBIT_REVERSED is returned, than the sense of the passed face
257    //-should be the opposite of that of this face with respect to
258    //-any volume.  CUBIT_UNKNOWN is returned if there are no
259    //-common RefEdges between RefFaces or there is more than one
260    //-common RefEdge.
261
262  CubitSense RefFace_get_geometry_sense(void *this_ref_face)
263{
264  RefFace *temp_ref_face = (RefFace *) this_ref_face;
265
266  return temp_ref_face->get_geometry_sense();
267}
268    //- Gets the sense of the reface with respect to the underlying
269    //- geometry engines representation of the surface.
270
271  CubitBoolean RefFace_about_spatially_equal (void *this_ref_face,  /* RefFace* */ void *ref_face_ptr_2,
272                                              double tolerance_factor,
273                                              CubitBoolean notify_refEntity,
274                                              CubitBoolean test_bbox,
275                                              int test_internal,
276                                              CubitBoolean force_merge)
277{
278  RefFace *temp_ref_face = (RefFace *) this_ref_face;
279
280  RefFace *temp_ref_face_ptr_2 = (RefFace *) ref_face_ptr_2;
281 
282  return temp_ref_face->about_spatially_equal(temp_ref_face_ptr_2, tolerance_factor, notify_refEntity,
283                                              test_bbox, test_internal, force_merge);
284}
285 
286    //R CubitBoolean
287    //R-CUBIT_TRUE/CUBIT_FALSE
288    //I RefFace*, double, CubitBoolean
289    //I- Second RefFace to compare, Tolerance factor to for GEOMETRY_RESABS,
290    //I- and flag for notifying compared RefEntities.
291    //O CubitBoolean
292    //O- If the two RefFaces are spatially equal within the GEOMETRY_RESABS*
293    //- the tolerance_factor, then CUBIT_TRUE will be returned.  Otherwise
294    //- CUBIT_FALSE is returned.
295    //- The comparison is done by first checking the bounding boxes of the
296    //- RefFaces.  If this test is passed then the ref_edges of each face
297    //- are looped through and compared.  A bounding box check for each
298    //- edge is also done first before a comparison, for speed.
299 
300  CubitSense RefFace_compare_alignment(void *this_ref_face,  /* RefFace* */ void *second_ref_face_ptr )
301{
302  RefFace *temp_ref_face = (RefFace *) this_ref_face;
303
304  RefFace *temp_second_ref_face_ptr = (RefFace *) second_ref_face_ptr;
305 
306  return temp_ref_face->compare_alignment(temp_second_ref_face_ptr);
307}
308    //R CubitSense
309    //R- Sense of this reface with respect to the second one passed in.
310    //I RefFace *
311    //I- pointer to second ref face with which the alignment is compared.
312    //- This function will compare the sense of the two ref-faces, or
313    //- rather their normals.
314    //- NOTE: It is ASSUMED that BOTH reffaces are SPATIALLY EQUAL.
315    //- If this is not followed this could explode.
316 
317
318  CubitVectorStruct RefFace_normal_at(void *this_ref_face, const CubitVectorStruct location, /* RefVolume* */ void *volume)
319{
320  RefFace *temp_ref_face = (RefFace *) this_ref_face;
321
322  RefVolume *temp_volume = (RefVolume *) volume;
323 
324  return temp_ref_face->normal_at(location, temp_volume);
325}
326    //- Calculate normal for input location (optional input RefVolume to
327    //- allow for feature consolidation).
328    //- Note that the input location is modified to the coordinates
329    //- of the closest point on the surface.
330    //-
331    //- MJP NOTE:
332    //- In the previous implementation, the result of this function call
333    //- would not only be the returned unit vector which is the normal
334    //- at the location, but the function would also fill in the myPosition
335    //- and myParametricPosition data members of RefFace.  These data
336    //- members have been removed in this implementation of RefFace.
337    //- However, the Surface::normal_at function that gets called returns
338    //- an additional parameter which is the location on the underlying
339    //- surface that is closest to the input location.
340  void RefFace_reverse_normal(void *this_ref_face)
341{
342  RefFace *temp_ref_face = (RefFace *) this_ref_face;
343
344  temp_ref_face->reverse_normal();
345}
346    //- switch the sense of this face with respect to the underlying
347    //- geometry, so that all normals point in the opposite
348    //- direction. The orientation of quads on the surface are switched
349    //- to agree with this normal.
350
351//========  Change Code by DZ of Cat,  on 10/29/98 8:46:59 AM  ========
352  CubitBoolean RefFace_set_outward_normal(void *this_ref_face, /* RefVolume * */ void *volume )
353{
354  RefFace *temp_ref_face = (RefFace *) this_ref_face;
355
356  RefVolume *temp_volume = (RefVolume *) volume;
357 
358  return temp_ref_face->set_outward_normal(temp_volume);
359}
360    //- Set the normal of this face to point outward wrt to given volume.
361    //- Assumes there is only one coface of the volume for this RefFace.
362    //- Uses the above "reverse_normal" function.
363    //- return true only if reverse_normal function called.
364//========  Change End by DZ of Cat,  on 10/29/98 8:46:59 AM  ========
365
366  void RefFace_move_to_surface (void *this_ref_face,  /* CubitVector& */ CubitVectorStruct *location, LocalStart start)
367{
368  RefFace *temp_ref_face = (RefFace *) this_ref_face;
369
370  CubitVector temp_location = *location;
371 
372  temp_ref_face->move_to_surface(temp_location, start);
373
374  *location = temp_location;
375}
376    //- Moves the given node back onto its surface
377 
378  void RefFace_find_closest_point_trimmed(void *this_ref_face, CubitVectorStruct from_point, 
379                                            /* CubitVector& */ CubitVectorStruct *point_on_surface)
380{
381  RefFace *temp_ref_face = (RefFace *) this_ref_face;
382
383  CubitVector temp_point_on_surface = *point_on_surface;
384 
385  temp_ref_face->find_closest_point_trimmed(from_point, temp_point_on_surface);
386
387  *point_on_surface = temp_point_on_surface;
388}
389    //R void
390    //I CubitVector
391    //I- point from which to find closest point on trimmed surface
392    //O CubitVector
393    //O- point on trimmed surface closest to passed-in point
394    //- This function finds the closest point on a TRIMMED surface to the
395    //- passed-in point. 
396 
397  CubitStatus RefFace_get_principal_curvatures(void *this_ref_face,  const CubitVectorStruct point,
398                                                 /* double& */ double *curvature1,
399                                                 /* double& */ double *curvature2,
400                                                 /* RefVolume* */ void *ref_volume_ptr)
401{
402  RefFace *temp_ref_face = (RefFace *) this_ref_face;
403
404  CubitVector temp_point = point;
405
406  RefVolume *temp_ref_volume_ptr = (RefVolume *) ref_volume_ptr;
407 
408  return temp_ref_face->get_principal_curvatures(temp_point, *curvature1, *curvature2, temp_ref_volume_ptr);
409}
410    //R CubitStatus
411    //R- CUBIT_SUCCESS/FAILURE
412    //I point
413    //I- Input location. The coordinates of this input point are
414    //I- modified to those of the point closest to this one, on the
415    //I- surface of this RefFace.
416    //O curvature1/curvature2
417    //O- Output principal curvature values.
418    //I ref_volume_ptr
419    //I- Input RefVolume pointer
420    //- This function first computes the point on the surface closest to the
421    //- input point and sets the values of "point" to this closest
422    //- location.  Then, the principal curvatures of the surface at this
423    //- new point are computed and returned. If the input RefVolume pointer
424    //- is not NULL, it is used when computing the curvatures.
425 
426  CubitVectorStruct RefFace_position_from_u_v (void *this_ref_face, double u, double v)
427{
428  RefFace *temp_ref_face = (RefFace *) this_ref_face;
429
430  return temp_ref_face->position_from_u_v(u, v);
431}
432    //- Return a CubitVector (representing a position vector corresponding
433    //- to the input point in {u,v} space
434 
435  CubitStatus RefFace_u_v_from_position (void *this_ref_face, const CubitVectorStruct location,
436                                           /* double& */ double *u, 
437                                           /* double& */ double *v,
438                                           /* CubitVector* */ CubitVectorStruct *closest_location)
439{
440  RefFace *temp_ref_face = (RefFace *) this_ref_face;
441
442  CubitVector temp_location(location);
443
444  CubitVector *temp_closest_location =
445    (closest_location ? new CubitVector(*closest_location) : NULL);
446   
447  CubitStatus status = temp_ref_face->u_v_from_position(temp_location, *u, *v, temp_closest_location);
448
449  if (temp_closest_location != NULL) {
450    *closest_location = *temp_closest_location;
451    delete temp_closest_location;
452  }
453
454  return status;
455}
456    //R CubitStatus
457    //R- CUBIT_SUCCESS/FAILURE
458    //I location
459    //I- The input point in global space
460    //O u, v
461    //O- The returned u, v coordinate values (in local parametric space)
462    //O- of the closest_point
463    //O closest_location
464    //O- The point on the Surface closest to the input location
465    //I refvolume_ptr
466    //I- The reference RefVolume with respect to which, the normal
467    //I- is to be computed.  If the pointer is NULL, then the
468    //I- first underlying solid model entity is used to compute the
469    //I- normal.
470    //- This function returns the {u, v} coordinates of the point
471    //- on the Surface closest to the input point (specified in global
472    //- space). The closest_location is also returned.
473 
474  CubitBoolean RefFace_is_parametric(void *this_ref_face)
475{
476  RefFace *temp_ref_face = (RefFace *) this_ref_face;
477
478  return temp_ref_face->is_parametric();
479}
480    //R CubitBoolean
481    //R- CUBIT_TRUE/CUBIT_FALSE
482    //- This function determines whether the underlying geometry of the
483    //- Surface is parametrically defined or not.  Returns CUBIT_TRUE if
484    //- it is and CUBIT_FALSE if it is not.
485 
486  CubitBoolean RefFace_get_param_range_U(void *this_ref_face,  /* double& */ double *lower_bound,
487                                           /* double& */ double *upper_bound )
488{
489  RefFace *temp_ref_face = (RefFace *) this_ref_face;
490
491  return temp_ref_face->get_param_range_U(*lower_bound, *upper_bound);
492}
493    //R CubitBoolean
494    //R- CUBIT_TRUE/CUBIT_FALSE
495    //O lower_bound
496    //O- The lower bound of the parametric range in the U direction.
497    //O- This is set to 0.0 if the surface is not parametric.
498    //O upper_bound
499    //O- The upper bound of the parametric range in the U direction.
500    //O- This is set to 0.0 if the surface is not parametric.
501    //- Returns the lower and upper parametric bounds of the
502    //- surface in U, if it is parametric.  Otherwise, it returns
503    //- CUBIT_FALSE and zeroes for the upper and lower parametric
504    //- bounds.
505 
506  CubitBoolean RefFace_get_param_range_V(void *this_ref_face,  /* double& */ double *lower_bound,
507                                           /* double& */ double *upper_bound )
508{
509  RefFace *temp_ref_face = (RefFace *) this_ref_face;
510
511  return temp_ref_face->get_param_range_V(*lower_bound, *upper_bound);
512}
513    //R CubitBoolean
514    //R- CUBIT_TRUE/CUBIT_FALSE
515    //O lower_bound
516    //O- The lower bound of the parametric range in the V direction.
517    //O- This is set to 0.0 if the surface is not parametric.
518    //O upper_bound
519    //O- The upper bound of the parametric range in the V direction.
520    //O- This is set to 0.0 if the surface is not parametric.
521    //- Returns the lower and upper parametric bounds of the
522    //- surface in V, if it is parametric.  Otherwise, it returns
523    //- CUBIT_FALSE and zeroes for the upper and lower parametric
524    //- bounds.
525 
526  CubitBoolean RefFace_is_periodic(void *this_ref_face)
527{
528  RefFace *temp_ref_face = (RefFace *) this_ref_face;
529
530  return temp_ref_face->is_periodic();
531}
532    //R CubitBoolean
533    //R- CUBIT_TRUE/CUBIT_FALSE
534    //- This function determines whether the underlying geometry of the
535    //- Surface is periodic or not.  Returns CUBIT_TRUE if it is and
536    //- CUBIT_FALSE if it is not.
537 
538  CubitBoolean RefFace_is_periodic_in_U(void *this_ref_face,  /* double& */ double *period )
539{
540  RefFace *temp_ref_face = (RefFace *) this_ref_face;
541
542  return temp_ref_face->is_periodic_in_U(*period);
543}
544    //R CubitBoolean
545    //R- CUBIT_TRUE/CUBIT_FALSE
546    //O period
547    //O- The value of the period in the U direction.
548    //- Determines whether the surface object is
549    //- periodic in the U direction or not.  If it is, it
550    //- returns CUBIT_TRUE and the value of the period. Otherwise,
551    //- it returns CUBIT_FALSE and a value of 0.0 or the period.
552 
553  CubitBoolean RefFace_is_periodic_in_V(void *this_ref_face,  /* double& */ double *period )
554{
555  RefFace *temp_ref_face = (RefFace *) this_ref_face;
556
557  return temp_ref_face->is_periodic_in_V(*period);
558}
559    //R CubitBoolean
560    //R- CUBIT_TRUE/CUBIT_FALSE
561    //O period
562    //O- The value of the period in the V direction.
563    //- Determines whether the surface object is
564    //- periodic in the V direction or not.  If it is, it
565    //- returns CUBIT_TRUE and the value of the period. Otherwise,
566    //- it returns CUBIT_FALSE and a value of 0.0 or the period.
567
568  CubitBoolean RefFace_is_singular_in_U(void *this_ref_face,  double u_param )
569{
570  RefFace *temp_ref_face = (RefFace *) this_ref_face;
571
572  return temp_ref_face->is_singular_in_U(u_param);
573}
574  CubitBoolean RefFace_is_singular_in_V(void *this_ref_face,  double v_param )
575{
576  RefFace *temp_ref_face = (RefFace *) this_ref_face;
577
578  return temp_ref_face->is_singular_in_V(v_param);
579}
580    //R CubitBoolean
581    //R- CUBIT_TRUE/CUBIT_FALSE
582    //I double u/v parameter value.
583    //- Determines if the surface is singular in a given direction
584    //- at a given parameter value.
585
586  CubitBoolean RefFace_is_closed_in_U(void *this_ref_face)
587{
588  RefFace *temp_ref_face = (RefFace *) this_ref_face;
589
590  return temp_ref_face->is_closed_in_U();
591}
592  CubitBoolean RefFace_is_closed_in_V(void *this_ref_face)
593{
594  RefFace *temp_ref_face = (RefFace *) this_ref_face;
595
596  return temp_ref_face->is_closed_in_V();
597}
598    //R CubitBoolean
599    //R- CUBIT_TRUE/CUBIT_FALSE
600    //- Determines if the surface is closed, smoothly or not in the
601    //- given parameter direction.
602    //- A periodic surface is always closed but a closed surface is
603    //- is not always periodic.
604
605  CubitStatus RefFace_uv_derivitives(void *this_ref_face,  double u_param,
606                                     double v_param,
607                                       /* CubitVector & */ CubitVectorStruct *du,
608                                       /* CubitVector & */ CubitVectorStruct *dv )
609{
610  RefFace *temp_ref_face = (RefFace *) this_ref_face;
611
612  CubitVector temp_du, temp_dv;
613 
614  CubitStatus status = temp_ref_face->uv_derivitives(u_param, v_param, temp_du, temp_dv);
615
616  *du = temp_du;
617  *dv = temp_dv;
618
619  return status;
620}
621    //R CubitStatus
622    //R- CUBIT_SUCCESS/CUBIT_FAILURE
623    //O- du, dv
624    //- Determines the u and v derivitives from the given parameter
625    //- values.
626
627  int RefFace_dimension(void *this_ref_face)
628{
629  RefFace *temp_ref_face = (RefFace *) this_ref_face;
630
631  return temp_ref_face->dimension();
632}
633    //- Returns the geometric dimension of RefFace entities.
634
635  double RefFace_area(void *this_ref_face)
636{
637  RefFace *temp_ref_face = (RefFace *) this_ref_face;
638
639  return temp_ref_face->area();
640}
641    //- get the area of the underlying surface
642
643  double RefFace_measure(void *this_ref_face)
644{
645  RefFace *temp_ref_face = (RefFace *) this_ref_face;
646
647  return temp_ref_face->measure();
648}
649    /* CubitString */ const char *RefFace_measure_label(void *this_ref_face)
650{
651  RefFace *temp_ref_face = (RefFace *) this_ref_face;
652
653  return temp_ref_face->measure_label().c_str();
654}
655 
656  CubitBoolean RefFace_is_planar(void *this_ref_face)
657{
658  RefFace *temp_ref_face = (RefFace *) this_ref_face;
659
660  return temp_ref_face->is_planar();
661}
662    //R CubitBoolean
663    //R CUBIT_TRUE/CUBIT_FALSE
664    //- This function returns CUBIT_TRUE if the underlying geometry
665    //- of the face is planar. CUBIT_FALSE otherwise.
666
667  CubitStatus RefFace_get_point_normal(void *this_ref_face,  /* CubitVector& */ CubitVectorStruct *origin, /* CubitVector& */ CubitVectorStruct *normal )
668{
669  RefFace *temp_ref_face = (RefFace *) this_ref_face;
670
671  CubitVector temp_origin, temp_normal;
672 
673  CubitStatus status = temp_ref_face->get_point_normal(temp_origin, temp_normal);
674
675  *origin = temp_origin;
676
677  *normal = temp_normal;
678
679  return status;
680}
681    //- Only valid for planar surfaces
682    //- Finds the underlying plane's origin and normal (unit) vector
683    //- Returns CUBIT_FAILURE if surface is not a plane
684 
685  int RefFace_validate(void *this_ref_face)
686{
687  RefFace *temp_ref_face = (RefFace *) this_ref_face;
688
689  return temp_ref_face->validate();
690}
691    //- Check that entity is valid. Returns number of problems detected.
692
693  double RefFace_get_crack_length(void *this_ref_face)
694{
695  RefFace *temp_ref_face = (RefFace *) this_ref_face;
696
697  return temp_ref_face->get_crack_length();
698}
699    //- return the length of the periodic crack, or 0.0 if non-periodic.
700
701    /* geometry modification */
702
703  void RefFace_add_hard_point(void *this_ref_face,  double x, double y, double z )
704{
705  RefFace *temp_ref_face = (RefFace *) this_ref_face;
706
707  temp_ref_face->add_hard_point(x, y, z);
708}
709    //- Add a hard point to this RefFace.  The input "point" is first
710    //- moved to the underlying surface, and then a hard point is added
711    //- at this, possibly different, location on the surface.
712    //-***************************************************************
713    //- MJP Note:
714    //- Currently, the new RefVertex that is created is NOT PART OF THE
715    //- main DAG datastructure. The new RefVertex, however, has its
716    //- own little mini-DAG which consists of a single CDODAGNode.
717    //- Discuss this with the team before making it a part of the main DAG.
718    //- It is, however, deleted appropriately when the RefFace is deleted.
719    //-***************************************************************
720     
721  void RefFace_add_hard_point(void *this_ref_face, /* RefVertex* */ void *ref_vertex_ptr )
722{
723  RefFace *temp_ref_face = (RefFace *) this_ref_face;
724
725  RefVertex *temp_ref_vertex_ptr = (RefVertex*) ref_vertex_ptr;
726 
727  temp_ref_face->add_hard_point(temp_ref_vertex_ptr);
728}
729    //- Add a hard point to this RefFace.
730    //-***************************************************************
731    //- MJP Note:
732    //- Currently, the new RefVertex that is created is NOT PART OF THE
733    //- main DAG datastructure. The new RefVertex, however, has its
734    //- own little mini-DAG which consists of a single CDODAGNode.
735    //- Discuss this with the team before making it a part of the main DAG.
736    //- It is, however, deleted appropriately when the RefFace is deleted.
737    //-***************************************************************
738
739    /* other functions */
740
741///**********Graphics Related Functions*********//
742  void RefFace_draw_my_edges (void *this_ref_face,  int color)
743{
744  RefFace *temp_ref_face = (RefFace *) this_ref_face;
745
746  temp_ref_face->draw_my_edges(color);
747}
748 
749  void RefFace_draw_normal   (void *this_ref_face, int color,
750                              double length,
751                              /* RefVolume * */ void *wrt_vol)
752{
753  RefFace *temp_ref_face = (RefFace *) this_ref_face;
754
755  RefVolume *temp_wrt_vol = (RefVolume *) wrt_vol;
756 
757  temp_ref_face->draw_normal(color, length, temp_wrt_vol);
758}
759
760    /* Surface* */ void *RefFace_get_surface_ptr(void *this_ref_face)
761{
762  RefFace *temp_ref_face = (RefFace *) this_ref_face;
763
764  return temp_ref_face->get_surface_ptr();
765}
766    //R Surface*
767    //R- A pointer to the Surface to which the current
768    //R- face points.
769    //- This function returns a pointer to the Surface
770    //- to which the current face points.
771 
772  EntityType RefFace_entity_type(void *) 
773{ return RefFace_TYPE;}
774
775 
776  void* RefFace_get_address(void *this_ref_face, EntityType inputEntityType)
777{
778  RefFace *temp_ref_face = (RefFace *) this_ref_face;
779
780  return temp_ref_face->get_address(inputEntityType);
781}
782    //R void*
783    //R- Returned void pointer
784    //I inputEntityType
785    //I- The input type to get the address of.
786    //- This function returns a void pointer that points to the
787    //- "appropriate" portion of this object.  The appropriate
788    //- portion is determined by the input EntityType variable.
789    //- Returns NULL if the input type and the type of "this"
790    //- are not related by inheritance.
791    //- Note: The RTTI capabilities encoded in these functions
792    //-       are designed to work with any form of multiple
793    //-       inheritance, as well.  Multiple inheritance is what
794    //-       necessitates having this function defined in every
795    //-       class in the hierarchy.
796    //- Note: This function can also be used to merely check if
797    //-       an object of one type is related to another type
798    //-       through inheritance.  If a non-NULL pointer is
799    //-       returned, then this is true.
800
801enum CubitStatus RefFace_setup_use_facets( void *this_ref_face, 
802                                             /* DLCubitFacetList &*/ void ***facet_list, 
803                                           int *facet_list_size,
804                                           int interp_order) 
805{
806  RefFace *temp_ref_face = (RefFace *) this_ref_face;
807
808  DLCubitFacetList temp_list;
809  COPY_ARRAY_TO_LIST(*facet_list, *facet_list_size, temp_list);
810
811  return temp_ref_face->setup_use_facets(temp_list, interp_order);
812}
813 
814    /* set up the underlying geometry to use a faceted base representation. */
815
816void RefFace_stop_use_facets(void *RefFace_ptr) 
817{
818  RefFace *temp_ref_face = (RefFace *) RefFace_ptr;
819  temp_ref_face->stop_use_facets();
820}
821
822enum CubitBoolean RefFace_get_use_facets(void *RefFace_ptr) 
823{
824  RefFace *temp_ref_face = (RefFace *) RefFace_ptr;
825  return temp_ref_face->get_use_facets();
826}
827 
Note: See TracBrowser for help on using the browser.