]> OCCT Git - occt-copy.git/commitdiff
0023964: Extrema_ExtXX::Point methods might return constant reference instead of...
authorazv <azv@opencascade.com>
Thu, 19 Sep 2013 11:56:51 +0000 (15:56 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 20 Sep 2013 08:09:45 +0000 (12:09 +0400)
Changed definitions of Point() functions
Removal of floating point exceptions from previous commit

34 files changed:
src/Extrema/Extrema_ExtPElC.cdl
src/Extrema/Extrema_ExtPElC.cxx
src/Extrema/Extrema_ExtPElC2d.cdl
src/Extrema/Extrema_ExtPElC2d.cxx
src/Extrema/Extrema_ExtPElS.cdl
src/Extrema/Extrema_ExtPElS.cxx
src/Extrema/Extrema_ExtPExtS.cdl
src/Extrema/Extrema_ExtPExtS.cxx
src/Extrema/Extrema_ExtPRevS.cdl
src/Extrema/Extrema_ExtPRevS.cxx
src/Extrema/Extrema_ExtPS.cdl
src/Extrema/Extrema_ExtPS.cxx
src/Extrema/Extrema_ExtPSOfRev.cdl
src/Extrema/Extrema_ExtPSOfRev.gxx
src/Extrema/Extrema_FuncExtPC.cdl
src/Extrema/Extrema_FuncExtPC.gxx
src/Extrema/Extrema_FuncExtPS.cdl
src/Extrema/Extrema_FuncExtPS.cxx
src/Extrema/Extrema_FuncExtSS.cdl
src/Extrema/Extrema_FuncExtSS.cxx
src/Extrema/Extrema_GExtPC.cdl
src/Extrema/Extrema_GExtPC.gxx
src/Extrema/Extrema_GLocateExtPC.cdl
src/Extrema/Extrema_GLocateExtPC.gxx
src/Extrema/Extrema_GenExtPC.cdl
src/Extrema/Extrema_GenExtPC.gxx
src/Extrema/Extrema_GenExtPS.cdl
src/Extrema/Extrema_GenExtPS.cxx
src/Extrema/Extrema_GenExtSS.cdl
src/Extrema/Extrema_GenExtSS.cxx
src/Extrema/Extrema_GenLocateExtPC.cdl
src/Extrema/Extrema_GenLocateExtPC.gxx
src/Extrema/Extrema_GenLocateExtPS.cdl
src/Extrema/Extrema_GenLocateExtPS.cxx

index 06db9e9b70d7106545f178a7425c0397deaadb0c..0e2750bf472f44f5ac2a89f430bd0cb9b5154f69 100755 (executable)
@@ -138,6 +138,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnCurv
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth extremum distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index 685c7c004c6344e814001287d2502898fe4bb94b..5eca62834cdfa9ca3b2e85b2af4f264a30ac2177 100755 (executable)
@@ -444,7 +444,7 @@ Standard_Boolean Extrema_ExtPElC::IsMin (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnCurv Extrema_ExtPElC::Point (const Standard_Integer N) const
+const Extrema_POnCurv& Extrema_ExtPElC::Point (const Standard_Integer N) const
 {
   if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
   return myPoint[N-1];
index 06cf926dce144ef223522e74369805254905a64e..40083548ac7a3a9e7a6f3f269ab8e85649d6708f 100755 (executable)
@@ -142,6 +142,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnCurv2d
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth extremum distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index bf9a8e6d3cf3063d5ded86c52705685bd6aa76a5..96dfd41393dbf51e1efa6495097664c892630fea 100755 (executable)
@@ -328,7 +328,7 @@ Standard_Boolean Extrema_ExtPElC2d::IsMin (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnCurv2d Extrema_ExtPElC2d::Point (const Standard_Integer N) const
+const Extrema_POnCurv2d& Extrema_ExtPElC2d::Point (const Standard_Integer N) const
 {
   if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
   return myPoint[N-1];
index e5bc527b075f0e7a68d7a0bb23590abc269a5275..19a36a1088b5e27bf553bfd94d832e318ad6b0d3 100755 (executable)
@@ -101,6 +101,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index 63586dd6d1ea8fda403a11bddb51556342a9bc99..16d8313e88687e06c6dd87c74bca7aaf0dc9844a 100755 (executable)
@@ -408,7 +408,7 @@ Standard_Real Extrema_ExtPElS::SquareDistance (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_ExtPElS::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_ExtPElS::Point (const Standard_Integer N) const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
index 2e8bc89cefcf4b9fe2078ac37bf30f12d35cbbe2..06f087bc11ade28989db2f6645e32ab2ad0ed23b 100755 (executable)
@@ -88,6 +88,7 @@ is
                    is static;
 
     Point (me; N: Integer) returns POnSurf
+    ---C++: return const &
     ---Purpose: Returns the point of the Nth resulting distance.
                    raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index 76c4e42daa3343e7af25b684f994f50968285445..77184e48165355932797c37b60d1279ecfaa2047 100755 (executable)
@@ -416,7 +416,7 @@ Standard_Real Extrema_ExtPExtS::SquareDistance (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_ExtPExtS::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_ExtPExtS::Point (const Standard_Integer N) const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
index 1f4bedad8bd499c11ec9ee50585a2a3d88369616..a1782b3e8c30c9eefabc8a91992c505b0b17cf80 100755 (executable)
@@ -85,6 +85,7 @@ is
                    is static;
 
     Point (me; N: Integer) returns POnSurf
+    ---C++: return const &
     ---Purpose: Returns the point of the Nth resulting distance.
                    raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index 203726c333e3c187b0d1c031f2f7cfd2cb17532d..443396cd6e8f4ecab7b320a4995e11bf0a56682c 100755 (executable)
@@ -528,7 +528,7 @@ Standard_Real Extrema_ExtPRevS::SquareDistance(const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Extrema_POnSurf Extrema_ExtPRevS::Point(const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_ExtPRevS::Point(const Standard_Integer N) const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
index 866e68d9d90c80ff9ffb30cb21f0639d359c228f..361f79c3d1506cb1cb68dfb912bff6832e3481d7 100755 (executable)
@@ -116,6 +116,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index cfcf009a5bc23a93f625e7fca56c033d31c0e350..61ab55ac933d6d3ed5529eef93ed983ee702d35a 100755 (executable)
@@ -332,7 +332,7 @@ Standard_Integer Extrema_ExtPS::NbExt() const
 
 
 
-Extrema_POnSurf Extrema_ExtPS::Point(const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_ExtPS::Point(const Standard_Integer N) const
 {
   if(!myDone) StdFail_NotDone::Raise();
   return myPoints.Value(N);
index 6b05f96bb3f41fa075c496e21ce4ef01c8ffcfeb..5548632f0e64c01d99b31d0ece941be8775ec025 100755 (executable)
@@ -66,6 +66,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index b2ca56185efcf7eeb439e1a2cab4f7bbb27e4aee..01cc292b6435a0f14194ce084246925b4a0b3f2b 100755 (executable)
@@ -102,7 +102,7 @@ Standard_Real Extrema_ExtPSOfRev::SquareDistance (const Standard_Integer N) cons
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_ExtPSOfRev::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_ExtPSOfRev::Point (const Standard_Integer N) const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myPoint.Value(N);
index 6a7f9be3d211f957946fc5816593f1a3a6084b5d..f73b0776d327bcf57ac2bc9283f58ce5cb6937d2 100755 (executable)
@@ -89,6 +89,7 @@ is
                -- if N < 1 or N > NbExt(me).
 
     Point (me; N: Integer) returns POnC
+        ---C++: return const &
        ---Purpose: Returns the Nth extremum.
        raises  OutOfRange from Standard,
                 TypeMismatch from Standard;
index 1f9753985c203944f65dc98b467582630b54efa2..b10ba260ee5d04a99caf8fbdbc55dc7c8748372a 100755 (executable)
@@ -411,7 +411,7 @@ Standard_Boolean Extrema_FuncExtPC::IsMin (const Standard_Integer N) const
   return (myIsMin.Value(N) == 1);
 }
 //=============================================================================
-POnC Extrema_FuncExtPC::Point (const Standard_Integer N) const
+const POnC & Extrema_FuncExtPC::Point (const Standard_Integer N) const
 {
   if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
   return myPoint.Value(N);
index 1303a74cec87f3a9d20658496818635f743ebc40..d3e803bc4d44cc3e73c64bb23e24f548bfe18e61 100755 (executable)
@@ -105,6 +105,7 @@ is
                -- if N < 1 or N > NbExt(me).
 
     Point (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the Nth extremum.
        raises  OutOfRange;
                -- if N < 1 or N > NbExt(me).
index f80d35e8d85bebd9991d08abf8a9e9b343ef1329..01524031c2b3fff424aec6ace72a1668c78865d0 100755 (executable)
@@ -160,7 +160,7 @@ Standard_Real Extrema_FuncExtPS::SquareDistance (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_FuncExtPS::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_FuncExtPS::Point (const Standard_Integer N) const
 {
   if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
   return myPoint.Value(N);
index 948567ee4adec311d863183f06e395ba99416167..9bf7db2379a8622e7371eb8a0550e225748a167b 100755 (executable)
@@ -78,11 +78,13 @@ is
                -- if N < 1 or N > NbExt(me).
 
     PointOnS1 (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Return the Nth extremum on S1.
        raises  OutOfRange;
                -- if N < 1 or N > NbExt(me).
 
     PointOnS2 (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Renvoie le Nieme extremum sur S2.
        raises  OutOfRange;
                -- si N < 1 ou N > NbExt(me).
index 75874346e7ce5305a0f2954d8747a6eb8c585bda..6da12fc7c100deb5936da27da47523fc9b5c6278 100755 (executable)
@@ -257,7 +257,7 @@ Standard_Real Extrema_FuncExtSS::SquareDistance (const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Extrema_POnSurf Extrema_FuncExtSS::PointOnS1 (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_FuncExtSS::PointOnS1 (const Standard_Integer N) const
 {
   if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
   return myPoint1.Value(N);
@@ -267,7 +267,7 @@ Extrema_POnSurf Extrema_FuncExtSS::PointOnS1 (const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Extrema_POnSurf Extrema_FuncExtSS::PointOnS2 (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_FuncExtSS::PointOnS2 (const Standard_Integer N) const
 {
   if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
   return myPoint2.Value(N);
index 98e45380c84518379656a3713568d8feb9989404..a397868679056eded21d8e23b294daa987692957 100755 (executable)
@@ -118,6 +118,7 @@ is
     is static;
     
     Point(me; N: Integer from Standard) returns ThePOnC
+        ---C++: return const &
        ---Purpose: Returns the point of the <N>th extremum distance.
     raises NotDone    from StdFail, 
           OutOfRange from Standard
index e27e64382c13a6d279d7902de86063b9a3c53b09..6250bcf10d86e8cc99295f32cba7a5d9dfb7d586 100755 (executable)
@@ -337,7 +337,7 @@ Standard_Boolean Extrema_GExtPC::IsMin(const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-ThePOnC Extrema_GExtPC::Point(const Standard_Integer N) const
+const ThePOnC & Extrema_GExtPC::Point(const Standard_Integer N) const
 {
   if(!mydone) StdFail_NotDone::Raise();
   if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
index 6eb07f6bbd7b396ae0b3afec919d82f240b13466..35bf17fc9716964c0bae04269fcef6572bf0a9cf 100755 (executable)
@@ -119,6 +119,7 @@ is
        is static;
 
     Point (me) returns ThePOnC
+        ---C++: return const &
        ---Purpose: Returns the point of the extremum distance.
        raises  NotDone from StdFail
                -- if IsDone(me)=False.
index 21c0055262aaf133c4ab34e5f4f634e727bea449..35e0d596c1f9a892ed7e4b282a24320d92a7bc7b 100755 (executable)
@@ -330,20 +330,14 @@ Standard_Boolean Extrema_GLocateExtPC::IsMin () const
 //purpose  : 
 //=======================================================================
 
-ThePOnC Extrema_GLocateExtPC::Point () const 
+const ThePOnC & Extrema_GLocateExtPC::Point () const 
 {
   if (!myDone) { StdFail_NotDone::Raise(); }
-  ThePOnC P;
   if (type == GeomAbs_BezierCurve) {
-    P = myLocExtPC.Point();
+    return myLocExtPC.Point();
   }
   else if(type == GeomAbs_BSplineCurve || type == GeomAbs_OtherCurve) {
-    P =  mypp;
+    return mypp;
   }
-  else {
-    if (numberext != 0) {
-      P = myExtremPC.Point(numberext);
-    }
-  }
-  return P;
+  return myExtremPC.Point(numberext);
 }
index 35a58630161ca85b0282b85041c02f03f33285c3..cf832357b1d7e4ec7493e4067755e39b9593ad5b 100755 (executable)
@@ -133,6 +133,7 @@ is
 
 
     Point (me; N: Integer) returns POnC
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth extremum distance.
     raises TypeMismatch from Standard,
           NotDone from StdFail,
index 2d5a3b929b5d0053b7e6dc5e2b12e885f8983e81..7227024a464f8c15852ee4e6d7856a31c27c9891 100755 (executable)
@@ -235,7 +235,7 @@ Standard_Boolean Extrema_GenExtPC::IsMin (const Standard_Integer N) const {
 //purpose  : 
 //=======================================================================
 
-POnC Extrema_GenExtPC::Point (const Standard_Integer N) const 
+const POnC & Extrema_GenExtPC::Point (const Standard_Integer N) const 
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myF.Point(N);
index e5eaf180ef2762ff0210f7a59fff19f52c47082c..86c4477cd6d5964f7a44108e04670315202279e9 100755 (executable)
@@ -126,6 +126,7 @@ is
        is static;
 
     Point (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index 82982b6d49ee240025152668bf1e984606f22c07..37181864d39f5e781a5e00235f743f5abe171b9e 100755 (executable)
@@ -953,7 +953,7 @@ Standard_Real Extrema_GenExtPS::SquareDistance (const Standard_Integer N) const
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_GenExtPS::Point (const Standard_Integer N) const
+const Extrema_POnSurf& Extrema_GenExtPS::Point (const Standard_Integer N) const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myF.Point(N);
index 28835155e6e3d3a927230eeba46b6c2d26335e02..22c5e5825ef47b64a9070bd84ae181c5c8402fe0 100755 (executable)
@@ -111,6 +111,7 @@ is
        is static;
 
     PointOnS1 (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
@@ -119,6 +120,7 @@ is
        is static;
 
     PointOnS2 (me; N: Integer) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the Nth resulting distance.
        raises  NotDone from StdFail,
                -- if IsDone(me)=False.
index e0e29c96811596539175ab7533cabf2920921775..876d7d9ae073e7158220f14ebe657535aff7384f 100755 (executable)
@@ -321,7 +321,7 @@ Standard_Real Extrema_GenExtSS::SquareDistance(const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Extrema_POnSurf Extrema_GenExtSS::PointOnS1(const Standard_Integer N) const 
+const Extrema_POnSurf& Extrema_GenExtSS::PointOnS1(const Standard_Integer N) const 
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myF.PointOnS1(N);
@@ -332,7 +332,7 @@ Extrema_POnSurf Extrema_GenExtSS::PointOnS1(const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Extrema_POnSurf Extrema_GenExtSS::PointOnS2(const Standard_Integer N) const 
+const Extrema_POnSurf& Extrema_GenExtSS::PointOnS2(const Standard_Integer N) const 
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myF.PointOnS2(N);
index 82107cfff4a6fc60f7676932a8df4453f85059a8..252fbd9df353225c68777a8694742151056f0928 100755 (executable)
@@ -102,6 +102,7 @@ is
        is static;
 
     Point (me) returns POnC
+        ---C++: return const &
        ---Purpose: Returns the point of the extremum distance.
        raises  NotDone from StdFail
                -- if IsDone(me)=False.
index b245e32ef5a8416d67590d04e2c9372341cac87e..5e2953313f7d6640031ce6af71dd1a07ba46037b 100755 (executable)
@@ -167,7 +167,7 @@ Standard_Boolean Extrema_GenLocateExtPC::IsMin () const
 //purpose  : 
 //=======================================================================
 
-POnC Extrema_GenLocateExtPC::Point () const 
+const POnC & Extrema_GenLocateExtPC::Point () const 
 {
   if (!myDone) { StdFail_NotDone::Raise(); }
   return myF.Point(1);
index 172ad500d5d0ed5e8e73965a931bfe62b93bc737..5409f27148e4a6837f44c91397b30e66c901a5f3 100755 (executable)
@@ -60,6 +60,7 @@ is
        is static;
 
     Point (me) returns POnSurf
+        ---C++: return const &
        ---Purpose: Returns the point of the extremum distance.
        raises  NotDone from StdFail
                -- if IsDone(me)=False.
index c47c38c21eb35e4080ce36e7900e8c0b5a635338..41e7900881ff3bd083abc34217581adf5fd02363 100755 (executable)
@@ -101,7 +101,7 @@ Standard_Real Extrema_GenLocateExtPS::SquareDistance () const
 }
 //=============================================================================
 
-Extrema_POnSurf Extrema_GenLocateExtPS::Point () const
+const Extrema_POnSurf& Extrema_GenLocateExtPS::Point () const
 {
   if (!IsDone()) { StdFail_NotDone::Raise(); }
   return myPoint;