mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0028880: Modeling Algorithms - add missing BRepFeat_SplitShape::Right() getter
- Added Right() method to BRepFeat_SplitShape; - Added an option in command buc60854, which allows to select Left() or Right() method; - Modified method BUC60854 in QABugs_14.cxx; - Added new option to the help of command buc60854; - Modified test case buc60854. Now its state is "OK"; - Added check Right() in buc60854 test case.
This commit is contained in:
parent
62afcbbb4a
commit
68064d7bc3
@ -27,6 +27,7 @@
|
|||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopoDS_Wire.hxx>
|
#include <TopoDS_Wire.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Build
|
//function : Build
|
||||||
@ -38,6 +39,7 @@ void BRepFeat_SplitShape::Build ()
|
|||||||
if (mySShape.IsDone()) {
|
if (mySShape.IsDone()) {
|
||||||
Done();
|
Done();
|
||||||
myShape = mySShape.ResultingShape();
|
myShape = mySShape.ResultingShape();
|
||||||
|
myRight.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +66,33 @@ const TopTools_ListOfShape& BRepFeat_SplitShape::Left() const
|
|||||||
return mySShape.Left();
|
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
|
//function : isDeleted
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -105,6 +105,9 @@ public:
|
|||||||
//! Raises NotDone if IsDone returns <Standard_False>.
|
//! Raises NotDone if IsDone returns <Standard_False>.
|
||||||
Standard_EXPORT const TopTools_ListOfShape& Left() const;
|
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.
|
//! Builds the cut and the resulting faces and edges as well.
|
||||||
Standard_EXPORT void Build() Standard_OVERRIDE;
|
Standard_EXPORT void Build() Standard_OVERRIDE;
|
||||||
|
|
||||||
@ -130,6 +133,8 @@ private:
|
|||||||
LocOpe_Spliter mySShape;
|
LocOpe_Spliter mySShape;
|
||||||
Handle(LocOpe_WiresOnShape) myWOnShape;
|
Handle(LocOpe_WiresOnShape) myWOnShape;
|
||||||
|
|
||||||
|
mutable TopTools_ListOfShape myRight;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -239,7 +239,8 @@ static Standard_Integer BUC60854 (Draw_Interpretor& /*di*/, Standard_Integer arg
|
|||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (i++; i<argc; i+=2) {
|
i++;
|
||||||
|
while (argv[i][0] != '#') {
|
||||||
TopoDS_Shape Ew,Es;
|
TopoDS_Shape Ew,Es;
|
||||||
TopoDS_Shape aLocalShape(DBRep::Get(argv[i],TopAbs_EDGE));
|
TopoDS_Shape aLocalShape(DBRep::Get(argv[i],TopAbs_EDGE));
|
||||||
Es = TopoDS::Edge(aLocalShape);
|
Es = TopoDS::Edge(aLocalShape);
|
||||||
@ -252,13 +253,24 @@ static Standard_Integer BUC60854 (Draw_Interpretor& /*di*/, Standard_Integer arg
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
Spls.Add(TopoDS::Edge(Ew),TopoDS::Edge(Es));
|
Spls.Add(TopoDS::Edge(Ew),TopoDS::Edge(Es));
|
||||||
|
i += 2;
|
||||||
}
|
}
|
||||||
Spls.Build();
|
Spls.Build();
|
||||||
const TopTools_ListOfShape& aLeftPart = Spls.Left();
|
const TopTools_ListOfShape& aLeftPart = Spls.Left();
|
||||||
|
const TopTools_ListOfShape& aRightPart = Spls.Right();
|
||||||
BRep_Builder BB;
|
BRep_Builder BB;
|
||||||
TopoDS_Shape aShell;
|
TopoDS_Shape aShell;
|
||||||
BB.MakeShell(TopoDS::Shell(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());
|
for(; anIter.More(); anIter.Next()) BB.Add(aShell, anIter.Value());
|
||||||
aShell.Closed (BRep_Tool::IsClosed (aShell));
|
aShell.Closed (BRep_Tool::IsClosed (aShell));
|
||||||
DBRep::Set(argv[1],aShell);
|
DBRep::Set(argv[1],aShell);
|
||||||
@ -1044,7 +1056,7 @@ void QABugs::Commands_14(Draw_Interpretor& theCommands) {
|
|||||||
theCommands.Add ("BUC60897", "BUC60897", __FILE__, BUC60897, group);
|
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 ("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 ("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 ("BUC60870", "BUC60870 result name_of_shape_1 name_of_shape_2 dev", __FILE__, BUC60870, group);
|
||||||
theCommands.Add ("BUC60902", "BUC60902", __FILE__, BUC60902, group);
|
theCommands.Add ("BUC60902", "BUC60902", __FILE__, BUC60902, group);
|
||||||
theCommands.Add ("BUC60944", "BUC60944 path", __FILE__, BUC60944, group);
|
theCommands.Add ("BUC60944", "BUC60944 path", __FILE__, BUC60944, group);
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
puts "TODO OCC12345 ALL: BUC60854: Error"
|
|
||||||
|
|
||||||
puts "========"
|
puts "========"
|
||||||
puts "BUC60854"
|
puts "BUC60854"
|
||||||
puts "========"
|
puts "========"
|
||||||
@ -21,17 +19,15 @@ renamevar test_shape_1 test_face
|
|||||||
|
|
||||||
vertex test_vertex_3 0.2 0.5 0
|
vertex test_vertex_3 0.2 0.5 0
|
||||||
vertex test_vertex_4 0.8 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
|
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
|
vertex test_vertex_6 1 1 0
|
||||||
edge test_edge_3 test_vertex_4 test_vertex_6
|
edge test_edge_3 test_vertex_6 test_vertex_4
|
||||||
|
|
||||||
BUC60854 result test_shape test_face test_edge_2 test_edge_3 @ test_edge test_edge_1
|
BUC60854 result test_shape test_face test_edge_2 test_edge_3 @ test_edge test_edge_1 # L
|
||||||
|
|
||||||
erase test_plane
|
|
||||||
|
|
||||||
regexp {FACE +: +([-0-9.+eE]+)} [numshapes result] full FACE_num
|
regexp {FACE +: +([-0-9.+eE]+)} [numshapes result] full FACE_num
|
||||||
|
|
||||||
@ -39,5 +35,15 @@ if {${FACE_num} != 3} {
|
|||||||
puts "BUC60854: Error"
|
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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user