r4737 - cgm/branches/merge-cubit12/geom/OCC
Author: janehu Date: 2011-04-13 13:03:01 -0500 (Wed, 13 Apr 2011) New Revision: 4737 Modified: cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp cgm/branches/merge-cubit12/geom/OCC/OCCShapeAttributeSet.cpp Log: Changed to make code simpler. Thanks, Jason. Modified: cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp =================================================================== --- cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp 2011-04-13 17:28:17 UTC (rev 4736) +++ cgm/branches/merge-cubit12/geom/OCC/OCCAttribSet.cpp 2011-04-13 18:03:01 UTC (rev 4737) @@ -21,9 +21,11 @@ #endif #if OCC_VERSION_MINOR < 5 -#include "TDataStd_Shape.hxx" + #include "TDataStd_Shape.hxx" + typedef TDataStd_Shape TDataXtd_Shape; + typedef Handle_TDataStd_Shape Handle_TDataXtd_Shape; #else -#include "TDataXtd_Shape.hxx" + #include "TDataXtd_Shape.hxx" #endif #include "TCollection_ExtendedString.hxx" @@ -49,18 +51,9 @@ //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)) { @@ -82,18 +75,10 @@ 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); //test if the attribute has been attached -#if (OCC_VERSION_MINOR == 3) - assert(aLabel.IsAttribute(TDataStd_Shape::GetID())); -#else
participants (1)
-
jiangtao_ma@yahoo.com