0026313: Method BRepBuilderAPI_GTransform::ModifiedShape(...) thows exception
authornbv <nbv@opencascade.com>
Thu, 10 Sep 2015 13:16:55 +0000 (16:16 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Sep 2015 13:19:23 +0000 (16:19 +0300)
Test cases for issue CR26313

src/BRepBuilderAPI/BRepBuilderAPI_Collect.cxx
src/QABugs/QABugs_19.cxx
tests/bugs/modalg_6/bug26313 [new file with mode: 0755]

index f24c38b..7217e03 100644 (file)
@@ -210,8 +210,13 @@ void BRepBuilderAPI_Collect::Add (const TopoDS_Shape& SI,
   TopTools_DataMapOfShapeShape ModBack;
   BuildBack (myGen, GenBack);   // Vraiment pas optimum a Revoir
   BuildBack (myMod, ModBack);
-  
+
+  Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_COMPOUND);
+  Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_COMPSOLID);
+  Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_SOLID);
+  Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_SHELL);
   Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_FACE);
+  Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_WIRE);
   Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_EDGE);
   Update (myMod,myGen,ModBack,GenBack,SI,MKS,TopAbs_VERTEX);
 
index c396672..dbba186 100644 (file)
@@ -4089,6 +4089,50 @@ static Standard_Integer OCC26462 (Draw_Interpretor& theDI, Standard_Integer /*th
   return 0;
 }
 
+
+#include <BRepBuilderAPI_GTransform.hxx>
+static Standard_Integer OCC26313(Draw_Interpretor& di,Standard_Integer n,const char** a)
+{
+  if (n <= 1) return 1;
+  
+  gp_Trsf T;
+  gp_GTrsf GT(T);
+  
+  gp_Mat rot( 1.0, 0.0, 0.0,
+              0.0, 2.0, 0.0,
+              0.0, 0.0, 3.0);
+  
+  GT.SetVectorialPart(rot);
+  BRepBuilderAPI_GTransform gtrf(GT);
+
+  TopoDS_Shape aSrcShape = DBRep::Get(a[2]);
+  if (aSrcShape.IsNull()) {
+    di << a[2] << " is not a valid shape" << "\n";
+    return 1;
+  }
+
+  
+  gtrf.Perform(aSrcShape);
+  if (gtrf.IsDone())
+  {
+    try
+    {
+      DBRep::Set(a[1], gtrf.ModifiedShape(aSrcShape));
+    }
+    catch(Standard_Failure)
+    {
+      di << "Error: Exception is thrown\n";
+    }
+  }
+  else
+  {
+    di << "Error: Result is not done\n";
+    return 1;
+  }
+  
+  return 0;
+}
+
 void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   const char *group = "QABugs";
 
@@ -4176,5 +4220,8 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC26462",
                    "OCC26462: Checks the ability to manage sensitivity of a particular selection mode in local context",
                    __FILE__, OCC26462, group);
+
+  theCommands.Add ("OCC26313", "OCC26313 result shape", __FILE__, OCC26313, group);
+
   return;
 }
diff --git a/tests/bugs/modalg_6/bug26313 b/tests/bugs/modalg_6/bug26313
new file mode 100755 (executable)
index 0000000..281a99a
--- /dev/null
@@ -0,0 +1,26 @@
+puts "============"
+puts "OCC26313"
+puts "============"
+puts ""
+#######################################################################
+# Method BRepBuilderAPI_GTransform::ModifiedShape(...) thows exception
+#######################################################################
+
+pload QAcommands
+
+box bb 100 100 100
+OCC26313 rr bb
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 8
+ EDGE      : 12
+ WIRE      : 6
+ FACE      : 6
+ SHELL     : 1
+ SOLID     : 1
+ COMPSOLID : 0
+ COMPOUND  : 0
+ SHAPE     : 34
+"
+checknbshapes rr -ref ${nbshapes_expected} -t -m "Modified Shape"