{
SetErrorCode(KO);
+ if ( theShapeType != TopAbs_VERTEX && theShapeType != TopAbs_EDGE &&
+ theShapeType != TopAbs_FACE && theShapeType != TopAbs_SOLID ) {
+ SetErrorCode( "Error: You could create group only next type: vertex, edge, face or solid" );
+ return NULL;
+ }
+
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
anArray->SetValue(1, -1);
SetErrorCode(KO);
if(theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return;
TopTools_IndexedMapOfShape aMapOfShapes;
TopExp::MapShapes(aMainShape, aMapOfShapes);
+ TopAbs_ShapeEnum aGroupType = GetType(theGroup);
+ TopAbs_ShapeEnum aShapeType = aMapOfShapes.FindKey(theSubShapeID).ShapeType();
+ if ( aGroupType != aShapeType ) {
+ SetErrorCode( "Error: You could perform this operation only with object the same type as the type of group." );
+ return;
+ }
+
if (theSubShapeID < 1 || aMapOfShapes.Extent() < theSubShapeID) {
SetErrorCode("Invalid sub-shape index: out of range");
return;
SetErrorCode(KO);
if(theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return;
SetErrorCode(KO);
if (theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
SetErrorCode(KO);
if (theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
SetErrorCode(KO);
if (theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
SetErrorCode(KO);
if (theGroup.IsNull()) return;
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return;
+ }
+
Standard_Integer aLen = theSubShapes->Length();
if (aLen < 1) {
//SetErrorCode("The list is empty");
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
+ if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
+
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
+ if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
+
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
SetErrorCode(KO);
if (theGroup1.IsNull() || theGroup2.IsNull()) return NULL;
+ if ( theGroup1->GetType() != GEOM_GROUP || theGroup2->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
+
// Get group type
TopAbs_ShapeEnum aType1 = GetType(theGroup1);
TopAbs_ShapeEnum aType2 = GetType(theGroup2);
// Iterate on the initial groups
for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i));
-
+ if ( aGr_i->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
// Iterate on the initial groups
for (i = 1; i <= aLen; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList->Value(i));
-
+ if ( aGr_i->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
// 1. Collect indices to be excluded (from theGList2) into the mapIDs
for (i = 1; i <= aLen2; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList2->Value(i));
-
+ if ( aGr_i->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
// Get group type
aType_i = GetType(aGr_i);
if (i == 1)
// 2. Collect indices from theGList1, avoiding indices from theGList2 (mapIDs)
for (i = 1; i <= aLen1; i++) {
Handle(GEOM_Object) aGr_i = Handle(GEOM_Object)::DownCast(theGList1->Value(i));
-
+ if ( aGr_i->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
// Get group type
aType_i = GetType(aGr_i);
if (i == 1 && aLen2 < 1)
SetErrorCode(KO);
if(theGroup.IsNull()) return NULL;
-
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
Handle(GEOM_Function) aGroupFunction = theGroup->GetFunction(1);
if (aGroupFunction.IsNull()) return NULL;
SetErrorCode(KO);
if(theGroup.IsNull()) return NULL;
-
+ if ( theGroup->GetType() != GEOM_GROUP ) {
+ SetErrorCode( "Error: You could perform this operation only with group. Please select a group." );
+ return NULL;
+ }
Handle(GEOM_Function) aFunction = theGroup->GetLastFunction();
if(aFunction.IsNull()) return NULL;