]> OCCT Git - occt-copy.git/commitdiff
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 97ab7106325f8841d2a37d9baba82cb22a0e607a..b57ccbfb6a9a7ddd8a0f70c07c5979ade67d0bff 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 3b878197547ab312e17df4eb5f5667e2291857c3..8f13d7954dc570d86712d0a05e5c81560d91dc78 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 6594debcbd25242a39c6b7f934e39070efe9a9f7..a2ca503912dce1409eebc1b12057f55a6a97b6c9 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 ae737e02d3bcd6823b5cd1adf4a7fa4c2dde3662..4055a0908a4e1de6dbc6e8838fe6206c624348db 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 6dc78b729e6f3ca4c07e22da6c0c26208c6e7208..16464455e0cccf6ca742b833991b0df5fe781cf1 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 61b8deb39ae3af41359344552998b2a22b633e13..8b5aca2946a49060d1c36933722184a4dd11b329 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 127e7cde67720d23e451efbb6327672c7d2f84fd..24c08bd5513ff81c0910b3c88e76875b7d1a63dd 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 a9dd32d151c9f4a603a1b9b54d37fd85a80ef388..231b303d86ff90b75bc4e9cdb04af35efbc87249 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 8cd203cf6c6206a2d090aa4a76d3d7b437f61e9c..99b93cf306ce126462b983adf47b1ea2091c2323 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 96603c1413b7443cbc608ec0e778185b228305e8..d886efac6fd93f9194a503c4b04039386cfa908e 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 d97f1c264671cc8a59101b523e85352b374bf14b..39427fdcdc703d8a24d0f3ad0dddf9735a67f24c 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 87dde286211fc3896043694f5255d55044a618de..c2e5f9507af778f019f5adf33ab26704d1731314 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 66151e80e5b74eb952063d675e8ae4dc3b54ff46..a939afa56102eb95e4c378fa6d338f43c24a3ff6 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 fcd3fa1f0b4cc536976da7dbb50221c91ee54f8b..bbc49bd626780e3520b2d414026b0d7b219e20fb 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 a1ba23cc29674f3214e9dc7addb28f2dfc50ff74..078ce1a05be77fa83f61599719553f1b5284ca77 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 bc2e30fa0c4d55fe2740906bf5728e2b7ebe53f2..7087686b5dbcbe031e57f4ae8afb52d31d409c50 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 658fef3dfa31592bc138b0e6348c4d6e3b272d60..2210375b2866521ab0a47bb6a60a5ae8e5f5d3bd 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 2729ae6672dd03b0ad3871bb40ac4f380e0d79ec..c36b93e0f506d68bd36c832e0c1c8da4f358ec1f 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 0fa9ef8841006e23ee011b81c49d75ef715857d4..30691cd6e0de79c2e4f39f61fb8177562fe56045 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 47f94a696346e024ae7dd3af4aaebb502f8942fe..c752b15efcc6dab0bf62933c175fa550dc86688b 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index c25cf385956a790df5dd27536e669cf023eb7480..ee82d1a9ccedf530b1eb2a95ae1e142e68a02784 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index ff39ced69bd7dbc37f3d75be91ed2137760faa7c..62b506a7caa5a0dcb795358746bf7608e1ed4163 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index eb4a661d914c767643d4497b76bc053033d36711..ec81f8981e7525c5faeafe4dd3145b7a3e47c85f 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 4bbb313438ffa75180f41295bf0c89c14ba9a490..7a0e2ac99fd36d870b862a12408678a40928b118 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 3f276eec39aac7a43788e8836908afc9bc929e51..a8d6864fe26e19f440631d05fb42dd6c592d0a84 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index 1dffcfebe8f16c1ef87ddb0a3cf6a29c5f393b9a..1223e9d5787338d65282cd56b4a97c606a9fba01 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 5add70d9735b615456357029650534495b4ac822..aced514bb1ae08b32eb5926f9ec01e9fcc0fd0cc 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 831631d5dc267cfee7cce93b8416094c632778d8..d38957ad4d46716bfd74a3e76a2a8df7cc6d775e 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index ec21d6b3504ce9477fab911cb02597122eeb42f7..74733f97838b42a21715c6a537bdcc9b2def5657 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # ============= OCAF ============================
 # Naming
 #
index 2c55479673cc5f8b6af5fd50528790d637b88c39..8f39e59b87a8c3cdbefa47c462ac062f1f66862a 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index d3cb14a4250e7a1b6782c1faf0a6f563c9680002..347a550c8cdef41cf10aec766ab5e6e72061d46b 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #
index c52ccef8f74187ba42fba3565b8f48decb76d345..1e3c83d3b1cd2c26e3b4286d4aa6b68f8f0829b0 100755 (executable)
@@ -1,5 +1,3 @@
-puts "TODO ?CR23788 ALL: Failed units"
-
 # =================== OCAF ======================
 # Naming
 #