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

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Wed Aug 26 13:25:54 CDT 2009


Author: sjackson
Date: 2009-08-26 13:25:53 -0500 (Wed, 26 Aug 2009)
New Revision: 3119

Modified:
   cgm/trunk/itaps/iGeom.h
   cgm/trunk/itaps/iGeom_CGMA.cc
Log:
Add support for creating cones in iGeom by extending the interface
with the new function iGeom_createCone.


Modified: cgm/trunk/itaps/iGeom.h
===================================================================
--- cgm/trunk/itaps/iGeom.h	2009-08-25 14:38:58 UTC (rev 3118)
+++ cgm/trunk/itaps/iGeom.h	2009-08-26 18:25:53 UTC (rev 3119)
@@ -2116,6 +2116,17 @@
 /**\brief 
  *
  */
+  void iGeom_createCone( iGeom_Instance,
+			 double height,
+			 double major_rad_base,
+			 double minor_rad_base,
+			 double rad_top,
+			 iBase_EntityHandle* geom_entity,
+			 int* err );
+
+/**\brief 
+ *
+ */
   void iGeom_createTorus( iGeom_Instance,
                           double major_rad,
                           double minor_rad,

Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc	2009-08-25 14:38:58 UTC (rev 3118)
+++ cgm/trunk/itaps/iGeom_CGMA.cc	2009-08-26 18:25:53 UTC (rev 3119)
@@ -5305,8 +5305,30 @@
 
   RETURN(iBase_SUCCESS);
 }
-          
+      
 void
+iGeom_createCone (iGeom_Instance instance,
+		  /*in*/ double height,
+		  /*in*/ double major_rad_base,
+		  /*in*/ double minor_rad_base,
+		  /*in*/ double rad_top,
+		  /*out*/ iBase_EntityHandle *geom_entity,
+		  int* err)
+{
+  double tmp_minor = (0.0 == minor_rad_base ? major_rad_base : minor_rad_base);
+  RefEntity *temp_body = 
+    gmt->cylinder(height, major_rad_base, tmp_minor, rad_top);
+  *geom_entity = reinterpret_cast<iBase_EntityHandle>(temp_body);
+
+
+  if (NULL == *geom_entity) {
+    RETURN(iBase_FAILURE);
+  }
+
+  RETURN(iBase_SUCCESS);
+}
+    
+void
 iGeom_createTorus (iGeom_Instance instance,
                    /*in*/ double major_rad,
                    /*in*/ double minor_rad,



More information about the cgma-dev mailing list