- TopoDS_Shape FFace = MF.Shape();
- if (!FFace.IsNull()) {
- unsigned int ind, nbshapes = aShapes->Length();
- if (nbshapes == 1) {
- aShape = FFace;
-
- } else if (nbshapes >= 2) {
- TopoDS_Compound C;
- BRep_Builder aBuilder;
- aBuilder.MakeCompound(C);
- BRepAlgo_FaceRestrictor FR;
-
- TopAbs_Orientation OriF = FFace.Orientation();
- TopoDS_Shape aLocalS = FFace.Oriented(TopAbs_FORWARD);
- FR.Init(TopoDS::Face(aLocalS), Standard_False, Standard_True);
-
- for (ind = 1; ind <= nbshapes; ind++) {
- Handle(GEOM_Function) aRefWire_i =
- Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
- TopoDS_Shape aWire_i = aRefWire_i->GetValue();
- if (aWire_i.IsNull() || aWire_i.ShapeType() != TopAbs_WIRE) {
- Standard_NullObject::Raise("Shape for face construction is null or not a wire");
- }
-
- FR.Add(TopoDS::Wire(aWire_i));
- }
-
- FR.Perform();
-
- if (FR.IsDone()) {
- int k = 0;
- TopoDS_Shape aFace;
- for (; FR.More(); FR.Next()) {
- aFace = FR.Current().Oriented(OriF);
- aBuilder.Add(C, aFace);
- k++;
- }
- if (k == 1) {
- aShape = aFace;
- } else {
- aShape = C;
- }
- }
+
+ if (nbshapes == 1) {
+ aShape = FFace;
+
+ } else {
+ TopoDS_Compound C;
+ BRep_Builder aBuilder;
+ aBuilder.MakeCompound(C);
+ BRepAlgo_FaceRestrictor FR;
+
+ TopAbs_Orientation OriF = FFace.Orientation();
+ TopoDS_Shape aLocalS = FFace.Oriented(TopAbs_FORWARD);
+ FR.Init(TopoDS::Face(aLocalS), Standard_False, Standard_True);
+
+ for (int ind = 1; ind <= nbshapes; ind++) {
+ Handle(GEOM_Function) aRefWire_i =
+ Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
+ TopoDS_Shape aWire_i = aRefWire_i->GetValue();
+ if (aWire_i.IsNull() || aWire_i.ShapeType() != TopAbs_WIRE) {
+ Standard_NullObject::Raise("Shape for face construction is null or not a wire");
+ }
+
+ FR.Add(TopoDS::Wire(aWire_i));
+ }
+
+ FR.Perform();
+
+ if (FR.IsDone()) {
+ int k = 0;
+ TopoDS_Shape aFace;
+ for (; FR.More(); FR.Next()) {
+ aFace = FR.Current().Oriented(OriF);
+ aBuilder.Add(C, aFace);
+ k++;
+ }
+ if (k == 1) {
+ aShape = aFace;
+ } else {
+ aShape = C;
+ }