0023819: Naming failures
authorszy <szy@opencascade.com>
Mon, 25 Mar 2013 13:21:31 +0000 (17:21 +0400)
committerszy <szy@opencascade.com>
Mon, 25 Mar 2013 13:21:31 +0000 (17:21 +0400)
Fixed regression with DummyVertex processing.
Correction test cases for CR23819

32 files changed:
src/TNaming/TNaming_NamedShape.cxx
tests/caf/driver/A1
tests/caf/driver/A2
tests/caf/driver/A3
tests/caf/driver/A4
tests/caf/driver/A5
tests/caf/driver/A6
tests/caf/driver/A7
tests/caf/driver/A8
tests/caf/driver/A9
tests/caf/driver/B1
tests/caf/driver/B2
tests/caf/driver/B3
tests/caf/driver/B4
tests/caf/driver/B5
tests/caf/driver/B6
tests/caf/driver/B7
tests/caf/named_shape/E1
tests/caf/named_shape/E2
tests/caf/named_shape/E3
tests/caf/named_shape/E4
tests/caf/named_shape/E5
tests/caf/named_shape/E6
tests/caf/named_shape/E7
tests/caf/named_shape/E8
tests/caf/named_shape/E9
tests/caf/named_shape/F1
tests/caf/named_shape/F2
tests/caf/named_shape/F3
tests/caf/named_shape/F4
tests/caf/named_shape/F5
tests/caf/named_shape/F6

index 97ab710..b57ccbf 100755 (executable)
@@ -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);
index 3b87819..8f13d79 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #1 - create box using more flexible set of commands
 NewCommand D
 set B2 [AddObject D];                  ## add object
index 6594deb..a2ca503 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #Drivers' nick-names:
 #Box|Sph|Cyl|Cut|Fuse|Prism|Revol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
 # order of functions recomputation should be defined out of the tool (by end user)
index ae737e0..4055a09 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
 #1 Box creation
 NewCommand D
index 6dc78b7..1646445 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
 
 #1 Create Box
index 61b8deb..8b5aca2 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
 
 #1 Create Box
index 127e7cd..24c08bd 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 #1 - create Box using short-cut
 NewCommand D
 AddDriver D Box;                       ## add box driver to driver table
index a9dd32d..231b303 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #Drivers' nick-names:
 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
 # order of functions recomputation should be defined out of the tool (by end user)
index 8cd203c..99b93cf 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #Drivers' nick-names:
 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
 # order of functions recomputation should be defined out of the tool (by end user)
index 96603c1..d886efa 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #1 - create Box using short-cut
 NewCommand D
 AddDriver D Box;                       ## add box driver to driver table
index d97f1c2..39427fd 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 AddDriver D Box Cyl Sph Attach XAttach PTxyz PTALine PRLine PMirr Cut Fuse Prism FulRevol SecRevol Fillet
 
 #1 Create Box
index 87dde28..c2e5f95 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 #1 - create Box using short-cut
 NewCommand D
 AddDriver D Box;                       ## add box driver to driver table
index 66151e8..a939afa 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #1 - create Box using short-cut
 NewCommand D
 AddDriver D Box;                       ## add box driver to driver table
index fcd3fa1..bbc49bd 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 #Drivers' nick-names:
 #Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
 # order of functions recomputation should be defined out of the tool (by end user)
index a1ba23c..078ce1a 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 #1 - create 4 Pnts
 NewCommand D
 AddDriver D PntXYZ PntRLT Line3D Attach;
index bc2e30f..7087686 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-puts "TODO ?CR23788 ALL: DNaming_SolveFlatFrom: Driver failed"
 #1 - create 4 Pnts
 NewCommand D
 AddDriver D PntXYZ PntRLT Line3D Attach;
index 658fef3..2210375 100755 (executable)
@@ -1,4 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
 #1 - create 4 Pnts
 NewCommand D
 AddDriver D PntXYZ PntRLT Line3D Attach;
index 2729ae6..c36b93e 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 0fa9ef8..30691cd 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 47f94a6..c752b15 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index c25cf38..ee82d1a 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index ff39ced..62b506a 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index eb4a661..ec81f89 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 4bbb313..7a0e2ac 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 3f276ee..a8d6864 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 1dffcfe..1223e9d 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 5add70d..aced514 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 831631d..d38957a 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index ec21d6b..74733f9 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 2c55479..8f39e59 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index d3cb14a..347a550 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index c52ccef..1e3c83d 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #