0025246: Make methods Intervals and NbIntervals const in Adaptor3d_Curve and it desce...
[occt.git] / src / BRepAdaptor / BRepAdaptor_CompCurve.cxx
index a2f3ea3..2b9d895 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.
 #include <TopExp.hxx>
 
 BRepAdaptor_CompCurve::BRepAdaptor_CompCurve()
-{
-}
-
-BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
-                                            const Standard_Boolean AC)
-{
-  Initialize(W, AC);
-}
-
-BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
-                                            const Standard_Boolean AC,
-                                            const Standard_Real First,
-                                            const Standard_Real Last,
-                                            const Standard_Real Tol)
-{
-  Initialize(W, AC, First, Last, Tol);
+: TFirst  (0.0),
+  TLast   (0.0),
+  PTol    (0.0),
+  myPeriod(0.0),
+  CurIndex(-1),
+  Forward (Standard_False),
+  IsbyAC  (Standard_False),
+  Periodic(Standard_False)
+{
+}
+
+BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire&     theWire,
+                                             const Standard_Boolean theIsAC)
+: myWire  (theWire),
+  TFirst  (0.0),
+  TLast   (0.0),
+  PTol    (0.0),
+  myPeriod(0.0),
+  CurIndex(-1),
+  Forward (Standard_False),
+  IsbyAC  (theIsAC),
+  Periodic(Standard_False)
+{
+  Initialize(theWire, theIsAC);
+}
+
+BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
+                                             const Standard_Boolean theIsAC,
+                                             const Standard_Real theFirst,
+                                             const Standard_Real theLast,
+                                             const Standard_Real theTolerance)
+: myWire  (theWire),
+  TFirst  (theFirst),
+  TLast   (theLast),
+  PTol    (theTolerance),
+  myPeriod(0.0),
+  CurIndex(-1),
+  Forward (Standard_False),
+  IsbyAC  (theIsAC),
+  Periodic(Standard_False)
+{
+  Initialize(theWire, theIsAC, theFirst, theLast, theTolerance);
 }
 
  void BRepAdaptor_CompCurve::Initialize(const TopoDS_Wire& W,
@@ -86,9 +112,8 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
   Forward = Standard_True; // Defaut ; The Reverse Edges are parsed.
   if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
     TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
-    Standard_Boolean B;
     TopoDS_Vertex VI, VL;
-    B = TopExp::CommonVertex(myCurves->Value(1).Edge(),
+    TopExp::CommonVertex(myCurves->Value(1).Edge(),
                             myCurves->Value(2).Edge(),
                             VI);
     VL = TopExp::LastVertex(myCurves->Value(1).Edge());
@@ -201,7 +226,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
   return myCurves->Value(1).Continuity();
 }
 
- Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S)
+ Standard_Integer BRepAdaptor_CompCurve::NbIntervals(const GeomAbs_Shape S) const
 {
   Standard_Integer NbInt, ii;
   for (ii=1, NbInt=0; ii<=myCurves->Length(); ii++)
@@ -211,7 +236,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
 }
 
  void BRepAdaptor_CompCurve::Intervals(TColStd_Array1OfReal& T,
-                                      const GeomAbs_Shape S)
+                                       const GeomAbs_Shape S) const
 {
   Standard_Integer ii, jj, kk, n;
   Standard_Real f, F, delta;