- Handle(GEOM_SubShapeDriver) _anOtherObject;
-
- if (!AnObject.IsNull()) {
- if (AnObject->IsKind(STANDARD_TYPE(GEOM_SubShapeDriver))) {
- _anOtherObject = Handle(GEOM_SubShapeDriver)((Handle(GEOM_SubShapeDriver)&)AnObject);
- }
+ if (Label().IsNull()) return 0;
+ Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+ GEOM_ISubShape aCI( function );
+
+ enum { GEOM_SUBSHAPE = 28, GEOM_GROUP = 37 };
+
+ TDF_Label aLabel = function->GetOwnerEntry();
+ if (aLabel.IsRoot()) return false;
+ Handle(GEOM_Object) obj = GEOM_Object::GetObject( aLabel );
+ if ( obj.IsNull() ) return false;
+
+ switch ( obj->GetType() ) {
+ case GEOM_SUBSHAPE:
+ theOperationName = "EXPLODE";
+ AddParam( theParams, "Main Object", aCI.GetMainShape() );
+ AddParam( theParams, "Index", aCI.GetIndices() );
+ break;
+ case GEOM_GROUP:
+ {
+ theOperationName = "GROUP_CREATE";
+ TopAbs_ShapeEnum type = TopAbs_SHAPE;
+ {
+ TDF_Label aFreeLabel = obj->GetFreeLabel();
+ Handle(TDataStd_Integer) anAttrib;
+ if(aFreeLabel.FindAttribute(TDataStd_Integer::GetID(), anAttrib))
+ type = (TopAbs_ShapeEnum) anAttrib->Get();
+ }
+ AddParam( theParams, "Shape Type", type );
+ AddParam( theParams, "Main Shape", aCI.GetMainShape() );
+ AddParam( theParams, "Indices", aCI.GetIndices() );
+ break;