1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0023819: Naming failures

Fixed regression with DummyVertex processing.
Correction test cases for CR23819
This commit is contained in:
szy
2013-03-25 17:21:31 +04:00
parent b62b93ac30
commit 456b8422e1
32 changed files with 28 additions and 63 deletions

View File

@@ -833,7 +833,28 @@ void TNaming_Builder::Modify(const TopoDS_Shape& oldShape,
}
//=======================================================================
static TopoDS_Vertex theDummyVertex (BRepBuilderAPI_MakeVertex(gp_Pnt(0.,0.,0.)).Vertex());
//function : DummyShapeToStoreOrientation
//=======================================================================
static const TopoDS_Shape& DummyShapeToStoreOrientation (const TopAbs_Orientation Or)
{
gp_Pnt aPnt(0,0,0);
static TopoDS_Vertex aVForward, aVRev;
switch(Or) {
case TopAbs_FORWARD:
if(aVForward.IsNull()) {
aVForward = BRepBuilderAPI_MakeVertex (aPnt).Vertex();
aVForward.Orientation(TopAbs_FORWARD);
}
return aVForward;
case TopAbs_REVERSED:
if(aVRev.IsNull()) {
aVRev = BRepBuilderAPI_MakeVertex (aPnt).Vertex();
aVRev.Orientation(TopAbs_REVERSED);
}
return aVRev;
}
return aVForward;
}
//=======================================================================
//function : Select
@@ -849,15 +870,15 @@ void TNaming_Builder::Select (const TopoDS_Shape& S,
}
TNaming_RefShape* pos;
if(S.ShapeType() != TopAbs_VERTEX) {
TopoDS_Shape aV = theDummyVertex;
aV.Orientation (S.Orientation());
if(S.ShapeType() != TopAbs_VERTEX &&
(S.Orientation() == TopAbs_FORWARD || S.Orientation() == TopAbs_REVERSED)) {
const TopoDS_Shape& aV = DummyShapeToStoreOrientation (S.Orientation());
if (!myShapes->myMap.IsBound(aV)) {
pos = new TNaming_RefShape(aV);
myShapes->myMap.Bind(aV,pos);
}
else
pos = myShapes->myMap.ChangeFind(aV);
} else
pos = myShapes->myMap.ChangeFind(aV);
} else {
if (!myShapes->myMap.IsBound(InS)) {
pos = new TNaming_RefShape(InS);