]> OCCT Git - occt-copy.git/commitdiff
0029967: Draw Harness - command bounding has annoying syntax
authorkgv <kgv@opencascade.com>
Fri, 20 Jul 2018 10:07:47 +0000 (13:07 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 27 Jul 2018 13:19:26 +0000 (16:19 +0300)
Bnd_OBB constructor from Bnd_Box is fixed for VOID input.

DRAW command bounding command is adjusted:
- Support of old syntax 'bounding shape'is restored.
- Exception on VOID bounding box is avoided.
- Arguments are handled in case-insensitive way.
- Options -s, -perfmeter, and ability to set result as first argument are removed as redundant.
- Help is moved to command definition.

Separate command OCC29311 is added (in QADraw) to do the same as option -perfmeter did; tests are updated.

67 files changed:
samples/tcl/Penrose.tcl
samples/tcl/snowflake.tcl
src/BRepTest/BRepTest_BasicCommands.cxx
src/Bnd/Bnd_OBB.hxx
src/QABugs/QABugs_20.cxx
tests/bugs/modalg_1/buc60849
tests/bugs/modalg_1/bug108
tests/bugs/modalg_1/bug12661
tests/bugs/modalg_4/bug6334
tests/bugs/modalg_6/bug27537
tests/bugs/modalg_7/bug29311_1
tests/bugs/modalg_7/bug29311_12
tests/bugs/modalg_7/bug29311_13
tests/bugs/modalg_7/bug29311_14
tests/bugs/modalg_7/bug29311_15
tests/bugs/modalg_7/bug29311_16
tests/bugs/modalg_7/bug29311_17
tests/bugs/modalg_7/bug29311_2
tests/bugs/modalg_7/bug29311_3
tests/bugs/modalg_7/bug29311_4
tests/bugs/moddata_1/bug15570
tests/bugs/moddata_2/bug23165
tests/bugs/moddata_2/bug2442
tests/bugs/moddata_2/bug257
tests/bugs/moddata_2/bug566
tests/bugs/moddata_2/bug6503
tests/bugs/moddata_3/bug23575
tests/bugs/moddata_3/bug25631
tests/bugs/moddata_3/bug26560
tests/bugs/moddata_3/bug27261_1
tests/bugs/moddata_3/bug27261_2
tests/bugs/step/bug24595
tests/bugs/stlvrml/bug26338
tests/bugs/vis/buc60857
tests/bugs/vis/bug27796
tests/bugs/xde/bug659
tests/caf/basic/K1
tests/caf/basic/K2
tests/caf/basic/K3
tests/caf/bugs/B3
tests/caf/bugs/B5
tests/caf/bugs/B7
tests/caf/bugs/D2
tests/caf/named_shape/A1
tests/caf/named_shape/B1
tests/caf/named_shape/C1
tests/caf/named_shape/D1
tests/caf/named_shape/D2
tests/caf/named_shape/D3
tests/caf/xlink/A1
tests/caf/xlink/A2
tests/caf/xlink/B1
tests/caf/xlink/B2
tests/caf/xlink/B3
tests/caf/xlink/B4
tests/caf/xlink/B5
tests/caf/xlink/C1
tests/caf/xlink/D1
tests/caf/xlink/D2
tests/chamfer/begin
tests/demo/draw/binpersist_1
tests/demo/draw/binpersist_2
tests/demo/draw/binpersist_3
tests/perf/modalg/bug29311
tests/xml/data/ocaf/B3
tests/xml/data/ocaf/B5
tests/xml/data/ocaf/B7

index 3df642dae363bb2704cbb9f660be173a2f240f51..292813fc7da3efa25f33a79373580b774e86b666 100644 (file)
@@ -41,7 +41,7 @@ tcopy bxx b10
 
 # make some boxes hollow
 for {set i 1} {$i <= 1} {incr i} {
-  set dim [bounding -s b$i -save xmin ymin zmin xmax ymax zmax]
+  set dim [bounding b$i -save xmin ymin zmin xmax ymax zmax]
   set dx [dval xmax-xmin]
   set x1 [dval xmin+0.1*$dx]
   set x2 [dval ymin+0.1*$dx]
index 94fef6a18701f5db2320c387f55f8c33015a9998..f29550823e61ca78504be5801afcf14e14400934 100644 (file)
@@ -135,7 +135,7 @@ vfit
 
 # add dimension:
 # detect vertices extremal in X direction
-bounding -s snowflake -save x1 y1 z1 x2 y2 z2
+bounding snowflake -save x1 y1 z1 x2 y2 z2
 plane f1 x1 0 0 1 0 0
 plane f2 x2 0 0 1 0 0
 mkface f1 f1
index 87417ef84be21ec2694f415245e91e18503fd203..69f7d1f03a1729c0db1ebc1ca475a3e766198188 100644 (file)
@@ -66,6 +66,12 @@ Standard_IMPORT Draw_Viewer dout;
 static void ConvertBndToShape(const Bnd_OBB& theBox,
                               const char* const theName)
 {
+  if (theBox.IsVoid())
+  {
+    DBRep::Set (theName, TopoDS_Shape());
+    return;
+  }
+
   const gp_Pnt &aBaryCenter = theBox.Center();
   const gp_XYZ &aXDir = theBox.XDirection(),
                &aYDir = theBox.YDirection(),
@@ -455,6 +461,29 @@ static Standard_Integer getcoords(Draw_Interpretor& di,Standard_Integer n,const
   return 0;
 }
 
+//! Parse 6 real values for defining AABB.
+static Standard_Boolean parseMinMax (const char** theArgVec, Bnd_Box& theBox)
+{
+  const TCollection_AsciiString aMin[3] = { theArgVec[0], theArgVec[1], theArgVec[2] };
+  const TCollection_AsciiString aMax[3] = { theArgVec[3], theArgVec[4], theArgVec[5] };
+  if (!aMin[0].IsRealValue()
+   || !aMin[1].IsRealValue()
+   || !aMin[2].IsRealValue()
+   || !aMax[0].IsRealValue()
+   || !aMax[1].IsRealValue()
+   || !aMax[2].IsRealValue())
+  {
+    return Standard_False;
+  }
+
+  const gp_Pnt aPntMin (aMin[0].RealValue(), aMin[1].RealValue(), aMin[2].RealValue());
+  const gp_Pnt aPntMax (aMax[0].RealValue(), aMax[1].RealValue(), aMax[2].RealValue());
+  theBox.SetVoid();
+  theBox.Add (aPntMin);
+  theBox.Add (aPntMax);
+  return Standard_True;
+}
+
 //=======================================================================
 //function : BoundBox
 //purpose  : 
@@ -463,200 +492,132 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
                                  Standard_Integer theNArg,
                                  const char** theArgVal)
 {
-  if(theNArg < 2)
-  {
-    theDI << "Use: " << theArgVal[0] << " {-s shape | -c xmin ymin zmin xmax ymax zmax} "
-             "[-obb]\n\t\t[-shape name] [-dump] [-notriangulation]\n\t\t"
-             "[-perfmeter name NbIters] [-nodraw] [-optimal] [-exttoler]\n\t\t"
-             "[-save xmin ymin zmin xmax ymax zmax]\n\n\n";
-
-    theDI << "Computes a bounding box (BndBox). Two types of the source data are supported:\n";
-    theDI << "  * \"-s\"-option sets the shape, which will be circumscribed by the BndBox;\n";
-    theDI << "  * \"-c\"-option sets two opposite corners (having (xmin, ymin, zmin) and\n\t"
-             "(xmax, ymax, zmax) coordinates) of the resulting\n\taxis-aligned BndBox (AABB).\n";
-    theDI << "\nThe following options are supported:\n";
-    theDI << "  * \"-obb\". If it is switched on then the oriented BndBox (OBB) will "
-             "be\n\tcreated. Otherwise, AABB will be created.\n";
-    theDI << "  * \"-shape\". If it is switched on then the resulting BndBox will be "
-             "stored\n\tas a shape (solid) with specified name.\n";
-    theDI << "  * \"-nodraw\". If it is switched on then the resulting BndBox will not be\n\t"
-             "drawn as DRAW-object.\n";
-    theDI << "  * \"-dump\". Prints the information about the created BndBox.\n";
-    theDI << "  * \"-notriangulation\". By default, AABB is built from existing mesh.\n\t"
-             "This option allows ignoring triangulation.\n";
-    theDI << "  * \"-save\". Stores the information about created AABB in "
-             "specified variables.\n";
-    theDI << "  * \"-optimal\". If it is switched on then the AABB will be optimal.\n\t"
-             "This option is useful for OBB, too. It allows constructing\n\toptimal "
-             "initial AABB.\n";
-    theDI << "  * \"-exttoler\". If it is switched on then the resulting box will be "
-             "extended\n\ton the tolerance of the source shape.\n";
-    theDI << "  * \"-perfmeter\" - Auxiliary option. It provides compatibility "
-             "with\n\tOCCT-test system. \"name\" is the counter name for "
-             "\"chrono\"-TCL-command.\n\tNbIters is the number of iterations.\n";
-    return 1;
-  }
+  // 1. Parse arguments
 
   TopoDS_Shape aShape;
-  
+  Bnd_Box anAABB;
+
+  Standard_Boolean doPrint = Standard_False;
+  Standard_Boolean useOldSyntax = Standard_False;
   Standard_Boolean isOBB = Standard_False;
-  Standard_Boolean hasToPrint = Standard_False,
-                   isTriangulationReq = Standard_True,
-                   isOptimal = Standard_False,
-                   isTolerUsed = Standard_False,
-                   hasToDraw = Standard_True;
-  Standard_Integer aNbIters = 1;
-  Standard_Integer aStartIdxToSave = -1,
-                   aStartIdxToCreate = -1,
-                   aNameToShape = -1,
-                   anIdxCounterName = -1;
-
-  for(Standard_Integer anAIdx = 1; anAIdx < theNArg; anAIdx++)
+  Standard_Boolean isTriangulationReq = Standard_True;
+  Standard_Boolean isOptimal = Standard_False;
+  Standard_Boolean isTolerUsed = Standard_False;
+  Standard_Boolean hasToDraw = Standard_True;
+  
+  TCollection_AsciiString anOutVars[6];
+  TCollection_AsciiString aResShapeName;
+  for (Standard_Integer anArgIter = 1; anArgIter < theNArg; ++anArgIter)
   {
-    if(theArgVal[anAIdx][0] != '-')
-    {
-      theDI << "Error: Wrong option \"" << theArgVal[anAIdx] << 
-               "\". Please use \'-\' symbol\n";
-      return 1;
-    }
-
-    if(!strcmp(theArgVal[anAIdx], "-s"))
-    {
-      aShape = DBRep::Get(theArgVal[++anAIdx]);
-      if(aShape.IsNull())
-      {
-        theDI << "Error: Argument " << theArgVal[anAIdx] << " is not a shape.\n";
-        return 1;
-      }
-    }
-    else if(!strcmp(theArgVal[anAIdx], "-c"))
-    {
-      aStartIdxToCreate = anAIdx + 1;
-      anAIdx += 6;
-    }
-    else if(!strncmp(theArgVal[anAIdx], "-obb", 4))
+    TCollection_AsciiString anArgCase (theArgVal[anArgIter]);
+    anArgCase.LowerCase();
+    if (anArgCase == "-obb")
     {
       isOBB = Standard_True;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-shape", 4))
+    else if (anArgCase == "-aabb")
     {
-      aNameToShape = ++anAIdx;
+      isOBB = Standard_False;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-dump", 4))
+    else if (anArgCase == "-shape"
+          && anArgIter + 1 < theNArg
+          && aResShapeName.IsEmpty())
     {
-      hasToPrint = Standard_True;
+      aResShapeName = theArgVal[++anArgIter];
+      hasToDraw = Standard_False;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-save", 4))
+    else if (anArgCase == "-dump"
+          || anArgCase == "-print")
     {
-      aStartIdxToSave = anAIdx+1;
-      anAIdx += 6;
+      doPrint = Standard_True;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-notriangulation", 9))
+    else if (anArgCase == "-save"
+          && anArgIter + 6 < theNArg
+          && anOutVars[0].IsEmpty())
     {
-      isTriangulationReq = Standard_False;
+      for (int aCompIter = 0; aCompIter < 6; ++aCompIter)
+      {
+        anOutVars[aCompIter] = theArgVal[anArgIter + aCompIter + 1];
+      }
+      anArgIter += 6;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-perfmeter", 8))
+    else if (anArgCase == "-notriangulation")
     {
-      anIdxCounterName = ++anAIdx;
-      aNbIters = Draw::Atoi(theArgVal[++anAIdx]);
+      isTriangulationReq = Standard_False;
     }
-    else if(!strncmp(theArgVal[anAIdx], "-optimal", 4))
+    else if (anArgCase == "-optimal")
     {
       isOptimal = Standard_True;
     }
-    else if(!strcmp(theArgVal[anAIdx], "-exttoler"))
+    else if (anArgCase == "-exttoler")
     {
       isTolerUsed = Standard_True;
     }
-    else if(!strcmp(theArgVal[anAIdx], "-nodraw"))
+    else if (anArgCase == "-nodraw")
     {
       hasToDraw = Standard_False;
     }
+    else if (aShape.IsNull()
+         && !DBRep::Get (theArgVal[anArgIter]).IsNull())
+    {
+      aShape = DBRep::Get (theArgVal[anArgIter]);
+    }
+    else if (anAABB.IsVoid()
+          && anArgIter + 5 < theNArg
+          && parseMinMax (theArgVal + anArgIter, anAABB))
+    {
+      anArgIter += 5;
+    }
     else
     {
-      theDI << "Error: Unknown option  \"" << theArgVal[anAIdx] << "\".\n";
+      std::cout << "Syntax error at argument '" << theArgVal[anArgIter] << "'.\n";
       return 1;
     }
   }
 
-  if(aShape.IsNull() && (aStartIdxToCreate < 0))
+  if (anAABB.IsVoid()
+   && aShape.IsNull())
   {
-    theDI << "Error: One of the options \'-s\' or \'-c\' must be set necessarily.\n";
+    std::cout << "Syntax error: input is not specified (neither shape nor coordinates)\n";
     return 1;
   }
-
-  if(aStartIdxToCreate > 0)
+  else if (!anAABB.IsVoid()
+        && (isOBB || isOptimal || isTolerUsed))
   {
-    if(!aShape.IsNull())
-    {
-      theDI << "Error: Options \'-s\' and \'-c\' are fail for using simultaneously.\n";
-      return 1;
-    }
-    else if(isOBB)
-    {
-      theDI << "Error: Options \'-c\' and \"-obb\" are fail for using simultaneously.\n";
-      return 1;
-    }
+    std::cout << "Syntax error: Options -obb, -optimal and -extToler cannot be used for explicitly defined AABB.\n";
+    return 1;
   }
-
-  if(isOptimal)
+  else if (isOBB
+       && !anOutVars[0].IsEmpty())
   {
-    if(aShape.IsNull())
-    {
-      theDI << "Error: Options \"-optimal\" is used without any shape. "
-               "Use \'-s\'-option.\n";
-      return 1;
-    }
+    std::cout << "Error: Option -save works only with axes-aligned boxes.\n";
+    return 1;
   }
 
-  if(isTolerUsed)
+  // enable printing (old syntax) if neither saving to shape nor to DRAW variables is requested
+  if (! doPrint && anOutVars[0].IsEmpty() && aResShapeName.IsEmpty())
   {
-    if(aShape.IsNull())
-    {
-      theDI << "Error: Option \"-exttoler\" is used without any shape. "
-        "Use \'-s\'-option.\n";
-      return 1;
-    }
+    doPrint = Standard_True;
+    useOldSyntax = Standard_True;
   }
 
+  // 2. Compute box and save results
   Handle(Draw_Box) aDB;
-  OSD_Timer aTimer;
-
-  if(isOBB)
+  if (isOBB)
   {
-    if(aStartIdxToSave > 0)
-    {
-      theDI << "Error: Option \"-save\" work only with axes-aligned boxes.\n";
-      return 1;
-    }
-
     Bnd_OBB anOBB;
-    Standard_Integer aN = aNbIters;
-
-    aTimer.Start();
-    while(aN-- > 0)
-    {
-      anOBB.SetVoid();
-      BRepBndLib::AddOBB(aShape, anOBB, isTriangulationReq, isOptimal, isTolerUsed);
-    }
-    aTimer.Stop();
+    BRepBndLib::AddOBB(aShape, anOBB, isTriangulationReq, isOptimal, isTolerUsed);
 
-    if(anOBB.IsVoid())
+    if (anOBB.IsVoid())
     {
       theDI << "Void box.\n";
-      hasToPrint = Standard_False;
     }
-
-    const gp_Pnt &aBaryCenter= anOBB.Center();
-    const gp_XYZ &aXDir = anOBB.XDirection(),
-                 &aYDir = anOBB.YDirection(),
-                 &aZDir = anOBB.ZDirection();
-    Standard_Real aHalfX = anOBB.XHSize(), 
-                  aHalfY = anOBB.YHSize(),
-                  aHalfZ = anOBB.ZHSize();
-
-    if(hasToPrint)
+    else if (doPrint)
     {
+      const gp_Pnt &aBaryCenter= anOBB.Center();
+      const gp_XYZ &aXDir = anOBB.XDirection(),
+                   &aYDir = anOBB.YDirection(),
+                   &aZDir = anOBB.ZDirection();
       theDI << "Oriented bounding box\n";
       theDI << "Center: " << aBaryCenter.X() << " " << 
                              aBaryCenter.Y() << " " <<
@@ -664,116 +625,92 @@ static Standard_Integer BoundBox(Draw_Interpretor& theDI,
       theDI << "X-axis: " << aXDir.X() << " " << aXDir.Y() << " " << aXDir.Z() << "\n";
       theDI << "Y-axis: " << aYDir.X() << " " << aYDir.Y() << " " << aYDir.Z() << "\n";
       theDI << "Z-axis: " << aZDir.X() << " " << aZDir.Y() << " " << aZDir.Z() << "\n";
-      theDI << "Half X: " << aHalfX << "\n" << 
-               "Half Y: " << aHalfY << "\n" << "Half Z: " << aHalfZ << "\n";
+      theDI << "Half X: " << anOBB.XHSize() << "\n"
+            << "Half Y: " << anOBB.YHSize() << "\n"
+            << "Half Z: " << anOBB.ZHSize() << "\n";
+    }
+
+    if (hasToDraw
+    && !anOBB.IsVoid())
+    {
+      aDB = new Draw_Box (anOBB, Draw_orange);
     }
-    
-    if(hasToDraw)
-      aDB = new Draw_Box(anOBB, Draw_orange);
 
-    if(aNameToShape > 0)
+    if (!aResShapeName.IsEmpty())
     {
-      ConvertBndToShape(anOBB, theArgVal[aNameToShape]);
+      ConvertBndToShape (anOBB, aResShapeName.ToCString());
     }
   }
   else // if(!isOBB)
   {
-    Standard_Real aXmin = RealFirst(), aYmin = RealFirst(), aZmin = RealFirst(),
-                  aXMax = RealLast(), aYMax = RealLast(), aZMax = RealLast();
-
-    Bnd_Box anAABB;
-
-    if(aStartIdxToCreate < 0)
+    if (!aShape.IsNull())
     {
-      Standard_Integer aN = aNbIters;
+      anAABB.SetVoid ();
       if(isOptimal)
       {
-        aTimer.Start();
-        while(aN-- > 0)
-        {
-          anAABB.SetVoid();
-          BRepBndLib::AddOptimal(aShape, anAABB, isTriangulationReq, isTolerUsed);
-        }
-        aTimer.Stop();
+        BRepBndLib::AddOptimal (aShape, anAABB, isTriangulationReq, isTolerUsed);
       }
       else
       {
-        aTimer.Start();
-        while(aN-- > 0)
-        {
-          anAABB.SetVoid();
-          BRepBndLib::Add(aShape, anAABB, isTriangulationReq);
-        }
-        aTimer.Stop();
-      }
-    }
-    else
-    {
-      if(anIdxCounterName > 0)
-      {
-        theDI << "Error: Option \"-perfmeter\"does not work if the option \'-c\' "
-                 "is switched on.\n";
-        return 1;
+        BRepBndLib::Add (aShape, anAABB, isTriangulationReq);
       }
-
-      Standard_Integer anIdx = aStartIdxToCreate;
-      aXmin = Draw::Atof(theArgVal[anIdx++]);
-      aYmin = Draw::Atof(theArgVal[anIdx++]);
-      aZmin = Draw::Atof(theArgVal[anIdx++]);
-      aXMax = Draw::Atof(theArgVal[anIdx++]);
-      aYMax = Draw::Atof(theArgVal[anIdx++]);
-      aZMax = Draw::Atof(theArgVal[anIdx++]);
-
-      anAABB.Add(gp_Pnt(aXmin, aYmin, aZmin));
-      anAABB.Add(gp_Pnt(aXMax, aYMax, aZMax));
     }
 
-    if(anAABB.IsVoid())
+    if (anAABB.IsVoid())
     {
       theDI << "Void box.\n";
-      hasToPrint = Standard_False;
     }
-
-    if(hasToPrint || (aStartIdxToSave>0))
+    else
     {
-      anAABB.Get(aXmin, aYmin, aZmin, aXMax, aYMax, aZMax);
+      const gp_Pnt aMin = anAABB.CornerMin();
+      const gp_Pnt aMax = anAABB.CornerMax();
+
+      // print to DRAW
+      if (doPrint)
+      {
+        if (useOldSyntax)
+        {
+          theDI << aMin.X () << " " << aMin.Y () << " " << aMin.Z () << " "
+                << aMax.X () << " " << aMax.Y () << " " << aMax.Z () << "\n";
+        }
+        else
+        {
+          theDI << "Axes-aligned bounding box\n";
+          theDI << "X-range: " << aMin.X () << " " << aMax.X () << "\n" <<
+                   "Y-range: " << aMin.Y() << " " << aMax.Y() << "\n" <<
+                   "Z-range: " << aMin.Z () << " " << aMax.Z () << "\n";
+        }
+      }
 
-      if(hasToPrint)
+      // save DRAW variables
+      if (!anOutVars[0].IsEmpty())
       {
-        theDI << "Axes-aligned bounding box\n";
-        theDI << "X-range: " << aXmin << " " << aXMax << "\n" <<
-                 "Y-range: " << aYmin << " " << aYMax << "\n" <<
-                 "Z-range: " << aZmin << " " << aZMax << "\n";
+        Draw::Set (anOutVars[0].ToCString(), aMin.X());
+        Draw::Set (anOutVars[1].ToCString(), aMin.Y());
+        Draw::Set (anOutVars[2].ToCString(), aMin.Z());
+        Draw::Set (anOutVars[3].ToCString(), aMax.X());
+        Draw::Set (anOutVars[4].ToCString(), aMax.Y());
+        Draw::Set (anOutVars[5].ToCString(), aMax.Z());
       }
 
-      if(aStartIdxToSave > 0)
+      // add presentation to DRAW viewer
+      if (hasToDraw)
       {
-        Draw::Set(theArgVal[aStartIdxToSave++], aXmin);
-        Draw::Set(theArgVal[aStartIdxToSave++], aYmin);
-        Draw::Set(theArgVal[aStartIdxToSave++], aZmin);
-        Draw::Set(theArgVal[aStartIdxToSave++], aXMax);
-        Draw::Set(theArgVal[aStartIdxToSave++], aYMax);
-        Draw::Set(theArgVal[aStartIdxToSave++], aZMax);
+        aDB = new Draw_Box (anAABB, Draw_orange);
       }
     }
 
-    if(hasToDraw)
-      aDB = new Draw_Box(anAABB, Draw_orange);
-
-    if(aNameToShape > 0)
+    // save as shape
+    if (!aResShapeName.IsEmpty())
     {
-      ConvertBndToShape(anAABB, theArgVal[aNameToShape]);
+      ConvertBndToShape (anAABB, aResShapeName.ToCString());
     }
   }
 
-  if(hasToDraw)
-    dout << aDB;
-
-  if(anIdxCounterName > 0)
+  if (!aDB.IsNull())
   {
-    theDI << "COUNTER " << theArgVal[anIdxCounterName] << ": " << aTimer.ElapsedTime() << "\n";
+    dout << aDB;
   }
-
   return 0;
 }
 
@@ -1514,7 +1451,30 @@ void  BRepTest::BasicCommands(Draw_Interpretor& theCommands)
     __FILE__,
     getcoords,g);
   
-  theCommands.Add("bounding", "enter the comand w/o any arguments to obtain the help.",
+  theCommands.Add ("bounding",
+                   "bounding {shape | xmin ymin zmin xmax ymax zmax}"
+         "\n\t\t:            [-obb] [-noTriangulation] [-optimal] [-extToler]"
+         "\n\t\t:            [-dump] [-shape name] [-nodraw]"
+         "\n\t\t:            [-save xmin ymin zmin xmax ymax zmax]"
+         "\n\t\t:"
+         "\n\t\t: Computes a bounding box. Two types of the source data are supported:"
+         "\n\t\t: a shape or AABB corners (xmin, ymin, zmin, xmax, ymax, zmax)."
+         "\n\t\t:"
+         "\n\t\t: Calculation options (applicable only if input is a shape):"
+         "\n\t\t:  -obb     Compute Oriented Bounding Box (OBB) instead of AABB."
+         "\n\t\t:  -noTriangulation Force use of exact geometry for calculation"
+         "\n\t\t:                   even if triangulation is present."
+         "\n\t\t:  -optimal Force calculation of optimal (more tight) AABB."
+         "\n\t\t:           In case of OBB, applies to initial AABB used in OBB calculation."
+         "\n\t\t:  -extToler Include tolerance of the shape in the resulting box."
+         "\n\t\t:"
+         "\n\t\t: Output options:"
+         "\n\t\t:  -dump    Prints the information about computed Bounding Box."
+         "\n\t\t:           It is enabled by default (with plain old syntax for AABB)"
+         "\n\t\t:           if neither -shape nor -save is specified."
+         "\n\t\t:  -shape   Stores computed box as solid in DRAW variable with specified name."
+         "\n\t\t:  -save    Stores min and max coordinates of AABB in specified variables."
+         "\n\t\t:  -noDraw  Avoid drawing resulting Bounding Box in DRAW viewer.",
                   __FILE__, BoundBox, g);
 
  //
index e5f43ad54cbac9eb0a88948eb3508591ef5913d3..474af04ed4b2ffa921c1f6f21440245d99cb255a 100644 (file)
@@ -73,6 +73,13 @@ public:
   //! Constructor to create OBB from AABB.
   Bnd_OBB(const Bnd_Box& theBox) : myIsAABox(Standard_True)
   {
+    if (theBox.IsVoid())
+    {
+      myHDims[0] = myHDims[1] = myHDims[2] = -1.0;
+      myIsAABox = Standard_False;
+      return;
+    }
+
     Standard_Real aX1, aY1, aZ1, aX2, aY2, aZ2;
     theBox.Get(aX1, aY1, aZ1, aX2, aY2, aZ2);
 
index a9fcfa701d106ed57bc79f4447ae0e180e142001..33a58bf43f2d1a0586bf8d0e74cb9f4e98fb3cb9 100644 (file)
 
 #include <Standard_Failure.hxx>
 
+#include <Bnd_OBB.hxx>
+#include <BRepBndLib.hxx>
+#include <OSD_Timer.hxx>
+
 #include <limits>
 
 //=======================================================================
@@ -2990,6 +2994,36 @@ static Standard_Integer OCC29925 (Draw_Interpretor& theDI, Standard_Integer, con
   return 0;
 }
 
+//=======================================================================
+//function : OCC29311
+//purpose  : check performance of OBB calculations
+//=======================================================================
+static Standard_Integer OCC29311 (Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
+{
+  if (theArgc < 4)
+  {
+    std::cerr << "Use: " << theArgv[0] << " shape counter_name nb_iterations" << std::endl;
+    return 1;
+  }
+
+  TopoDS_Shape aShape = DBRep::Get (theArgv[1]);
+  Standard_Integer aNbIter = Draw::Atoi (theArgv[3]);
+
+  Bnd_OBB anOBB;
+  OSD_Timer aTimer;
+  aTimer.Start ();
+  for (Standard_Integer aN = aNbIter; aN > 0; --aN)
+  {
+    anOBB.SetVoid ();
+    BRepBndLib::AddOBB (aShape, anOBB, Standard_False, Standard_False, Standard_False);
+  }
+  aTimer.Stop ();
+
+  theDI << "COUNTER " << theArgv[2] << ": " << aTimer.ElapsedTime() << "\n";
+
+  return 0;
+}
+
 void QABugs::Commands_20(Draw_Interpretor& theCommands) {
   const char *group = "QABugs";
 
@@ -3028,6 +3062,7 @@ void QABugs::Commands_20(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC29064", "OCC29064: test memory usage by copying empty maps", __FILE__, OCC29064, group);
   theCommands.Add ("OCC29925", "OCC29925: check safety of character classification functions", __FILE__, OCC29925, group);
   theCommands.Add("OCC29807", "OCC29807 surface1 surface2 u1 v1 u2 v2", __FILE__, OCC29807, group);
+  theCommands.Add("OCC29311", "OCC29311 shape counter nbiter: check performance of OBB calculation", __FILE__, OCC29311, group);
 
   return;
 }
index 2311d4fb31e36383b322fa061051927d0f52b737..a2e40cb1dd1f1efaaa1f0391c03aa7568745421c 100755 (executable)
@@ -6,7 +6,7 @@ puts ""
 restore [locate_data_file BUC60849.brep] result
 checkshape result
 
-bounding -s result -save xmin ymin zmin xmax ymax zmax -dump
+bounding result -save xmin ymin zmin xmax ymax zmax -dump
 
 smallview
 fit
index 5ec0c836a39e3b144a4560fa5287f2d538b96759..fe699f3f20e8494025c5e4e2d728ca9e28431551 100755 (executable)
@@ -10,7 +10,7 @@ puts ""
 restore [locate_data_file bug61037.brep] sh1
 checkshape sh1
 
-bounding -s sh1 -dump -shape result
+bounding sh1 -dump -shape result
 checkprops result -v 5.78576e-005 -s 0.042162
 
 smallview
index 5038fe8dcb3f7e7c76be58ac86d46cec506eea67..5d1d7bd909a0665f64984eaedd64bbbc86719243 100755 (executable)
@@ -9,7 +9,7 @@ puts ""
 set BugNumber OCC12661
 
 restore [locate_data_file OCC12661.brep] result
-bounding -s result -save x1 y1 z1 x2 y2 z2
+bounding result -save x1 y1 z1 x2 y2 z2
 
 checkreal "x1" [dval x1] -6.3659273065258741 0 0.001
 checkreal "y1" [dval y1] 0.7051405053395956  0 0.001
index 003551d4ea219355e1314f81667da47be25374f9..16647b912e98a6956f064ab9561adf889a077cca 100755 (executable)
@@ -16,7 +16,7 @@ offsetshape t b 10 b_1
 
 checkshape t
 
-bounding -s t -save xt1 yy zz xt2 yy zz -dump
+bounding t -save xt1 yy zz xt2 yy zz -dump
 set ori [lindex [dtyp t] 2]
 puts "Orientation of thick solid is $ori"
 
@@ -28,7 +28,7 @@ if { [regexp {Faulty} $che] } {
     puts "Faulty ${BugNumber} : checkshape is wrong for h"
 }
 
-bounding -s h -save xh1 yy zz xh2 yy zz -dump
+bounding h -save xh1 yy zz xh2 yy zz -dump
 
 renamevar h result
 
index a184a80d12d767873e034fbf3f4355d3f07f17f4..f04455bac86b9a615ede6ba75b2ccd4862cedf60 100644 (file)
@@ -9,7 +9,7 @@ puts ""
 restore [locate_data_file bug27537.brep] result
 incmesh result 0.2
 
-bounding -s result -save xMin yMin zMin xMax yMax zMax -dump
+bounding result -save xMin yMin zMin xMax yMax zMax -dump
 
 mkcurve c result
 bounds c u1 u2
index 889b43180909547c1a10cf4fb02fc01e2911ee92..ab97c4f299d849a0f2d084b498b6f96d33448c3e 100644 (file)
@@ -12,7 +12,7 @@ set step [expr 360.0/($NbIters-1) ]
 restore [locate_data_file bug29237_no_overlap.lhs.brep] a
 
 # Create AABB for a and put it into "r1" variable
-#   Draw[]> bounding -s a -shape r1
+#   Draw[]> bounding a -shape r1
 # The volume of one AABB is
 #   Draw[]> vprops r1 1.0e-12 -full
 #   32736000.276308119
@@ -22,7 +22,7 @@ set VMax 0
 set MaxIteration 0
 
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -shape rr$i
+  bounding a -obb -shape rr$i
   
   regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
   
index 07b4a92dda044bc2f0d012a3f1ad587c85e2cdf4..428effea5952edc48f9949660d9c4c3ddf7c2d82 100644 (file)
@@ -10,5 +10,5 @@ line ll -5 3 8 -1 0 0
 trim ll ll -100 100
 mkedge result ll
 
-bounding -s result -obb
+bounding result -obb
 
index 2ef6810d6a6ec3ef96a3310dc7824121bee1ed34..fa62c5f10c03a99e22f26164ce52f5bbf3be7036 100644 (file)
@@ -12,7 +12,7 @@ compound result
 
 # construct obb for each edge of the shape
 foreach e [explode part e] {
-  if [catch {bounding -s $e -obb}] {
+  if [catch {bounding $e -obb}] {
     puts "Error with $e (exception)"
     add $e result
   } else {
index 508e7edc5addc9e5dfbbd71fb9219e36c832a90e..2d3a27b76019e8d985daaf3b838b8fd526b18cbc 100644 (file)
@@ -12,7 +12,7 @@ compound result
 
 # construct obb for each face of the shape
 foreach f [explode part f] {
-  if [catch {bounding -s $f -obb}] {
+  if [catch {bounding $f -obb}] {
     puts "Error with $f (exception)"
     add $f result
   } else {
index 83090512ef16d7becab8ba4c520bb1afc41ef227..565a634561f6c40e5dc0cbd91d4a376e1d86f0e8 100644 (file)
@@ -11,7 +11,7 @@ set py 2
 set pz 3
 
 vertex vv $px $py $pz
-set log [bounding -s vv -obb -dump]
+set log [bounding vv -obb -dump]
 
 if {![regexp {Center: +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $log full xc yc zc]} {
   puts "Error in Dump."
index 136d0a836679480121f29059fbc05e74c0b746b9..6a585b254ec62c34ddf9443c995c1988cf355de7 100644 (file)
@@ -22,7 +22,7 @@ set MaxIteration 0
 set MinIteration 0
 
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -shape rr$i
+  bounding a -obb -shape rr$i
   
   regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
   
@@ -46,6 +46,6 @@ checkreal {Transformed BndBoxes} $VMax $VMin 0.0 0.001
 puts "The box with maximal volume is achieved in $MaxIteration iteration. See \"amax\" shape."
 puts "The box with minimal volume is achieved in $MinIteration iteration. See \"amin\" shape."
 
-bounding -s amax -obb -dump
-bounding -s amin -obb -dump
+bounding amax -obb -dump
+bounding amin -obb -dump
 
index 3582cdb232b54fec26841a5e8f6221431ce055ef..0a457e9c29f7009ec99f45ebf551f9587673df69 100644 (file)
@@ -22,7 +22,7 @@ set MaxIteration 0
 set MinIteration 0
 
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -shape rr$i
+  bounding a -obb -shape rr$i
   
   regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
   
@@ -46,6 +46,6 @@ checkreal {Transformed BndBoxes} $VMax $VMin 0.0 0.3
 puts "The box with maximal volume is achieved in $MaxIteration iteration. See \"amax\" shape."
 puts "The box with minimal volume is achieved in $MinIteration iteration. See \"amin\" shape."
 
-bounding -s amax -obb -dump
-bounding -s amin -obb -dump
+bounding amax -obb -dump
+bounding amin -obb -dump
 
index 9b1735156cd797a19a1f60a293703eda1a1ce95b..719060bc10078e90b4d501e766b1bda6daecc018 100644 (file)
@@ -12,7 +12,7 @@ set step [expr 360.0/($NbIters-1) ]
 restore [locate_data_file bug29237_no_overlap.rhs.brep] a
 
 # Create AABB for a and put it into "r1" variable
-#   Draw[]> bounding -s a -shape r1
+#   Draw[]> bounding a -shape r1
 # The volume of one AABB is
 #   Draw[]> vprops r1 1.0e-12 -full
 #   32736000.184203226
@@ -22,7 +22,7 @@ set VMax 0
 set MaxIteration 0
 
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -shape rr$i
+  bounding a -obb -shape rr$i
   
   regexp {Mass +: +([-0-9.+eE]+)} [vprops rr$i 1.0e-12 -full] full Vreal
   
index d27740c64d9514b1c7b9ae91ff0ee908759ed6d3..8571c50b2c1a2e4cd06d394f50aacb54e44dc51e 100644 (file)
@@ -6,5 +6,5 @@ puts ""
 # Implementation of the Oriented Bounding Boxes (OBB) functionality
 #################################################
 
-bounding -c 50 100 30 180 200 100 -shape result
+bounding 50 100 30 180 200 100 -shape result
 checkprops result -v 910000
index 730b4da52785ebc18541671bf08990000335a98d..19d210c31a3daae65d6e267b044459866de5acb3 100644 (file)
@@ -10,7 +10,7 @@ ptorus result 20 5
 trotate result 5 10 15 1 1 1 28
 
 puts "AABB"
-bounding -s result -shape ra -dump -save x1 y1 z1 x2 y2 z2
+bounding result -shape ra -dump -save x1 y1 z1 x2 y2 z2
 
 dump x1 y1 z1 x2 y2 z2
 
@@ -19,7 +19,7 @@ set VaExp [ dval (x2-x1)*(y2-y1)*(z2-z1) ]
 checkprops ra -v $VaExp
 
 puts "OBB"
-bounding -s result -shape ro -dump -obb
+bounding result -shape ro -dump -obb
 
 checkprops ro -v 28694.7
 
index 3ec05c5e444d0d5d9db4f93929429df7f3ae61fa..d937e3096dc172362f5a930c275f273890cf33f4 100755 (executable)
@@ -13,7 +13,7 @@ pload XDE
 igesbrep [locate_data_file OCC15570.igs] a *
 tpcompound result
 
-bounding -s result -save xmin ymin zmin xmax ymax zmax -nodraw
+bounding result -save xmin ymin zmin xmax ymax zmax -nodraw
 
 checkreal "xmin" [dval xmin] -22.500000100000001 0 0.001
 checkreal "ymin" [dval ymin] -88.366946209482094 0 0.001
index 92d0880072c79db6a934ca8b661e0f2a3df387e1..7283fc9ebed1ce8c1d129a1e1180fbf9c9088ee7 100755 (executable)
@@ -18,14 +18,14 @@ set exception_status 0
 restore [locate_data_file OCC23165-edge1.brep] e1 
 
 donly e1
-catch { bounding -s e1 } msg
+catch { bounding e1 } msg
 fit
 
 set index [lsearch $msg exception]
 if {$index > -1} {
   set exception_status 1
 } else {
-  bounding -s e1 -save e1_x1 e1_y1 e1_z1 e1_x2 e1_y2 e1_z2
+  bounding e1 -save e1_x1 e1_y1 e1_z1 e1_x2 e1_y2 e1_z2
 
   set e1_good_x1 -17.610622244944413
   set e1_good_y1 -0.010622244944394899
@@ -47,7 +47,7 @@ restore [locate_data_file OCC23165-curve.rle] c
 mkedge result c 20 36
 
 donly result
-set res [bounding -s result -save x1 y1 z1 x2 y2 z2 ]
+set res [bounding result -save x1 y1 z1 x2 y2 z2 ]
 fit
 
 set good_x1 -17.6105835090592
index a57fe7ccc4d96a92db9b6d0de43de0833d12029c..d66229392ef74f0260f889f42d1b4cd98b81954e 100755 (executable)
@@ -25,7 +25,7 @@ set tol_rel 1.e-7
 checkreal "Distance 1 " ${dist1} ${good_dist} ${tol_abs} ${tol_rel}
 checkreal "Distance 2 " ${dist2} ${good_dist} ${tol_abs} ${tol_rel}
 
-bounding -s a -save x0 y0 z0 x1 y1 z1 -nodraw
+bounding a -save x0 y0 z0 x1 y1 z1 -nodraw
 ttranslate a -x0 -y0 -z0
 ttranslate b -x0 -y0 -z0
 
index 6da9a5814e3d19dfe78acd5e2e2b3866ec82fc60..1c5bcbca283823c595ae752f390eb5f6e64bb21f 100755 (executable)
@@ -10,7 +10,7 @@ puts ""
 restore [locate_data_file OCC257.brep] result 
 checkshape result
 
-bounding -s result -save x1 y1 z1 x2 y2 z2
+bounding result -save x1 y1 z1 x2 y2 z2
 
 set len    [ dval x2-x1]
 set width  [ dval y2-y1]
index 460b2076fcec7f71d635c0b1b2e10882fb895462..2f39691e625c315e88902566a70869b52030799e 100755 (executable)
@@ -10,7 +10,7 @@ puts ""
 
 restore [locate_data_file OCC566.brep] a 
 
-bounding -s a -save v1_x v1_y v1_z v2_x v2_y v2_z -dump -shape result
+bounding a -save v1_x v1_y v1_z v2_x v2_y v2_z -dump -shape result
 set err2 [OCC566 a]
 
 regexp { *([-0-9.+eE]+) *([-0-9.+eE]+) *([-0-9.+eE]+) *([-0-9.+eE]+) *([-0-9.+eE]+) *([-0-9.+eE]+)} $err2 full v3_x v3_y v3_z v4_x v4_y v4_z
index b5ce418e42c682049accb8a787b5e44ec8e13908..3901535d7c56cbe2ae0da7cb10f168d5b683c355 100755 (executable)
@@ -10,7 +10,7 @@ set BugNumber OCC6503
 
 plane pl 0 0 0 0 0 1
 mkface f pl
-set info_result [bounding -s f -save x1 y1 z1 x2 y2 z2]
+set info_result [bounding f -save x1 y1 z1 x2 y2 z2]
 
 set good_x1 -1e+100
 set good_y1 -1e+100
index 81f707ab8f9c5a7d0f3c91a8e32d7e6d2515caf0..8b1d08a15ce62ef2a78e25d6070d3471f2b538bd 100644 (file)
@@ -8,7 +8,7 @@ puts ""
 
 bsplinecurve c 3 2 0 4 1 4 0 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1
 mkedge e c
-bounding -s e -save Xmin Ymin Zmin Xmax Ymax Zmax
+bounding e -save Xmin Ymin Zmin Xmax Ymax Zmax
 
 checkreal "Xmin" [dval Xmin]  0. 0.1 0.
 checkreal "Ymin" [dval Ymin] 0. 0.1 0.
index a1d948c19501c4ea3eed7e1c9f00f0a23e6fe9b1..b3c8d48c1dba456de4db3b3fcd476ed2c74af8aa 100755 (executable)
@@ -8,7 +8,7 @@ puts ""
 
 restore [locate_data_file bug25631_fbx.brep] result
 
-bounding -s result -save Xmin Ymin Zmin Xmax Ymax Zmax
+bounding result -save Xmin Ymin Zmin Xmax Ymax Zmax
 
 set tol_abs 1.0e-4
 set tol_rel 1.0e-4
index 450c1d569eb139f8e5371343646beeeac1856be8..2f0030d9d3530ea5eee773a1bd1434f8e15e5839 100755 (executable)
@@ -8,7 +8,7 @@ puts ""
 
 restore [locate_data_file bug26560_planarspline.brep] result
 
-bounding -s result -save Xmin Ymin Zmin Xmax Ymax Zmax -shape resbox
+bounding result -save Xmin Ymin Zmin Xmax Ymax Zmax -shape resbox
 
 set tol_abs 1.0e-4
 set tol_rel 0.0001
index b3c077459b34804ac78ca8265d1fddc1f81010fd..f4ae1d625a6cc637424e622ad144808017e1ae58 100644 (file)
@@ -7,7 +7,7 @@ puts ""
 ##############################################################
 
 restore [locate_data_file bug27261_f1.brep] result
-bounding -s result -dump
+bounding result -dump
 
 # Visual check.
 smallview
index 9820fc4f75384084136f5104c13348d3fdf0777b..544633719e7af7c147e8fb8c647dcb5c2cc531df 100644 (file)
@@ -7,7 +7,7 @@ puts ""
 ##############################################################
 
 restore [locate_data_file bug27261_f2.brep] result
-bounding -s result -dump
+bounding result -dump
 
 # Visual check.
 smallview
index e5d62606919f098078d236e92002c6ba736355f2..f5588bdde3658cd2b6b879fff9df9b0b45cbb74d 100644 (file)
@@ -11,7 +11,7 @@ explode a_1 f
 
 checknbshapes a_1_3 -wire 1
 
-bounding -s a_1_3 -dump -save Xmin Ymin Zmin Xmax Ymax Zmax
+bounding a_1_3 -dump -save Xmin Ymin Zmin Xmax Ymax Zmax
 
 checkreal "Xmin" [dval Xmin] -7.1677412321949925 0.1 0.
 checkreal "Ymin" [dval Ymin] -8.0000000999999994 0.1 0.
index 2a1a0f1a4c5edbd147d8583ca9123d455ef2a406..ff82376735e146cec70561b7e755ecd66a6f8642 100644 (file)
@@ -19,7 +19,7 @@ writestl comp $imagedir/${casename}.stl 1
 readstl result $imagedir/${casename}.stl -brep
 
 # check that bounding box is 
-bounding -s result -save Xmin Ymin Zmin Xmax Ymax Zmax -nodraw
+bounding result -save Xmin Ymin Zmin Xmax Ymax Zmax -nodraw
 
 checkreal "Xmin" [dval Xmin] 0.0 1e-5 0.
 checkreal "Ymin" [dval Ymin] 0.0 1e-5 0.
index 007055a0c2068a903f81e8edc261dca998311b3f..bb9bd1affda0c7a9403926127394861f6c68b3db 100755 (executable)
@@ -15,9 +15,9 @@ set area_RED [lindex ${Property_RED} 2]
 set Property_GREEN [sprops BUC60857_GREEN]
 set area_GREEN [lindex ${Property_GREEN} 2]
 
-bounding -s BUC60857_BLUE -save xmin_BLUE ymin_BLUE zmin_BLUE xmax_BLUE ymax_BLUE zmax_BLUE -nodraw
-bounding -s BUC60857_RED -save xmin_RED ymin_RED zmin_RED xmax_RED ymax_RED zmax_RED -nodraw
-bounding -s BUC60857_GREEN -save xmin_GREEN ymin_GREEN zmin_GREEN xmax_GREEN ymax_GREEN zmax_GREEN -nodraw
+bounding BUC60857_BLUE -save xmin_BLUE ymin_BLUE zmin_BLUE xmax_BLUE ymax_BLUE zmax_BLUE -nodraw
+bounding BUC60857_RED -save xmin_RED ymin_RED zmin_RED xmax_RED ymax_RED zmax_RED -nodraw
+bounding BUC60857_GREEN -save xmin_GREEN ymin_GREEN zmin_GREEN xmax_GREEN ymax_GREEN zmax_GREEN -nodraw
 
 set delta_area_GB [expr abs(${area_GREEN} - ${area_BLUE}) / ${area_BLUE} * 100]
 set delta_area_BR [expr ${area_BLUE} / ${area_RED}]
index 10048590e2ffb74fb29984cd8071448c4bf31f97..0b195ae839dfe3e462dd988ce41b889ffa348bcc 100644 (file)
@@ -12,7 +12,7 @@ box b1 -100 -50  -2 200 100 1
 
 # text label
 text2brep t "texT | Text\ntexT | Text" -height 50
-bounding -s t -save xx yy zz aTX aTY zz
+bounding t -save xx yy zz aTX aTY zz
 ttranslate t -0.5*aTX -0.5*aTY 1
 
 # sphere
index 1a65ea5bfec08a77d4d40888a05fcf32f877f997..37c522618447548dd1fe50e69e3339e1660bbc09 100755 (executable)
@@ -23,8 +23,8 @@ if [catch { igesbrep . a 6425 } res] {
 
 renamevar a_1 a2
 
-set size1 [ bounding -s a1 -save x1_a1 yy zz x2_a1 yy zz ]
-set size2 [ bounding -s a2 -save x1_a2 yy zz x2_a2 yy zz ]
+set size1 [ bounding a1 -save x1_a1 yy zz x2_a1 yy zz ]
+set size2 [ bounding a2 -save x1_a2 yy zz x2_a2 yy zz ]
 
 set dim2 [ dval x2_a2-x1_a2 ]
 set dim1 [ dval x2_a1-x1_a1 ]
index e8866edf74431cae83714c388374e861c2cea841..400f8f6a7fe1e7a77394ac171b3ceffd5ea49674 100755 (executable)
@@ -18,7 +18,7 @@ set aSetDY1 200
 set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 set aLabel 0:2
 SetShape D ${aLabel} aBox1
@@ -40,7 +40,7 @@ Undo D
 # Get a value of the attribute
 GetShape D ${aLabel} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 4865ff9a27aea3e03f20967982d2426c400baf6e..30dcaa6459de43b5cdf11f2bd53156b4715c2801 100755 (executable)
@@ -18,7 +18,7 @@ set aSetDY1 200
 set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 set aLabel 0:2
 SetShape D ${aLabel} aBox1
@@ -46,7 +46,7 @@ Undo D
 # Get a value of the attribute
 GetShape D ${aLabel} aBox4
 
-bounding -s aBox4 -save X1_Box4 Y1_Box4 Z1_Box4 X2_Box4 Y2_Box4 Z2_Box4
+bounding aBox4 -save X1_Box4 Y1_Box4 Z1_Box4 X2_Box4 Y2_Box4 Z2_Box4
 if { [dval X1_Box1] != [dval X1_Box4] || 
      [dval Y1_Box1] != [dval Y1_Box4] || 
      [dval Z1_Box1] != [dval Z1_Box4] || 
index 1cc057088559858ce1ec75895948d68fdb004fe2..d0053a42df1fe8ae64bea98300dd1a052e86248f 100755 (executable)
@@ -19,7 +19,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 set aLabel 0:2
 SetShape D ${aLabel} aBox1
@@ -49,7 +49,7 @@ if { ${IsDone} != 0 } {
        return
 }
 
-bounding -s aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
+bounding aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
 
 if { [dval X1_Box1] != [dval X1_Box5] || 
      [dval Y1_Box1] != [dval Y1_Box5] || 
index bed8ccc56d2ea5c1a71449f912ab13bce77f9e76..845e26d482b20c9280def424662a5503ec1bb10a 100755 (executable)
@@ -31,7 +31,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 set aLabel 0:2
 SetShape Doc ${aLabel} aBox1
@@ -61,7 +61,7 @@ if { ${IsDone} != 0 } {
        puts "OCC1228: ERROR (case 2)"
 }
 
-bounding -s aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
+bounding aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
 
 if { [dval X1_Box1] != [dval X1_Box5] || 
      [dval Y1_Box1] != [dval Y1_Box5] || 
index df1832792e48d531231569c644a45db2b62ad38d..38c797c12effc5ec42465af400a3a3e19fe590f2 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 # Create a label
 set aLabel 0:2
@@ -67,7 +67,7 @@ if { ${IsDone} != 0 } {
        puts "OCC1228: ERROR (case 2)"
 }
 
-bounding -s aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
+bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
 
 if { [dval X1_Box1] != [dval X1_Box3] || 
      [dval Y1_Box1] != [dval Y1_Box3] || 
index ce280855659a0f37b6e7607b0d69616e8231302e..16db31dcb033af9978b81a25e753eadca465a0ce 100755 (executable)
@@ -35,7 +35,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -75,7 +75,7 @@ if { ${IsDone} != 0 } {
        puts "OCC1228: ERROR (case 2)"
 }
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index b300c2073e28c412ffcd8f55ac6afe754e253b7c..ef122e5b3a14d0ca4c77222e9c524c2b3baba72f 100644 (file)
@@ -173,7 +173,7 @@ if !$Create_Doc {
   # NamedShape
   eval box Box $test_boxXYZ $test_boxDX $test_boxDY $test_boxDZ
   if [catch {GetShape D 0:1:6 b}] {puts "Error: NamedShape not found"
-  } elseif {[bounding -s b -dump] != [bounding -s Box -dump]} {puts "Error: invalid NamedShape"
+  } elseif {[bounding b -dump] != [bounding Box -dump]} {puts "Error: invalid NamedShape"
   } else {
     checkshape b
     checkprops b -l [expr $test_boxDX * 8 + $test_boxDY * 8 + $test_boxDZ * 8]
index 411cf45ad877e6b23d8ba00e3f017cfdcf4d62c4..7e90dbd05cf90cead1a59edcd38e5da89f1388ea 100755 (executable)
@@ -18,7 +18,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 # Create a label
 set aLabel 0:2
@@ -45,7 +45,7 @@ Redo D
 # Get a shape from the label
 GetShape D ${aLabel} aBox3
 
-bounding -s aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
+bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
 
 if { [dval X1_Box1] != [dval X1_Box3] || 
      [dval Y1_Box1] != [dval Y1_Box3] || 
index bb14d464b5352748cfb38c167bce3cc82c2b3448..825941e7ef9066afdcad485de84b3747eb695bc1 100755 (executable)
@@ -18,7 +18,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 # Create a label
 set aLabel 0:2
@@ -45,7 +45,7 @@ Redo D
 # Get a shape from the label
 GetShape D ${aLabel} aBox3
 
-bounding -s aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
+bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
 
 if { [dval X1_Box1] != [dval X1_Box3] || 
      [dval Y1_Box1] != [dval Y1_Box3] || 
index 9db94495e4134dc8bfcfec94b8b64eddd10396ff..10082e143a81429e589d8e8d917b1f3b0b864b7e 100755 (executable)
@@ -18,7 +18,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 # Create a label
 set aLabel 0:2
@@ -55,7 +55,7 @@ if { ${IsDone} != 0 } {
        return
 }
 
-bounding -s aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
+bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
 
 if { [dval X1_Box1] != [dval X1_Box3] || 
      [dval Y1_Box1] != [dval Y1_Box3] || 
index b84e674fc3ef2b81ff40f26038ba9efde9d6c628..8fa211cb11bc16209fb2465f7fdfed0dfdacdfb1 100755 (executable)
@@ -47,7 +47,7 @@ foreach S [directory [concat $aBox1$ter]] {
        puts "SubShape=$S"
 
        #Memorize a bounding box of the selected sub-shape
-       bounding -s ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+       bounding ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
        # Select a sub-shape
        set LABEL [Label D 0:$iSubLabel]
@@ -60,7 +60,7 @@ foreach S [directory [concat $aBox1$ter]] {
        GetShape D ${LABEL} aSubShape
        
        # Get bounding box
-       bounding -s aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+       bounding aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
        
        if {[dval X1_Box1] != [dval X1_Box2] || [dval Y1_Box1] != [dval Y1_Box2] || [dval Z1_Box1] != [dval Z1_Box2] || [dval X2_Box1] != [dval X2_Box2] || [dval Y2_Box1] != [dval Y2_Box2] || [dval Z2_Box1] != [dval Z2_Box2]} {
                puts "SelectGeometry command (${i}): Error"
index 66c64d5b6534f7e1a606de3db2438ce03ec8a22b..ff1799d46efcee7daa1665ea44182341edc72260 100755 (executable)
@@ -47,7 +47,7 @@ foreach S [directory [concat $aBox1$ter]] {
        puts "SubShape=$S"
 
        #Memorize a bounding box of the selected sub-shape
-       bounding -s ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+       bounding ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
        # Select a sub-shape
        set LABEL [Label D 0:$iSubLabel]
@@ -60,7 +60,7 @@ foreach S [directory [concat $aBox1$ter]] {
        GetShape D ${LABEL} aSubShape
        
        # Get bounding box
-       bounding -s aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+       bounding aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
        
        if {[dval X1_Box1] != [dval X1_Box2] || [dval Y1_Box1] != [dval Y1_Box2] || [dval Z1_Box1] != [dval Z1_Box2] || [dval X2_Box1] != [dval X2_Box2] || [dval Y2_Box1] != [dval Y2_Box2] || [dval Z2_Box1] != [dval Z2_Box2]} {
                puts "SelectGeometry command (${i}): Error"
index b1276e6735f1e6169b8421229720cd995be23db8..bf6d006d0dd084f0370e877e8b672f870721c834 100755 (executable)
@@ -47,7 +47,7 @@ foreach S [directory [concat $aBox1$ter]] {
        puts "SubShape=$S"
 
        #Memorize a bounding box of the selected sub-shape
-       bounding -s ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+       bounding ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
        # Select a sub-shape
        set LABEL [Label D 0:$iSubLabel]
@@ -60,7 +60,7 @@ foreach S [directory [concat $aBox1$ter]] {
        GetShape D ${LABEL} aSubShape
        
        # Get bounding box
-       bounding -s aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+       bounding aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
        
        if {[dval X1_Box1] != [dval X1_Box2] || [dval Y1_Box1] != [dval Y1_Box2] || [dval Z1_Box1] != [dval Z1_Box2] || [dval X2_Box1] != [dval X2_Box2] || [dval Y2_Box1] != [dval Y2_Box2] || [dval Z2_Box1] != [dval Z2_Box2]} {
                puts "SelectGeometry command (${i}): Error"
index baaca396fcfd88226979a0a6c547120044496a24..46fb552e9653f673608b3b2023e34735868e506a 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -57,7 +57,7 @@ Redo Doc1
 # Get a shape from 'TLabel1'
 GetShape Doc1 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 8589d2b5fb1c3137bc64b66f00d4da54614c7114..53539ae27a2469e60c8fcfa6c5bd50e3fe4d95b0 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -57,7 +57,7 @@ Redo Doc2
 # Get a shape from 'TLabel1'
 GetShape Doc2 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index dce34e06ff37b5cb627d8f0f9eb6805623aed92e..728d94766fba82ba2eb3bf1e1f78592293fa86ca 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -57,7 +57,7 @@ Redo Doc1
 # Get a shape from 'TLabel1'
 GetShape Doc1 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 9faac9db6c3d3bba29e57f2564fe4fc46e559277..e39cabddcf5a27ff45797d0f1523525086558ddb 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -62,7 +62,7 @@ Redo Doc1
 # Get a shape from 'TLabel1'
 GetShape Doc1 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 3ade9a31bcd71445c7c7969964715d96bf7c4ff1..00925d4aaff154ee612241cff130c8213848892f 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -70,7 +70,7 @@ if { ${IsDone} != 0 } {
        return
 }
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 65a5c7f3c9cd44ace328862e88310648cb597363..ff834a567e0130f23a38ba25f53f87511638fae3 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -57,7 +57,7 @@ Redo Doc2
 # Get a shape from 'TLabel1'
 GetShape Doc2 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 0843d4be8d00684cc03c32bcfc1dd49921ed4f5b..0e76b638fb6aadc2589c51fbe5d98b0ac8c2c163 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -62,7 +62,7 @@ Redo Doc1
 # Get a shape from 'TLabel1'
 GetShape Doc2 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] || 
index 4907c23ed607e494612477dcb3ea072ea9909c3d..3e9fa5355f2c620c6cda351b38aa3dd035918ecf 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -68,7 +68,7 @@ Redo Doc1
 # 11. Get a shape from 'TLabel1'
 GetShape Doc1 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] == [dval X1_Box2] || 
      [dval Y1_Box1] == [dval Y1_Box2] || 
index 70a731f85c3379c98076c7a903aa2ce44a550f1c..ea3f1da4aaf91c821d46c6089d240d685f23ed8f 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -68,7 +68,7 @@ Redo Doc2
 # Get a shape from 'TLabel1'
 GetShape Doc2 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] == [dval X1_Box2] || 
      [dval Y1_Box1] == [dval Y1_Box2] || 
index 3c3cc27b500cb2791450ce7b073bbe7dc0468a3a..5a574c9ab32a2261e072104228da993fb94e1fcb 100755 (executable)
@@ -30,7 +30,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -48,7 +48,7 @@ set aSetDZ12 2300
 
 box aBox12 ${aSetX12} ${aSetY12} ${aSetZ12} ${aSetDX12} ${aSetDY12} ${aSetDZ12}
 
-bounding -s aBox12 -save X1_Box12 Y1_Box12 Z1_Box12 X2_Box12 Y2_Box12 Z2_Box12
+bounding aBox12 -save X1_Box12 Y1_Box12 Z1_Box12 X2_Box12 Y2_Box12 Z2_Box12
 
 SetShape Doc1 ${aLabel12} aBox12
 
@@ -99,12 +99,12 @@ Redo Doc2
 # Get a shape from 'TLabel1'
 GetShape Doc2 ${aLabel2} aBox2
 
-bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 # Get a shape from 'T2Label1'
 GetShape Doc2 ${aLabel22} aBox22
 
-bounding -s aBox22 -save X1_Box22 Y1_Box22 Z1_Box22 X2_Box22 Y2_Box22 Z2_Box22
+bounding aBox22 -save X1_Box22 Y1_Box22 Z1_Box22 X2_Box22 Y2_Box22 Z2_Box22
 
 if { [dval X1_Box1] == [dval X1_Box2] || 
      [dval Y1_Box1] == [dval Y1_Box2] || 
index 35787411e776c4749b7533ce21bf766a2f6f318f..38b22299467e9854543db55dcc56842bf56e5eff 100644 (file)
@@ -37,7 +37,7 @@ proc get_element { type args } {
             global $element
             distmini dd ver $element
             if { [string match "*$type*" [whatis $element]] } {
-               set bbox [bounding -s $element -save xx1 yy1 zz1 xx2 yy2 zz2 ]
+               set bbox [bounding $element -save xx1 yy1 zz1 xx2 yy2 zz2 ]
 # Get distance
                set dv [lindex [dump dd_val] 5]
                if {[expr {[dval xx1-1e-2] <= $x  && $x  <= [dval xx2+1e-2]
index 4faabfcc3b0af0d76e9ec110301447d1b056ae5d..a88cfa676d26d71759d5b3859b257eb84f80970d 100644 (file)
@@ -12,7 +12,7 @@ if [regexp "Cannot write to the file $file" [binsave b $file]] {
   puts "Error: binrestore"
 } else {
   file delete $file
-  if {[bounding -s b -dump] != [bounding -s bb -dump]} {
+  if {[bounding b -dump] != [bounding bb -dump]} {
     puts "Error: restored shape has another bounding box"
   }
   checkshape bb
index 0fe86e53ac0b486568430c8e81a145d19ba826c7..8d4f959502835bdbc1c8e78e3772c550bb536f70 100644 (file)
@@ -12,7 +12,7 @@ if [regexp "Cannot write to the file $file" [binsave b $file]] {
   puts "Error: binrestore"
 } else {
   file delete $file
-  if {[bounding -s b -dump] != [bounding -s bb -dump]} {
+  if {[bounding b -dump] != [bounding bb -dump]} {
     puts "Error: restored shape has another bounding box"
   }
   checkshape bb
index b047cec52d6209b74bedbc4a528b5b727f05fe50..16bbb4480f1ab917b0da0a0e346d2fced6b7dccf 100644 (file)
@@ -12,7 +12,7 @@ if [regexp "Cannot write to the file $file" [binsave b $file]] {
   puts "Error: binrestore"
 } else {
   file delete $file
-  if {[bounding -s b -dump] != [bounding -s bb -dump]} {
+  if {[bounding b -dump] != [bounding bb -dump]} {
     puts "Error: restored shape has another bounding box"
   }
   checkshape bb
index ad95d41dae67593c8ba865b6ccb595ca560f8a19..f2fb6220adc3c4b9470c3203c17673e5c845804c 100644 (file)
@@ -6,17 +6,19 @@ puts ""
 # Implementation of the Oriented Bounding Boxes (OBB) functionality
 #################################################
 
+pload QAcommands
+
 set NbIters 101
 set step [expr 360.0/($NbIters-1) ]
 
 restore [locate_data_file bug29237_no_overlap.lhs.brep] a
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -perfmeter OBBL$i 5
+  OCC29311 a OBBL$i 5
   if { $i != $NbIters } { trotate a 283 162 317 2 7 9 $step }
 }
 
 restore [locate_data_file bug29237_no_overlap.rhs.brep] a
 for {set i 1} { $i <= $NbIters} { incr i } {
-  bounding -s a -obb -perfmeter OBBR$i 5
+  OCC29311 a OBBR$i 5
   if { $i != $NbIters } { trotate a 283 162 317 2 7 9 $step }
 }
index c74849a8296b60f3392039ff84081f2356740c25..77a27bec67bcf0971eb31eb3d8236c0d6307ab86 100644 (file)
@@ -11,7 +11,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 set aLabel 0:2
 SetShape D ${aLabel} aBox1
@@ -33,7 +33,7 @@ set IsDone [catch {GetShape DD ${aLabel} aBox5} aResult]
 if { ${IsDone} != 0 } {
     puts "Error : Get a value of TDataStd_Shape attribute from restoring document"
 } else {
-    bounding -s aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
+    bounding aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
 
 if { [dval X1_Box1] != [dval X1_Box5] || 
      [dval Y1_Box1] != [dval Y1_Box5] || 
index 802ada865b541ece97a7cde356a77d11ec2da476..54b389a719f3589f299e008876f9e8471226afe4 100644 (file)
@@ -11,7 +11,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 # Create a label
 set aLabel 0:2
@@ -41,7 +41,7 @@ if { ${IsDone} != 0 } {
     puts ${aResult}
     puts "Error : Get a value of TNaming_NamedShape attribute from restoring document"
 } else {
-    bounding -s aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
+    bounding aBox3 -save X1_Box3 Y1_Box3 Z1_Box3 X2_Box3 Y2_Box3 Z2_Box3
 
 if { [dval X1_Box1] != [dval X1_Box3] || 
      [dval Y1_Box1] != [dval Y1_Box3] || 
index 8d95cf2d73d6311750302ae212e27821f62759d3..1d27abad19b026badf94a70490d790704a725457 100644 (file)
@@ -27,7 +27,7 @@ set aSetDZ1 300
 
 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
 
-bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
+bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
 
 SetShape Doc1 ${aLabel1} aBox1
 
@@ -59,7 +59,7 @@ set IsDone [catch {GetShape Doc2 ${aLabel2} aBox2} aResult]
 if { ${IsDone} != 0 } {
     puts "Error : Get a value of TNaming_NamedShape attribute from restoring document"
 } else {
-    bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
+    bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
 
 if { [dval X1_Box1] != [dval X1_Box2] || 
      [dval Y1_Box1] != [dval Y1_Box2] ||