[cgma-dev] r5379 - cgm/trunk/itaps

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Tue Feb 7 11:41:06 CST 2012


Author: janehu
Date: 2012-02-07 11:41:06 -0600 (Tue, 07 Feb 2012)
New Revision: 5379

Modified:
   cgm/trunk/itaps/iGeom.h
   cgm/trunk/itaps/iGeom_CGMA.cc
Log:
Added a iGeom function to check if point is on the surface/curve/body. Per Shengyong's request.

Modified: cgm/trunk/itaps/iGeom.h
===================================================================
--- cgm/trunk/itaps/iGeom.h	2012-02-06 04:29:21 UTC (rev 5378)
+++ cgm/trunk/itaps/iGeom.h	2012-02-07 17:41:06 UTC (rev 5379)
@@ -3971,6 +3971,13 @@
                        int **facets, int *facets_allocated, int *facets_size,
                        int *err);
 
+  /* checks if a point is on a surface or a curve or a body*/
+  void iGeom_isPositionOn(iGeom_Instance instance,
+                          iBase_EntityHandle entity,
+                          double x,
+                          double y,
+                          double z,
+                          bool isOn); 
 #ifdef __cplusplus
 } /* extern "C" */
 #endif

Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc	2012-02-06 04:29:21 UTC (rev 5378)
+++ cgm/trunk/itaps/iGeom_CGMA.cc	2012-02-07 17:41:06 UTC (rev 5379)
@@ -310,7 +310,6 @@
   return status;
 }
 
-
 extern "C" {
 
 void iGeom_newGeom( const char* options,
@@ -6274,6 +6273,35 @@
   }
 }
 
+void iGeom_isPositionOn(iGeom_Instance instance,
+                        iBase_EntityHandle entity,
+                        double x,
+                        double y,
+                        double z,
+                        bool IsOn)
+{
+  CubitVector position(x,y,z);
+  CubitPointContainment pc;
+  RefFace *ref_face = dynamic_cast<RefFace*>(ENTITY_HANDLE(entity));
+  if(ref_face)
+    pc = ref_face->point_containment(position);
+
+  RefEdge *ref_edge = dynamic_cast<RefEdge*>(ENTITY_HANDLE(entity));
+  if(ref_edge)
+    pc = ref_edge->point_containment(position);


More information about the cgma-dev mailing list