0030346: Modeling Algorithms - BRepPrimAPI_MakeRevol throws "BRepSweep_Translation...
[occt.git] / src / BRepTest / BRepTest_MatCommands.cxx
index 1acdec8..7a4d8c1 100644 (file)
@@ -5,8 +5,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
@@ -50,7 +50,7 @@
 #include <DBRep.hxx>
 #include <TopoDS.hxx>
 
-#ifdef WNT
+#ifdef _WIN32
 Standard_IMPORT Draw_Viewer dout;
 #endif
 
@@ -100,9 +100,17 @@ static Standard_Integer drawcont(Draw_Interpretor& , Standard_Integer , const ch
 //           calculate the map of locations bisector on the contour defined by 
 //           the explorer.
 //==========================================================================
-static Standard_Integer mat(Draw_Interpretor& , Standard_Integer, const char**)
+static Standard_Integer mat(Draw_Interpretor&, Standard_Integer n, const char** a)
 {
-  MapBiLo.Compute(anExplo,1,SideOfMat);
+  GeomAbs_JoinType theJoinType = GeomAbs_Arc;
+  if (n  >= 2 && strcmp(a[1], "i") == 0)
+    theJoinType = GeomAbs_Intersection;
+
+  Standard_Boolean IsOpenResult = Standard_False;
+  if (n == 3 && strcmp(a[2], "o") == 0)
+    IsOpenResult = Standard_True;
+  
+  MapBiLo.Compute(anExplo, 1, SideOfMat, theJoinType, IsOpenResult);
   LinkComputed = Standard_False;
 
   return 0;
@@ -191,10 +199,10 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
   Draw_Color                 Couleur;
 
   if (type == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
-    curve = (*(Handle_Geom2d_TrimmedCurve*)&aCurve)->BasisCurve();
+    curve = Handle(Geom2d_TrimmedCurve)::DownCast (aCurve)->BasisCurve();
     type = curve->DynamicType();    
     if (type == STANDARD_TYPE(Bisector_BisecAna)) {
-      curve =(*(Handle_Bisector_BisecAna*)&curve)->Geom2dCurve(); 
+      curve =Handle(Bisector_BisecAna)::DownCast (curve)->Geom2dCurve(); 
       type = curve->DynamicType(); 
     }
     // PB of representation of semi_infinite curves.
@@ -266,7 +274,7 @@ void BRepTest::MatCommands (Draw_Interpretor& theCommands)
 {
   theCommands.Add("topoload","load face",__FILE__,topoload);
   theCommands.Add("drawcont","display current contour",__FILE__,drawcont);
-  theCommands.Add("mat","computes the mat",__FILE__,mat);
+  theCommands.Add("mat","computes the mat: mat [a/i [o]]",__FILE__,mat);
   theCommands.Add("side","side left/right",__FILE__,side);
   theCommands.Add("result","result",__FILE__,result);
   theCommands.Add("zone","zone edge or vertex",__FILE__,zone);