mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0026937: Eliminate NO_CXX_EXCEPTION macro support
Macro NO_CXX_EXCEPTION was removed from code. Method Raise() was replaced by explicit throw statement. Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer. Method Standard_Failure::Caught() is deprecated now. Eliminated empty constructors. Updated samples. Eliminate empty method ChangeValue from NCollection_Map class. Removed not operable methods from NCollection classes.
This commit is contained in:
@@ -49,8 +49,7 @@ Standard_Boolean ShapeAnalysis_BoxBndTreeSelector::
|
||||
Accept (const Standard_Integer& theObj)
|
||||
{
|
||||
if (theObj < 1 || theObj > mySeq->Length())
|
||||
Standard_NoSuchObject::Raise
|
||||
("ShapeAnalysis_BoxBndTreeSelector::Accept : no such object for current index");
|
||||
throw Standard_NoSuchObject("ShapeAnalysis_BoxBndTreeSelector::Accept : no such object for current index");
|
||||
Standard_Boolean IsAccept = Standard_False;
|
||||
if (myList.Contains(theObj))
|
||||
return Standard_False;
|
||||
|
@@ -256,12 +256,14 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D,
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
OK = Standard_False;
|
||||
#ifdef OCCT_DEBUG //:s5
|
||||
catch(Standard_Failure const& anException) {
|
||||
#ifdef OCCT_DEBUG
|
||||
//:s5
|
||||
cout << "\nWarning: ShapeAnalysis_Curve::ProjectAct(): Exception in Extrema_ExtPC: ";
|
||||
Standard_Failure::Caught()->Print(cout); cout << endl;
|
||||
anException.Print(cout); cout << endl;
|
||||
#endif
|
||||
(void)anException;
|
||||
OK = Standard_False;
|
||||
}
|
||||
|
||||
//szv#4:S4163:12Mar99 moved
|
||||
|
@@ -474,12 +474,14 @@ static Handle(Geom_Curve) ComputeIso
|
||||
if (utype) iso = surf->UIso (par);
|
||||
else iso = surf->VIso (par);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
iso.Nullify();
|
||||
#ifdef OCCT_DEBUG //:s5
|
||||
catch(Standard_Failure const& anException) {
|
||||
#ifdef OCCT_DEBUG
|
||||
//:s5
|
||||
cout << "\nWarning: ShapeAnalysis_Surface, ComputeIso(): Exception in UVIso(): ";
|
||||
Standard_Failure::Caught()->Print(cout); cout << endl;
|
||||
anException.Print(cout); cout << endl;
|
||||
#endif
|
||||
(void)anException;
|
||||
iso.Nullify();
|
||||
}
|
||||
return iso;
|
||||
}
|
||||
@@ -1155,22 +1157,24 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real
|
||||
|
||||
} // end Try ValueOfUV (CKY 30-DEC-1997)
|
||||
|
||||
catch(Standard_Failure) {
|
||||
catch(Standard_Failure const& anException) {
|
||||
#ifdef OCCT_DEBUG
|
||||
// Pas de raison mais qui sait. Mieux vaut retourner un truc faux que stopper
|
||||
// L ideal serait d avoir un status ... mais qui va l interroger ?
|
||||
// Avec ce status, on saurait que ce point est a sauter et voila tout
|
||||
// En attendant, on met une valeur "pas idiote" mais surement fausse ...
|
||||
//szv#4:S4163:12Mar99 optimized
|
||||
//szv#4:S4163:12Mar99 optimized
|
||||
//:s5
|
||||
cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: ";
|
||||
anException.Print(cout); cout << endl;
|
||||
#endif
|
||||
(void)anException;
|
||||
S = (Precision::IsInfinite(uf))? 0 : (uf+ul) / 2.;
|
||||
T = (Precision::IsInfinite(vf))? 0 : (vf+vl) / 2.;
|
||||
#ifdef OCCT_DEBUG //:s5
|
||||
cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: ";
|
||||
Standard_Failure::Caught()->Print(cout); cout << endl;
|
||||
#endif
|
||||
}
|
||||
} //:c9
|
||||
//szv#4:S4163:12Mar99 waste raise
|
||||
//if (!computed) Standard_NoSuchObject::Raise("PCurveLib_ProjectPointOnSurf::ValueOfUV untreated surface type");
|
||||
//if (!computed) throw Standard_NoSuchObject("PCurveLib_ProjectPointOnSurf::ValueOfUV untreated surface type");
|
||||
if (computed) { if (myGap <= 0) myGap = P3D.Distance (SurfAdapt.Value (S,T)); }
|
||||
else { myGap = -1.; S = 0.; T = 0.; }
|
||||
return gp_Pnt2d( S, T);
|
||||
@@ -1359,12 +1363,14 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d,const Standard_
|
||||
U = UU; V = VV;
|
||||
|
||||
} // fin try RAJOUT
|
||||
catch(Standard_Failure) {
|
||||
theMin = RealLast(); // theMin de depart
|
||||
#ifdef OCCT_DEBUG //:s5
|
||||
catch(Standard_Failure const& anException) {
|
||||
#ifdef OCCT_DEBUG
|
||||
//:s5
|
||||
cout << "\nWarning: ShapeAnalysis_Curve::UVFromIso(): Exception: ";
|
||||
Standard_Failure::Caught()->Print(cout); cout << endl;
|
||||
anException.Print(cout); cout << endl;
|
||||
#endif
|
||||
(void)anException;
|
||||
theMin = RealLast(); // theMin de depart
|
||||
}
|
||||
return theMin;
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ void ShapeAnalysis_WireOrder::Add(const gp_XYZ& start3d,const gp_XYZ& end3d)
|
||||
{
|
||||
//szv#4:S4163:12Mar99 waste raise
|
||||
//if (!myMode)
|
||||
//Standard_TypeMismatch::Raise("ShapeAnalysis_WireOrder : AddXYZ");
|
||||
//throw Standard_TypeMismatch("ShapeAnalysis_WireOrder : AddXYZ");
|
||||
if (myMode) {
|
||||
myXYZ->Append (start3d); myXYZ->Append (end3d);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ void ShapeAnalysis_WireOrder::Add(const gp_XY& start2d,const gp_XY& end2d)
|
||||
{
|
||||
//szv#4:S4163:12Mar99 waste raise
|
||||
//if ( myMode)
|
||||
//Standard_TypeMismatch::Raise("ShapeAnalysis_WireOrder : AddXY");
|
||||
//throw Standard_TypeMismatch("ShapeAnalysis_WireOrder : AddXY");
|
||||
if (!myMode) {
|
||||
gp_XYZ val;
|
||||
val.SetCoord (start2d.X(),start2d.Y(),0.);
|
||||
|
Reference in New Issue
Block a user