#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopExp_Explorer.hxx>
//=======================================================================
//function : Build
if (mySShape.IsDone()) {
Done();
myShape = mySShape.ResultingShape();
+ myRight.Clear();
}
}
return mySShape.Left();
}
+
+//=======================================================================
+//function : Right
+//purpose :
+//=======================================================================
+
+const TopTools_ListOfShape& BRepFeat_SplitShape::Right() const
+{
+ if (myRight.IsEmpty())
+ {
+ TopTools_MapOfShape aMapOfLeft;
+ TopTools_ListIteratorOfListOfShape anIterator;
+ for (anIterator.Initialize(mySShape.Left()); anIterator.More(); anIterator.Next())
+ {
+ aMapOfLeft.Add(anIterator.Value());
+ }
+ TopExp_Explorer anExplorer;
+ for (anExplorer.Init(myShape, TopAbs_FACE); anExplorer.More(); anExplorer.Next())
+ {
+ const TopoDS_Shape& aFace = anExplorer.Current();
+ if (!aMapOfLeft.Contains(aFace))
+ myRight.Append(aFace);
+ }
+ }
+ return myRight;
+}
+
//=======================================================================
//function : isDeleted
//purpose :
//! Raises NotDone if IsDone returns <Standard_False>.
Standard_EXPORT const TopTools_ListOfShape& Left() const;
+ //! Returns the faces of the "right" part on the shape.
+ Standard_EXPORT const TopTools_ListOfShape& Right() const;
+
//! Builds the cut and the resulting faces and edges as well.
Standard_EXPORT void Build() Standard_OVERRIDE;
LocOpe_Spliter mySShape;
Handle(LocOpe_WiresOnShape) myWOnShape;
+ mutable TopTools_ListOfShape myRight;
+
};
else
return 1;
}
- for (i++; i<argc; i+=2) {
+ i++;
+ while (argv[i][0] != '#') {
TopoDS_Shape Ew,Es;
TopoDS_Shape aLocalShape(DBRep::Get(argv[i],TopAbs_EDGE));
Es = TopoDS::Edge(aLocalShape);
return 1;
}
Spls.Add(TopoDS::Edge(Ew),TopoDS::Edge(Es));
+ i += 2;
}
Spls.Build();
const TopTools_ListOfShape& aLeftPart = Spls.Left();
+ const TopTools_ListOfShape& aRightPart = Spls.Right();
BRep_Builder BB;
TopoDS_Shape aShell;
BB.MakeShell(TopoDS::Shell(aShell));
- TopTools_ListIteratorOfListOfShape anIter(aLeftPart);
+ TopTools_ListIteratorOfListOfShape anIter;
+ if (argv[argc - 1][0] == 'L') {
+ anIter.Initialize(aLeftPart);
+ }
+ else if (argv[argc - 1][0] == 'R') {
+ anIter.Initialize(aRightPart);
+ }
+ else {
+ return 1;
+ }
for(; anIter.More(); anIter.Next()) BB.Add(aShell, anIter.Value());
aShell.Closed (BRep_Tool::IsClosed (aShell));
DBRep::Set(argv[1],aShell);
theCommands.Add ("BUC60897", "BUC60897", __FILE__, BUC60897, group);
theCommands.Add ("BUC60889", "BUC60889 point_1 point_2 name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2", __FILE__, BUC60889, group);
theCommands.Add ("BUC60852", "BUC60852 name_of_edge bndbox_X1 bndbox_Y1 bndbox_Z1 bndbox_X2 bndbox_Y2 bndbox_Z2", __FILE__, BUC60852, group);
- theCommands.Add ("BUC60854", "BUC60854 result_shape name_of_shape name_of_face name_of_wire/name_of_edge [ name_of_wire/name_of_edge ... ] [ name_of_face name_of_wire/name_of_edge [ name_of_wire/name_of_edge ... ] ... ] [ @ edge_on_shape edge_on_wire [ edge_on_shape edge_on_wire ... ] ] ", __FILE__, BUC60854, group);
+ theCommands.Add ("BUC60854", "BUC60854 result_shape name_of_shape name_of_face name_of_wire/name_of_edge [ name_of_wire/name_of_edge ... ] [ name_of_face name_of_wire/name_of_edge [ name_of_wire/name_of_edge ... ] ... ] [ @ edge_on_shape edge_on_wire [ edge_on_shape edge_on_wire ... ] ] [ # L/R ]", __FILE__, BUC60854, group);
theCommands.Add ("BUC60870", "BUC60870 result name_of_shape_1 name_of_shape_2 dev", __FILE__, BUC60870, group);
theCommands.Add ("BUC60902", "BUC60902", __FILE__, BUC60902, group);
theCommands.Add ("BUC60944", "BUC60944 path", __FILE__, BUC60944, group);
-puts "TODO OCC12345 ALL: BUC60854: Error"
-
puts "========"
puts "BUC60854"
puts "========"
vertex test_vertex_3 0.2 0.5 0
vertex test_vertex_4 0.8 0.5 0
-edge test_edge_1 test_vertex_3 test_vertex_4
+edge test_edge_1 test_vertex_4 test_vertex_3
vertex test_vertex_5 0 1 0
-edge test_edge_2 test_vertex_5 test_vertex_3
+edge test_edge_2 test_vertex_3 test_vertex_5
vertex test_vertex_6 1 1 0
-edge test_edge_3 test_vertex_4 test_vertex_6
-
-BUC60854 result test_shape test_face test_edge_2 test_edge_3 @ test_edge test_edge_1
+edge test_edge_3 test_vertex_6 test_vertex_4
-erase test_plane
+BUC60854 result test_shape test_face test_edge_2 test_edge_3 @ test_edge test_edge_1 # L
regexp {FACE +: +([-0-9.+eE]+)} [numshapes result] full FACE_num
puts "BUC60854: Error"
}
-checkview -display result -2d -path ${imagedir}/${test_image}.png
+BUC60854 result_2 test_shape test_face test_edge_2 test_edge_3 @ test_edge test_edge_1 # R
+
+regexp {FACE +: +([-0-9.+eE]+)} [numshapes result_2] full FACE_num
+
+if {${FACE_num} != 1} {
+ puts "BUC60854: Error"
+}
+
+erase test_plane
+
+checkview -display result -2d -with ${result_2} -path ${imagedir}/${test_image}.png