// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <BinTools_CurveSet.ixx>
+
#include <BinTools.hxx>
+#include <BinTools_CurveSet.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
#include <Geom_Circle.hxx>
-#include <Geom_Line.hxx>
+#include <Geom_Curve.hxx>
#include <Geom_Ellipse.hxx>
-#include <Geom_Parabola.hxx>
#include <Geom_Hyperbola.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_TrimmedCurve.hxx>
+#include <Geom_Line.hxx>
#include <Geom_OffsetCurve.hxx>
-
-#include <gp_Lin.hxx>
+#include <Geom_Parabola.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <gp_Circ.hxx>
#include <gp_Elips.hxx>
-#include <gp_Parab.hxx>
#include <gp_Hypr.hxx>
-
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColgp_Array1OfPnt.hxx>
-#include <Standard_Failure.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Parab.hxx>
#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_Array1OfReal.hxx>
#define LINE 1
#define CIRCLE 2
void BinTools_CurveSet::WriteCurve(const Handle(Geom_Curve)& C,
Standard_OStream& OS)
{
- Standard_SStream aMsg;
Handle(Standard_Type) TheType = C->DynamicType();
try {
OCC_CATCH_SIGNALS
OS << Handle(Geom_OffsetCurve)::DownCast(C);
}
else {
- aMsg << "UNKNOWN CURVE TYPE" <<endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure("UNKNOWN CURVE TYPE");
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
+ Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_CurveSet::WriteCurve(..)" << endl;
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
- aMsg << anExc << endl;
- Standard_Failure::Raise(aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
}
Standard_IStream& BinTools_CurveSet::ReadCurve(Standard_IStream& IS,
Handle(Geom_Curve)& C)
{
- Standard_SStream aMsg;
try {
OCC_CATCH_SIGNALS
const Standard_Byte ctype = (Standard_Byte) IS.get();
default:
{
C = NULL;
- aMsg << "UNKNOWN CURVE TYPE" << endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure("UNKNOWN CURVE TYPE");
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
C = NULL;
+ Standard_SStream aMsg;
aMsg <<"EXCEPTION in BinTools_CurveSet::ReadCurve(..)" << endl;
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
- Standard_Failure::Raise(aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
return IS;
}
if (IS.fail() || strcmp(buffer,"Curves")) {
Standard_SStream aMsg;
aMsg << "BinTools_CurveSet::Read: Not a Curve table"<<endl;
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout <<"CurveSet buffer: " << buffer << endl;
#endif
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}