[cgma-dev] r4736 - cgm/branches/merge-cubit12/geom/OCC

jiangtao_ma at yahoo.com jiangtao_ma at yahoo.com
Wed Apr 13 12:28:17 CDT 2011


Author: janehu
Date: 2011-04-13 12:28:17 -0500 (Wed, 13 Apr 2011)
New Revision: 4736

Modified:
   cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp
   cgm/branches/merge-cubit12/geom/OCC/OCCShapeAttributeSet.cpp
Log:
Added version check code to make CGM compatible to both OCC6.3 and OCC6.5 kernel.

Modified: cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp
===================================================================
--- cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp	2011-04-13 15:11:00 UTC (rev 4735)
+++ cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp	2011-04-13 17:28:17 UTC (rev 4736)
@@ -15,7 +15,17 @@
 #include "OCCQueryEngine.hpp"
 #include "CubitSimpleAttrib.hpp"
 #include "CubitFileIOWrapper.hpp"
+
+#ifndef OCC_VERSION_MINOR
+#include "Standard_Version.hxx"
+#endif
+
+#if OCC_VERSION_MINOR < 5
+#include "TDataStd_Shape.hxx"
+#else
 #include "TDataXtd_Shape.hxx"
+#endif
+
 #include "TCollection_ExtendedString.hxx"
 #include "Handle_TDataStd_Name.hxx"
 #include "Handle_TDataStd_ExtStringArray.hxx"
@@ -39,9 +49,18 @@
     //find the same shape attribute first
     aLabel = it1.Value();
 
+#if (OCC_VERSION_MINOR == 3)
+    Handle_TDataStd_Shape attr_shape;
+#else
     Handle_TDataXtd_Shape attr_shape;
+#endif
+
     TopoDS_Shape old_shape;
+#if (OCC_VERSION_MINOR == 3)
+    if(aLabel.FindAttribute(TDataStd_Shape::GetID(), attr_shape))
+#else
     if(aLabel.FindAttribute(TDataXtd_Shape::GetID(), attr_shape))
+#endif
       old_shape = attr_shape->Get(aLabel);
     if(old_shape.IsPartner(shape))
     {
@@ -63,10 +82,18 @@
   if(!found)
   { 
     aLabel = OCCQueryEngine::instance()->mainLabel.NewChild();
+#if (OCC_VERSION_MINOR == 3)
+    Handle_TDataStd_Shape attr_shape = TDataStd_Shape::Set(aLabel, shape);
+#else
     Handle_TDataXtd_Shape attr_shape = TDataXtd_Shape::Set(aLabel, shape);
+#endif
     //myLabel.AddAttribute(attr_shape);


More information about the cgma-dev mailing list