-
- static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
- if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
- static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
- if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
- static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
- if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
-
-
- static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
- static Handle_Standard_Type _aType = new Standard_Type("GEOM_SubShapeDriver",
- sizeof(GEOM_SubShapeDriver),
- 1,
- (Standard_Address)_Ancestors,
- (Standard_Address)NULL);
-
- return _aType;
-}
-
-//=======================================================================
-//function : DownCast
-//purpose :
-//=======================================================================
-const Handle(GEOM_SubShapeDriver) Handle(GEOM_SubShapeDriver)::DownCast(const Handle(Standard_Transient)& AnObject)
-{
- 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;