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.
@subsubsection occt_fcug_2_4_4 Implementation on various platforms.
-The exception handling mechanism in Open CASCADE Technology is implemented in different ways depending on the preprocessor macros *NO_CXX_EXCEPTIONS* and *OCC_CONVERT_SIGNALS*, which shall be consistently defined by compilation procedures for both Open CASCADE Technology and user applications:
+The exception handling mechanism in Open CASCADE Technology is implemented in different ways depending on the preprocessor macro *OCC_CONVERT_SIGNALS*, which shall be consistently defined by compilation procedures for both Open CASCADE Technology and user applications:
1. On Windows, these macros are not defined by default, and normal C++ exceptions are used in all cases, including throwing from signal handler. Thus the behavior is as expected in C++.
* macro *OCC_CATCH_SIGNALS* is necessary (besides call to *OSD::SetSignal()* described above) for conversion of signals into exceptions;
* the destructors for automatic C++ objects created in the code after that macro and till the place where signal is raised will not be called in case of signal, since no C++ stack unwinding is performed by long jump.
-3. On Linux Open CASCADE Technology can also be compiled in compatibility mode. In that case macro *NO_CXX_EXCEPTIONS* is defined and the C++ exceptions are simulated with C long jumps. As a consequence, the behavior is slightly different from that expected in the C++ standard.
-
-While exception handling with *NO_CXX_EXCEPTIONS* is very similar to C++ by syntax, it has a number of peculiarities that should be taken into account:
-
-* try and catch are actually macros defined in the file *Standard_ErrorHandler.hxx*. Therefore, including this file is necessary for handling OCCT exceptions;
-* due to being a macro, catch cannot contain a declaration of the exception object after its type; only type is allowed in the catch statement. Use method *Standard_Failure::Caught()* to access an exception object;
-* catch macro may conflict with some STL classes that might use catch(...) statements in their header files. So STL headers should not be included after *Standard_ErrorHandler.hxx*;
-* Open CASCADE Technology try/catch block will not handle normal C++ exceptions; however this can be achieved using special workarounds;
-* the try macro defines a C++ object that holds an entry point in the exception handler. Therefore if exception is raised by code located immediately after the try/catch block but on the same nesting level as *try*, it may be handled by that *catch*. This may lead to unexpected behavior, including infinite loop. To avoid that, always surround the try/catch block with curved brackets;
-* the destructors of C++ objects allocated on the stack after handler initialization are not called by exception raising.
-
-In general, for writing platform-independent code it is recommended to insert macros *OCC_CATCH_SIGNALS* in try {} blocks or other code where signals may happen. For compatibility with previous versions of Open CASCADE Technology the limitations described above for *NO_CXX_EXCEPTIONS* shall be assumed.
+In general, for writing platform-independent code it is recommended to insert macros *OCC_CATCH_SIGNALS* in try {} blocks or other code where signals may happen.
@subsection occt_fcug_2_5 Plug-In Management
case CurAction2d_GlobalPanning :// noting
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
myCurrentMode = CurAction2d_Nothing;
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
case CurAction2d_GlobalPanning : // nothing
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
if (!(W.Closed())){
AfxMessageBox (L"Wire is not closed!");
return;
- //Standard_Failure::Raise("Wire is not closed");
+ //throw Standard_Failure("Wire is not closed");
}
BRepBuilderAPI_MakeFace MF(support,W,Standard_True);
{
myPresentation->DoSample();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
- aSStream << "An exception was caught: " << Standard_Failure::Caught() << ends;
+ aSStream << "An exception was caught: " << anException << ends;
CString aMsg = aSStream.str().c_str();
AfxMessageBox (aMsg);
}
// Get the TNaming_NamedShape attributes of these labels
Handle(TNaming_NamedShape) OriginalNShape, ToolNShape;
if (!( OriginalLab.FindAttribute(TNaming_NamedShape::GetID(),OriginalNShape) ))
- Standard_Failure::Raise("TOcaf_Commands::CutObjects");
+ throw Standard_Failure("TOcaf_Commands::CutObjects");
if (!( ToolLab.FindAttribute(TNaming_NamedShape::GetID(),ToolNShape) ))
- Standard_Failure::Raise("TOcaf_Commands::CutObjects");
+ throw Standard_Failure("TOcaf_Commands::CutObjects");
// Now, let's get the TopoDS_Shape of these TNaming_NamedShape:
TopoDS_Shape OriginalShape = OriginalNShape->Get();
{
myPresentation->DoSample();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
- aSStream << "An exception was caught: " << Standard_Failure::Caught() << ends;
+ aSStream << "An exception was caught: " << anException << ends;
CString aMsg = aSStream.str().c_str();
// aSStream.rdbuf()->freeze(0); // allow deletion of dynamic array
AfxMessageBox (aMsg);
case CurAction2d_GlobalPanning :
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
myView->StartRotation(point.x,point.y);
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
myCurrentMode = CurAction3d_Nothing;
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
myView->Redraw();
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & CASCADESHORTCUTKEY ) else
SetTimer ( 1 , 100 , NULL ) ;
break ;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
KillTimer ( 1 ) ;
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
case CurrentAction3d_Turn :
break ;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
{
myPresentation->DoSample();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
Standard_SStream aSStream;
- aSStream << "An exception was caught: " << Standard_Failure::Caught() << ends;
+ aSStream << "An exception was caught: " << anException << ends;
CString aMsg = aSStream.str().c_str();
AfxMessageBox (aMsg);
}
TheCircularGridDialog.ShowWindow(SW_SHOW);
break;
default :
- Standard_Failure::Raise("invalid Aspect_GridType");
+ throw Standard_Failure("invalid Aspect_GridType");
}
}
void OCC_2dView::OnUpdateBUTTONGridValues(CCmdUI* pCmdUI)
case CurAction2d_GlobalPanning :// nothing
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
myCurrentMode = CurAction2d_Nothing;
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( CASCADESHORTCUTKEY )
case CurAction2d_GlobalPanning : // nothing
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & CASCADESHORTCUTKEY ) else
TheCircularGridDialog.ShowWindow(SW_SHOW); \n\
break; \n\
default : \n\
- Standard_Failure::Raise(\"invalid Aspect_GridType\"); \n\
+ throw Standard_Failure(\"invalid Aspect_GridType\"); \n\
} \n\
\n");
// Update The Result Dialog
myView->StartRotation(point.x,point.y);
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
}
}
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
} //switch (myCurrentMode)
} // else // if ( Ctrl )
myView->Redraw();
break;
default :
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}// switch (myCurrentMode)
}// if ( nFlags & MK_CONTROL ) else
nReturnCode = pApp->Run();
}
// if(_Function.Catches(STANDARD_TYPE(Standard_Failure)))
- catch(Standard_Failure)
+ catch(Standard_Failure const& anException)
{
Standard_SStream ostr;
- ostr<<Standard_Failure::Caught()<<"\n\0";
+ ostr<<anException<<"\n\0";
CString aMsg = ostr.str().c_str();
MessageBoxW (NULL, aMsg, L"CasCade Error", MB_ICONERROR);
goto Application; // restart application loop
myView->StartRotation( point.x(), point.y() );
break;
default:
- Standard_Failure::Raise( "incompatible Current Mode" );
+ throw Standard_Failure( "incompatible Current Mode" );
break;
}
}
noActiveActions();
break;
default:
- Standard_Failure::Raise(" incompatible Current Mode ");
+ throw Standard_Failure(" incompatible Current Mode ");
break;
}
activateCursor( myCurrentMode );
myView->Redraw();
break;
default:
- Standard_Failure::Raise( "incompatible Current Mode" );
+ throw Standard_Failure( "incompatible Current Mode" );
break;
}
}
// The text position point for angle dimension should belong to the working plane.
if (!GetPlane().Contains (theTextPos, Precision::Confusion()))
{
- Standard_ProgramError::Raise ("The text position point for angle dimension doesn't belong to the working plane.");
+ throw Standard_ProgramError("The text position point for angle dimension doesn't belong to the working plane.");
}
myIsTextPositionFixed = Standard_True;
{
if (theAnimation.IsNull())
{
- Standard_ProgramError::Raise ("AIS_Animation::Add() - attempt to add a NULL animation!");
+ throw Standard_ProgramError("AIS_Animation::Add() - attempt to add a NULL animation!");
}
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
{
if (myTimer.IsNull())
{
- Standard_ProgramError::Raise ("AIS_Animation::UpdateTimer() - timer was not created!");
+ throw Standard_ProgramError("AIS_Animation::UpdateTimer() - timer was not created!");
}
const Standard_Real anElapsedTime = myTimer->ElapsedTime();
void AIS_Axis::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Axis::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Axis::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Circle::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Circle::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
}
else
{
- Standard_ProgramError::Raise ("AIS_ConnectedInteractive::Connect() - object without own presentation can not be connected");
+ throw Standard_ProgramError("AIS_ConnectedInteractive::Connect() - object without own presentation can not be connected");
}
if (!myReference.IsNull())
// do not build any dimension for equal points
if (theFirstPoint.IsEqual (theSecondPoint, Precision::Confusion()))
{
- Standard_ProgramError::Raise ("Can not build presentation for equal points.");
+ throw Standard_ProgramError("Can not build presentation for equal points.");
}
Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
if (!AdjustParametersForLinear (myFixedTextPosition, theFirstPoint, theSecondPoint,
anExtensionSize, aHorisontalTextPos, myFlyout, myPlane, myIsPlaneCustom))
{
- Standard_ProgramError::Raise ("Can not adjust plane to the custom label position.");
+ throw Standard_ProgramError("Can not adjust plane to the custom label position.");
}
}
}
else
{
- Standard_ConstructionError::Raise("AIS:: Not expected type of surface") ;
+ throw Standard_ConstructionError("AIS:: Not expected type of surface") ;
return;
}
{
if(Offset <0.0 && Abs(Offset) > myEllipse.MinorRadius ())
{
- Standard_ConstructionError::Raise("AIS:: Absolute value of negative offset is larger than MinorRadius");
+ throw Standard_ConstructionError("AIS:: Absolute value of negative offset is larger than MinorRadius");
return;
}
}
if( !find )
{
- Standard_ConstructionError::Raise("AIS:: Curve is not an ellipsee or is Null") ;
+ throw Standard_ConstructionError("AIS:: Curve is not an ellipsee or is Null") ;
return;
}
void AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/,
const Handle( Prs3d_Presentation )& /*aPresentation*/)
{
-// Standard_NotImplemented::Raise("AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )&,
+// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )&,
// const Handle( Prs3d_Presentation )& )");
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)&,
+// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)&,
// const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/,
const Handle( Prs3d_Presentation )& /*aPresentation*/)
{
-// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )&,const Handle( Prs3d_Presentation )& )");
+// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )&,const Handle( Prs3d_Presentation )& )");
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
{
if (theIObj->myCTXPtr != this)
{
- Standard_ProgramError::Raise ("AIS_InteractiveContext - object has been displayed in another context!");
+ throw Standard_ProgramError("AIS_InteractiveContext - object has been displayed in another context!");
}
theIObj->SetContext (Handle(AIS_InteractiveContext)());
}
{
if (theObj->myCTXPtr != this)
{
- Standard_ProgramError::Raise ("AIS_InteractiveContext - object has been already displayed in another context!");
+ throw Standard_ProgramError("AIS_InteractiveContext - object has been already displayed in another context!");
}
}
else
void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Line::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Line::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
+// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
-// Standard_NotImplemented::Raise("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
-void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
+void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,
+ const Handle(Geom_Transformation)&,
+ const Handle(Prs3d_Presentation)&)
{
- Standard_NotImplemented::Raise("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
+ throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
//=======================================================================
void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
+// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
-// Standard_NotImplemented::Raise("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation)");
+// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation)");
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
//=======================================================================
void AIS_ParallelRelation::ComputeTwoFacesParallel(const Handle(Prs3d_Presentation)&)
{
- Standard_NotImplemented::Raise("AIS_ParallelRelation::ComputeTwoFacesParallel not implemented");
+ throw Standard_NotImplemented("AIS_ParallelRelation::ComputeTwoFacesParallel not implemented");
}
//=======================================================================
void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Point::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Point::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
-// Standard_NotImplemented::Raise("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
-void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
+void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,
+ const Handle(Geom_Transformation)&,
+ const Handle(Prs3d_Presentation)&)
{
- Standard_NotImplemented::Raise("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
+ throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
//=======================================================================
void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
}
const Handle(Geom_Transformation)& aTransformation,
const Handle(Prs3d_Presentation)& aPresentation)
{
-// Standard_NotImplemented::Raise("AIS_Trihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
+// throw Standard_NotImplemented("AIS_Trihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
}
Standard_Real Adaptor2d_Curve2d::FirstParameter() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::FirstParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::FirstParameter");
}
Standard_Real Adaptor2d_Curve2d::LastParameter() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::LastParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::LastParameter");
}
GeomAbs_Shape Adaptor2d_Curve2d::Continuity() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Continuity");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Continuity");
}
//Standard_Integer Adaptor2d_Curve2d::NbIntervals(const GeomAbs_Shape S) const
Standard_Integer Adaptor2d_Curve2d::NbIntervals(const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbIntervals");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::NbIntervals");
}
void Adaptor2d_Curve2d::Intervals(TColStd_Array1OfReal& ,
const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Intervals");
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Intervals");
}
const Standard_Real ,
const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Trim");
- return Handle(Adaptor2d_HCurve2d)();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Trim");
}
//=======================================================================
Standard_Boolean Adaptor2d_Curve2d::IsClosed() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsClosed");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::IsClosed");
}
Standard_Boolean Adaptor2d_Curve2d::IsPeriodic() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsPeriodic");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::IsPeriodic");
}
Standard_Real Adaptor2d_Curve2d::Period() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Period");
- return 0.;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Period");
}
//gp_Pnt2d Adaptor2d_Curve2d::Value(const Standard_Real U) const
gp_Pnt2d Adaptor2d_Curve2d::Value(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Value");
- return gp_Pnt2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Value");
}
//void Adaptor2d_Curve2d::D0(const Standard_Real U, gp_Pnt2d& P) const
void Adaptor2d_Curve2d::D0(const Standard_Real , gp_Pnt2d& ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D0");
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::D0");
}
void Adaptor2d_Curve2d::D1(const Standard_Real ,
gp_Pnt2d& , gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D1");
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::D1");
}
void Adaptor2d_Curve2d::D2(const Standard_Real ,
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D2");
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::D2");
}
void Adaptor2d_Curve2d::D3(const Standard_Real ,
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& , gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D3");
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::D3");
}
gp_Vec2d Adaptor2d_Curve2d::DN(const Standard_Real ,
const Standard_Integer ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::DN");
- return gp_Vec2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::DN");
}
//Standard_Real Adaptor2d_Curve2d::Resolution(const Standard_Real R3d) const
Standard_Real Adaptor2d_Curve2d::Resolution(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Resolution");
- return 0.;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Resolution");
}
GeomAbs_CurveType Adaptor2d_Curve2d::GetType() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::GetType");
- return GeomAbs_OtherCurve;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::GetType");
}
gp_Lin2d Adaptor2d_Curve2d::Line() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Line");
- return gp_Lin2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Line");
}
gp_Circ2d Adaptor2d_Curve2d::Circle() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Circle");
- return gp_Circ2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Circle");
}
gp_Elips2d Adaptor2d_Curve2d::Ellipse() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Ellipse");
- return gp_Elips2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Ellipse");
}
gp_Hypr2d Adaptor2d_Curve2d::Hyperbola() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Hyperbola");
- return gp_Hypr2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Hyperbola");
}
gp_Parab2d Adaptor2d_Curve2d::Parabola() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Parabola");
- return gp_Parab2d();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Parabola");
}
Standard_Integer Adaptor2d_Curve2d::Degree() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Degree");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Degree");
}
Standard_Boolean Adaptor2d_Curve2d::IsRational() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsRational");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::IsRational");
}
Standard_Integer Adaptor2d_Curve2d::NbPoles() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbPole");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::NbPole");
}
Standard_Integer Adaptor2d_Curve2d::NbKnots() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbKnots");
- return 0;
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::NbKnots");
}
Handle(Geom2d_BezierCurve) Adaptor2d_Curve2d::Bezier() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Bezier");
- return Handle(Geom2d_BezierCurve)();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::Bezier");
}
Handle(Geom2d_BSplineCurve) Adaptor2d_Curve2d::BSpline() const
{
- Standard_NotImplemented::Raise("Adaptor2d_Curve2d::BSpline");
- return Handle(Geom2d_BSplineCurve)();
+ throw Standard_NotImplemented("Adaptor2d_Curve2d::BSpline");
}
//=======================================================================
Standard_Real Adaptor2d_Line2d::Period() const
{
- Standard_NoSuchObject::Raise();
- return 0;
+ throw Standard_NoSuchObject();
}
//=======================================================================
//gp_Vec2d Adaptor2d_Line2d::DN(const Standard_Real U, const Standard_Integer N) const
gp_Vec2d Adaptor2d_Line2d::DN(const Standard_Real , const Standard_Integer N) const
{
- if (N<=0) {Standard_OutOfRange::Raise();}
+ if (N<=0) {throw Standard_OutOfRange();}
if (N==1) {
return myAx2d.Direction();
}
gp_Circ2d Adaptor2d_Line2d::Circle() const
{
- Standard_NoSuchObject::Raise();
- return gp_Circ2d();
+ throw Standard_NoSuchObject();
}
//=======================================================================
gp_Elips2d Adaptor2d_Line2d::Ellipse() const
{
- Standard_NoSuchObject::Raise();
- return gp_Elips2d();
+ throw Standard_NoSuchObject();
}
//=======================================================================
gp_Hypr2d Adaptor2d_Line2d::Hyperbola() const
{
- Standard_NoSuchObject::Raise();
- return gp_Hypr2d();
+ throw Standard_NoSuchObject();
}
//=======================================================================
gp_Parab2d Adaptor2d_Line2d::Parabola() const
{
- Standard_NoSuchObject::Raise();
- return gp_Parab2d();
+ throw Standard_NoSuchObject();
}
//=======================================================================
Standard_Integer Adaptor2d_Line2d::Degree() const
{
- Standard_NoSuchObject::Raise();
- return 0 ;
+ throw Standard_NoSuchObject();
}
//=======================================================================
//function : IsRational
Standard_Boolean Adaptor2d_Line2d::IsRational() const
{
- Standard_NoSuchObject::Raise();
- return 0 ;
+ throw Standard_NoSuchObject();
}
//=======================================================================
//function : NbPoles
Standard_Integer Adaptor2d_Line2d::NbPoles() const
{
- Standard_NoSuchObject::Raise();
- return 0 ;
+ throw Standard_NoSuchObject();
}
//=======================================================================
//function : NbKnots
Standard_Integer Adaptor2d_Line2d::NbKnots() const
{
- Standard_NoSuchObject::Raise();
- return 0 ;
+ throw Standard_NoSuchObject();
}
//=======================================================================
//function : Bezier
Handle(Geom2d_BezierCurve) Adaptor2d_Line2d::Bezier() const
{
- Standard_NoSuchObject::Raise();
- Handle(Geom2d_BezierCurve) nul;
- return nul;
+ throw Standard_NoSuchObject();
}
//=======================================================================
Handle(Geom2d_BSplineCurve) Adaptor2d_Line2d::BSpline() const
{
- Standard_NoSuchObject::Raise();
- Handle(Geom2d_BSplineCurve) nul;
- return nul;
+ throw Standard_NoSuchObject();
}
case GeomAbs_G1: return GeomAbs_C0;
case GeomAbs_C0:
// No Continuity !!
- Standard_TypeMismatch::Raise("Adaptor2d_OffsetCurve::IntervalContinuity");
+ throw Standard_TypeMismatch("Adaptor2d_OffsetCurve::IntervalContinuity");
break;
}
return gp_Pnt2d(P.XY()+myOffset*V.XY()/Norme);
}
else {
- gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::Value");
- return gp_Pnt2d();
+ throw gp_VectorWithNullMagnitude("Adaptor2d_OffsetCurve::Value");
}
}
else {
(V2.XY()*V3.XY())/(Norme*Norme)));
}
else {
- gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::D1");
+ throw gp_VectorWithNullMagnitude("Adaptor2d_OffsetCurve::D1");
}
}
else {
D1( U,P,V1);
}
else {
- gp_VectorWithNullMagnitude::Raise("Adaptor2d_OffsetCurve::D2");
+ throw gp_VectorWithNullMagnitude("Adaptor2d_OffsetCurve::D2");
}
}
else {
(const Standard_Real ,
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& , gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_OffsetCurve::D3");
+ throw Standard_NotImplemented("Adaptor2d_OffsetCurve::D3");
}
//=======================================================================
// (const Standard_Real T, const Standard_Integer N) const
(const Standard_Real , const Standard_Integer ) const
{
- Standard_NotImplemented::Raise("Adaptor2d_OffsetCurve::DN");
- return gp_Vec2d();
+ throw Standard_NotImplemented("Adaptor2d_OffsetCurve::DN");
}
return gp_Lin2d(P,V);
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Line");
- return gp_Lin2d();
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::Line");
}
}
return gp_Circ2d( axes,radius);
}
else { // Cercle de rayon Nul
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Circle");
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::Circle");
}
}
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Circle");
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::Circle");
}
- // portage WNT
- return gp_Circ2d();
}
//=======================================================================
return myCurve->Ellipse();;
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Ellipse");
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve:Ellipse");
}
- // portage WNT
- return gp_Elips2d();
}
//=======================================================================
return myCurve->Hyperbola();
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Hyperbola");
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve:Hyperbola");
}
- // portage WNT
- return gp_Hypr2d();
}
//=======================================================================
return myCurve->Parabola();
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve:Parabola");
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve:Parabola");
}
- // portage WNT
- return gp_Parab2d();
}
//=======================================================================
//function : Degree
return myCurve->Degree();
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::Degree");
- return 0;
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::Degree");
}
}
//=======================================================================
return myCurve->NbPoles();
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::NbPoles");
- return 0;
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::NbPoles");
}
}
return myCurve->NbKnots();
}
else {
- Standard_NoSuchObject::Raise("Adaptor2d_OffsetCurve::NbKnots");
- return 0;
+ throw Standard_NoSuchObject("Adaptor2d_OffsetCurve::NbKnots");
}
}
Standard_Real Adaptor3d_Curve::FirstParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::FirstParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Curve::FirstParameter");
}
Standard_Real Adaptor3d_Curve::LastParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::LastParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Curve::LastParameter");
}
GeomAbs_Shape Adaptor3d_Curve::Continuity() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Continuity");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::Continuity");
}
Standard_Integer Adaptor3d_Curve::NbIntervals(const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::NbIntervals");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::NbIntervals");
}
void Adaptor3d_Curve::Intervals(TColStd_Array1OfReal& , const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Intervals");
+ throw Standard_NotImplemented("Adaptor3d_Curve::Intervals");
}
//Handle(Adaptor3d_HCurve) Adaptor3d_Curve::Trim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
Handle(Adaptor3d_HCurve) Adaptor3d_Curve::Trim(const Standard_Real , const Standard_Real , const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Trim");
- return Handle(Adaptor3d_HCurve)();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Trim");
}
Standard_Boolean Adaptor3d_Curve::IsClosed() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::IsClosed");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::IsClosed");
}
Standard_Boolean Adaptor3d_Curve::IsPeriodic() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::IsPeriodic");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::IsPeriodic");
}
Standard_Real Adaptor3d_Curve::Period() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Period");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Curve::Period");
}
//gp_Pnt Adaptor3d_Curve::Value(const Standard_Real U) const
gp_Pnt Adaptor3d_Curve::Value(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Value");
- return gp_Pnt();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Value");
}
//void Adaptor3d_Curve::D0(const Standard_Real U, gp_Pnt& P) const
void Adaptor3d_Curve::D0(const Standard_Real , gp_Pnt& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::D0");
+ throw Standard_NotImplemented("Adaptor3d_Curve::D0");
}
//void Adaptor3d_Curve::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) const
void Adaptor3d_Curve::D1(const Standard_Real , gp_Pnt& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::D1");
+ throw Standard_NotImplemented("Adaptor3d_Curve::D1");
}
//void Adaptor3d_Curve::D2(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const
void Adaptor3d_Curve::D2(const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::D2");
+ throw Standard_NotImplemented("Adaptor3d_Curve::D2");
}
//void Adaptor3d_Curve::D3(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const
void Adaptor3d_Curve::D3(const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::D3");
+ throw Standard_NotImplemented("Adaptor3d_Curve::D3");
}
//gp_Vec Adaptor3d_Curve::DN(const Standard_Real U, const Standard_Integer N) const
gp_Vec Adaptor3d_Curve::DN(const Standard_Real , const Standard_Integer ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::DN");
- return gp_Vec();
+ throw Standard_NotImplemented("Adaptor3d_Curve::DN");
}
//Standard_Real Adaptor3d_Curve::Resolution(const Standard_Real R3d) const
Standard_Real Adaptor3d_Curve::Resolution(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Resolution");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Curve::Resolution");
}
GeomAbs_CurveType Adaptor3d_Curve::GetType() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::GetType");
- return GeomAbs_OtherCurve;
+ throw Standard_NotImplemented("Adaptor3d_Curve::GetType");
}
gp_Lin Adaptor3d_Curve::Line() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Line");
- return gp_Lin();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Line");
}
gp_Circ Adaptor3d_Curve::Circle() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Circle");
- return gp_Circ();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Circle");
}
gp_Elips Adaptor3d_Curve::Ellipse() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Ellipse");
- return gp_Elips();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Ellipse");
}
gp_Hypr Adaptor3d_Curve::Hyperbola() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Hyperbola");
- return gp_Hypr();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Hyperbola");
}
gp_Parab Adaptor3d_Curve::Parabola() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Parabola");
- return gp_Parab();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Parabola");
}
Standard_Integer Adaptor3d_Curve::Degree() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Degree");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::Degree");
}
Standard_Boolean Adaptor3d_Curve::IsRational() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::IsRational");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::IsRational");
}
Standard_Integer Adaptor3d_Curve::NbPoles() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::NbPoles");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::NbPoles");
}
Standard_Integer Adaptor3d_Curve::NbKnots() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::NbKnots");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Curve::NbKnots");
}
Handle(Geom_BezierCurve) Adaptor3d_Curve::Bezier() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::Bezier");
- return Handle(Geom_BezierCurve)();
+ throw Standard_NotImplemented("Adaptor3d_Curve::Bezier");
}
Handle(Geom_BSplineCurve) Adaptor3d_Curve::BSpline() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::BSpline");
- return Handle(Geom_BSplineCurve)();
+ throw Standard_NotImplemented("Adaptor3d_Curve::BSpline");
}
//=======================================================================
Handle(Geom_OffsetCurve) Adaptor3d_Curve::OffsetCurve() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Curve::OffsetCurve");
- return Handle(Geom_OffsetCurve)();
+ throw Standard_NotImplemented("Adaptor3d_Curve::OffsetCurve");
}
Iloc = i;
else
if(Abs(Coord - Arr(i)) > Tol)
- Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:Hunt");
+ throw Standard_NotImplemented("Adaptor3d_CurveOnSurface:Hunt");
}
//=======================================================================
D3(U,P,V1,V2,V);
break ;
default:
- Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:DN");
+ throw Standard_NotImplemented("Adaptor3d_CurveOnSurface:DN");
break;
}
return V;
if (mySurface->GetType()==GeomAbs_Plane)
return myCurve->NbKnots();
else {
- Standard_NoSuchObject::Raise();
- return 0;
+ throw Standard_NoSuchObject();
}
}
Ok = LocatePart_Offset(UV,DUV,mySurface,LeftBot,RightTop);
break;
default :
- Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface::EvalFirstLastSurf");
+ throw Standard_NotImplemented("Adaptor3d_CurveOnSurface::EvalFirstLastSurf");
break;
}
}
Ok = LocatePart_Offset(UV,DUV,mySurface,LeftBot,RightTop);
break;
default :
- Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface::EvalFirstLastSurf");
+ throw Standard_NotImplemented("Adaptor3d_CurveOnSurface::EvalFirstLastSurf");
break;
}
}
Adaptor3d_InterFunc::Adaptor3d_InterFunc(const Handle(Adaptor2d_HCurve2d)& C, const Standard_Real FixVal, const Standard_Integer Fix) : myCurve2d(C),myFixVal(FixVal),myFix(Fix)
{
- if(Fix != 1 && Fix != 2 ) Standard_ConstructionError::Raise();
+ if(Fix != 1 && Fix != 2 ) throw Standard_ConstructionError();
}
break;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
break;
}
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return GeomAbs_C0;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
//=======================================================================
Standard_Integer Adaptor3d_IsoCurve::NbIntervals(const GeomAbs_Shape S) const
{
- if (myIso == GeomAbs_NoneIso) Standard_NoSuchObject::Raise();
+ if (myIso == GeomAbs_NoneIso) throw Standard_NoSuchObject();
Standard_Boolean UIso = (myIso == GeomAbs_IsoU);
Standard_Integer nbInter = UIso ?
void Adaptor3d_IsoCurve::Intervals(TColStd_Array1OfReal& TI,
const GeomAbs_Shape S) const
{
- if (myIso == GeomAbs_NoneIso) Standard_NoSuchObject::Raise();
+ if (myIso == GeomAbs_NoneIso) throw Standard_NoSuchObject();
Standard_Boolean UIso = (myIso == GeomAbs_IsoU);
Standard_Integer nbInter = UIso ?
break;
}
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return Standard_False;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
//=======================================================================
break;
}
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return Standard_False;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
//=======================================================================
break;
}
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return 0.;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
//=======================================================================
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
break;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
break;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
P,V1,dummy1,V2,dummy2,dummy3);
break;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
break;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
return mySurface->DN(T,myParameter,N,0);
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
}
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- // portage WNT
- return GeomAbs_OtherCurve;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
return GeomAbs_Circle;
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- // portage WNT
- return GeomAbs_OtherCurve;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
break;
return mySurface->BasisCurve()->GetType();
case GeomAbs_NoneIso:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- // portage WNT
- return GeomAbs_OtherCurve;
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break;
}
break;
case GeomAbs_IsoU:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:UIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:UIso");
}
case GeomAbs_IsoV:
{
}
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
case GeomAbs_IsoU:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:UIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:UIso");
}
case GeomAbs_IsoV:
{
}
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
case GeomAbs_NoneIso:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
}
default:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:Circle");
- return gp_Circ();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:Circle");
}
}
}
default:
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:Ellipse");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:Ellipse");
}
}
- return gp_Elips();
}
//=======================================================================
gp_Hypr Adaptor3d_IsoCurve::Hyperbola() const
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:Hyperbola");
- return gp_Hypr();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:Hyperbola");
}
//=======================================================================
gp_Parab Adaptor3d_IsoCurve::Parabola() const
{
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:Parabola");
- return gp_Parab();
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:Parabola");
}
//=======================================================================
case GeomAbs_NoneIso:
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break ;
degree = mySurface->BasisCurve()->Degree();
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
degree = mySurface->BasisCurve()->Degree();
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break ;
}
return degree ;
case GeomAbs_NoneIso:
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break ;
is_rational = mySurface->BasisCurve()->IsRational();
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
is_rational = mySurface->BasisCurve()->IsRational();
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
return is_rational;
}
case GeomAbs_NoneIso:
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
break ;
case GeomAbs_SurfaceOfRevolution:
}
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
}
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break ;
}
return nb_poles ;
case GeomAbs_NoneIso:
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break ;
break ;
}
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break ;
break ;
}
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
}
}
break ;
default:
- Standard_NoSuchObject::Raise("Adaptor3d_IsoCurve:NoneIso");
+ throw Standard_NoSuchObject("Adaptor3d_IsoCurve:NoneIso");
break ;
}
return nb_knots ;
Standard_Real Adaptor3d_Surface::FirstUParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::FirstUParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::FirstUParameter");
}
Standard_Real Adaptor3d_Surface::LastUParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::LastUParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::LastUParameter");
}
Standard_Real Adaptor3d_Surface::FirstVParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::FirstVParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::FirstVParameter");
}
Standard_Real Adaptor3d_Surface::LastVParameter() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::LastVParameter");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::LastVParameter");
}
GeomAbs_Shape Adaptor3d_Surface::UContinuity() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UContinuity");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::UContinuity");
}
GeomAbs_Shape Adaptor3d_Surface::VContinuity() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VContinuity");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::VContinuity");
}
//Standard_Integer Adaptor3d_Surface::NbUIntervals(const GeomAbs_Shape S) const
Standard_Integer Adaptor3d_Surface::NbUIntervals(const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUIntervals");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbUIntervals");
}
//Standard_Integer Adaptor3d_Surface::NbVIntervals(const GeomAbs_Shape S) const
Standard_Integer Adaptor3d_Surface::NbVIntervals(const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVIntervals");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbVIntervals");
}
//void Adaptor3d_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
void Adaptor3d_Surface::UIntervals(TColStd_Array1OfReal& , const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UIntervals");
+ throw Standard_NotImplemented("Adaptor3d_Surface::UIntervals");
}
//void Adaptor3d_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
void Adaptor3d_Surface::VIntervals(TColStd_Array1OfReal& , const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VIntervals");
+ throw Standard_NotImplemented("Adaptor3d_Surface::VIntervals");
}
//Handle(Adaptor3d_HSurface) Adaptor3d_Surface::UTrim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::UTrim(const Standard_Real , const Standard_Real , const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UTrim");
- return Handle(Adaptor3d_HSurface)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::UTrim");
}
//Handle(Adaptor3d_HSurface) Adaptor3d_Surface::VTrim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::VTrim(const Standard_Real , const Standard_Real , const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VTrim");
- return Handle(Adaptor3d_HSurface)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::VTrim");
}
Standard_Boolean Adaptor3d_Surface::IsUClosed() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsUClosed");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsUClosed");
}
Standard_Boolean Adaptor3d_Surface::IsVClosed() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVClosed");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsVClosed");
}
Standard_Boolean Adaptor3d_Surface::IsUPeriodic() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsUPeriodic");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsUPeriodic");
}
Standard_Real Adaptor3d_Surface::UPeriod() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UPeriod");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::UPeriod");
}
Standard_Boolean Adaptor3d_Surface::IsVPeriodic() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVPeriodic");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsVPeriodic");
}
Standard_Real Adaptor3d_Surface::VPeriod() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VPeriod");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::VPeriod");
}
//gp_Pnt Adaptor3d_Surface::Value(const Standard_Real U, const Standard_Real V) const
gp_Pnt Adaptor3d_Surface::Value(const Standard_Real , const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Value");
- return gp_Pnt();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Value");
}
//void Adaptor3d_Surface::D0(const Standard_Real U, const Standard_Real V, gp_Pnt& P) const
void Adaptor3d_Surface::D0(const Standard_Real , const Standard_Real , gp_Pnt& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::D0");
+ throw Standard_NotImplemented("Adaptor3d_Surface::D0");
}
//void Adaptor3d_Surface::D1(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V) const
void Adaptor3d_Surface::D1(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::D1");
+ throw Standard_NotImplemented("Adaptor3d_Surface::D1");
}
//void Adaptor3d_Surface::D2(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV) const
void Adaptor3d_Surface::D2(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::D2");
+ throw Standard_NotImplemented("Adaptor3d_Surface::D2");
}
//void Adaptor3d_Surface::D3(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const
void Adaptor3d_Surface::D3(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::D3");
+ throw Standard_NotImplemented("Adaptor3d_Surface::D3");
}
//gp_Vec Adaptor3d_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
gp_Vec Adaptor3d_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::DN");
- return gp_Vec();
+ throw Standard_NotImplemented("Adaptor3d_Surface::DN");
}
//Standard_Real Adaptor3d_Surface::UResolution(const Standard_Real R3d) const
Standard_Real Adaptor3d_Surface::UResolution(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UResolution");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::UResolution");
}
//Standard_Real Adaptor3d_Surface::VResolution(const Standard_Real R3d) const
Standard_Real Adaptor3d_Surface::VResolution(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VResolution");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::VResolution");
}
GeomAbs_SurfaceType Adaptor3d_Surface::GetType() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::GetType");
- return GeomAbs_OtherSurface;
+ throw Standard_NotImplemented("Adaptor3d_Surface::GetType");
}
gp_Pln Adaptor3d_Surface::Plane() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Plane");
- return gp_Pln();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Plane");
}
gp_Cylinder Adaptor3d_Surface::Cylinder() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Cylinder");
- return gp_Cylinder();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Cylinder");
}
gp_Cone Adaptor3d_Surface::Cone() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Cone");
- return gp_Cone();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Cone");
}
gp_Sphere Adaptor3d_Surface::Sphere() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Sphere");
- return gp_Sphere();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Sphere");
}
gp_Torus Adaptor3d_Surface::Torus() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Torus");
- return gp_Torus();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Torus");
}
Standard_Integer Adaptor3d_Surface::UDegree() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::UDegree");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::UDegree");
}
Standard_Integer Adaptor3d_Surface::NbUPoles() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUPoles");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbUPoles");
}
Standard_Integer Adaptor3d_Surface::VDegree() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::VDegree");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::VDegree");
}
Standard_Integer Adaptor3d_Surface::NbVPoles() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVPoles");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbVPoles");
}
Standard_Integer Adaptor3d_Surface::NbUKnots() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbUKnots");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbUKnots");
}
Standard_Integer Adaptor3d_Surface::NbVKnots() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::NbVKnots");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::NbVKnots");
}
Standard_Boolean Adaptor3d_Surface::IsURational() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsURational");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsURational");
}
Standard_Boolean Adaptor3d_Surface::IsVRational() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::IsVRational");
- return 0;
+ throw Standard_NotImplemented("Adaptor3d_Surface::IsVRational");
}
Handle(Geom_BezierSurface) Adaptor3d_Surface::Bezier() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Bezier");
- return Handle(Geom_BezierSurface)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Bezier");
}
Handle(Geom_BSplineSurface) Adaptor3d_Surface::BSpline() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::BSpline");
- return Handle(Geom_BSplineSurface)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::BSpline");
}
gp_Ax1 Adaptor3d_Surface::AxeOfRevolution() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::AxeOfRevolution");
- return gp_Ax1();
+ throw Standard_NotImplemented("Adaptor3d_Surface::AxeOfRevolution");
}
gp_Dir Adaptor3d_Surface::Direction() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::Direction");
- return gp_Dir();
+ throw Standard_NotImplemented("Adaptor3d_Surface::Direction");
}
Handle(Adaptor3d_HCurve) Adaptor3d_Surface::BasisCurve() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::BasisCurve");
- return Handle(Adaptor3d_HCurve)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::BasisCurve");
}
Handle(Adaptor3d_HSurface) Adaptor3d_Surface::BasisSurface() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::BasisSurface");
- return Handle(Adaptor3d_HSurface)();
+ throw Standard_NotImplemented("Adaptor3d_Surface::BasisSurface");
}
Standard_Real Adaptor3d_Surface::OffsetValue() const
{
- Standard_NotImplemented::Raise("Adaptor3d_Surface::OffsetValue");
- return 0.;
+ throw Standard_NotImplemented("Adaptor3d_Surface::OffsetValue");
}
void Adaptor3d_TopolTool::Initialize ()
{
- Standard_NotImplemented::Raise("Adaptor3d_TopolTool::Initialize ()");
+ throw Standard_NotImplemented("Adaptor3d_TopolTool::Initialize ()");
}
void Adaptor3d_TopolTool::Initialize (const Handle(Adaptor3d_HSurface)& S)
Handle(Adaptor2d_HCurve2d) Adaptor3d_TopolTool::Value ()
{
- if (idRestr >= nbRestr) {Standard_DomainError::Raise();}
+ if (idRestr >= nbRestr) {throw Standard_DomainError();}
return myRestr[idRestr];
}
Handle(Adaptor3d_HVertex) Adaptor3d_TopolTool::Vertex ()
{
- if (idVtx >= nbVtx) {Standard_DomainError::Raise();}
+ if (idVtx >= nbVtx) {throw Standard_DomainError();}
return myVtx[idVtx];
}
Standard_Real Adaptor3d_TopolTool::Tol3d(const Handle(Adaptor2d_HCurve2d)&) const
{
- Standard_DomainError::Raise("Adaptor3d_TopolTool: has no 3d representation");
- return 0.;
+ throw Standard_DomainError("Adaptor3d_TopolTool: has no 3d representation");
}
//=======================================================================
Standard_Real Adaptor3d_TopolTool::Tol3d(const Handle(Adaptor3d_HVertex)&) const
{
- Standard_DomainError::Raise("Adaptor3d_TopolTool: has no 3d representation");
- return 0.;
+ throw Standard_DomainError("Adaptor3d_TopolTool: has no 3d representation");
}
//=======================================================================
gp_Pnt Adaptor3d_TopolTool::Pnt(const Handle(Adaptor3d_HVertex)&) const
{
- Standard_DomainError::Raise("Adaptor3d_TopolTool: has no 3d representation");
- return gp::Origin();
+ throw Standard_DomainError("Adaptor3d_TopolTool: has no 3d representation");
}
iu = 2;
break;
default :
- Standard_ConstructionError::Raise("AdvApp2Var_ApproxAFunc2Var : UContinuity Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : UContinuity Error");
}
switch (myContInV) {
case GeomAbs_C0 :
iv = 2;
break;
default :
- Standard_ConstructionError::Raise("AdvApp2Var_ApproxAFunc2Var : VContinuity Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VContinuity Error");
}
ndu = Max(myMaxDegInU+1,2*iu+2);
ndv = Max(myMaxDegInV+1,2*iv+2);
if (ndu<2*iu+2)
- Standard_ConstructionError::Raise("AdvApp2Var_ApproxAFunc2Var : UMaxDegree Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : UMaxDegree Error");
if (ndv<2*iv+2)
- Standard_ConstructionError::Raise("AdvApp2Var_ApproxAFunc2Var : VMaxDegree Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VMaxDegree Error");
myPrecisionCode = Max(0,Min(myPrecisionCode,3));
AdvApp2Var_Context Conditions(ifav,iu,iv,ndu,ndv,
myPrecisionCode,
myResult(FirstNA).Discretise(myConditions,myConstraints,Func);
if ( ! myResult(FirstNA).IsDiscretised() ) {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
}
// calculate the number and the type of autorized cuts
}
else {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
}
break;
case 1 :
break;
default :
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
}
}
}
myResult(FirstNA).Discretise(myConditions,myConstraints,Func);
if ( ! myResult(FirstNA).IsDiscretised() ) {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
}
// calculate the number and type of autorized cuts
}
else {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
}
break;
case 1 :
break;
default :
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Surface Approximation Error");
}
}
}
}
else {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
}
}
}
}
else {
myHasResult = myDone = Standard_False;
- Standard_ConstructionError::Raise
- ("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
+ throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
}
}
}
{
Handle (TColStd_HArray1OfReal) EPtr;
if (Dimension <1 || Dimension >3) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::MaxError : Dimension must be equal to 1,2 or 3 !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::MaxError : Dimension must be equal to 1,2 or 3 !");
}
switch (Dimension) {
case 1:
{
Handle (TColStd_HArray1OfReal) EPtr;
if (Dimension <1 || Dimension >3) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::AverageError : Dimension must be equal to 1,2 or 3 !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::AverageError : Dimension must be equal to 1,2 or 3 !");
}
switch (Dimension) {
case 1:
{
Handle (TColStd_HArray1OfReal) EPtr;
if (Dimension <1 || Dimension >3) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::UFrontError : Dimension must be equal to 1,2 or 3 !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::UFrontError : Dimension must be equal to 1,2 or 3 !");
}
switch (Dimension) {
case 1:
{
Handle (TColStd_HArray1OfReal) EPtr;
if (Dimension <=0 || Dimension >3) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::VFrontError : Dimension must be equal to 1,2 or 3 !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::VFrontError : Dimension must be equal to 1,2 or 3 !");
}
switch (Dimension) {
case 1:
const Standard_Integer SSPIndex) const
{
if (Dimension !=3 || SSPIndex !=1) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::MaxError: ONE Surface 3D only !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::MaxError: ONE Surface 3D only !");
}
Handle (TColStd_HArray1OfReal) EPtr = MaxError(Dimension);
return EPtr->Value(SSPIndex);
const Standard_Integer SSPIndex) const
{
if (Dimension !=3 || SSPIndex !=1) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::AverageError : ONE Surface 3D only !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::AverageError : ONE Surface 3D only !");
}
Handle (TColStd_HArray1OfReal) EPtr = AverageError(Dimension);
return EPtr->Value(SSPIndex);
const Standard_Integer SSPIndex) const
{
if (Dimension !=3 || SSPIndex !=1) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::UFrontError : ONE Surface 3D only !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::UFrontError : ONE Surface 3D only !");
}
Handle (TColStd_HArray1OfReal) EPtr = UFrontError(Dimension);
return EPtr->Value(SSPIndex);
const Standard_Integer SSPIndex) const
{
if (Dimension !=3 || SSPIndex !=1) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::VFrontError : ONE Surface 3D only !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::VFrontError : ONE Surface 3D only !");
}
Handle (TColStd_HArray1OfReal) EPtr = VFrontError(Dimension);
return EPtr->Value(SSPIndex);
const Standard_Integer SSPIndex) const
{
if (Dimension !=3 || SSPIndex !=1) {
- Standard_OutOfRange::Raise
- ("AdvApp2Var_ApproxAFunc2Var::CritError: ONE Surface 3D only !");
+ throw Standard_OutOfRange("AdvApp2Var_ApproxAFunc2Var::CritError: ONE Surface 3D only !");
}
return myCriterionError;
}
ncfl = nlimu;
if (ncfl<2*iu+2) ncfl = 2*iu+2;
if (!lesparam(iu,ncfl,iprecis,NbPntU,JDegU) )
- { Standard_ConstructionError::Raise("AdvApp2Var_Context");}
+ { throw Standard_ConstructionError("AdvApp2Var_Context");}
myNbURoot = NbPntU;
myJDegU = JDegU;
if (iu>-1) NbPntU = myNbURoot - 2;
if (ncfl<2*iv+2) ncfl = 2*iv+2;
//Ma1nbp(&iv,&ncfl,&iprec,&NbPntV,&JDegV,&ErrorCode);
if (!lesparam(iv, ncfl, iprecis, NbPntV, JDegV) )
- { Standard_ConstructionError::Raise("AdvApp2Var_Context");}
+ { throw Standard_ConstructionError("AdvApp2Var_Context");}
myNbVRoot = NbPntV;
myJDegV = JDegV;
if (iv>-1) NbPntV = myNbVRoot - 2;
(Standard_Real *) &UGauss->ChangeArray1()(UGauss->Lower());
AdvApp2Var_ApproxF2var::mmapptt_(&JDegU,&NbPntU,&iu,UG_array,&ErrorCode);
if (ErrorCode != 0 ) {
- Standard_ConstructionError::Raise("AdvApp2Var_Context : Error in FORTRAN");
+ throw Standard_ConstructionError("AdvApp2Var_Context : Error in FORTRAN");
}
myUGauss = UGauss;
(Standard_Real *) &VGauss->ChangeArray1()(VGauss->Lower());
AdvApp2Var_ApproxF2var::mmapptt_(&JDegV,&NbPntV,&iv,VG_array,&ErrorCode);
if (ErrorCode != 0 ) {
- Standard_ConstructionError::Raise("AdvApp2Var_Context : Error in FORTRAN");
+ throw Standard_ConstructionError("AdvApp2Var_Context : Error in FORTRAN");
}
myVGauss = VGauss;
if (IORDRV>=0) {
AdvApp2Var_ApproxF2var::mma1her_(&IORDRV,HermV,&IERCOD);
if (IERCOD!=0) {
- Standard_ConstructionError::Raise
- ("AdvApp2Var_Patch::AddConstraints : Error in FORTRAN");
+ throw Standard_ConstructionError("AdvApp2Var_Patch::AddConstraints : Error in FORTRAN");
}
AdvApp2Var_ApproxF2var::mma2ac2_(&NDIMEN,
&NDegU,
if (IORDRU>=0) {
AdvApp2Var_ApproxF2var::mma1her_(&IORDRU,HermU,&IERCOD);
if (IERCOD!=0) {
- Standard_ConstructionError::Raise
- ("AdvApp2Var_Patch::AddConstraints : Error in FORTRAN");
+ throw Standard_ConstructionError("AdvApp2Var_Patch::AddConstraints : Error in FORTRAN");
}
AdvApp2Var_ApproxF2var::mma2ac3_(&NDIMEN,&NDegU,&NDegV,&IORDRU,&NCFLMV,
NCFU0,IsoU0,NCFU1,IsoU1,HermU,PATCAN);
&myNbCoeffInV,
PATJAC,PATAUX,PATCAN,&IERCOD);
if (IERCOD !=0) {
- Standard_ConstructionError::Raise
- ("AdvApp2Var_Patch::MakeApprox : Error in FORTRAN");
+ throw Standard_ConstructionError("AdvApp2Var_Patch::MakeApprox : Error in FORTRAN");
}
myEquation = HPCAN;
SousEquation = myEquation;
}
else {
- Standard_ConstructionError::Raise
- ("AdvApp2Var_Patch::Poles : SSPIndex out of range");
+ throw Standard_ConstructionError("AdvApp2Var_Patch::Poles : SSPIndex out of range");
}
Handle(TColStd_HArray1OfReal) Intervalle =
new (TColStd_HArray1OfReal) (1,2);
SousEquation = myEquation;
}
else {
- Standard_ConstructionError::Raise
- ("AdvApp2Var_Patch::Poles : SSPIndex out of range");
+ throw Standard_ConstructionError("AdvApp2Var_Patch::Poles : SSPIndex out of range");
}
return SousEquation;
}
Continuity = GeomAbs_C2 ;
break ;
default:
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
//--------------------- Choix du nombre de points ----------------------
myLast < myFirst ||
myMaxDegree < 1 ||
myMaxSegments < 0)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
if (myMaxDegree > 14) {
myMaxDegree = 14 ;
}
ContinuityOrder = 2 ;
break ;
default:
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real ApproxStartEnd[2] ;
Standard_Integer NumMaxCoeffs = Max(myMaxDegree + 1, 2 * ContinuityOrder + 2);
if (D <= 0 ||
D > 3) {
- Standard_OutOfRange::Raise() ;
+ throw Standard_OutOfRange() ;
}
switch (D) {
case 1:
if (D <= 0 ||
D > 3) {
- Standard_OutOfRange::Raise() ;
+ throw Standard_OutOfRange() ;
}
switch (D) {
case 1:
//=======================================================================
inline Standard_Integer AdvApprox_ApproxAFunction::NumSubSpaces(const Standard_Integer Dimension) const
-{ if (Dimension < 1 || Dimension > 3) Standard_ConstructionError::Raise() ;
+{ if (Dimension < 1 || Dimension > 3) throw Standard_ConstructionError() ;
return myNumSubSpaces[Dimension-1] ; }
{
myRecCutting = RecCut;
myPrefCutting = PrefCut;
- if (myWeight <= 1) { Standard_DomainError::Raise("PrefAndRec : Weight is too small");}
+ if (myWeight <= 1) { throw Standard_DomainError("PrefAndRec : Weight is too small");}
}
Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a,
case GeomAbs_C1: myNivConstr = 1; break;
case GeomAbs_C2: myNivConstr = 2; break;
default:
- Standard_ConstructionError::Raise("Invalid Continuity");
+ throw Standard_ConstructionError("Invalid Continuity");
}
Standard_Integer DegreeQ = myWorkDegree - 2*(myNivConstr+1);
void AppBlend_AppSurf::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
- if (W1 < 0 || W2 < 0 || W3 < 0 ) Standard_DomainError::Raise();
+ if (W1 < 0 || W2 < 0 || W3 < 0 ) throw Standard_DomainError();
critweights[0] = W1;
critweights[1] = W2;
critweights[2] = W3;
Standard_Integer& NbUKnots,
Standard_Integer& NbVKnots) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
UDegree = udeg;
VDegree = vdeg;
NbUPoles = tabPoles->ColLength();
TColStd_Array1OfInteger& TVMults) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
TPoles = tabPoles->Array2();
TWeights = tabWeights->Array2();
TUKnots = tabUKnots->Array1();
Standard_Integer& NbPoles,
Standard_Integer& NbKnots) const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
Degree = vdeg;
NbPoles = tabPoles->ColLength();
NbKnots = tabVKnots->Length();
TColStd_Array1OfReal& TKnots,
TColStd_Array1OfInteger& TMults) const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
TPoles = seqPoles2d(Index)->Array1();
TKnots = tabVKnots->Array1();
TMults = tabVMults->Array1();
inline Standard_Integer AppBlend_AppSurf::UDegree() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return udeg;
}
inline Standard_Integer AppBlend_AppSurf::VDegree() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return vdeg;
}
inline const TColgp_Array2OfPnt& AppBlend_AppSurf::SurfPoles() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabPoles->Array2();
}
inline const TColStd_Array2OfReal& AppBlend_AppSurf::SurfWeights() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabWeights->Array2();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::SurfUKnots() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabUKnots->Array1();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::SurfVKnots() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::SurfUMults() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabUMults->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::SurfVMults() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tabVMults->Array1();
}
inline Standard_Integer AppBlend_AppSurf::NbCurves2d () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return seqPoles2d.Length();
}
inline Standard_Integer AppBlend_AppSurf::Curves2dDegree() const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return vdeg;
}
inline const TColgp_Array1OfPnt2d& AppBlend_AppSurf::
Curve2dPoles(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return seqPoles2d(Index)->Array1();
}
inline const TColStd_Array1OfReal& AppBlend_AppSurf::Curves2dKnots () const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& AppBlend_AppSurf::Curves2dMults () const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return tabVMults->Array1();
}
inline void AppBlend_AppSurf::TolReached (Standard_Real& Tol3d,
Standard_Real& Tol2d) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
Tol3d = tol3dreached;
Tol2d = tol2dreached;
}
void InvMMatrix(const Standard_Integer classe,
math_Matrix& InvM)
{
- if (classe > 24) Standard_DimensionError::Raise("InvMMatrix: classe > 24");
+ if (classe > 24) throw Standard_DimensionError("InvMMatrix: classe > 24");
Standard_Integer i, j, k = 0, Som = 0;
for (i = 2; i < classe; i++) {
Som += (i)*(i);
void IBPMatrix(const Standard_Integer classe, math_Matrix& IBPMa)
{
- if (classe > 26) Standard_DimensionError::Raise("IBPMatrix: classe > 26");
+ if (classe > 26) throw Standard_DimensionError("IBPMatrix: classe > 26");
// math_Matrix IBPMa(1, classe-2, 1, classe-2);
Standard_Integer i, j, k = 0, Som = 0;
for (i = 1; i < classe-2; i++) {
void MMatrix(const Standard_Integer classe,
math_Matrix& M)
{
- if (classe > 24) Standard_DimensionError::Raise("MMatrix: classe > 24");
+ if (classe > 24) throw Standard_DimensionError("MMatrix: classe > 24");
Standard_Integer i, j, k = 0, Som = 0;
for (i = 2; i < classe; i++) {
Som += (i)*(i);
void IBTMatrix(const Standard_Integer classe, math_Matrix& IBTMa)
{
- if (classe > 26) Standard_DimensionError::Raise("IBTMatrix: classe > 26");
+ if (classe > 26) throw Standard_DimensionError("IBTMatrix: classe > 26");
// math_Matrix IBTMa(1, classe-4, 1, classe-4);
Standard_Integer i, j, k = 0, Som = 0;
for (i = 1; i < classe-4; i++) {
const Standard_Integer nbpoints,
math_Matrix& M)
{
- if (classe > 26) Standard_DimensionError::Raise("VBernstein: classe > 26");
- if (nbpoints > 24) Standard_DimensionError::Raise("VBernstein: nbpoints > 24");
+ if (classe > 26) throw Standard_DimensionError("VBernstein: classe > 26");
+ if (nbpoints > 24) throw Standard_DimensionError("VBernstein: nbpoints > 24");
// math_Matrix VB(classe, nbpoints);
Standard_Integer i, j, k = 0, Som;
//=======================================================================
Handle(FEmTool_HAssemblyTable) AppDef_LinearCriteria::AssemblyTable() const
{
- if(myCurve.IsNull()) Standard_DomainError::Raise("AppDef_LinearCriteria::AssemblyTable");
+ if(myCurve.IsNull()) throw Standard_DomainError("AppDef_LinearCriteria::AssemblyTable");
Standard_Integer NbDim = myCurve->Dimension(),
NbElm = myCurve->NbElements(),
//=======================================================================
Handle(TColStd_HArray2OfInteger) AppDef_LinearCriteria::DependenceTable() const
{
- if(myCurve.IsNull()) Standard_DomainError::Raise("AppDef_LinearCriteria::DependenceTable");
+ if(myCurve.IsNull()) throw Standard_DomainError("AppDef_LinearCriteria::DependenceTable");
Standard_Integer Dim = myCurve->Dimension();
Standard_Real& J2,
Standard_Real& J3)
{
- if(myCurve.IsNull()) Standard_DomainError::Raise("AppDef_LinearCriteria::QualityValues");
+ if(myCurve.IsNull()) throw Standard_DomainError("AppDef_LinearCriteria::QualityValues");
Standard_Integer NbDim = myCurve->Dimension(),
NbElm = myCurve->NbElements();
Standard_Real& QuadraticError,
Standard_Real& AverageError)
{
- if(myCurve.IsNull()) Standard_DomainError::Raise("AppDef_LinearCriteria::ErrorValues");
+ if(myCurve.IsNull()) throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues");
Standard_Integer NbDim = myCurve->Dimension();
Standard_Integer myNbP2d = AppDef_MyLineTool::NbP2d(mySSP), myNbP3d = AppDef_MyLineTool::NbP3d(mySSP);
- if(NbDim != (2*myNbP2d + 3*myNbP3d)) Standard_DomainError::Raise("AppDef_LinearCriteria::ErrorValues");
+ if(NbDim != (2*myNbP2d + 3*myNbP3d)) throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues");
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
const Standard_Integer Dimension2,
math_Matrix& H)
{
- if(myCurve.IsNull()) Standard_DomainError::Raise("AppDef_LinearCriteria::Hessian");
+ if(myCurve.IsNull()) throw Standard_DomainError("AppDef_LinearCriteria::Hessian");
if(DependenceTable()->Value(Dimension1, Dimension2) == 0)
- Standard_DomainError::Raise("AppDef_LinearCriteria::Hessian");
+ throw Standard_DomainError("AppDef_LinearCriteria::Hessian");
Standard_Integer //NbDim = myCurve->Dimension(),
MxDeg = myCurve->Base()->WorkDegree(),
math_Vector& G)
{
if(myCurve.IsNull())
- Standard_DomainError::Raise("AppDef_LinearCriteria::ErrorValues");
+ throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues");
Standard_Integer myNbP2d = AppDef_MyLineTool::NbP2d(mySSP), myNbP3d = AppDef_MyLineTool::NbP3d(mySSP);
if(Dimension > (2*myNbP2d + 3*myNbP3d))
- Standard_DomainError::Raise("AppDef_LinearCriteria::ErrorValues");
+ throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues");
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
const Standard_Real percentJ3)
{
if (QuadraticWeight < 0. || QualityWeight < 0.)
- Standard_DomainError::Raise("AppDef_LinearCriteria::SetWeight");
+ throw Standard_DomainError("AppDef_LinearCriteria::SetWeight");
if (percentJ1 < 0. || percentJ2 < 0. || percentJ3 < 0.)
- Standard_DomainError::Raise("AppDef_LinearCriteria::SetWeight");
+ throw Standard_DomainError("AppDef_LinearCriteria::SetWeight");
myQuadraticWeight = QuadraticWeight; myQualityWeight = QualityWeight;
AppDef_MultiLine::AppDef_MultiLine (const Standard_Integer NbMult)
{
- if (NbMult < 0 ) Standard_ConstructionError::Raise();
+ if (NbMult < 0 ) throw Standard_ConstructionError();
tabMult = new AppDef_HArray1OfMultiPointConstraint (1, NbMult);
}
void AppDef_MultiLine::SetValue (const Standard_Integer Index,
const AppDef_MultiPointConstraint& MPoint) {
if ((Index <= 0) || (Index > tabMult->Length())) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabMult->SetValue(Index, MPoint);
}
AppDef_MultiPointConstraint AppDef_MultiLine::Value (const Standard_Integer Index) const
{
if ((Index <= 0) || (Index > tabMult->Length())) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabMult->Value(Index);
}
(tabP2d.Length() != tabVec2d.Length()) ||
(tabCur.Length() != tabP.Length()) ||
(tabCur2d.Length() != tabP2d.Length())) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
if ((tabP.Length() != tabVec.Length()) ||
(tabP2d.Length() != tabVec2d.Length())) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
AppParCurves_MultiPoint(tabP) {
if (tabP.Length() != tabVec.Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
if ((tabP.Length() != tabVec.Length()) ||
(tabP.Length() != tabCur.Length())) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
AppParCurves_MultiPoint(tabP2d) {
if (tabP2d.Length() != tabVec2d.Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
if ((tabP2d.Length() != tabVec2d.Length()) ||
(tabCur2d.Length() != tabP2d.Length())) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
if (tabTang.IsNull())
tabTang = new TColgp_HArray1OfVec (1, nbP);
if ((Index <= 0) || (Index > nbP)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabTang->SetValue(Index, Tang);
}
gp_Vec AppDef_MultiPointConstraint::Tang (const Standard_Integer Index) const {
if ((Index <= 0) || (Index > nbP)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabTang->Value(Index);
}
if ((Index <= nbP) ||
(Index > nbP+nbP2d)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabTang2d->SetValue(Index-nbP, Tang2d);
}
gp_Vec2d AppDef_MultiPointConstraint::Tang2d (const Standard_Integer Index) const {
if ((Index <= nbP) ||
(Index > nbP+nbP2d)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabTang2d->Value(Index-nbP);
}
if (tabCurv.IsNull())
tabCurv = new TColgp_HArray1OfVec (1, nbP);
if ((Index <= 0) || (Index > nbP)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabCurv->SetValue(Index, Curv);
}
gp_Vec AppDef_MultiPointConstraint::Curv (const Standard_Integer Index) const {
if ((Index <= 0) || (Index > nbP)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabCurv->Value(Index);
}
tabCurv2d = new TColgp_HArray1OfVec2d (1, nbP2d);
if ((Index <= nbP) ||
(Index > nbP+nbP2d)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabCurv2d->SetValue(Index- nbP, Curv2d);
}
gp_Vec2d AppDef_MultiPointConstraint::Curv2d (const Standard_Integer Index) const {
if ((Index <= nbP) ||
(Index > nbP+nbP2d)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabCurv2d->Value(Index - nbP);
}
myWithCutting(WithCutting)
{
// Verifications:
- if (myMaxDegree < 1) Standard_DomainError::Raise();
+ if (myMaxDegree < 1) throw Standard_DomainError();
myMaxDegree = Min (30, myMaxDegree);
//
- if (myMaxSegment < 1) Standard_DomainError::Raise();
+ if (myMaxSegment < 1) throw Standard_DomainError();
//
- if (myWithMinMax != 0 && myWithMinMax !=1 ) Standard_DomainError::Raise();
- if (myWithCutting != 0 && myWithCutting !=1 ) Standard_DomainError::Raise();
+ if (myWithMinMax != 0 && myWithMinMax !=1 ) throw Standard_DomainError();
+ if (myWithCutting != 0 && myWithCutting !=1 ) throw Standard_DomainError();
//
myIsOverConstr = Standard_False;
myIsCreated = Standard_False;
myNivCont=2;
break ;
default:
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
//
myNbP2d = AppDef_MyLineTool::NbP2d(SSP);
mySmoothCriterion = new AppDef_LinearCriteria(mySSP, myFirstPoint, myLastPoint);
myParameters = new TColStd_HArray1OfReal(myFirstPoint, myLastPoint);
myNbPoints=myLastPoint-myFirstPoint+1;
- if (myNbPoints <= 0) Standard_ConstructionError::Raise();
+ if (myNbPoints <= 0) throw Standard_ConstructionError();
//
myTabPoints= new TColStd_HArray1OfReal(1,myDimension*myNbPoints);
//
gp_Vec2d Vt2d, Vc2d;
myNbConstraints=myConstraints->Length();
- if (myNbConstraints < 0) Standard_ConstructionError::Raise();
+ if (myNbConstraints < 0) throw Standard_ConstructionError();
myTypConstraints = new TColStd_HArray1OfInteger(1,Max(1,2*myNbConstraints));
myTabConstraints = new TColStd_HArray1OfReal(1,Max(1,2*myDimension*myNbConstraints));
if(myNbP2d !=0 && myNbP3d == 0 )
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV2d) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp2d=1;jp2d<=myNbP2d;jp2d++)
{
Vt2d=TabV2d.Value(jp2d);
if(myNbP3d !=0 && myNbP2d == 0)
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV3d) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp3d=1;jp3d<=myNbP3d;jp3d++)
{
Vt3d=TabV3d.Value(jp3d);
if(myNbP3d !=0 && myNbP2d != 0)
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV3d,TabV2d) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp3d=1;jp3d<=myNbP3d;jp3d++)
{
Vt3d=TabV3d.Value(jp3d);
if(myNbP2d !=0 && myNbP3d == 0)
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV2d) == Standard_False )
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
if (AppDef_MyLineTool::Curvature(mySSP,ipoint,TabV2dcurv) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp2d=1;jp2d<=myNbP2d;jp2d++)
{
Vt2d=TabV2d.Value(jp2d);
Vt2d.Normalize();
Vc2d=TabV2dcurv.Value(jp2d);
if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y());
myTabConstraints->SetValue(jndex++,Vc2d.X());
if(myNbP3d !=0 && myNbP2d == 0 )
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV3d) == Standard_False )
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
if (AppDef_MyLineTool::Curvature(mySSP,ipoint,TabV3dcurv) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp3d=1;jp3d<=myNbP3d;jp3d++)
{
Vt3d=TabV3d.Value(jp3d);
Vt3d.Normalize();
Vc3d=TabV3dcurv.Value(jp3d);
if ( (Vc3d.Normalized()).IsNormal(Vt3d,Precision::Angular()) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
myTabConstraints->SetValue(jndex++,Vt3d.X());
myTabConstraints->SetValue(jndex++,Vt3d.Y());
myTabConstraints->SetValue(jndex++,Vt3d.Z());
if(myNbP3d !=0 && myNbP2d != 0 )
{
if (AppDef_MyLineTool::Tangency(mySSP,ipoint,TabV3d,TabV2d) == Standard_False )
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
if (AppDef_MyLineTool::Curvature(mySSP,ipoint,TabV3dcurv,TabV2dcurv) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jp3d=1;jp3d<=myNbP3d;jp3d++)
{
Vt3d=TabV3d.Value(jp3d);
Vt3d.Normalize();
Vc3d=TabV3dcurv.Value(jp3d);
if ( (Vc3d.Normalized()).IsNormal(Vt3d,Precision::Angular()) == Standard_False)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
myTabConstraints->SetValue(jndex++,Vt3d.X());
myTabConstraints->SetValue(jndex++,Vt3d.Y());
myTabConstraints->SetValue(jndex++,Vt3d.Z());
Vt2d.Normalize();
Vc2d=TabV2dcurv.Value(jp2d);
if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
myTabConstraints->SetValue(jndex++,Vt2d.X());
myTabConstraints->SetValue(jndex++,Vt2d.Y());
myTabConstraints->SetValue(jndex++,Vc2d.X());
}
break ;
default:
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
CurMultyPoint += myNbP3d * 6 + myNbP2d * 2;
}
void AppDef_Variational::Approximate()
{
- if (myIsCreated == Standard_False ) StdFail_NotDone:: Raise();
+ if (myIsCreated == Standard_False ) throw StdFail_NotDone();
Standard_Real WQuadratic, WQuality;
//
AppParCurves_MultiBSpCurve AppDef_Variational::Value() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myMBSpCurve;
}
//
Standard_Real AppDef_Variational::MaxError() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myMaxError;
}
//
//
Standard_Integer AppDef_Variational::MaxErrorIndex() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myMaxErrorIndex;
}
//
//
Standard_Real AppDef_Variational::QuadraticError() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myCriterium[0];
}
//
void AppDef_Variational::Distance(math_Matrix& mat)
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
Standard_Integer ipoint,jp2d,jp3d,index;
TColgp_Array1OfPnt TabP3d(1,Max(1,myNbP3d));
TColgp_Array1OfPnt2d TabP2d(1, Max(1,myNbP2d));
//
Standard_Real AppDef_Variational::AverageError() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myAverageError;
}
//
//
const Handle(TColStd_HArray1OfReal)& AppDef_Variational::Parameters() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myParameters;
}
//
//
const Handle(TColStd_HArray1OfReal)& AppDef_Variational::Knots() const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
return myKnots;
}
//
//
void AppDef_Variational::Criterium(Standard_Real& VFirstOrder, Standard_Real& VSecondOrder, Standard_Real& VThirdOrder) const
{
- if (myIsDone == Standard_False) StdFail_NotDone::Raise();
+ if (myIsDone == Standard_False) throw StdFail_NotDone();
VFirstOrder=myCriterium[1] ;
VSecondOrder=myCriterium[2];
VThirdOrder=myCriterium[3];
NivCont=2;
break ;
default:
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (((myMaxDegree-NivCont)*myMaxSegment-myNbPassPoints-2*myNbTangPoints-3*myNbCurvPoints) < 0 )
return Standard_False;
//
void AppDef_Variational::SetCriteriumWeight(const Standard_Real Percent1, const Standard_Real Percent2, const Standard_Real Percent3)
{
- if (Percent1 < 0 || Percent2 < 0 || Percent3 < 0 ) Standard_DomainError::Raise();
+ if (Percent1 < 0 || Percent2 < 0 || Percent3 < 0 ) throw Standard_DomainError();
Standard_Real Total = Percent1 + Percent2 + Percent3;
myPercent[0] = Percent1/Total;
myPercent[1] = Percent2/Total;
//
void AppDef_Variational::SetCriteriumWeight(const Standard_Integer Order, const Standard_Real Percent)
{
- if ( Percent < 0 ) Standard_DomainError::Raise();
- if ( Order < 1 || Order > 3 ) Standard_ConstructionError::Raise();
+ if ( Percent < 0 ) throw Standard_DomainError();
+ if ( Order < 1 || Order > 3 ) throw Standard_ConstructionError();
myPercent[Order-1] = Percent;
Standard_Real Total = myPercent[0] + myPercent[1] + myPercent[2];
myPercent[0] = myPercent[0] / Total;
if(Length <= Eps1)
- Standard_ConstructionError::Raise("AppDef_Variational::InitParameters");
+ throw Standard_ConstructionError("AppDef_Variational::InitParameters");
for(ipoint = myFirstPoint + 1; ipoint <= myLastPoint - 1; ipoint++)
}
if(ORCMx > myMaxDegree - myNivCont)
- Standard_ConstructionError::Raise("AppDef_Variational::InitCutting");
+ throw Standard_ConstructionError("AppDef_Variational::InitCutting");
Standard_Integer NLibre = Max(myMaxDegree - myNivCont - (myMaxDegree + 1) / 4,
myNivCont + 1);
if(NbElem > myMaxSegment)
- Standard_ConstructionError::Raise("AppDef_Variational::InitCutting");
+ throw Standard_ConstructionError("AppDef_Variational::InitCutting");
aCurve = new FEmTool_Curve(myDimension, NbElem, aBase, CurvTol);
Standard_Real& MaxE2d)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
Standard_Integer i, j, k, i2, indexdeb, indexfin;
Standard_Integer i21, i22;
Standard_Real AA, BB, CC, Fi, FX, FY, FZ, AIJ;
Standard_Real& MaxE3d,
Standard_Real& MaxE2d)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
Standard_Integer i, j, k, i2, indexdeb, indexfin;
Standard_Real AA, BB, CC, Fi, FX, FY, FZ, AIJ;
// Standard_Real DAIJ, DAA, DBB, DCC, Gr, gr1= 0.0, gr2= 0.0;
AppParCurves_MultiCurve AppParCurves_LeastSquare::BezierValue()
{
- if (!myknots.IsNull()) Standard_NoSuchObject::Raise();
+ if (!myknots.IsNull()) throw Standard_NoSuchObject();
return (AppParCurves_MultiCurve)(BSplineValue());
}
const AppParCurves_MultiBSpCurve& AppParCurves_LeastSquare::BSplineValue()
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
Standard_Integer i, j, j2, npoints = nbP+nbP2d;;
gp_Pnt Pt;
const math_Matrix& AppParCurves_LeastSquare::FunctionMatrix() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return A;
}
const math_Matrix& AppParCurves_LeastSquare::DerivativeFunctionMatrix() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return DA;
}
const Standard_Real U, gp_Pnt& Pt) const {
if (Dimension(CuIndex) != 3) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt TabPoles(1, tabPoint->Length());
const Standard_Real U, gp_Pnt2d& Pt) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPoles(1, tabPoint->Length());
void AppParCurves_MultiBSpCurve::D1 (const Standard_Integer CuIndex,
const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1) const {
if (Dimension(CuIndex) != 3) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt TabPoles(1, tabPoint->Length());
gp_Vec& V1,
gp_Vec& V2) const {
if (Dimension(CuIndex) != 3) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt TabPoles(1, tabPoint->Length());
void AppParCurves_MultiBSpCurve::D1 (const Standard_Integer CuIndex,
const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPoles(1, tabPoint->Length());
gp_Vec2d& V1,
gp_Vec2d& V2) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPoles(1, tabPoint->Length());
Standard_Integer Lo = tabPoint->Lower();
Standard_Integer nb = tabPoint->Value(Lo).NbPoints() + tabPoint->Value(Lo).NbPoints2d();
if ((Index <= 0) || (Index > nb)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabPoint->Value(Lo).Dimension(Index);
}
const AppParCurves_MultiPoint& MPoint) {
if ((Index <= 0) || (Index > tabPoint->Length())) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
tabPoint->SetValue(Index, MPoint);
}
void AppParCurves_MultiCurve::Curve (const Standard_Integer CuIndex,
TColgp_Array1OfPnt& TabPnt) const {
if ((CuIndex <= 0)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
for ( Standard_Integer i = 1; i <= tabPoint->Length(); i++) {
TabPnt(i) = tabPoint->Value(i).Point(CuIndex);
void AppParCurves_MultiCurve::Curve (const Standard_Integer CuIndex,
TColgp_Array1OfPnt2d& TabPnt2d) const {
if ((CuIndex <= 0)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
for ( Standard_Integer i = 1; i <= tabPoint->Length(); i++) {
TabPnt2d(i) = tabPoint->Value(i).Point2d(CuIndex);
const Standard_Integer Nieme) const
{
if ((CuIndex <= 0) && Nieme <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabPoint->Value(Nieme).Point(CuIndex);
}
const Standard_Integer Nieme)const
{
if ((CuIndex <= 0) && Nieme <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabPoint->Value(Nieme).Point2d(CuIndex);
}
const AppParCurves_MultiPoint& AppParCurves_MultiCurve::Value (const Standard_Integer Index) const {
if ((Index <= 0) || (Index > tabPoint->Length())) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return tabPoint->Value(Index);
}
const Standard_Real z,
const Standard_Real dz)
{
- if (Dimension(CuIndex) != 3) Standard_OutOfRange::Raise();
+ if (Dimension(CuIndex) != 3) throw Standard_OutOfRange();
for (Standard_Integer i = 1 ; i <= tabPoint->Length(); i++) {
(tabPoint->ChangeValue(i)).Transform(CuIndex, x, dx, y, dy, z, dz);
const Standard_Real y,
const Standard_Real dy)
{
- if (Dimension(CuIndex) != 2) Standard_OutOfRange::Raise();
+ if (Dimension(CuIndex) != 2) throw Standard_OutOfRange();
for (Standard_Integer i = 1 ; i <= tabPoint->Length(); i++) {
(tabPoint->ChangeValue(i)).Transform2d(CuIndex, x, dx, y, dy);
void AppParCurves_MultiCurve::Value (const Standard_Integer CuIndex,
const Standard_Real U, gp_Pnt& Pt) const {
- if (Dimension(CuIndex) != 3)Standard_OutOfRange::Raise();
+ if (Dimension(CuIndex) != 3)throw Standard_OutOfRange();
TColgp_Array1OfPnt TabPoles(1, tabPoint->Length());
void AppParCurves_MultiCurve::Value (const Standard_Integer CuIndex,
const Standard_Real U, gp_Pnt2d& Pt) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPole(1, tabPoint->Length());
gp_Vec& V1) const {
if (Dimension(CuIndex) != 3) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt TabPole(1, tabPoint->Length());
gp_Vec& V2) const {
if (Dimension(CuIndex) != 3) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt TabPole(1, tabPoint->Length());
const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPole(1, tabPoint->Length());
gp_Vec2d& V2) const {
if (Dimension(CuIndex) != 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt2d TabPole(1, tabPoint->Length());
const Standard_Real z,
const Standard_Real dz)
{
- if (Dimension(CuIndex) != 3) Standard_OutOfRange::Raise();
+ if (Dimension(CuIndex) != 3) throw Standard_OutOfRange();
gp_Pnt P, newP;
P = Point(CuIndex);
const Standard_Real y,
const Standard_Real dy)
{
- if (Dimension(CuIndex) != 2) Standard_OutOfRange::Raise();
+ if (Dimension(CuIndex) != 2) throw Standard_OutOfRange();
gp_Pnt2d P, newP;
P = Point2d(CuIndex);
inline Standard_Integer AppParCurves_MultiPoint::Dimension(const Standard_Integer Index) const
{
if (Index < 0 || Index > (nbP + nbP2d)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (Index <= nbP) {
return 3;
const Standard_Boolean only2d)
{
myIsDone = Standard_False;
- if(only3d && only2d) Standard_ConstructionError::Raise();
+ if(only3d && only2d) throw Standard_ConstructionError();
GeomAbs_Shape Order = S;
Handle( Adaptor2d_HCurve2d ) TrimmedC2D = C2D->Trim( First, Last, Precision::PConfusion() );
{
Standard_Integer i, j;
Standard_Integer NbInt = Si->Length() - 1;
- if (NbInt < 3) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter");
+ if (NbInt < 3) throw Standard_ConstructionError("Approx_CurvlinFunc::GetUParameter");
if(NInterval < 1) NInterval = 1;
else if(NInterval > NbInt - 2) NInterval = NbInt - 2;
void Approx_CurvlinFunc::Trim(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol)
{
- if (First < 0 || Last >1) Standard_OutOfRange::Raise("Approx_CurvlinFunc::Trim");
+ if (First < 0 || Last >1) throw Standard_OutOfRange("Approx_CurvlinFunc::Trim");
if ((Last - First) < Tol) return;
Standard_Real FirstU, LastU;
#ifdef OCCT_DEBUG_CHRONO
InitChron(chr_uparam);
#endif
- if(S < 0 || S > 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::GetUParameter");
+ if(S < 0 || S > 1) throw Standard_ConstructionError("Approx_CurvlinFunc::GetUParameter");
if(NumberOfCurve == 1) {
InitUArray = myUi_1;
Standard_Boolean Approx_CurvlinFunc::EvalCase1(const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const
{
- if(myCase != 1) Standard_ConstructionError::Raise("Approx_CurvlinFunc::EvalCase1");
+ if(myCase != 1) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase1");
gp_Pnt C;
gp_Vec dC_dU, dC_dS, d2C_dU2, d2C_dS2;
Standard_Boolean Approx_CurvlinFunc::EvalCase2(const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result) const
{
- if(myCase != 2) Standard_ConstructionError::Raise("Approx_CurvlinFunc::EvalCase2");
+ if(myCase != 2) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase2");
Standard_Boolean Done;
Standard_Boolean Approx_CurvlinFunc::EvalCase3(const Standard_Real S, const Standard_Integer Order, TColStd_Array1OfReal& Result)
{
- if(myCase != 3) Standard_ConstructionError::Raise("Approx_CurvlinFunc::EvalCase3");
+ if(myCase != 3) throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCase3");
TColStd_Array1OfReal tmpRes1(0, 4), tmpRes2(0, 4);
Standard_Boolean Done;
Length = myLength2;
}
else
- Standard_ConstructionError::Raise("Approx_CurvlinFunc::EvalCurOnSur");
+ throw Standard_ConstructionError("Approx_CurvlinFunc::EvalCurOnSur");
Standard_Real Mag, dU_dS, d2U_dS2, dV_dU, dW_dU, dV_dS, dW_dS, d2V_dS2, d2W_dS2, d2V_dU2, d2W_dU2;
gp_Pnt2d C2D;
BSplCLib::Interpolate(3,FlatKnots,InterpolationParameters,ContactOrder,
1,Poles(1),inversion_problem);
if(inversion_problem) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
// Test if par2d(par3d) is monotonous function or not ----- IFV, Jan 2000
1,Poles(1),inversion_problem);
if(inversion_problem)
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real besttol = sqrt(besttol2);
Standard_Integer& NbUKnots,
Standard_Integer& NbVKnots) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
UDegree = udeg;
VDegree = vdeg;
NbUPoles = tabPoles->ColLength();
TColStd_Array1OfInteger& TUMults,
TColStd_Array1OfInteger& TVMults) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
TPoles = tabPoles->Array2();
TWeights = tabWeights->Array2();
TUKnots = tabUKnots->Array1();
{
Standard_Integer ii;
Standard_Real MaxError = 0, err;
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
if (myFunc->IsRational()) {
TColStd_Array1OfReal Wmin(1, Num1DSS);
{
Standard_Integer ii;
Standard_Real MoyError = 0, err;
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
if (myFunc->IsRational()) {
TColStd_Array1OfReal Wmin(1, Num1DSS);
Standard_Integer& NbPoles,
Standard_Integer& NbKnots) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError("Approx_SweepApproximation");}
Degree = deg2d;
NbPoles = seqPoles2d(1)->Length();
NbKnots = tab2dKnots->Length();
TColStd_Array1OfReal& TKnots,
TColStd_Array1OfInteger& TMults) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError("Approx_SweepApproximation");}
TPoles = seqPoles2d(Index)->Array1();
TKnots = tab2dKnots->Array1();
TMults = tab2dMults->Array1();
Standard_Real Approx_SweepApproximation::Max2dError(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
return tab2dError->Value(Index);
}
Standard_Real Approx_SweepApproximation::Average2dError(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
return Ave2dError->Value(Index);
}
Standard_Real Approx_SweepApproximation::TolCurveOnSurf(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise("Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone("Approx_SweepApproximation");}
return COnSurfErr->Value(Index);
}
inline Standard_Integer Approx_SweepApproximation::UDegree() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return udeg;
}
inline Standard_Integer Approx_SweepApproximation::VDegree() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return vdeg;
}
inline const TColgp_Array2OfPnt& Approx_SweepApproximation::SurfPoles() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabPoles->Array2();
}
inline const TColStd_Array2OfReal& Approx_SweepApproximation::SurfWeights() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabWeights->Array2();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::SurfUKnots() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabUKnots->Array1();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::SurfVKnots() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabVKnots->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::SurfUMults() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabUMults->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::SurfVMults() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return tabVMults->Array1();
}
inline Standard_Integer Approx_SweepApproximation::NbCurves2d() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
return Num2DSS;
}
inline Standard_Integer Approx_SweepApproximation::Curves2dDegree() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return deg2d;
}
inline const TColgp_Array1OfPnt2d& Approx_SweepApproximation::Curve2dPoles(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return seqPoles2d(Index)->Array1();
}
inline const TColStd_Array1OfReal& Approx_SweepApproximation::Curves2dKnots() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return tab2dKnots->Array1();
}
inline const TColStd_Array1OfInteger& Approx_SweepApproximation::Curves2dMults() const
{
- if (!done) {StdFail_NotDone::Raise(" Approx_SweepApproximation");}
- if (seqPoles2d.Length() == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone(" Approx_SweepApproximation");}
+ if (seqPoles2d.Length() == 0) {throw Standard_DomainError();}
return tab2dMults->Array1();
}
// Standard_Boolean Approx_SweepFunction::D1(const Standard_Real Param,const Standard_Real First,const Standard_Real Last,TColgp_Array1OfPnt& Poles,TColgp_Array1OfVec& DPoles,TColgp_Array1OfPnt2d& Poles2d,TColgp_Array1OfVec2d& DPoles2d,TColStd_Array1OfReal& Weigths,TColStd_Array1OfReal& DWeigths)
Standard_Boolean Approx_SweepFunction::D1(const Standard_Real ,const Standard_Real ,const Standard_Real ,TColgp_Array1OfPnt& ,TColgp_Array1OfVec& ,TColgp_Array1OfPnt2d& ,TColgp_Array1OfVec2d& ,TColStd_Array1OfReal& ,TColStd_Array1OfReal& )
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::D1");
- return Standard_False;
+ throw Standard_NotImplemented("Approx_SweepFunction::D1");
}
// Standard_Boolean Approx_SweepFunction::D2(const Standard_Real Param,const Standard_Real First,const Standard_Real Last,TColgp_Array1OfPnt& Poles,TColgp_Array1OfVec& DPoles,TColgp_Array1OfVec& D2Poles,TColgp_Array1OfPnt2d& Poles2d,TColgp_Array1OfVec2d& DPoles2d,TColgp_Array1OfVec2d& D2Poles2d,TColStd_Array1OfReal& Weigths,TColStd_Array1OfReal& DWeigths,TColStd_Array1OfReal& D2Weigths)
Standard_Boolean Approx_SweepFunction::D2(const Standard_Real ,const Standard_Real ,const Standard_Real ,TColgp_Array1OfPnt& ,TColgp_Array1OfVec& ,TColgp_Array1OfVec& ,TColgp_Array1OfPnt2d& ,TColgp_Array1OfVec2d& ,TColgp_Array1OfVec2d& ,TColStd_Array1OfReal& ,TColStd_Array1OfReal& ,TColStd_Array1OfReal& )
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::D2");
- return Standard_False;
+ throw Standard_NotImplemented("Approx_SweepFunction::D2");
}
// void Approx_SweepFunction::Resolution(const Standard_Integer Index,const Standard_Real Tol,Standard_Real& TolU,Standard_Real& TolV) const
void Approx_SweepFunction::Resolution(const Standard_Integer ,const Standard_Real ,Standard_Real& ,Standard_Real& ) const
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::Resolution");
+ throw Standard_NotImplemented("Approx_SweepFunction::Resolution");
}
gp_Pnt Approx_SweepFunction::BarycentreOfSurf() const
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::BarycentreOfSurf");
- return gp_Pnt(0.,0.,0.);
+ throw Standard_NotImplemented("Approx_SweepFunction::BarycentreOfSurf");
}
Standard_Real Approx_SweepFunction::MaximalSection() const
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::MaximalSection()");
- return 0;
+ throw Standard_NotImplemented("Approx_SweepFunction::MaximalSection()");
}
// void Approx_SweepFunction::GetMinimalWeight(TColStd_Array1OfReal& Weigths) const
void Approx_SweepFunction::GetMinimalWeight(TColStd_Array1OfReal& ) const
{
- Standard_NotImplemented::Raise("Approx_SweepFunction::GetMinimalWeight");
+ throw Standard_NotImplemented("Approx_SweepFunction::GetMinimalWeight");
}
#if !defined No_Exception && !defined No_Aspect_AspectFillAreaDefinitionError
#define Aspect_AspectFillAreaDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_AspectFillAreaDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_AspectFillAreaDefinitionError(MESSAGE);
#else
#define Aspect_AspectFillAreaDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_AspectLineDefinitionError
#define Aspect_AspectLineDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_AspectLineDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_AspectLineDefinitionError(MESSAGE);
#else
#define Aspect_AspectLineDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_AspectMarkerDefinitionError
#define Aspect_AspectMarkerDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_AspectMarkerDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_AspectMarkerDefinitionError(MESSAGE);
#else
#define Aspect_AspectMarkerDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_BadAccess
#define Aspect_BadAccess_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_BadAccess::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_BadAccess(MESSAGE);
#else
#define Aspect_BadAccess_Raise_if(CONDITION, MESSAGE)
#endif
TCollection_AsciiString aMessage;
aMessage += "Can not connect to the server \"";
aMessage += myDisplayName + "\"";
- Aspect_DisplayConnectionDefinitionError::Raise (aMessage.ToCString());
+ throw Aspect_DisplayConnectionDefinitionError(aMessage.ToCString());
}
}
#if !defined No_Exception && !defined No_Aspect_DisplayConnectionDefinitionError
#define Aspect_DisplayConnectionDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_DisplayConnectionDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_DisplayConnectionDefinitionError(MESSAGE);
#else
#define Aspect_DisplayConnectionDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_DriverDefinitionError
#define Aspect_DriverDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_DriverDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_DriverDefinitionError(MESSAGE);
#else
#define Aspect_DriverDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
{
if (theLow > theUpper)
{
- Aspect_IdentDefinitionError::Raise ("GenId Create Error: wrong interval");
+ throw Aspect_IdentDefinitionError("GenId Create Error: wrong interval");
}
}
}
else if (myFreeCount < 1)
{
- Aspect_IdentDefinitionError::Raise ("GenId Next Error: Available == 0");
+ throw Aspect_IdentDefinitionError("GenId Next Error: Available == 0");
}
--myFreeCount;
#if !defined No_Exception && !defined No_Aspect_GraphicDeviceDefinitionError
#define Aspect_GraphicDeviceDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_GraphicDeviceDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_GraphicDeviceDefinitionError(MESSAGE);
#else
#define Aspect_GraphicDeviceDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_IdentDefinitionError
#define Aspect_IdentDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_IdentDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_IdentDefinitionError(MESSAGE);
#else
#define Aspect_IdentDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_WindowDefinitionError
#define Aspect_WindowDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_WindowDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_WindowDefinitionError(MESSAGE);
#else
#define Aspect_WindowDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Aspect_WindowError
#define Aspect_WindowError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Aspect_WindowError::Raise(MESSAGE);
+ if (CONDITION) throw Aspect_WindowError(MESSAGE);
#else
#define Aspect_WindowError_Raise_if(CONDITION, MESSAGE)
#endif
return;
}
if (myProgressIndicator->UserBreak()) {
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
}
// myErrorStatus
//
if(aC2D.IsNull())
{
- Standard_ConstructionError::Raise("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
+ throw Standard_ConstructionError("BOPTools_AlgoTools2D::MakePCurveOnFace : PCurve is Null");
}
//
TolReached2d=aTolR;
case GeomAbs_BezierCurve :
case GeomAbs_OtherCurve :
default :
- Standard_NotImplemented::Raise
- ("BOPTools_AlgoTools2D::MakePCurveOfType");
+ throw Standard_NotImplemented("BOPTools_AlgoTools2D::MakePCurveOfType");
break;
}
}
Handle(BRep_TFace) TF = new BRep_TFace();
if(!F.IsNull() && F.Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::MakeFace");
+ throw TopoDS_LockedShape("BRep_Builder::MakeFace");
}
TF->Surface(S);
TF->Tolerance(Tol);
Handle(BRep_TFace) TF = new BRep_TFace();
if(!F.IsNull() && F.Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::MakeFace");
+ throw TopoDS_LockedShape("BRep_Builder::MakeFace");
}
TF->Triangulation(T);
MakeShape(F, TF);
Handle(BRep_TFace) TF = new BRep_TFace();
if(!F.IsNull() && F.Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::MakeFace");
+ throw TopoDS_LockedShape("BRep_Builder::MakeFace");
}
TF->Surface(S);
TF->Tolerance(Tol);
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &F.TShape());
if(TF->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateFace");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateFace");
}
TF->Surface(S);
TF->Tolerance(Tol);
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &F.TShape());
if(TF->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateFace");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateFace");
}
TF->Triangulation(T);
F.TShape()->Modified(Standard_True);
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &F.TShape());
if(TF->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateFace");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateFace");
}
TF->Tolerance(Tol);
F.TShape()->Modified(Standard_True);
const Handle(BRep_TFace)& TF = (*((Handle(BRep_TFace)*) &F.TShape()));
if(TF->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::NaturalRestriction");
+ throw TopoDS_LockedShape("BRep_Builder::NaturalRestriction");
}
TF->NaturalRestriction(N);
F.TShape()->Modified(Standard_True);
Handle(BRep_TEdge) TE = new BRep_TEdge();
if(!E.IsNull() && E.Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::MakeEdge");
+ throw TopoDS_LockedShape("BRep_Builder::MakeEdge");
}
MakeShape(E,TE);
}
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
BRep_ListOfCurveRepresentation& lcr = TE->ChangeCurves();
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
const TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
TopLoc_Location l = L.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateEdge");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateEdge");
}
TE->UpdateTolerance(Tol);
TE->Modified(Standard_True);
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::Continuity");
+ throw TopoDS_LockedShape("BRep_Builder::Continuity");
}
const TopLoc_Location l1 = L1.Predivided(E.Location());
const TopLoc_Location l2 = L2.Predivided(E.Location());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::SameParameter");
+ throw TopoDS_LockedShape("BRep_Builder::SameParameter");
}
TE->SameParameter(S);
TE->Modified(Standard_True);
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::SameRange");
+ throw TopoDS_LockedShape("BRep_Builder::SameRange");
}
TE->SameRange(S);
TE->Modified(Standard_True);
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::Degenerated");
+ throw TopoDS_LockedShape("BRep_Builder::Degenerated");
}
TE->Degenerated(D);
if (D) {
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::Range");
+ throw TopoDS_LockedShape("BRep_Builder::Range");
}
BRep_ListOfCurveRepresentation& lcr = TE->ChangeCurves();
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::Range");
+ throw TopoDS_LockedShape("BRep_Builder::Range");
}
const TopLoc_Location l = L.Predivided(E.Location());
}
if (!itcr.More())
- Standard_DomainError::Raise("BRep_Builder::Range, no pcurve");
+ throw Standard_DomainError("BRep_Builder::Range, no pcurve");
TE->Modified(Standard_True);
}
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &Ein.TShape());
if(TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::Transfert");
+ throw TopoDS_LockedShape("BRep_Builder::Transfert");
}
const Standard_Real tol = TE->Tolerance();
const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &V.TShape());
if(TV->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateVertex");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
}
TV->Pnt(P.Transformed(V.Location().Inverted().Transformation()));
TV->UpdateTolerance(Tol);
{
if (Precision::IsPositiveInfinite(Par) ||
Precision::IsNegativeInfinite(Par))
- Standard_DomainError::Raise("BRep_Builder::Infinite parameter");
+ throw Standard_DomainError("BRep_Builder::Infinite parameter");
const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &V.TShape());
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
if(TV->Locked() || TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateVertex");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
}
TopLoc_Location L = E.Location().Predivided(V.Location());
{
if (Precision::IsPositiveInfinite(Par) ||
Precision::IsNegativeInfinite(Par))
- Standard_DomainError::Raise("BRep_Builder::Infinite parameter");
+ throw Standard_DomainError("BRep_Builder::Infinite parameter");
// Find the curve representation
TopLoc_Location l = L.Predivided(V.Location());
if(TV->Locked() || TE->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateVertex");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
}
// Search the vertex in the edge
}
if (!itcr.More())
- Standard_DomainError::Raise("BRep_Builder:: no pcurve");
+ throw Standard_DomainError("BRep_Builder:: no pcurve");
TV->UpdateTolerance(Tol);
TE->Modified(Standard_True);
if(TV->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateVertex");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
}
TopLoc_Location L;
if(TV->Locked())
{
- TopoDS_LockedShape::Raise("BRep_Builder::UpdateVertex");
+ throw TopoDS_LockedShape("BRep_Builder::UpdateVertex");
}
TV->UpdateTolerance(Tol);
void BRep_CurveOn2Surfaces::D0(const Standard_Real , gp_Pnt& )const
{
- Standard_NullObject::Raise("BRep_CurveOn2Surfaces::D0");
+ throw Standard_NullObject("BRep_CurveOn2Surfaces::D0");
}
const Handle(Geom_Curve)& BRep_CurveRepresentation::Curve3D()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Geom_Curve)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::Curve3D(const Handle(Geom_Curve)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Geom_Surface)& BRep_CurveRepresentation::Surface()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Geom_Surface)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Geom2d_Curve)& BRep_CurveRepresentation::PCurve()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Geom2d_Curve)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
const Handle(Geom2d_Curve)& BRep_CurveRepresentation::PCurve2()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Geom2d_Curve)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::PCurve(const Handle(Geom2d_Curve)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::PCurve2(const Handle(Geom2d_Curve)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const GeomAbs_Shape& BRep_CurveRepresentation::Continuity()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((GeomAbs_Shape*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::Continuity(const GeomAbs_Shape )
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Geom_Surface)& BRep_CurveRepresentation::Surface2()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Geom_Surface)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const TopLoc_Location& BRep_CurveRepresentation::Location2()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((TopLoc_Location*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Poly_Polygon3D)& BRep_CurveRepresentation::Polygon3D()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Poly_Polygon3D)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::Polygon3D(const Handle(Poly_Polygon3D)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Poly_Polygon2D)& BRep_CurveRepresentation::Polygon()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Poly_Polygon2D)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
void BRep_CurveRepresentation::Polygon(const Handle(Poly_Polygon2D)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
const Handle(Poly_PolygonOnTriangulation)& BRep_CurveRepresentation::PolygonOnTriangulation2() const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Poly_PolygonOnTriangulation)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
void BRep_CurveRepresentation::PolygonOnTriangulation2
(const Handle(Poly_PolygonOnTriangulation)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
void BRep_CurveRepresentation::PolygonOnTriangulation
(const Handle(Poly_PolygonOnTriangulation)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Poly_PolygonOnTriangulation)& BRep_CurveRepresentation::PolygonOnTriangulation()
const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *(Handle(Poly_PolygonOnTriangulation)*)NULL;
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
//=======================================================================
//function : Triangulation
const Handle(Poly_Triangulation)& BRep_CurveRepresentation::Triangulation()
const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *(Handle(Poly_Triangulation)*)NULL;
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
const Handle(Poly_Polygon2D)& BRep_CurveRepresentation::Polygon2()const
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
- return *((Handle(Poly_Polygon2D)*) NULL);
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
void BRep_CurveRepresentation::Polygon2(const Handle(Poly_Polygon2D)&)
{
- Standard_DomainError::Raise("BRep_CurveRepresentation");
+ throw Standard_DomainError("BRep_CurveRepresentation");
}
Standard_Real BRep_PointRepresentation::Parameter2()const
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
- return 0;
+ throw Standard_DomainError("BRep_PointRepresentation");
}
void BRep_PointRepresentation::Parameter2(const Standard_Real )
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
+ throw Standard_DomainError("BRep_PointRepresentation");
}
const Handle(Geom_Curve)& BRep_PointRepresentation::Curve()const
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
- return *((Handle(Geom_Curve)*) NULL);
+ throw Standard_DomainError("BRep_PointRepresentation");
}
void BRep_PointRepresentation::Curve(const Handle(Geom_Curve)& )
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
+ throw Standard_DomainError("BRep_PointRepresentation");
}
const Handle(Geom2d_Curve)& BRep_PointRepresentation::PCurve()const
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
- return *((Handle(Geom2d_Curve)*) NULL);
+ throw Standard_DomainError("BRep_PointRepresentation");
}
void BRep_PointRepresentation::PCurve(const Handle(Geom2d_Curve)& )
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
+ throw Standard_DomainError("BRep_PointRepresentation");
}
const Handle(Geom_Surface)& BRep_PointRepresentation::Surface()const
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
- return *((Handle(Geom_Surface)*) NULL);
+ throw Standard_DomainError("BRep_PointRepresentation");
}
void BRep_PointRepresentation::Surface(const Handle(Geom_Surface)& )
{
- Standard_DomainError::Raise("BRep_PointRepresentation");
+ throw Standard_DomainError("BRep_PointRepresentation");
}
if (TV == 0)
{
- Standard_NullObject::Raise("BRep_Tool:: TopoDS_Vertex hasn't gp_Pnt");
+ throw Standard_NullObject("BRep_Tool:: TopoDS_Vertex hasn't gp_Pnt");
}
const gp_Pnt& P = TV->Pnt();
if (aTVert == 0)
{
- Standard_NullObject::Raise("BRep_Tool:: TopoDS_Vertex hasn't gp_Pnt");
+ throw Standard_NullObject("BRep_Tool:: TopoDS_Vertex hasn't gp_Pnt");
}
Standard_Real p = aTVert->Tolerance();
}
}
- Standard_NoSuchObject::Raise("BRep_Tool:: no parameter on edge");
- return 0;
+ throw Standard_NoSuchObject("BRep_Tool:: no parameter on edge");
}
//=======================================================================
//----------------------------------------------------------
- Standard_NoSuchObject::Raise("BRep_Tool:: no parameter on edge");
- return 0;
+ throw Standard_NoSuchObject("BRep_Tool:: no parameter on edge");
}
//=======================================================================
else return Pl;//Ambiguity (natural) for degenerated edges.
}
}
- Standard_NoSuchObject::Raise("BRep_Tool:: no parameters on surface");
- return gp_Pnt2d(0,0);
+ throw Standard_NoSuchObject("BRep_Tool:: no parameters on surface");
}
//=======================================================================
//function : IsClosed
myConSurf->ChangeCurve().Load(HC, HS);
}
else {
- Standard_NullObject::Raise("BRepAdaptor_Curve::No geometry");
+ throw Standard_NullObject("BRepAdaptor_Curve::No geometry");
}
}
myTrsf = L.Transformation();
Handle(Geom_OffsetCurve) BRepAdaptor_Curve::OffsetCurve() const
{
if ( !Is3DCurve() || myCurve.GetType() != GeomAbs_OffsetCurve)
- Standard_NoSuchObject::Raise("BRepAdaptor_Curve::OffsetCurve");
+ throw Standard_NoSuchObject("BRepAdaptor_Curve::OffsetCurve");
Handle(Geom_OffsetCurve) anOffC = myCurve.OffsetCurve();
return myTrsf.Form() == gp_Identity
void BRepAlgo_AsDes::Remove(const TopoDS_Shape& SS)
{
if (down.IsBound(SS)) {
- Standard_ConstructionError::Raise(" BRepAlgo_AsDes::Remove");
+ throw Standard_ConstructionError(" BRepAlgo_AsDes::Remove");
}
if (!up.IsBound(SS)) {
- Standard_ConstructionError::Raise(" BRepAlgo_AsDes::Remove");
+ throw Standard_ConstructionError(" BRepAlgo_AsDes::Remove");
}
TopTools_ListIteratorOfListOfShape it(up(SS));
for (; it.More(); it.Next()) {
const TopoDS_Shape& NewS)
{
if (down.IsBound(OldS)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::Bind");
+ throw Standard_ConstructionError(" BRepAlgo_Image::Bind");
return;
}
TopTools_ListOfShape L;
const TopTools_ListOfShape& L)
{
if (HasImage(OldS)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::Bind");
+ throw Standard_ConstructionError(" BRepAlgo_Image::Bind");
return;
}
TopTools_ListIteratorOfListOfShape it(L);
void BRepAlgo_Image::Add(const TopoDS_Shape& OldS, const TopoDS_Shape& NewS)
{
if (!HasImage(OldS)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::Add");
+ throw Standard_ConstructionError(" BRepAlgo_Image::Add");
}
down(OldS).Append(NewS);
up.Bind(NewS,OldS);
void BRepAlgo_Image::Remove(const TopoDS_Shape& S)
{
if (!up.IsBound(S)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::Remove");
+ throw Standard_ConstructionError(" BRepAlgo_Image::Remove");
}
const TopoDS_Shape& OldS = up(S);
TopTools_ListOfShape& L = down(OldS);
const TopoDS_Shape& BRepAlgo_Image::ImageFrom(const TopoDS_Shape& S) const
{
if (!up.IsBound(S)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::ImageFrom");
+ throw Standard_ConstructionError(" BRepAlgo_Image::ImageFrom");
}
return up(S);
}
const
{
if (!up.IsBound(S)) {
- Standard_ConstructionError::Raise(" BRepAlgo_Image::FirstImageFrom");
+ throw Standard_ConstructionError(" BRepAlgo_Image::FirstImageFrom");
}
TopoDS_Shape S1 = up(S);
return;
}
if (myProgressIndicator->UserBreak()) {
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
}
//=======================================================================
DEFINE_STANDARD_ALLOC
-
- //! Raises Construction Error
- Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox();
-
Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
DEFINE_STANDARD_ALLOC
-
- //! Raises Construction Error
- Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox();
-
//! compute the solution point with the close point
Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency);
inline const gp_Vec& BRepBlend_Extremity::Tangent () const
{
- if (!hastang) {Standard_DomainError::Raise();}
+ if (!hastang) {throw Standard_DomainError();}
return tang;
}
inline const Handle(Adaptor3d_HVertex)& BRepBlend_Extremity::Vertex () const
{
- if (!isvtx) {Standard_DomainError::Raise();}
+ if (!isvtx) {throw Standard_DomainError();}
return vtx;
}
inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS1 () const
{
- if (!hass1) {Standard_DomainError::Raise();}
+ if (!hass1) {throw Standard_DomainError();}
return tras1;
}
inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS2 () const
{
- if (!hass2) {Standard_DomainError::Raise();}
+ if (!hass2) {throw Standard_DomainError();}
return tras2;
}
inline IntSurf_TypeTrans BRepBlend_Line::TransitionOnS () const
{
- if (!hass1) {Standard_DomainError::Raise();}
+ if (!hass1) {throw Standard_DomainError();}
return tras1;
}
const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst1() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst1;
}
const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst1() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst1;
}
const gp_Vec& BRepBlend_RstRstConstRad::TangentOnRst2() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst2;
}
const gp_Vec2d& BRepBlend_RstRstConstRad::Tangent2dOnRst2() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst2;
}
const gp_Vec& BRepBlend_RstRstEvolRad::TangentOnRst1() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst1;
}
const gp_Vec2d& BRepBlend_RstRstEvolRad::Tangent2dOnRst1() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst1;
}
const gp_Vec& BRepBlend_RstRstEvolRad::TangentOnRst2() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst2;
}
const gp_Vec2d& BRepBlend_RstRstEvolRad::Tangent2dOnRst2() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst2;
}
Blend_CurvPointFuncInv& FinvP2,
const Standard_Real Pmin)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
if (iscomplete) {return Standard_True;}
if (sens >0.) {
previousP = line->Point(1);
inline const Handle(BRepBlend_Line)& BRepBlend_RstRstLineBuilder::Line() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return line;
}
const gp_Vec& BRepBlend_SurfRstConstRad::TangentOnS() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgs;
}
const gp_Vec2d& BRepBlend_SurfRstConstRad::Tangent2dOnS() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2ds;
}
const gp_Vec& BRepBlend_SurfRstConstRad::TangentOnRst() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst;
}
const gp_Vec2d& BRepBlend_SurfRstConstRad::Tangent2dOnRst() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst;
}
//=======================================================================
const gp_Vec& BRepBlend_SurfRstEvolRad::TangentOnS() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgs;
}
//=======================================================================
const gp_Vec2d& BRepBlend_SurfRstEvolRad::Tangent2dOnS() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2ds;
}
//=======================================================================
const gp_Vec& BRepBlend_SurfRstEvolRad::TangentOnRst() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tgrst;
}
//=======================================================================
const gp_Vec2d& BRepBlend_SurfRstEvolRad::Tangent2dOnRst() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2drst;
}
Blend_SurfCurvFuncInv& FinvC,
const Standard_Real Pmin)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
if (iscomplete) {return Standard_True;}
if (sens >0.) {
previousP = line->Point(1);
inline const Handle(BRepBlend_Line)& BRepBlend_SurfRstLineBuilder::Line() const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return line;
}
void BRepBuilderAPI_Command::Check()const
{
if (!myDone)
- StdFail_NotDone::Raise("BRep_API: command not done");
+ throw StdFail_NotDone("BRep_API: command not done");
}
const Standard_Boolean theIsReverse = Standard_False)
{
if((theIndex < 0) || (theIndex > 3))
- Standard_OutOfRange::Raise("BRepBuilderAPI_FastSewing.cxx, Get2DCurve(): OUT of Range");
+ throw Standard_OutOfRange("BRepBuilderAPI_FastSewing.cxx, Get2DCurve(): OUT of Range");
Handle(Geom2d_Curve) a2dCurv;
a3dCurv = aSurf->UIso(aUf);
break;
default:
- Standard_OutOfRange::Raise("FS_Edge::CreateTopologicalEdge()");
+ throw Standard_OutOfRange("FS_Edge::CreateTopologicalEdge()");
break;
}
void BRepBuilderAPI_ModifyShape::DoModif ()
{
if (myInitialShape.IsNull() || myModification.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
myModifier.Perform(myModification);
if (myModifier.IsDone()) {
GeomLib::SameRange(Precision::PConfusion(),CurvePtr,FirstOnCurve,LastOnCurve,
RequestedFirst,RequestedLast,NewCurvePtr);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameRange: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return NewCurvePtr;
}
BRepLib::SameParameter(edge);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::SameParameter: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
}
}
- catch (Standard_Failure) {
- worktol = MinTolerance();
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Exception in BRepBuilderAPI_Sewing::ProjectPointsOnCurve: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ worktol = MinTolerance();
}
if (!isProjected && isConsiderEnds) {
if (Min(distF2,distL2) < worktol * worktol) {
const Standard_Boolean B)
{
if (S.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
myShape = S;
myMap.Clear();
Handle(BRepCheck_Edge)::DownCast(aRes)->SetStatus(ste);
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
if (MapS.Add(aVertex))
myMap(aVertex)->InContext(S);
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
myMap(S)->SetFailStatus(S);
myMap(exp.Current())->InContext(S);
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
}
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
}
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
Handle(BRepCheck_Face)::DownCast(myMap(S))->SetUnorientable();
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
OCC_CATCH_SIGNALS
myMap(aShell)->InContext(S);
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"BRepCheck_Analyzer : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
if ( ! myMap(S).IsNull() )
{
myMap(S)->SetFailStatus(S);
BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer()
{
}
-#include <Standard_ConstructionError.hxx>
-
-//=======================================================================
-//function : BRepClass3d_SolidExplorer
-//purpose : Raise if called.
-//=======================================================================
-
-//BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& Oth)
-BRepClass3d_SolidExplorer::BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& )
-{
- Standard_ConstructionError::Raise("Magic constructor not allowed");
-}
//=======================================================================
//function : BRepClass3d_SolidExplorer
Standard_EXPORT BRepClass3d_SolidExplorer();
- //! Raise if called.
- Standard_EXPORT BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& Oth);
-
Standard_EXPORT BRepClass3d_SolidExplorer(const TopoDS_Shape& S);
Standard_EXPORT virtual ~BRepClass3d_SolidExplorer();
Standard_EXPORT void Destroy();
+private:
+
+ Standard_EXPORT BRepClass3d_SolidExplorer(const BRepClass3d_SolidExplorer& Oth);
+
protected:
Standard_EXPORT TopAbs_State ClassifyUVPoint
Standard_Real BRepExtrema_DistShapeShape::Value() const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::Value: There's no solution ");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::Value: There's no solution ");
return myDistRef;
}
TopoDS_Shape BRepExtrema_DistShapeShape::SupportOnShape1(const Standard_Integer N) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::SupportOnShape1: There's no solution ");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::SupportOnShape1: There's no solution ");
const BRepExtrema_SolutionElem &sol = mySolutionsShape1.Value(N);
switch (sol.SupportKind())
TopoDS_Shape BRepExtrema_DistShapeShape::SupportOnShape2(const Standard_Integer N) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::SupportOnShape2: There's no solution ");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::SupportOnShape2: There's no solution ");
const BRepExtrema_SolutionElem &sol = mySolutionsShape2.Value(N);
switch (sol.SupportKind())
void BRepExtrema_DistShapeShape::ParOnEdgeS1(const Standard_Integer N, Standard_Real& t) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::ParOnEdgeS1: There's no solution");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::ParOnEdgeS1: There's no solution");
const BRepExtrema_SolutionElem &sol = mySolutionsShape1.Value(N);
if (sol.SupportKind() != BRepExtrema_IsOnEdge)
- BRepExtrema_UnCompatibleShape::Raise
- ("BRepExtrema_DistShapeShape::ParOnEdgeS1: ParOnEdgeS1 is impossible without EDGE");
+ throw BRepExtrema_UnCompatibleShape("BRepExtrema_DistShapeShape::ParOnEdgeS1: ParOnEdgeS1 is impossible without EDGE");
sol.EdgeParameter(t);
}
void BRepExtrema_DistShapeShape::ParOnEdgeS2(const Standard_Integer N, Standard_Real& t) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::ParOnEdgeS2: There's no solution");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::ParOnEdgeS2: There's no solution");
const BRepExtrema_SolutionElem &sol = mySolutionsShape2.Value(N);
if (sol.SupportKind() != BRepExtrema_IsOnEdge)
- BRepExtrema_UnCompatibleShape::Raise
- ("BRepExtrema_DistShapeShape::ParOnEdgeS2: ParOnEdgeS2 is impossible without EDGE");
+ throw BRepExtrema_UnCompatibleShape("BRepExtrema_DistShapeShape::ParOnEdgeS2: ParOnEdgeS2 is impossible without EDGE");
sol.EdgeParameter(t);
}
void BRepExtrema_DistShapeShape::ParOnFaceS1(const Standard_Integer N, Standard_Real& u, Standard_Real& v) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::ParOnFaceS1: There's no solution");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::ParOnFaceS1: There's no solution");
const BRepExtrema_SolutionElem &sol = mySolutionsShape1.Value(N);
if (sol.SupportKind() != BRepExtrema_IsInFace)
- BRepExtrema_UnCompatibleShape::Raise
- ("BRepExtrema_DistShapeShape::ParOnFaceS1: ParOnFaceS1 is impossible without FACE");
+ throw BRepExtrema_UnCompatibleShape("BRepExtrema_DistShapeShape::ParOnFaceS1: ParOnFaceS1 is impossible without FACE");
sol.FaceParameter(u, v);
}
void BRepExtrema_DistShapeShape::ParOnFaceS2(const Standard_Integer N, Standard_Real& u, Standard_Real& v) const
{
if (!myIsDone)
- StdFail_NotDone::Raise("BRepExtrema_DistShapeShape::ParOnFaceS2: There's no solution");
+ throw StdFail_NotDone("BRepExtrema_DistShapeShape::ParOnFaceS2: There's no solution");
const BRepExtrema_SolutionElem &sol = mySolutionsShape2.Value(N);
if (sol.SupportKind() != BRepExtrema_IsInFace)
- BRepExtrema_UnCompatibleShape::Raise
- ("BRepExtrema_DistShapeShape::ParOnFaceS2:ParOnFaceS2 is impossible without FACE ");
+ throw BRepExtrema_UnCompatibleShape("BRepExtrema_DistShapeShape::ParOnFaceS2:ParOnFaceS2 is impossible without FACE ");
sol.FaceParameter(u, v);
}
#if !defined No_Exception && !defined No_BRepExtrema_UnCompatibleShape
#define BRepExtrema_UnCompatibleShape_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) BRepExtrema_UnCompatibleShape::Raise(MESSAGE);
+ if (CONDITION) throw BRepExtrema_UnCompatibleShape(MESSAGE);
#else
#define BRepExtrema_UnCompatibleShape_Raise_if(CONDITION, MESSAGE)
#endif
{
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myIsBlind = Standard_False;
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myIsBlind = Standard_False;
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myIsBlind = Standard_False;
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myIsBlind = Standard_False;
//
const TopoDS_Shape& aObject=myArguments.First();
if (aObject.IsNull() || !myAxDef || Length <= 0.) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myIsBlind = Standard_True;
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (exp.Init(myPbase,TopAbs_EDGE);exp.More();exp.Next()) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
if (trc) cout << "BRepFeat_MakeDPrism::Perform(Until)" << endl;
#endif
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
// myPbase.Orientation(TopAbs_FORWARD);
if (trc) cout << "BRepFeat_MakeDPrism::Perform(From,Until)" << endl;
#endif
if (From.IsNull() || Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull()) {
TopExp_Explorer exp(From, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
mySFrom = From;
Standard_Boolean Trff = TransformShapeFU(0);
if (trc) cout << "BRepFeat_MakeDPrism::PerformFromEnd(From,Until)" << endl;
#endif
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
PerformUntilEnd();
TopExp_Explorer exp;
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
// myPbase.Orientation(TopAbs_FORWARD);
myPerfSelection = BRepFeat_SelectionShU;
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
// myPbase.Orientation(TopAbs_FORWARD);
myGluedF.Clear();
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (exp.Init(myPbase,TopAbs_EDGE);exp.More();exp.Next()) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
if (trc) cout << "BRepFeat_MakePipe::Perform(Until)" << endl;
#endif
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myGluedF.Clear();
myPerfSelection = BRepFeat_SelectionU;
if (trc) cout << "BRepFeat_MakePipe::Perform(From,Until)" << endl;
#endif
if (From.IsNull() || Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull()) {
if (From.IsSame(mySkface)) {
PerfSelectionValid();
TopExp_Explorer exp(From, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
mySFrom = From;
TransformShapeFU(0);
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (exp.Init(myPbase,TopAbs_EDGE);exp.More();exp.Next()) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
if (trc) cout << "BRepFeat_MakePrism::Perform(Until)" << endl;
#endif
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myGluedF.Clear();
myPerfSelection = BRepFeat_SelectionU;
if (trc) cout << "BRepFeat_MakePrism::Perform(From,Until)" << endl;
#endif
if (From.IsNull() || Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull()) {
TopExp_Explorer exp(From, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
mySFrom = From;
Standard_Boolean Trff = TransformShapeFU(0);
if (trc) cout << "BRepFeat_MakePrism::PerformFromEnd(From,Until)" << endl;
#endif
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
myDir.Reverse();
TopExp_Explorer exp;
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myPerfSelection = BRepFeat_SelectionShU;
PerfSelectionValid();
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myGluedF.Clear();
myPerfSelection = BRepFeat_NoSelection;
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (exp.Init(myPbase,TopAbs_EDGE);exp.More();exp.Next()) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
Standard_Boolean TourComplet = Standard_False;
if (Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
Angle = 2*M_PI;
if (trc) cout << "BRepFeat_MakeRevol::Perform(From,Until)" << endl;
#endif
if (From.IsNull() || Until.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull()) {
if (From.IsSame(mySkface)) {
TopExp_Explorer exp(From, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
exp.Init(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
mySFrom = From;
}
TopExp_Explorer exp(Until, TopAbs_FACE);
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
Perform(Angle);
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mySlface.IsBound(F)) {
L = FS.Location();
}
else {
- Standard_NoSuchObject::Raise
- ("BRepFill_Evolved : The Face is not planar");
+ throw Standard_NoSuchObject("BRepFill_Evolved : The Face is not planar");
}
}
}
S = BRep_Tool::Surface(aFace, L);
}
- if (S.IsNull()) Standard_DomainError::Raise("BRepFill_Evolved::Axe");
+ if (S.IsNull()) throw Standard_DomainError("BRepFill_Evolved::Axe");
if (!L.IsIdentity())
S = Handle(Geom_Surface)::DownCast(S->Transformed(L.Transformation()));
else {
// There are open and closed sections :
// not processed
- Standard_DomainError::Raise("Sections must be all closed or all open");
+ throw Standard_DomainError("Sections must be all closed or all open");
}
}
//allClosed = (allClosed && myWork(i).Closed());
}
if (!allClosed)
- Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
+ throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
// sections ponctuelles, sections bouclantes ?
if (myDegen1) ideb++;
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if (SeqV.Length()>NbMaxV)
- Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
+ throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
// loop on vertices of wire1
for (ii=1;ii<=SeqV.Length();ii++) {
// sequence of vertices of the first wire
SeqOfVertices(wire1,SeqV);
if ( SeqV.Length()>NbMaxV || SeqV.Length()>SizeMap )
- Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
+ throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
// next wire
}
} //end of for(; itW.More(); itW.Next())
if (Esol.IsNull())
- Standard_ConstructionError::Raise("BRepFill :: profiles are inconsistent");
+ throw Standard_ConstructionError("BRepFill :: profiles are inconsistent");
MW.Add(Esol);
TopTools_ListOfShape ConnectedEdges;
if (nbmin>nbEdges) nbmin = nbEdges;
}
if (nbmin!=nbmax) {
- Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
+ throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
}
//Fill <myMap>
if (nbmin>nbEdges(i)) nbmin = nbEdges(i);
}
if (nbmax!=nbmin)
- Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByACR failed");
+ throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByACR failed");
}
//=======================================================================
}
*/
if (!allClosed)
- Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
+ throw Standard_NoSuchObject("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
/*
// Max number of possible cuts
gp_Pnt Pmini,P1,P2;
SeqOfVertices(wire,SeqV);
if (SeqV.Length()>NbMaxV)
- Standard_NoSuchObject::Raise("BRepFill::ComputeOrigin failed");
+ throw Standard_NoSuchObject("BRepFill::ComputeOrigin failed");
if (!polar) {
// choix du vertex le plus proche comme origine
distmini = Precision::Infinite();
allOpen = (allOpen && !myWork(i).Closed());
}
if (!allOpen)
- Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
+ throw Standard_NoSuchObject("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
// init
myLProp=SLP;
myOrder=Tang;
if ((Tang<-1)||(Tang>2))
- Standard_Failure::Raise("BRepFill : The continuity is not G0 G1 or G2");
+ throw Standard_Failure("BRepFill : The continuity is not G0 G1 or G2");
myNbPoints=NPt;
myConstG0=Standard_True;
myConstG1=Standard_True;
myConstG2=Standard_True;
if (myFrontiere.IsNull())
- Standard_Failure::Raise("BRepFill_CurveConstraint : Curve must be on a Surface");
+ throw Standard_Failure("BRepFill_CurveConstraint : Curve must be on a Surface");
Handle(Geom_Surface) Surf;
Handle(GeomAdaptor_HSurface) GS1;
GS1 = Handle(GeomAdaptor_HSurface)::DownCast(myFrontiere->ChangeCurve().GetSurface());
#ifdef OCCT_DEBUG
cout << "Error in MakeWire" << endl;
#endif
- Standard_ConstructionError::Raise("BRepFill_Draft");
+ throw Standard_ConstructionError("BRepFill_Draft");
}
}
else {
#ifdef OCCT_DEBUG
cout << "No Free Borders !" << endl;
#endif
- Standard_ConstructionError::Raise("BRepFill_Draft");
+ throw Standard_ConstructionError("BRepFill_Draft");
}
break;
}
default :
- Standard_ConstructionError::Raise("BRepFill_Draft");
+ throw Standard_ConstructionError("BRepFill_Draft");
}
// Attention to closed non declared wires !
myMap.Clear();
if (myJoinType > GeomAbs_Arc) {
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
TopTools_ListOfShape WorkProf;
L = FS.Location();
}
else
- Standard_NoSuchObject::Raise
- ("BRepFill_Evolved : The Face is not planar");
+ throw Standard_NoSuchObject("BRepFill_Evolved : The Face is not planar");
}
if (!L.IsIdentity())
C2d = BRep_Tool::CurveOnSurface(E,F,First,Last);
if (C2d.IsNull()) {
- Standard_ConstructionError::Raise("ConstructionError in PutProfilAt");
+ throw Standard_ConstructionError("ConstructionError in PutProfilAt");
}
if (E.Orientation() == TopAbs_REVERSED) {
return Exp.Current().Orientation();
}
}
- Standard_ConstructionError::Raise("BRepFill_Evolved::OriEdgeInFace");
- return E.Orientation();
+ throw Standard_ConstructionError("BRepFill_Evolved::OriEdgeInFace");
}
Standard_Real f, l;
BRep_Tool::CurveOnSurface( CurEdge, C2d, Surface, loc, f, l);
if (Surface.IsNull()) {
- Standard_Failure::Raise( "Add" );
+ throw Standard_Failure( "Add" );
return;
}
Surface = Handle(Geom_Surface)::DownCast(Surface->Copy());
TopoDS_Wire FinalWire = WireFromList(FinalEdges);
if (!(FinalWire.Closed()))
- Standard_Failure::Raise("Wire is not closed");
+ throw Standard_Failure("Wire is not closed");
myFace = BRepLib_MakeFace( Surface, FinalWire );
}
else {
curv1 = BRep_Tool::Curve(Edge1, loc, first1, last1);
if (curv1.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
curv1 =
Handle(Geom_Curve)::DownCast(curv1->Transformed(loc.Transformation()));
ff = first1;
else {
curv = BRep_Tool::Curve(Edge2, loc, first2, last2);
if (curv.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
curv =
Handle(Geom_Curve)::DownCast(curv->Transformed(loc.Transformation()));
ff = first2;
else {
C1 = BRep_Tool::Curve(Edge1, loc, a1, b1);
if (C1.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
C1 = Handle(Geom_Curve)::DownCast(C1->Transformed(loc.Transformation()));
aa = a1;
bb = b1;
else {
C2 = BRep_Tool::Curve(Edge2, loc, a1, b1);
if (C2.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
C2 = Handle(Geom_Curve)::DownCast(C2->Transformed(loc.Transformation()));
if (Edge2.Orientation() == TopAbs_REVERSED) {
C2->Reverse();
else {
C1 = BRep_Tool::Curve(Edge1,L1,f1,l1);
if (C1.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
}
if (degen2) {
Extremities(1) = BRep_Tool::Pnt(V2l);
else {
C2 = BRep_Tool::Curve(Edge2,L2,f2,l2);
if (C2.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
}
// compute the location
C = BRep_Tool::CurveOnSurface(Edge,Face, f, l);
if ( C.IsNull()) {
- Standard_ConstructionError::Raise ("BRepFill_MultiLine : Edge without PCurve");
+ throw Standard_ConstructionError("BRepFill_MultiLine : Edge without PCurve");
}
gp_Dir2d D = C->DN(f,1);
cout << "MultiLine : D1 = D2 and the Curve is not a circle" << endl;
cout << " ---> ValueOnFace failed at parameter U = " << U << endl;
#endif
- Standard_ConstructionError::Raise("BRepFill_MultiLine: ValueOnFace");
+ throw Standard_ConstructionError("BRepFill_MultiLine: ValueOnFace");
}
}
else if ( D1 < D2) {
PerformWithBiLo(myWorkSpine,Offset,myBilo,myLink,myJoinType,Alt);
}
}
- catch (Standard_Failure)//Every exception was caught.
- {
- myShape.Nullify();
- myIsDone = Standard_False;
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"An exception was caught in BRepFill_OffsetWire::Perform : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
+ myShape.Nullify();
+ myIsDone = Standard_False;
return;
}
if (!aWire.Closed()) {
myShape.Nullify();
myIsDone = Standard_False;
- Standard_ConstructionError::Raise("Offset wire is not closed.");
+ throw Standard_ConstructionError("Offset wire is not closed.");
}
}
}
TopExp::Vertices( Base, Vf, Vl );
if(Vf.IsNull() || Vl.IsNull())
{
- Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
-#ifdef OCCT_DEBUG
- BRepTools::Write(Base, "Base");
-#endif
+ throw Standard_Failure("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
}
gp_Pnt Pf, Pl;
Pf = BRep_Tool::Pnt(Vf);
if(V1.IsNull() || V2.IsNull())
{
- Standard_Failure::Raise("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
-#ifdef OCCT_DEBUG
- BRepTools::Write(Base, "Base");
- char name[128];
- sprintf(name,"Wire_%d",i);
- BRepTools::Write(aWire, name);
-#endif
+ throw Standard_Failure("BRepFill_OffsetWire::FixHoles(): Wrong wire.");
}
gp_Pnt P1, P2;
// *************************************************
iprof = FindEdge(myProfile, EProfile, count);
- if (!iprof) Standard_DomainError::Raise(
+ if (!iprof) throw Standard_DomainError(
"BRepFill_Pipe::Face : Edge not in the Profile");
for (ii=1; ii<=myLoc->NbLaw() && (!ispin); ii++)
if (ESpine.IsSame(myLoc->Edge(ii))) ispin = ii;
- if (!ispin) Standard_DomainError::Raise(
+ if (!ispin) throw Standard_DomainError(
"BRepFill_Pipe::Edge : Edge not in the Spine");
theFace = TopoDS::Face(myFaces->Value(iprof, ispin));
// Search if VProfile is a Vertex of myProfile
// *************************************************
iprof = FindVertex(myProfile, VProfile, count);
- if (!iprof) Standard_DomainError::Raise(
+ if (!iprof) throw Standard_DomainError(
"BRepFill_Pipe::Edge : Vertex not in the Profile");
for (ii=1; ii<=myLoc->NbLaw() && (!ispin); ii++)
if (ESpine.IsSame(myLoc->Edge(ii))) ispin = ii;
- if (!ispin) Standard_DomainError::Raise(
+ if (!ispin) throw Standard_DomainError(
"BRepFill_Pipe::Edge : Edge not in the Spine");
for (ii=1; ii<=myLoc->NbLaw()+1 && (!ispin); ii++)
if (VSpine.IsSame(myLoc->Vertex(ii))) ispin = ii;
- if (!ispin) Standard_DomainError::Raise(
+ if (!ispin) throw Standard_DomainError(
"BRepFill_Pipe::Section : Vertex not in the Spine");
BRep_Builder B;
case TopAbs_SOLID :
case TopAbs_COMPSOLID :
- Standard_DomainError::Raise("BRepFill_Pipe::profile contains solids");
+ throw Standard_DomainError("BRepFill_Pipe::profile contains solids");
break;
case TopAbs_COMPOUND :
case TopAbs_SOLID :
case TopAbs_COMPSOLID :
- Standard_DomainError::Raise("BRepFill_Pipe::SOLID or COMPSOLID");
+ throw Standard_DomainError("BRepFill_Pipe::SOLID or COMPSOLID");
break;
default:
break;
case TopAbs_SOLID :
case TopAbs_COMPSOLID :
- Standard_DomainError::Raise("BRepFill_Pipe::SOLID or COMPSOLID");
+ throw Standard_DomainError("BRepFill_Pipe::SOLID or COMPSOLID");
break;
default:
break;
BRepFill_CompatibleWires CW(SSh);
CW.SetPercent(0.1);
CW.Perform();
- if (!CW.IsDone()) StdFail_NotDone::Raise("Uncompatible wires");
+ if (!CW.IsDone()) throw StdFail_NotDone("Uncompatible wires");
GeomFill_SequenceOfTrsf EmptyTrsfs;
Handle(BRepFill_NSections) SL = new (BRepFill_NSections) (CW.Shape(),EmptyTrsfs,SR,0.,1.);
Standard_Real US = p1/(p1+p2);
BRepFill_CompatibleWires CW(Seq);
CW.SetPercent(0.1);
CW.Perform();
- if (!CW.IsDone()) StdFail_NotDone::Raise("Uncompatible wires");
+ if (!CW.IsDone()) throw StdFail_NotDone("Uncompatible wires");
TheGuide = TopoDS::Wire(CW.Shape().Value(2));
}
else if (GuideClose) {
Standard_Boolean BRepFill_PipeShell::MakeSolid()
{
if (myShape.IsNull())
- StdFail_NotDone::Raise("PipeShell is not built");
+ throw StdFail_NotDone("PipeShell is not built");
Standard_Boolean B = myShape.Closed();
BRep_Builder BS;
void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
TopTools_ListOfShape& theList)
{
- // Standard_NotImplemented::Raise("Generated:Pas Fait");
+ // throw Standard_NotImplemented("Generated:Pas Fait");
theList.Clear();
void BRepFill_PipeShell::Prepare()
{
TopoDS_Wire theSect;
- if (!IsReady()) StdFail_NotDone::Raise("PipeShell");
+ if (!IsReady()) throw StdFail_NotDone("PipeShell");
if (!myLocation.IsNull() && !mySection.IsNull()) return; // It is ready
//Check set of section for right configuration of punctual sections
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
- Standard_Failure::Raise("Wrong usage of punctual sections");
+ throw Standard_Failure("Wrong usage of punctual sections");
}
if (mySeq.Length() <= 2)
{
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
- Standard_Failure::Raise("Wrong usage of punctual sections");
+ throw Standard_Failure("Wrong usage of punctual sections");
}
// Construction of the law of location
}
default :
{ // Not planned!
- Standard_ConstructionError::Raise("PipeShell");
+ throw Standard_ConstructionError("PipeShell");
}
}
}
}
}
else {
- Standard_ConstructionError::Raise("PipeShell : uncompatible wires");
+ throw Standard_ConstructionError("PipeShell : uncompatible wires");
}
mySection = new (BRepFill_NSections) (WorkingSections,Transformations,Param,V1,V2);
wire.Closed( Standard_True );
}
else
- Standard_Failure::Raise("BRepFill_Section: bad shape type of section");
+ throw Standard_Failure("BRepFill_Section: bad shape type of section");
}
void BRepFill_Section::Set(const Standard_Boolean IsLaw)
// BRepExtrema_DistShapeShape Ext(mySection, myLaw->Wire());
// if (! Ext.IsDone())
-// Standard_ConstructionError::Raise("Distance Vertex/Spine");
+// throw Standard_ConstructionError("Distance Vertex/Spine");
// if (Ext.SupportTypeShape2(1) == BRepExtrema_IsOnEdge) {
// TopoDS_Shape sbis = Ext.SupportOnShape2(1);
}
}
- if (Bof) Standard_ConstructionError::Raise("Interval non trouve !!");
+ if (Bof) throw Standard_ConstructionError("Interval non trouve !!");
Ind1 = Index(Ind1);
if (Ind2) Ind2 = Index(Ind2);
char* Temp = name ;
DrawTrSurf::Set(Temp, C3d);
// DrawTrSurf::Set(name, C3d);
- Standard_ConstructionError::Raise("BRepFill_Sweep::BuildEdge");
+ throw Standard_ConstructionError("BRepFill_Sweep::BuildEdge");
#endif
}
DrawTrSurf::Set(Temp,Iso);
// DrawTrSurf::Set(name,Iso);
#endif
- Standard_ConstructionError::Raise("BRepFill_Sweep::BuildEdge");
+ throw Standard_ConstructionError("BRepFill_Sweep::BuildEdge");
}
E = MkE.Edge();
char* Temp = name ;
DrawTrSurf::Set(Temp,Iso);
// DrawTrSurf::Set(name,Iso);
- Standard_ConstructionError::Raise("BRepFill_Sweep::BuildEdge");
+ throw Standard_ConstructionError("BRepFill_Sweep::BuildEdge");
#endif
return Standard_False;
}
gp_Pnt P;
if ( !Intersector.IsDone()) {
- StdFail_NotDone::Raise("BRepFill_TrimSurfaceTool::IntersectWith");
+ throw StdFail_NotDone("BRepFill_TrimSurfaceTool::IntersectWith");
}
NbPoints = Intersector.NbPoints();
gp_Pnt P;
if ( !Intersector.IsDone()) {
- StdFail_NotDone::Raise("BRepFill_TrimSurfaceTool::IntersectWith");
+ throw StdFail_NotDone("BRepFill_TrimSurfaceTool::IntersectWith");
}
NbPoints = Intersector.NbPoints();
Intersector = Geom2dInt_GInter(ABis, AC, TolC, Tol);
if ( !Intersector.IsDone()) {
- StdFail_NotDone::Raise("BRepFill_TrimSurfaceTool::IntersectWith");
+ throw StdFail_NotDone("BRepFill_TrimSurfaceTool::IntersectWith");
}
NbPoints = Intersector.NbPoints();
Intersector = Geom2dInt_GInter(ABis, AC, TolC, Tol*10);
if ( !Intersector.IsDone()) {
- StdFail_NotDone::Raise("BRepFill_TrimSurfaceTool::IntersectWith");
+ throw StdFail_NotDone("BRepFill_TrimSurfaceTool::IntersectWith");
}
NbPoints = Intersector.NbPoints();
break;
}
default:
- Standard_NotImplemented::Raise(" BRepFill_TrimSurfaceTool");
+ throw Standard_NotImplemented(" BRepFill_TrimSurfaceTool");
}
gp_Vec2d D12d = Bis->DN(UBis,1);
IntCurveSurface_IntersectionPoint BRepIntCurveSurface_Inter::Point() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
const IntCurveSurface_IntersectionPoint& ICPS = myIntcs.Point(myCurrentindex);
return(IntCurveSurface_IntersectionPoint(ICPS.Pnt(),
myCurrentU, // ICPS.U(),
Standard_Real BRepIntCurveSurface_Inter::U() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
//-- return(myIntcs.Point(myCurrentindex).U());
return(myCurrentU);
}
Standard_Real BRepIntCurveSurface_Inter::V() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
//-- return(myIntcs.Point(myCurrentindex).V());
return(myCurrentV);
}
Standard_Real BRepIntCurveSurface_Inter::W() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return(myIntcs.Point(myCurrentindex).W());
}
TopAbs_State BRepIntCurveSurface_Inter::State() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
//-- return(classifier.State());
return(myCurrentstate);
}
IntCurveSurface_TransitionOnCurve BRepIntCurveSurface_Inter::Transition() const
{
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return(myIntcs.Point(myCurrentindex).Transition());
}
//===========================================================================
const gp_Pnt& BRepIntCurveSurface_Inter::Pnt() const {
if(myCurrentindex==0)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return(myIntcs.Point(myCurrentindex).Pnt());
}
BRepLProp_CLProps clp1(C1,u1,n1,tl);
BRepLProp_CLProps clp2(C2,u2,n2,tl);
if(!(clp1.Value().IsEqual(clp2.Value(),tl))) {
- Standard_Failure::Raise("Courbes non jointives");
+ throw Standard_Failure("Courbes non jointives");
}
Standard_Integer min = Min(n1,n2);
if ( min >= 1 ) {
BRepLib::EncodeRegularity(E, F1, F2, theTolAng);
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: Exception in BRepLib::EncodeRegularity(): ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout << endl;
#endif
+ (void)anException;
}
}
void BRepLib_Command::Check()const
{
if (!myDone)
- StdFail_NotDone::Raise("BRep_API: command not done");
+ throw StdFail_NotDone("BRep_API: command not done");
}
porig = aPrj.Point().Parameter();
}
else {
- Standard_ConstructionError::Raise("FuseEdges : Projection failed for closed curve");
+ throw Standard_ConstructionError("FuseEdges : Projection failed for closed curve");
}
}
myResultEdgesDone(Standard_False),myNbConnexEdge(0), myConcatBSpl(Standard_False)
{
// if (theShape.ShapeType() != TopAbs_SHELL && theShape.ShapeType() != TopAbs_SOLID)
-// Standard_ConstructionError::Raise("FuseEdges");
+// throw Standard_ConstructionError("FuseEdges");
Standard_NullObject_Raise_if(theShape.IsNull(),"FuseEdges");
myMapFaces.Clear();
aTC = new Geom_TrimmedCurve(aC, f, l);
if (!Concat.Add(aTC, Precision::Confusion())) {
// cannot merge curves
- Standard_ConstructionError::Raise("FuseEdges : Concatenation failed");
+ throw Standard_ConstructionError("FuseEdges : Concatenation failed");
}
}
C = Concat.BSplineCurve();
gp_Pnt aPf = C->Value(f);
gp_Pnt aPl = C->Value(l);
if(aPf.Distance(aPl) > Precision::Confusion()) {
- Standard_ConstructionError::Raise("FuseEdges : Curve must be closed");
+ throw Standard_ConstructionError("FuseEdges : Curve must be closed");
}
gp_Pnt PF = BRep_Tool::Pnt(VF);
if(PF.Distance(aPf) > Precision::Confusion()) {
//
ME.Init(C, VF, VL, f, l);
if (!ME.IsDone()) {
- Standard_ConstructionError::Raise("FuseEdges : MakeEdge failed for closed curve");
+ throw Standard_ConstructionError("FuseEdges : MakeEdge failed for closed curve");
}
}
else {
ME.Init(ExtC,VF,VL);
if (!ME.IsDone())
- Standard_ConstructionError::Raise("FuseEdges : Fusion failed");
+ throw Standard_ConstructionError("FuseEdges : Fusion failed");
}
else
- Standard_ConstructionError::Raise("FuseEdges : Fusion failed");
+ throw Standard_ConstructionError("FuseEdges : Fusion failed");
}
NewEdge = ME.Edge();
}
}
else {
- Standard_ConstructionError::Raise("BRepMAT2d_LinkTopoBilo::Perform");
+ throw Standard_ConstructionError("BRepMAT2d_LinkTopoBilo::Perform");
}
}
if (!BRepTools::Write(aMesh, theFileNameStr))
return "Error: write failed";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
return theFileNameStr;
if (!BRepTools::Write(aMesh, theFileNameStr))
return "Error: write failed";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
return theFileNameStr;
else
{
if (myIndex[1] >= 0)
- Standard_OutOfRange::Raise("BRepMesh_PairOfIndex::Append, more than two index to store");
+ throw Standard_OutOfRange("BRepMesh_PairOfIndex::Append, more than two index to store");
myIndex[1] = theIndex;
}
inline void Prepend(const Standard_Integer theIndex)
{
if (myIndex[1] >= 0)
- Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::Prepend, more than two index to store");
+ throw Standard_OutOfRange("BRepMesh_PairOfIndex::Prepend, more than two index to store");
myIndex[1] = myIndex[0];
myIndex[0] = theIndex;
inline Standard_Integer Index(const Standard_Integer thePairPos) const
{
if (thePairPos != 1 && thePairPos != 2)
- Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::Index, requested index is out of range");
+ throw Standard_OutOfRange("BRepMesh_PairOfIndex::Index, requested index is out of range");
return myIndex[thePairPos - 1];
}
const Standard_Integer theIndex)
{
if (thePairPos != 1 && thePairPos != 2)
- Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::SetIndex, requested index is out of range");
+ throw Standard_OutOfRange("BRepMesh_PairOfIndex::SetIndex, requested index is out of range");
myIndex[thePairPos - 1] = theIndex;
}
inline void RemoveIndex(const Standard_Integer thePairPos)
{
if (thePairPos != 1 && thePairPos != 2)
- Standard_OutOfRange::Raise ("BRepMesh_PairOfIndex::RemoveIndex, requested index is out of range");
+ throw Standard_OutOfRange("BRepMesh_PairOfIndex::RemoveIndex, requested index is out of range");
if ( thePairPos == 1 )
myIndex[0] = myIndex[1];
}
}
- //Standard_NoSuchObject::Raise("BRep_Tool:: no parameter on edge");
+ //throw Standard_NoSuchObject("BRep_Tool:: no parameter on edge");
return Standard_False;
}
}
#endif
- Standard_NotImplemented::Raise();
-
-#ifdef OCCT_DEBUG
- if ( ChronBuild) Clock.Show();
-#endif
+ throw Standard_NotImplemented();
}
gp_Pnt thePoint = BRep_Tool::Pnt(V);
GeomAPI_ProjectPointOnCurve Projector(thePoint, theCurve);
if (Projector.NbPoints() == 0)
- Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge no projection");
+ throw Standard_ConstructionError("BRepOffset_MakeOffset::TrimEdge no projection");
U = Projector.LowerDistanceParameter();
}
if (U < UMin) {
}
//
if (V1.IsNull() || V2.IsNull()) {
- Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge");
+ throw Standard_ConstructionError("BRepOffset_MakeOffset::TrimEdge");
}
if (!V1.IsSame(V2)) {
NE.Free( Standard_True );
GeomFill_Pipe Pipe(HCP, HEdge1, HEdge2, Abs(Offset));
Pipe.Perform(Tol, Polynomial, Conti);
if (!Pipe.IsDone())
- Standard_ConstructionError::Raise ("GeomFill_Pipe : Cannot make a surface");
+ throw Standard_ConstructionError("GeomFill_Pipe : Cannot make a surface");
Standard_Real ErrorPipe = Pipe.ErrorOnSurf();
Handle(Geom_Surface) S = Pipe.Surface();
GeomFill_Pipe Pipe(CP,myOffset);
Pipe.Perform();
if (!Pipe.IsDone())
- Standard_ConstructionError::Raise ("GeomFill_Pipe : Cannot make a surface");
+ throw Standard_ConstructionError("GeomFill_Pipe : Cannot make a surface");
BRepLib_MakeFace MF(Pipe.Surface(), Precision::Confusion());
myFace = MF.Face();
return Exp.Current().Orientation();
}
}
- Standard_ConstructionError::Raise("BRepOffset_Tool::OriEdgeInFace");
- return E.Orientation();
+ throw Standard_ConstructionError("BRepOffset_Tool::OriEdgeInFace");
}
B.UpdateEdge (E,C2d,F,BRep_Tool::Tolerance(E));
}
else {
- Standard_ConstructionError::Raise("BRepOffset_Tool::BuildPCurves");
- cout <<"Echec ProjLib"<<endl;
+ throw Standard_ConstructionError("BRepOffset_Tool::BuildPCurves");
}
}
if (myFace.IsNull()) {
myFace = BRepBuilderAPI_MakeFace(TopoDS::Wire(WorkWires.First()),Standard_True);
if (myFace.IsNull())
- StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : the wire is not planar");
+ throw StdFail_NotDone("BRepOffsetAPI_MakeOffset : the wire is not planar");
}
// Modified by Sergey KHROMOV - Thu Apr 26 16:04:43 2001 Begin
TopExp_Explorer anExp(myFace, TopAbs_WIRE);
}
FR.Perform();
if (!FR.IsDone()) {
- StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains");
+ throw StdFail_NotDone("BRepOffsetAPI_MakeOffset : Build Domains");
}
TopTools_ListOfShape Faces;
#ifdef OCCT_DEBUG
else
Done();
}
- catch(Standard_Failure) //Every exception was caught.
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"An exception was caught in BRepOffsetAPI_MakeOffset::Perform : ";
- Standard_ConstructionError::Caught()->Print(cout);
+ anException.Print(cout);
cout<<endl;
#endif
+ (void)anException;
NotDone();
myShape.Nullify();
}
//=======================================================================
Standard_Boolean BRepOffsetAPI_MakePipeShell::MakeSolid()
{
- if (!IsDone()) StdFail_NotDone::Raise("BRepOffsetAPI_MakePipeShell::MakeSolid");
+ if (!IsDone()) throw StdFail_NotDone("BRepOffsetAPI_MakePipeShell::MakeSolid");
Standard_Boolean Ok;
Ok = myPipe->MakeSolid();
if (Ok) myShape = myPipe->Shape();
TopoDS_Face& face1, TopoDS_Face& face2)
{
if (shell.IsNull())
- StdFail_NotDone::Raise("Thrusections is not build");
+ throw StdFail_NotDone("Thrusections is not build");
Standard_Boolean B = shell.Closed();
BRep_Builder BB;
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
- Standard_Failure::Raise("Wrong usage of punctual sections");
+ throw Standard_Failure("Wrong usage of punctual sections");
}
if (myWires.Length() <= 2)
{
wdeg = wdeg && (BRep_Tool::Degenerated(anEdge));
}
if (wdeg)
- Standard_Failure::Raise("Wrong usage of punctual sections");
+ throw Standard_Failure("Wrong usage of punctual sections");
}
if (myWCheck) {
Standard_Real aFirst, aLast;
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aLoc, aFirst, aLast);
if (aCurve.IsNull())
- Standard_NullObject::Raise("Null 3D curve in edge");
+ throw Standard_NullObject("Null 3D curve in edge");
// convert its part used by edge to bspline; note that if edge curve is bspline,
// conversion made via trimmed curve is still needed -- it will copy it, segment
void BRepOffsetAPI_ThruSections::SetCriteriumWeight(const Standard_Real W1, const Standard_Real W2, const Standard_Real W3)
{
- if (W1 < 0 || W2 < 0 || W3 < 0 ) Standard_DomainError::Raise();
+ if (W1 < 0 || W2 < 0 || W3 < 0 ) throw Standard_DomainError();
myCritWeights[0] = W1;
myCritWeights[1] = W2;
myCritWeights[2] = W3;
myRadius(Radius)
{
if (Height < Precision::Confusion())
- Standard_DomainError::Raise("cone with null height");
+ throw Standard_DomainError("cone with null height");
if (myHalfAngle*Height < Precision::Confusion())
- Standard_DomainError::Raise("cone with null angle");
+ throw Standard_DomainError("cone with null angle");
if ((M_PI/2 - myHalfAngle)*Height < Precision::Confusion())
- Standard_DomainError::Raise("cone with angle > PI/2");
+ throw Standard_DomainError("cone with angle > PI/2");
// cut at top
VMax(Height / Cos(myHalfAngle));
myRadius(0.)
{
if ((Angle < 0) || (Angle > M_PI/2))
- Standard_DomainError::Raise("cone with angle <0 or > PI/2");
+ throw Standard_DomainError("cone with angle <0 or > PI/2");
VMin(0.);
SetMeridian();
}
myRadius(0.)
{
if ((Angle < 0) || (Angle > M_PI/2))
- Standard_DomainError::Raise("cone with angle <0 or > PI/2");
+ throw Standard_DomainError("cone with angle <0 or > PI/2");
VMin(0.);
SetMeridian();
}
myHalfAngle(Angle)
{
if ((Angle < 0) || (Angle > M_PI/2))
- Standard_DomainError::Raise("cone with angle <0 or > PI/2");
+ throw Standard_DomainError("cone with angle <0 or > PI/2");
VMin(0.);
SetMeridian();
}
{
if (((R1 != 0) && (R1 < Precision::Confusion())) ||
((R2 != 0) && (R2 < Precision::Confusion())))
- Standard_DomainError::Raise("cone with negative or too small radius");
+ throw Standard_DomainError("cone with negative or too small radius");
if (Abs(R1-R2) < Precision::Confusion())
- Standard_DomainError::Raise("cone with two identic radii");
+ throw Standard_DomainError("cone with two identic radii");
if (H < Precision::Confusion())
- Standard_DomainError::Raise("cone with negative or null height");
+ throw Standard_DomainError("cone with negative or null height");
myRadius = R1;
myHalfAngle = ATan((R2 - R1) / H);
Standard_Real USMin,USMax,VSMin,VSMax;
S->Bounds(USMin,USMax,VSMin,VSMax);
- if (UMin >= UMax) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
- if (VMin >= VMax) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
- if (UMin < USMin) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
- if (UMax > USMax) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
- if (VMin < VSMin) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
- if (VMax > VSMax) Standard_ConstructionError::Raise("BRepPrim_FaceBuilder");
+ if (UMin >= UMax) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
+ if (VMin >= VMax) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
+ if (UMin < USMin) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
+ if (UMax > USMax) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
+ if (VMin < VSMin) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
+ if (VMax > VSMax) throw Standard_ConstructionError("BRepPrim_FaceBuilder");
// Make the vertices
B.MakeVertex(myVertex[0],S->Value(UMin,VMin),Precision::Confusion());
{
Standard_Integer i1 = BRepPrim_Wedge_NumDir1(d1);
Standard_Integer i2 = BRepPrim_Wedge_NumDir1(d2);
- if ( i1/2 == i2/2 ) Standard_DomainError::Raise();
+ if ( i1/2 == i2/2 ) throw Standard_DomainError();
return tab[i1][i2];
}
Standard_Integer i3 = BRepPrim_Wedge_NumDir1(d3);
if (( i1/2 == i2/2 ) ||
( i2/2 == i3/2 ) ||
- ( i3/2 == i1/2 )) Standard_DomainError::Raise();
+ ( i3/2 == i1/2 )) throw Standard_DomainError();
return val[i1]+val[i2]+val[i3];
}
{
Standard_Integer i;
for (i = 0; i < NBVERTICES; i++)
- if (V[i]) Standard_DomainError::Raise();
+ if (V[i]) throw Standard_DomainError();
for (i = 0; i < NBEDGES; i++)
- if (E[i]) Standard_DomainError::Raise();
+ if (E[i]) throw Standard_DomainError();
for (i = 0; i < NBWIRES; i++)
- if (W[i]) Standard_DomainError::Raise();
+ if (W[i]) throw Standard_DomainError();
for (i = 0; i < NBFACES; i++)
- if (F[i]) Standard_DomainError::Raise();
+ if (F[i]) throw Standard_DomainError();
}
//=======================================================================
if ( ( dx <= Precision::Confusion() ) ||
( dy <= Precision::Confusion() ) ||
( dz <= Precision::Confusion() ) )
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
( dy <= Precision::Confusion() ) ||
( dz <= Precision::Confusion() ) ||
( ltx < 0 ) )
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
( ZMax-ZMin <= Precision::Confusion() ) ||
( Z2Max-Z2Min < 0 ) ||
( X2Max-X2Min < 0 ) )
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt,
WiresBuilt,FacesBuilt);
}
(const BRepPrim_Direction d1,
const BRepPrim_Direction d2)
{
- if (!HasEdge(d1,d2)) Standard_DomainError::Raise();
+ if (!HasEdge(d1,d2)) throw Standard_DomainError();
Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
(const BRepPrim_Direction d1,
const BRepPrim_Direction d2)
{
- if (!HasEdge(d1,d2)) Standard_DomainError::Raise();
+ if (!HasEdge(d1,d2)) throw Standard_DomainError();
Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2);
const BRepPrim_Direction d2,
const BRepPrim_Direction d3)
{
- if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise();
+ if (!HasVertex(d1,d2,d3)) throw Standard_DomainError();
Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3);
const BRepPrim_Direction d2,
const BRepPrim_Direction d3)
{
- if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise();
+ if (!HasVertex(d1,d2,d3)) throw Standard_DomainError();
Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3);
{
Standard_Integer i;
for (i = 0; i < NBVERTICES; i++)
- if (V[i]) Standard_DomainError::Raise();
+ if (V[i]) throw Standard_DomainError();
for (i = 0; i < NBEDGES; i++)
- if (E[i]) Standard_DomainError::Raise();
+ if (E[i]) throw Standard_DomainError();
for (i = 0; i < NBWIRES; i++)
- if (W[i]) Standard_DomainError::Raise();
+ if (W[i]) throw Standard_DomainError();
for (i = 0; i < NBFACES; i++)
- if (F[i]) Standard_DomainError::Raise();
+ if (F[i]) throw Standard_DomainError();
}
//=======================================================================
aShape = C;
}
if ( aShape.IsNull() )
- Standard_ConstructionError::Raise(__FILE__": target shape has no faces");
+ throw Standard_ConstructionError(__FILE__": target shape has no faces");
// build section computing pcurves on the shape
// BRepAlgoAPI_Section aSectionTool (aShape, theTool, Standard_False);
Standard_NullObject_Raise_if((Wire.IsNull() || Shape.IsNull()),__FILE__": null input shape");
if (Wire.ShapeType() != TopAbs_EDGE &&
Wire.ShapeType() != TopAbs_WIRE )
- Standard_ConstructionError::Raise(__FILE__": projected shape is neither wire nor edge");
+ throw Standard_ConstructionError(__FILE__": projected shape is neither wire nor edge");
// compute the "length" of the cylindrical surface to build
Standard_Real mdis = DistanceIn(Wire, Shape);
Standard_NullObject_Raise_if((Wire.IsNull() || Shape.IsNull()),__FILE__": null input shape");
if (Wire.ShapeType() != TopAbs_EDGE &&
Wire.ShapeType() != TopAbs_WIRE )
- Standard_ConstructionError::Raise(__FILE__": projected shape is neither wire nor edge");
+ throw Standard_ConstructionError(__FILE__": projected shape is neither wire nor edge");
// if Wire is only an edge, transform it into a Wire
TopoDS_Wire aWire;
// compute the ratio of the scale transformation
Standard_Real Scale = PC.Distance(P);
if ( Abs (Scale) < Precision::Confusion() )
- Standard_ConstructionError::Raise("Projection");
+ throw Standard_ConstructionError("Projection");
Scale = 1. + mdis / Scale;
// move the base of the conical surface by scaling it with ratio Scale
myBuilder.MakeShell(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
- Standard_NoSuchObject::Raise("Unknown Shape");
+ throw Standard_NoSuchObject("Unknown Shape");
break;
}
bGenS = aGenS;
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
- Standard_NoSuchObject::Raise("Unknown Shape");
+ throw Standard_NoSuchObject("Unknown Shape");
break;
}
bGenS = aGenS;
myBuilder.MakeCompSolid(myShapes(iGenS,iDirS));
break;
case TopAbs_SOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPSOLID :
- Standard_NoSuchObject::Raise("Solids are not Processed");
+ throw Standard_NoSuchObject("Solids are not Processed");
break;
case TopAbs_COMPOUND :
myBuilder.MakeCompound(myShapes(iGenS,iDirS));
break;
default:
- Standard_NoSuchObject::Raise("Unknown Shape");
+ throw Standard_NoSuchObject("Unknown Shape");
break;
}
bDirS = aDirS;
if (!aTrimmedCurve.IsNull()) {
GL = Handle(Geom_Line)::DownCast(aTrimmedCurve->BasisCurve());
if (GL.IsNull()) {
- Standard_ConstructionError::Raise("BRepSweep_Rotation::SetGeneratingPCurve");
+ throw Standard_ConstructionError("BRepSweep_Rotation::SetGeneratingPCurve");
}
}
}
aGTrsf.SetVectorialPart(rot);
BRepBuilderAPI_GTransform aBRepGTrsf (aShapeBase, aGTrsf, Standard_False);
if (!aBRepGTrsf.IsDone())
- Standard_ConstructionError::Raise("Scaling not done");
+ throw Standard_ConstructionError("Scaling not done");
TopoDS_Shape Result = aBRepGTrsf.Shape();
DBRep::Set(a[1], Result);
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
theCommands<<"checkshape exception : ";
- theCommands << Standard_Failure::Caught()->GetMessageString();
+ theCommands << anException.GetMessageString();
theCommands<<"\n";
return 1;
}
DBRep::Set(name, E);
MW.Add(E);
if (MW.IsDone()==Standard_False) {
- Standard_Failure::Raise("mkWire is over ");
+ throw Standard_Failure("mkWire is over ");
}
}
TopoDS_Wire W;
W=MW.Wire();
- if (!(W.Closed())) Standard_Failure::Raise("Wire is not closed");
+ if (!(W.Closed())) throw Standard_Failure("Wire is not closed");
BRepBuilderAPI_MakeFace MF(Henri.Surface(),W,Standard_True);
DBRep::Set(a[1],MF.Face());
return 0;
BRepLib::BuildCurve3d(E);
MW.Add(E);
if (MW.IsDone()==Standard_False) {
- Standard_Failure::Raise("mkWire is over ");
+ throw Standard_Failure("mkWire is over ");
}
}
TopoDS_Wire W;
W=MW.Wire();
- if (!(W.Closed())) Standard_Failure::Raise("Wire is not closed");
+ if (!(W.Closed())) throw Standard_Failure("Wire is not closed");
BRepBuilderAPI_MakeFace MF(support,W,Standard_True);
DBRep::Set(a[1],MF.Face());
else
return "Error: write failed";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
return "Shape dumped to cout";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
return "Location dumped to cout";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
}
}
else{
- Standard_NoSuchObject::Raise("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface");
+ throw Standard_NoSuchObject("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface");
}
L.Identity();
}
}
else {
- Standard_NoSuchObject::Raise("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Curve");
+ throw Standard_NoSuchObject("BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Curve");
}
C = new Geom_TrimmedCurve(C, f, l);
}
void BRepTools_Modifier::Perform(const Handle(BRepTools_Modification)& M, const Handle(Message_ProgressIndicator) & aProgress)
{
if (myShape.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
#ifdef DEBUG_Modifier
MapE.Clear(); MapF.Clear();
inline const TopoDS_Shape& BRepTools_Modifier::ModifiedShape
(const TopoDS_Shape& S) const
{
- if (!myMap.IsBound(S)) { Standard_NoSuchObject::Raise();}
+ if (!myMap.IsBound(S)) { throw Standard_NoSuchObject();}
return myMap(S);
}
if ( gtrsf.Form() != gp_Identity) {
NewC = GeomLib::GTransform(NewC,gtrsf);
if (NewC.IsNull()) {
- Standard_DomainError::Raise("TrsfModification:Error in NewCurve2d");
- return Standard_False;
+ throw Standard_DomainError("TrsfModification:Error in NewCurve2d");
}
newf = NewC->FirstParameter();
newl = NewC->LastParameter();
return it.Value().Orientation();
it.Next();
}
- Standard_NoSuchObject::Raise("BRepTools_WireExplorer::Orientation");
- return TopAbs_FORWARD;
+ throw Standard_NoSuchObject("BRepTools_WireExplorer::Orientation");
}
//=======================================================================
#ifdef OCCT_DEBUG
cerr<<"Copy not allowed in BRepTopAdaptor_FClass2d"<<endl;
#endif
- Standard_ConstructionError::Raise();
- return(*this);
+ throw Standard_ConstructionError();
}
//=======================================================================
void BRepTopAdaptor_TopolTool::Initialize()
{
- Standard_NotImplemented::Raise("BRepTopAdaptor_TopolTool::Initialize()");
+ throw Standard_NotImplemented("BRepTopAdaptor_TopolTool::Initialize()");
}
//=======================================================================
//function : Initialize
{
Handle(BRepAdaptor_HSurface) brhs =
Handle(BRepAdaptor_HSurface)::DownCast(S);
- if (brhs.IsNull()) {Standard_ConstructionError::Raise();}
+ if (brhs.IsNull()) {throw Standard_ConstructionError();}
TopoDS_Shape s_wnt = ((BRepAdaptor_Surface *)&(brhs->Surface()))->Face();
s_wnt.Orientation(TopAbs_FORWARD);
myFace = TopoDS::Face(s_wnt);
void BRepTopAdaptor_TopolTool::Initialize(const Handle(Adaptor2d_HCurve2d)& C)
{
myCurve = Handle(BRepAdaptor_HCurve2d)::DownCast(C);
- if (myCurve.IsNull()) {Standard_ConstructionError::Raise();}
+ if (myCurve.IsNull()) {throw Standard_ConstructionError();}
}
//=======================================================================
//function : Init
{
Handle(BRepAdaptor_HCurve2d) brhc = Handle(BRepAdaptor_HCurve2d)::DownCast(C);
if (brhc.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: arc has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: arc has no 3d representation");
const BRepAdaptor_Curve2d& brc = (const BRepAdaptor_Curve2d &)brhc->Curve2d();
const TopoDS_Edge& edge = brc.Edge();
if (edge.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: arc has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: arc has no 3d representation");
return BRep_Tool::Tolerance(edge);
}
{
Handle(BRepTopAdaptor_HVertex) brhv = Handle(BRepTopAdaptor_HVertex)::DownCast(V);
if (brhv.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
const TopoDS_Vertex& ver = brhv->Vertex();
if (ver.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
return BRep_Tool::Tolerance(ver);
}
{
Handle(BRepTopAdaptor_HVertex) brhv = Handle(BRepTopAdaptor_HVertex)::DownCast(V);
if (brhv.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
const TopoDS_Vertex& ver = brhv->Vertex();
if (ver.IsNull())
- Standard_DomainError::Raise("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
+ throw Standard_DomainError("BRepTopAdaptor_TopolTool: vertex has no 3d representation");
return BRep_Tool::Pnt(ver);
}
mm[0] = mm[1] = Degree;
if (!PrepareInsertKnots( Degree, Periodic, Knots, Mults, K, &M,
nbpoles, nbknots, Epsilon( U1), 0))
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
TColStd_Array1OfReal TempPoles(1, nbpoles*Dimension);
TColStd_Array1OfReal TempKnots(1, nbknots);
UpperBandWidth,
LowerBandWidth) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
ErrorCode =
BSplCLib::FactorBandedMatrix(InterpolationMatrix,
LowerBandWidth,
InversionProblem) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
ErrorCode =
BSplCLib::SolveBandedSystem(InterpolationMatrix,
ArrayDimension,
Poles) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
}
//=======================================================================
UpperBandWidth,
LowerBandWidth) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
ErrorCode =
BSplCLib::FactorBandedMatrix(InterpolationMatrix,
LowerBandWidth,
InversionProblem) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
ErrorCode =
BSplCLib::SolveBandedSystem(InterpolationMatrix,
Poles,
Weights) ;
if(ErrorCode)
- Standard_OutOfRange::Raise("BSplCLib::Interpolate");
+ throw Standard_OutOfRange("BSplCLib::Interpolate");
}
//=======================================================================
if (Poles.Length() != num_bspline_poles ||
NewPoles.Length() != num_new_poles) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real * array_of_poles =
(Standard_Real *) &Poles(Poles.Lower()) ;
if (Poles.Length() != num_bspline_poles ||
NewPoles.Length() != num_new_poles) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real * array_of_poles =
(Standard_Real *) &Poles(Poles.Lower()) ;
num_poles = Poles.Length() ;
if (NewPoles.Length() != num_poles) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
delta_array = (Standard_Real *) &Delta ;
delta_derivative_array = (Standard_Real *)&DeltaDerivatives ;
if (Poles.Length() != num_bspline_poles ||
NewPoles.Length() != num_new_poles) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real * array_of_poles =
(Standard_Real *) &Poles(Poles.Lower()) ;
if (Poles.Length() != num_bspline_poles ||
NewPoles.Length() != num_new_poles) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real * array_of_poles =
(Standard_Real *) &Poles(Poles.Lower()) ;
result,
error_code) ;
if (error_code) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
gp_Pnt& P = NewNumerator(ii,jj);
P.SetX(P.X() * result);
Status) ;
}
else {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
for ( ;expf.More(); expf.Next()) Sew->Add(expf.Current());
Sew->Perform();
TopoDS_Shape SewedShape = Sew->SewedShape();
- if ( SewedShape.IsNull()) Standard_Failure::Raise("Sewing aux fraises");
+ if ( SewedShape.IsNull()) throw Standard_Failure("Sewing aux fraises");
// Check if the sewing modified the orientation.
expf.Init(myShape,TopAbs_FACE);
const TopoDS_Face& BiTgte_Blend::Face(const TopoDS_Shape& CenterLine) const
{
if ( !myMapSF.IsBound(CenterLine)) {
- Standard_DomainError::Raise("BiTgte_Blend::Face");
+ throw Standard_DomainError("BiTgte_Blend::Face");
}
return myMapSF(CenterLine).Face();
GeomAbs_Shape BiTgte_CurveOnEdge::Continuity() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Integer BiTgte_CurveOnEdge::NbIntervals(const GeomAbs_Shape) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
void BiTgte_CurveOnEdge::Intervals(TColStd_Array1OfReal&,
const GeomAbs_Shape) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
const Standard_Real,
const Standard_Real) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- Handle(BiTgte_HCurveOnEdge) HC;
- return HC;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Boolean BiTgte_CurveOnEdge::IsClosed() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Boolean BiTgte_CurveOnEdge::IsPeriodic() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Real BiTgte_CurveOnEdge::Period() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0.;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
void BiTgte_CurveOnEdge::D1(const Standard_Real,gp_Pnt& ,gp_Vec& ) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
void BiTgte_CurveOnEdge::D2(const Standard_Real ,gp_Pnt&,
gp_Vec& ,gp_Vec&) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
void BiTgte_CurveOnEdge::D3(const Standard_Real ,gp_Pnt&,
gp_Vec& ,gp_Vec& ,gp_Vec& ) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
gp_Vec BiTgte_CurveOnEdge::DN(const Standard_Real,
const Standard_Integer) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return gp_Vec();
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Real BiTgte_CurveOnEdge::Resolution(const Standard_Real) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0.;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
gp_Lin BiTgte_CurveOnEdge::Line() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return gp_Lin();
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
gp_Circ BiTgte_CurveOnEdge::Circle() const
{
if ( myType != GeomAbs_Circle) {
- Standard_NoSuchObject::Raise("BiTgte_CurveOnEdge::Circle");
- return gp_Circ();
+ throw Standard_NoSuchObject("BiTgte_CurveOnEdge::Circle");
}
return myCirc;
gp_Elips BiTgte_CurveOnEdge::Ellipse() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return gp_Elips();
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
gp_Hypr BiTgte_CurveOnEdge::Hyperbola() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return gp_Hypr();
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
gp_Parab BiTgte_CurveOnEdge::Parabola() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return gp_Parab();
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Integer BiTgte_CurveOnEdge::Degree() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Boolean BiTgte_CurveOnEdge::IsRational() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Integer BiTgte_CurveOnEdge::NbPoles() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Standard_Integer BiTgte_CurveOnEdge::NbKnots() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Handle(Geom_BezierCurve) BiTgte_CurveOnEdge::Bezier() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- Handle(Geom_BezierCurve) B;
- return B;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
Handle(Geom_BSplineCurve) BiTgte_CurveOnEdge::BSpline() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnEdge");
- Handle(Geom_BSplineCurve) B;
- return B;
+ throw Standard_NotImplemented("BiTgte_CurveOnEdge");
}
GeomAbs_Shape BiTgte_CurveOnVertex::Continuity() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Integer BiTgte_CurveOnVertex::NbIntervals(const GeomAbs_Shape) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
void BiTgte_CurveOnVertex::Intervals(TColStd_Array1OfReal&,
const GeomAbs_Shape) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
const Standard_Real)
const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- Handle(BiTgte_HCurveOnVertex) HC;
- return HC;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Boolean BiTgte_CurveOnVertex::IsClosed() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Boolean BiTgte_CurveOnVertex::IsPeriodic() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Real BiTgte_CurveOnVertex::Period() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0.;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
void BiTgte_CurveOnVertex::D1(const Standard_Real ,gp_Pnt& ,gp_Vec&) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
void BiTgte_CurveOnVertex::D2(const Standard_Real,gp_Pnt&,
gp_Vec& ,gp_Vec& ) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Vec& ,
gp_Vec& ) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Vec BiTgte_CurveOnVertex::DN(const Standard_Real,
const Standard_Integer) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return gp_Vec();
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Real BiTgte_CurveOnVertex::Resolution(const Standard_Real) const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0.;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Lin BiTgte_CurveOnVertex::Line() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return gp_Lin();
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Circ BiTgte_CurveOnVertex::Circle() const
{
- Standard_NoSuchObject::Raise("BiTgte_CurveOnVertex::Circle");
- return gp_Circ();
+ throw Standard_NoSuchObject("BiTgte_CurveOnVertex::Circle");
}
gp_Elips BiTgte_CurveOnVertex::Ellipse() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return gp_Elips();
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Hypr BiTgte_CurveOnVertex::Hyperbola() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return gp_Hypr();
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
gp_Parab BiTgte_CurveOnVertex::Parabola() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return gp_Parab();
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Integer BiTgte_CurveOnVertex::Degree() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Boolean BiTgte_CurveOnVertex::IsRational() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return Standard_False;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Integer BiTgte_CurveOnVertex::NbPoles() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Standard_Integer BiTgte_CurveOnVertex::NbKnots() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- return 0;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Handle(Geom_BezierCurve) BiTgte_CurveOnVertex::Bezier() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- Handle(Geom_BezierCurve) B;
- return B;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
Handle(Geom_BSplineCurve) BiTgte_CurveOnVertex::BSpline() const
{
- Standard_NotImplemented::Raise("BiTgte_CurveOnVertex");
- Handle(Geom_BSplineCurve) B;
- return B;
+ throw Standard_NotImplemented("BiTgte_CurveOnVertex");
}
return model_rd;
}
- Standard_Failure::Raise ("BinDrivers : unknown GUID");
- static Handle(Standard_Transient) aNullHandle;
- return aNullHandle;
+ throw Standard_Failure("BinDrivers : unknown GUID");
}
//=======================================================================
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
aNamedShapeDriver->ReadShapeSection (theIS);
}
- catch(Standard_Failure) {
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
+ catch(Standard_Failure const& anException) {
const TCollection_ExtendedString aMethStr
("BinDrivers_DocumentRetrievalDriver: ");
WriteMessage (aMethStr + "error of Shape Section " +
- aFailure->GetMessageString());
+ anException.GetMessageString());
}
}
}
Handle(BinMNaming_NamedShapeDriver) aShapesDriver = Handle(BinMNaming_NamedShapeDriver)::DownCast(aDriver);
if (aShapesDriver.IsNull())
{
- Standard_NotImplemented::Raise("Internal Error - TNaming_NamedShape is not found!");
+ throw Standard_NotImplemented("Internal Error - TNaming_NamedShape is not found!");
}
aShapesDriver->SetWithTriangles (theWithTriangulation);
Handle(BinMNaming_NamedShapeDriver)::DownCast (aDriver);
aNamedShapeDriver->WriteShapeSection (theOS);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
TCollection_ExtendedString anErrorStr ("Error: ");
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
TCollection_ExtendedString aStr =
anErrorStr + "BinDrivers_DocumentStorageDriver, Shape Section :";
- WriteMessage (aStr + aFailure->GetMessageString());
+ WriteMessage (aStr + anException.GetMessageString());
}
}
return model_rd;
}
- Standard_Failure::Raise ("BinLDrivers : unknown GUID");
- static Handle(Standard_Transient) aNullHandle;
- return aNullHandle;
+ throw Standard_Failure("BinLDrivers : unknown GUID");
}
//=======================================================================
myMapId.Bind (aType, i);
}
else {
- Standard_NoSuchObject::Raise
- ((TCollection_AsciiString("BinMDF_ADriverTable::AssignIds : ") +
+ throw Standard_NoSuchObject((TCollection_AsciiString("BinMDF_ADriverTable::AssignIds : ") +
"the type " + aType->Name() + " has not been registered").ToCString());
}
}
case TNaming_SELECTED : return 'S';
case TNaming_REPLACE : return 'M'; // for compatibility case TNaming_REPLACE : return 'R';
default:
- Standard_DomainError::Raise("TNaming_Evolution:: Evolution Unknown");
+ throw Standard_DomainError("TNaming_Evolution:: Evolution Unknown");
}
- return 'P'; // To avoid compilation error message.
}
//=======================================================================
case 'S': return TNaming_SELECTED;
case 'R': return TNaming_MODIFY; //for compatibility //TNaming_REPLACE;
default:
- Standard_DomainError::Raise("TNaming_Evolution:: Evolution Unknown");
+ throw Standard_DomainError("TNaming_Evolution:: Evolution Unknown");
}
- return TNaming_PRIMITIVE; // To avoid compilation error message.
}
//=======================================================================
static Standard_Character OrientationToChar(const TopAbs_Orientation theOrient)
case TopAbs_INTERNAL : return 'I';
case TopAbs_EXTERNAL : return 'E';
default:
- Standard_DomainError::Raise("TopAbs_Orientation:: Orientation Unknown");
+ throw Standard_DomainError("TopAbs_Orientation:: Orientation Unknown");
}
- return 'F'; // To avoid compilation error message.
}
//=======================================================================
static TopAbs_Orientation CharToOrientation(const Standard_Character theCharOrient)
case 'I': return TopAbs_INTERNAL;
case 'E': return TopAbs_EXTERNAL;
default:
- Standard_DomainError::Raise("TopAbs_Orientation:: Orientation Unknown");
+ throw Standard_DomainError("TopAbs_Orientation:: Orientation Unknown");
}
- return TopAbs_FORWARD; // To avoid compilation error message.
}
//=======================================================================
aBuilder.Modify(anOldShape, aNewShape); // for compatibility aBuilder.Replace(anOldShape, aNewShape);
break;
default :
- Standard_DomainError::Raise("TNaming_Evolution:: Evolution Unknown");
+ throw Standard_DomainError("TNaming_Evolution:: Evolution Unknown");
}
anOldShape.Nullify();
aNewShape.Nullify();
case TNaming_WIREIN : return 'W';
case TNaming_SHELLIN : return 'H';
default:
- Standard_DomainError::Raise("TNaming_NameType:: Name Type Unknown");
+ throw Standard_DomainError("TNaming_NameType:: Name Type Unknown");
}
- return 'N'; // To avoid compilation error message.
}
//=======================================================================
case 'W' : return TNaming_WIREIN;
case 'H' : return TNaming_SHELLIN;
default:
- Standard_DomainError::Raise("TNaming_NameType:: Name Type Unknown");
+ throw Standard_DomainError("TNaming_NameType:: Name Type Unknown");
}
- return TNaming_UNKNOWN; // To avoid compilation error message.
}
//=======================================================================
Standard_IStream& BinTools::GetReal(Standard_IStream& IS, Standard_Real& aValue)
{
if(!IS.read ((char*)&aValue, sizeof(Standard_Real)))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if DO_INVERSE
aValue = InverseReal (aValue);
#endif
Standard_IStream& BinTools::GetInteger(Standard_IStream& IS, Standard_Integer& aValue)
{
if(!IS.read ((char*)&aValue, sizeof(Standard_Integer)))
- Storage_StreamTypeMismatchError::Raise();;
+ throw Storage_StreamTypeMismatchError();;
#if DO_INVERSE
aValue = InverseInt (aValue);
#endif
Standard_IStream& BinTools::GetExtChar(Standard_IStream& IS, Standard_ExtCharacter& theValue)
{
if(!IS.read ((char*)&theValue, sizeof(Standard_ExtCharacter)))
- Storage_StreamTypeMismatchError::Raise();;
+ throw Storage_StreamTypeMismatchError();;
#if DO_INVERSE
theValue = InverseExtChar (theValue);
#endif
OS << Handle(Geom2d_OffsetCurve)::DownCast(C);
}
else {
- Standard_Failure::Raise("UNKNOWN CURVE2d TYPE");
+ throw Standard_Failure("UNKNOWN CURVE2d TYPE");
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_Curve2dSet::WriteCurve2d(..)" << 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());
}
}
default:
{
C = NULL;
- Standard_Failure::Raise("UNKNOWN CURVE2d TYPE");
+ throw Standard_Failure("UNKNOWN CURVE2d TYPE");
}
break;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
C = NULL;
Standard_SStream aMsg;
aMsg <<"EXCEPTION in BinTools_Curve2dSet::ReadCurve2d(...)" << 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());
}
return IS;
}
#ifdef OCCT_DEBUG
cout <<"Curve2dSet buffer: " << buffer << endl;
#endif
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}
OS << Handle(Geom_OffsetCurve)::DownCast(C);
}
else {
- Standard_Failure::Raise("UNKNOWN CURVE TYPE");
+ 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());
}
}
default:
{
C = NULL;
- Standard_Failure::Raise("UNKNOWN CURVE TYPE");
+ 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;
}
#ifdef OCCT_DEBUG
cout <<"CurveSet buffer: " << buffer << endl;
#endif
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_LocatioSet::Write(..)" << 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());
}
}
if (IS.fail() || (strcmp(buffer,"Locations"))) {
Standard_SStream aMsg;
aMsg << "BinTools_LocationSet::Read: Not a location table"<<endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}
} else {
Standard_SStream aMsg;
aMsg << "Unexpected location's type = " << aTypLoc << endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
if (!L.IsIdentity()) myMap.Add(L);
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_LocationSet::Read(..)" << 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());
}
}
if (IS.fail() || strcmp(buffer,"TShapes")) {
Standard_SStream aMsg;
aMsg << "BinTools_ShapeSet::Read: Not a TShape table"<<endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}
OS << (Standard_Byte) 0;//without triangulation
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteGeometry(S,OS)" << 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_SStream aMsg;
aMsg << "BinTools_SurfaceSet::ReadGeometry: UnExpected BRep_PointRepresentation = "<< val <<endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
}
{
Standard_SStream aMsg;
aMsg <<"Unexpected Curve Representation ="<< val << endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
}
{
Standard_SStream aMsg;
aMsg << "Unexpected topology type = "<< T <<endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
break;
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadGeometry(S,OS)" << 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());
}
}
BinTools::PutBool(OS, Standard_False);
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygonOnTriangulation(..)" << 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());
}
}
char buffer[255];
IS >> buffer;
if (IS.fail() || (strstr(buffer,"PolygonOnTriangulations") == NULL)) {
- Standard_Failure::Raise("BinTools_ShapeSet::ReadPolygonOnTriangulation: Not a PolygonOnTriangulation section");
+ throw Standard_Failure("BinTools_ShapeSet::ReadPolygonOnTriangulation: Not a PolygonOnTriangulation section");
}
Standard_Integer i, j, val, nbpol = 0, nbnodes =0;
Standard_Boolean hasparameters;
myNodes.Add(Poly);
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygonOnTriangulation(..)" << 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());
}
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygon3D(..)" << 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());
}
}
//=======================================================================
#ifdef OCCT_DEBUG
cout <<"Buffer: " << buffer << endl;
#endif
- Standard_Failure::Raise("BinTools_ShapeSet::ReadPolygon3D: Not a Polygon3D section");
+ throw Standard_Failure("BinTools_ShapeSet::ReadPolygon3D: Not a Polygon3D section");
}
Handle(Poly_Polygon3D) P;
IS >> nbpol;
myPolygons3D.Add(P);
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygon3D(..)" << 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());
}
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteTriangulation(..)" << 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());
}
}
IS >> buffer;
if (IS.fail() || (strstr(buffer,"Triangulations") == NULL)) {
- Standard_Failure::Raise("BinTools_ShapeSet::Triangulation: Not a Triangulation section");
+ throw Standard_Failure("BinTools_ShapeSet::Triangulation: Not a Triangulation section");
}
IS >> nbtri;
IS.get();// remove LF
myTriangulations.Add(T);
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadTriangulation(..)" << 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());
}
}
OS << Handle(Geom_OffsetSurface)::DownCast(S);
}
else {
- Standard_Failure::Raise("UNKNOWN SURFACE TYPE");
+ throw Standard_Failure("UNKNOWN SURFACE TYPE");
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_SurfaceSet::WriteSurface(..)" << 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());
}
}
default :
{
S = NULL;
- Standard_Failure::Raise("UNKNOWN SURFACE TYPE");
+ throw Standard_Failure("UNKNOWN SURFACE TYPE");
}
break;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
S = NULL;
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_SurfaceSet::ReadSurface(..)" << 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());
}
return IS;
}
#ifdef OCCT_DEBUG
cout <<"SurfaceSet buffer: " << buffer << endl;
#endif
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
return;
}
}
- Standard_Failure::Raise ("XCAFBinDrivers : unknown GUID");
- static Handle(Standard_Transient) aNullHandle;
- return aNullHandle;
+ throw Standard_Failure("XCAFBinDrivers : unknown GUID");
}
//=======================================================================
break;
default :
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
break;
}
}
}
}
else {
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
// Determination domaine d intersection de la Bissectrice.
//=============================================================================
Standard_Real Bisector_BisecAna::IntervalFirst(const Standard_Integer I) const
{
- if (I != 1) Standard_OutOfRange::Raise();
+ if (I != 1) throw Standard_OutOfRange();
return FirstParameter();
}
//=============================================================================
Standard_Real Bisector_BisecAna::IntervalLast(const Standard_Integer I) const
{
- if (I != 1) Standard_OutOfRange::Raise();
+ if (I != 1) throw Standard_OutOfRange();
return LastParameter();
}
//=============================================================================
void Bisector_BisecCC::Reverse()
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
//=============================================================================
case 2 : return V2;
case 3 : return V3;
default: {
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
}
- return V1;
}
//=============================================================================
{
if (I == 1) return curve1;
else if (I == 2) return curve2;
- else Standard_OutOfRange::Raise();
- return curve1;
+ else throw Standard_OutOfRange();
}
//=============================================================================
{
if (I == 1) curve1 = C;
else if (I == 2) curve2 = C;
- else Standard_OutOfRange::Raise();
+ else throw Standard_OutOfRange();
}
//=============================================================================
{
if (I == 1) sign1 = S;
else if (I == 2) sign2 = S;
- else Standard_OutOfRange::Raise();
+ else throw Standard_OutOfRange();
}
//=============================================================================
{
if (I == 1) isConvex1 = IsConvex;
else if (I == 2) isConvex2 = IsConvex;
- else Standard_OutOfRange::Raise();
+ else throw Standard_OutOfRange();
}
//=============================================================================
//=============================================================================
void Bisector_BisecPC::Reverse()
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
//=============================================================================
case 2 : return V2;
case 3 : return V3;
default: {
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
}
- return V1;
}
//=============================================================================
//=============================================================================
void Bisector_BisecPC::CuspFilter()
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
//=============================================================================
Standard_Real Blend_CSFunction::GetMinimalDistance() const
{
- Standard_NotImplemented::Raise("Blend_CSFunction::GetMinimalDistance");
- return RealLast();
+ throw Standard_NotImplemented("Blend_CSFunction::GetMinimalDistance");
}
inline const Handle(TheLine)& Blend_CSWalking::Line () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return line;
}
// Blend_CSFuncInv& FuncInv,
const Standard_Real Pmin)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
if (iscomplete) {return Standard_True;}
/*
inline void Blend_Point::ParametersOnS1 (Standard_Real& U1,
Standard_Real& V1) const
{
- if (!hass1) {Standard_DomainError::Raise();}
+ if (!hass1) {throw Standard_DomainError();}
U1 = u1;
V1 = v1;
}
inline void Blend_Point::ParametersOnS2 (Standard_Real& U2,
Standard_Real& V2) const
{
- if (!hass2) {Standard_DomainError::Raise();}
+ if (!hass2) {throw Standard_DomainError();}
U2 = u2;
V2 = v2;
}
inline const gp_Vec& Blend_Point::TangentOnS1 () const
{
- if (istgt) {Standard_DomainError::Raise();}
+ if (istgt) {throw Standard_DomainError();}
return tg1;
}
inline const gp_Vec& Blend_Point::TangentOnS2 () const
{
- if (istgt) {Standard_DomainError::Raise();}
+ if (istgt) {throw Standard_DomainError();}
return tg2;
}
inline gp_Vec2d Blend_Point::Tangent2dOnS1 () const
{
- if (istgt || !hass1) {Standard_DomainError::Raise();}
+ if (istgt || !hass1) {throw Standard_DomainError();}
return gp_Vec2d(utg12d,vtg12d);
}
inline gp_Vec2d Blend_Point::Tangent2dOnS2 () const
{
- if (istgt || !hass2) {Standard_DomainError::Raise();}
+ if (istgt || !hass2) {throw Standard_DomainError();}
return gp_Vec2d(utg22d,vtg22d);
}
inline void Blend_Point::ParametersOnS (Standard_Real& U1,
Standard_Real& V1) const
{
- if (!hass1) {Standard_DomainError::Raise();}
+ if (!hass1) {throw Standard_DomainError();}
U1 = u1;
V1 = v1;
}
inline Standard_Real Blend_Point::ParameterOnC () const
{
- if (!hasc2) {Standard_DomainError::Raise();}
+ if (!hasc2) {throw Standard_DomainError();}
return pc2;
}
inline const gp_Vec& Blend_Point::TangentOnS () const
{
- if (istgt || !hass1) {Standard_DomainError::Raise();}
+ if (istgt || !hass1) {throw Standard_DomainError();}
return tg1;
}
inline const gp_Vec& Blend_Point::TangentOnC () const
{
- if (istgt) {Standard_DomainError::Raise();}
+ if (istgt) {throw Standard_DomainError();}
return tg2;
}
inline gp_Vec2d Blend_Point::Tangent2d () const
{
- if (istgt || !hass1) {Standard_DomainError::Raise();}
+ if (istgt || !hass1) {throw Standard_DomainError();}
return gp_Vec2d(utg12d,vtg12d);
}
inline Standard_Real Blend_Point::ParameterOnC1 () const
{
- if (!hasc1) {Standard_DomainError::Raise();}
+ if (!hasc1) {throw Standard_DomainError();}
return pc1;
}
inline Standard_Real Blend_Point::ParameterOnC2 () const
{
- if (!hasc2) {Standard_DomainError::Raise();}
+ if (!hasc2) {throw Standard_DomainError();}
return pc2;
}
inline const gp_Vec& Blend_Point::TangentOnC1 () const
{
- if (istgt || !hass1) {Standard_DomainError::Raise();}
+ if (istgt || !hass1) {throw Standard_DomainError();}
return tg1;
}
inline const gp_Vec& Blend_Point::TangentOnC2 () const
{
- if (istgt) {Standard_DomainError::Raise();}
+ if (istgt) {throw Standard_DomainError();}
return tg2;
}
Standard_Real Blend_RstRstFunction::GetMinimalDistance() const
{
- Standard_NotImplemented::Raise("Blend_RstRstFunction::GetMinimalDistance");
- return RealLast();
+ throw Standard_NotImplemented("Blend_RstRstFunction::GetMinimalDistance");
}
}
Standard_Real Blend_SurfRstFunction::GetMinimalDistance() const
-{
- Standard_NotImplemented::Raise("Blend_SurfRstFunction::GetMinimalDistance");
- return RealLast();
-}
+{ throw Standard_NotImplemented("Blend_SurfRstFunction::GetMinimalDistance");}
inline const Handle(TheLine)& Blend_Walking::Line () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return line;
}
break;
default:
{
- Standard_Failure::Raise("Blend_Walking::PerformFirstSection : echec");
+ throw Standard_Failure("Blend_Walking::PerformFirstSection : echec");
}
}
if (sens < 0.0)
Blend_FuncInv& FuncInv,
const Standard_Real P)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
const Blend_Point& firstBP = line->Point(1);
const Blend_Point& lastBP = line->Point(line->NbPoints());
const Standard_Real P,
const Standard_Boolean OnS1)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
TheExtremity Ext1,Ext2;
if (sens < 0.) {
Ext1 = line->StartPointOnFirst();
Blend_FuncInv& FuncInv,
const Standard_Real Pmin)
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
if (iscomplete) {return Standard_True;}
if (sens >0.) {
void BlendFunc_CSCircular::Set(const Standard_Real, const Standard_Real)
{
- Standard_NotImplemented::Raise("BlendFunc_CSCircular::Set");
+ throw Standard_NotImplemented("BlendFunc_CSCircular::Set");
}
//=======================================================================
const gp_Vec& BlendFunc_CSCircular::TangentOnS () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSCircular::TangentOnS");
+ throw Standard_DomainError("BlendFunc_CSCircular::TangentOnS");
return tgs;
}
const gp_Vec& BlendFunc_CSCircular::TangentOnC () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSCircular::TangentOnC");
+ throw Standard_DomainError("BlendFunc_CSCircular::TangentOnC");
return tgc;
}
const gp_Vec2d& BlendFunc_CSCircular::Tangent2d () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSCircular::Tangent2d");
+ throw Standard_DomainError("BlendFunc_CSCircular::Tangent2d");
return tg2d;
}
TColgp_Array1OfVec& tabV)
{
Standard_Integer NbPoint=tabP.Length();
- if (NbPoint != tabV.Length() || NbPoint < 2) {Standard_RangeError::Raise();}
+ if (NbPoint != tabV.Length() || NbPoint < 2) {throw Standard_RangeError();}
Standard_Integer i, lowp = tabP.Lower(), lowv = tabV.Lower();
void BlendFunc_CSConstRad::Set(const Standard_Real, const Standard_Real)
{
- Standard_NotImplemented::Raise("BlendFunc_CSConstRad::Set");
+ throw Standard_NotImplemented("BlendFunc_CSConstRad::Set");
}
const gp_Vec& BlendFunc_CSConstRad::TangentOnS () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSConstRad::TangentOnS");
+ throw Standard_DomainError("BlendFunc_CSConstRad::TangentOnS");
return tgs;
}
const gp_Vec& BlendFunc_CSConstRad::TangentOnC () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSConstRad::TangentOnC");
+ throw Standard_DomainError("BlendFunc_CSConstRad::TangentOnC");
return tgc;
}
const gp_Vec2d& BlendFunc_CSConstRad::Tangent2d () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_CSConstRad::Tangent2d");
+ throw Standard_DomainError("BlendFunc_CSConstRad::Tangent2d");
return tg2d;
}
Standard_Boolean BlendFunc_CSConstRad::Section(const Blend_Point&, TColgp_Array1OfPnt&, TColgp_Array1OfVec&, TColgp_Array1OfVec&, TColgp_Array1OfPnt2d&, TColgp_Array1OfVec2d&, TColgp_Array1OfVec2d&, TColStd_Array1OfReal&, TColStd_Array1OfReal&, TColStd_Array1OfReal&)
{
- Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
- return Standard_False ;
+ throw Standard_DomainError("BlendFunc_CSConstRad::Section : Not implemented");
}
//=======================================================================
TColgp_Array1OfVec& tabV)
{
Standard_Integer NbPoint=tabP.Length();
- if (NbPoint != tabV.Length() || NbPoint < 2) {Standard_RangeError::Raise();}
+ if (NbPoint != tabV.Length() || NbPoint < 2) {throw Standard_RangeError();}
Standard_Integer i, lowp = tabP.Lower(), lowv = tabV.Lower();
const gp_Vec& BlendFunc_ChAsym::TangentOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::TangentOnS1");
+ throw Standard_DomainError("BlendFunc_ChAsym::TangentOnS1");
return tg1;
}
const gp_Vec2d& BlendFunc_ChAsym::Tangent2dOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::Tangent2dOnS1");
+ throw Standard_DomainError("BlendFunc_ChAsym::Tangent2dOnS1");
return tg12d;
}
const gp_Vec& BlendFunc_ChAsym::TangentOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::TangentOnS2");
+ throw Standard_DomainError("BlendFunc_ChAsym::TangentOnS2");
return tg2;
}
const gp_Vec2d& BlendFunc_ChAsym::Tangent2dOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::Tangent2dOnS2");
+ throw Standard_DomainError("BlendFunc_ChAsym::Tangent2dOnS2");
return tg22d;
}
Standard_Boolean BlendFunc_ChAsym::TwistOnS1() const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::TwistOnS1");
+ throw Standard_DomainError("BlendFunc_ChAsym::TwistOnS1");
return tg1.Dot(nplan) < 0.;
}
Standard_Boolean BlendFunc_ChAsym::TwistOnS2() const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ChAsym::TwistOnS2");
+ throw Standard_DomainError("BlendFunc_ChAsym::TwistOnS2");
return tg2.Dot(nplan) < 0.;
}
//=======================================================================
Standard_Real BlendFunc_ChAsym::GetSectionSize() const
{
- Standard_NotImplemented::Raise("BlendFunc_ChAsym::GetSectionSize()");
- return 0.;
+ throw Standard_NotImplemented("BlendFunc_ChAsym::GetSectionSize()");
}
//=======================================================================
//=======================================================================
Standard_Real BlendFunc_Chamfer::GetSectionSize() const
{
- Standard_NotImplemented::Raise("BlendFunc_Chamfer::GetSectionSize()");
- return 0;
+ throw Standard_NotImplemented("BlendFunc_Chamfer::GetSectionSize()");
}
//=======================================================================
const gp_Vec& BlendFunc_ConstRad::TangentOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::TangentOnS1");
+ throw Standard_DomainError("BlendFunc_ConstRad::TangentOnS1");
return tg1;
}
const gp_Vec& BlendFunc_ConstRad::TangentOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::TangentOnS2");
+ throw Standard_DomainError("BlendFunc_ConstRad::TangentOnS2");
return tg2;
}
const gp_Vec2d& BlendFunc_ConstRad::Tangent2dOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::Tangent2dOnS1");
+ throw Standard_DomainError("BlendFunc_ConstRad::Tangent2dOnS1");
return tg12d;
}
const gp_Vec2d& BlendFunc_ConstRad::Tangent2dOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::Tangent2dOnS2");
+ throw Standard_DomainError("BlendFunc_ConstRad::Tangent2dOnS2");
return tg22d;
}
Standard_Boolean BlendFunc_ConstRad::TwistOnS1() const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::TwistOnS1");
+ throw Standard_DomainError("BlendFunc_ConstRad::TwistOnS1");
return tg1.Dot(nplan) < 0.;
}
Standard_Boolean BlendFunc_ConstRad::TwistOnS2() const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_ConstRad::TwistOnS2");
+ throw Standard_DomainError("BlendFunc_ConstRad::TwistOnS2");
return tg2.Dot(nplan) < 0.;
}
const gp_Vec& BlendFunc_Corde::TangentOnS () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Corde::TangentOnS");
+ throw Standard_DomainError("BlendFunc_Corde::TangentOnS");
return tgs;
}
const gp_Vec2d& BlendFunc_Corde::Tangent2dOnS () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Corde::Tangent2dOnS");
+ throw Standard_DomainError("BlendFunc_Corde::Tangent2dOnS");
return tg2d;
}
Standard_Boolean BlendFunc_EvolRad::TwistOnS1() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg1.Dot(nplan) < 0.;
}
Standard_Boolean BlendFunc_EvolRad::TwistOnS2() const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2.Dot(nplan) < 0.;
}
const gp_Vec& BlendFunc_EvolRad::TangentOnS1 () const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg1;
}
const gp_Vec& BlendFunc_EvolRad::TangentOnS2 () const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg2;
}
const gp_Vec2d& BlendFunc_EvolRad::Tangent2dOnS1 () const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg12d;
}
const gp_Vec2d& BlendFunc_EvolRad::Tangent2dOnS2 () const
{
- if (istangent) {Standard_DomainError::Raise();}
+ if (istangent) {throw Standard_DomainError();}
return tg22d;
}
void BlendFunc_Ruled::Set(const Standard_Real,
const Standard_Real)
{
- Standard_NotImplemented::Raise("BlendFunc_Ruled::Set");
+ throw Standard_NotImplemented("BlendFunc_Ruled::Set");
}
void BlendFunc_Ruled::GetTolerance(math_Vector& Tolerance,
const gp_Vec& BlendFunc_Ruled::TangentOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Ruled::TangentOnS1");
+ throw Standard_DomainError("BlendFunc_Ruled::TangentOnS1");
return tg1;
}
const gp_Vec& BlendFunc_Ruled::TangentOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Ruled::TangentOnS2");
+ throw Standard_DomainError("BlendFunc_Ruled::TangentOnS2");
return tg2;
}
const gp_Vec2d& BlendFunc_Ruled::Tangent2dOnS1 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Ruled::Tangent2dOnS1");
+ throw Standard_DomainError("BlendFunc_Ruled::Tangent2dOnS1");
return tg12d;
}
const gp_Vec2d& BlendFunc_Ruled::Tangent2dOnS2 () const
{
if (istangent)
- Standard_DomainError::Raise("BlendFunc_Ruled::Tangent2dOnS2");
+ throw Standard_DomainError("BlendFunc_Ruled::Tangent2dOnS2");
return tg22d;
}
{
Standard_Integer NbPoint=tabP.Length();
- if (NbPoint != tabV.Length() || NbPoint < 2) {Standard_RangeError::Raise();}
+ if (NbPoint != tabV.Length() || NbPoint < 2) {throw Standard_RangeError();}
Standard_Integer i, lowp = tabP.Lower(), lowv = tabV.Lower();
//=======================================================================
Standard_Real BlendFunc_Ruled::GetSectionSize() const
{
- Standard_NotImplemented::Raise("BlendFunc_Ruled::GetSectionSize()");
- return 0;
+ throw Standard_NotImplemented("BlendFunc_Ruled::GetSectionSize()");
}
//=======================================================================
{
if (IsVoid())
{
- Standard_ConstructionError::Raise ("Bnd_Box is void");
+ throw Standard_ConstructionError("Bnd_Box is void");
}
if (IsOpenXmin()) theXmin = -Bnd_Precision_Infinite;
gp_Pnt aCornerMin;
if (IsVoid())
{
- Standard_ConstructionError::Raise ("Bnd_Box is void");
- return aCornerMin;
+ throw Standard_ConstructionError("Bnd_Box is void");
}
if (IsOpenXmin()) aCornerMin.SetX (-Bnd_Precision_Infinite);
else aCornerMin.SetX (Xmin - Gap);
gp_Pnt aCornerMax;
if (IsVoid())
{
- Standard_ConstructionError::Raise ("Bnd_Box is void");
- return aCornerMax;
+ throw Standard_ConstructionError("Bnd_Box is void");
}
if (IsOpenXmax()) aCornerMax.SetX (Bnd_Precision_Infinite);
else aCornerMax.SetX (Xmax + Gap);
Standard_Real& Xm, Standard_Real& Ym) const
{
if(Flags & VoidMask)
- Standard_ConstructionError::Raise("Bnd_Box is void");
+ throw Standard_ConstructionError("Bnd_Box is void");
Standard_Real pinf = 1e+100; //-- Precision::Infinite();
if (Flags & XminMask) x = -pinf;
else x = Xmin-Gap;
myFirst(theMin), myLast(theMax)
{
if(myLast < myFirst)
- Standard_ConstructionError::Raise("Last < First");
+ throw Standard_ConstructionError("Last < First");
};
//! Replaces <this> with common-part of <this> and theOther
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
OpenMinMax(L.Direction(),B);
B.Add(ElCLib::Value(0.,L));
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
OpenMax(L.Direction(),B);
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
OpenMinMax(L.Direction(),B);
B.Add(ElCLib::Value(0.,L));
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
OpenMax(L.Direction(),B);
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
B.OpenXmax();B.OpenYmax();B.OpenZmax();
B.OpenXmin();B.OpenYmin();B.OpenZmin();
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
B.Add(ElCLib::Value(P2,P));
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
B.OpenXmax();B.OpenYmax();
B.OpenXmin();B.OpenYmin();
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
B.Add(ElCLib::Value(P2,P));
{
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
B.OpenXmax();B.OpenYmax();B.OpenZmax();
B.OpenXmin();B.OpenYmin();B.OpenZmin();
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
B.Add(ElCLib::Value(P2,H));
if (Precision::IsNegativeInfinite(P1)) {
if (Precision::IsNegativeInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(P2)) {
B.OpenXmax();B.OpenYmax();
B.OpenXmin();B.OpenYmin();
}
else if (Precision::IsPositiveInfinite(P2)) {
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else {
B.Add(ElCLib::Value(P2,H));
{
if (Precision::IsNegativeInfinite(VMax))
{
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(VMax))
{
}
else if (Precision::IsPositiveInfinite(VMax))
{
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else
{
{
if (Precision::IsNegativeInfinite(VMax))
{
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else if (Precision::IsPositiveInfinite(VMax))
{
}
else if (Precision::IsPositiveInfinite(VMax))
{
- Standard_Failure::Raise("BndLib::bad parameter");
+ throw Standard_Failure("BndLib::bad parameter");
}
else
{
case PCDM_RS_UnknownDocument:
aMsg << "could not find the referenced document: " << aMetaData->Path() << "; not found." <<(char)0 << endl;
myRetrievableStatus = PCDM_RS_UnknownDocument;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
break;
case PCDM_RS_PermissionDenied:
aMsg << "Could not find the referenced document: " << aMetaData->Path() << "; permission denied. " <<(char)0 << endl;
myRetrievableStatus = PCDM_RS_PermissionDenied;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
break;
default:
break;
{
Standard_SStream aMsg;
aMsg << "Could not determine format for the file " << aMetaData->FileName() << (char)0;
- Standard_NoSuchObject::Raise(aMsg);
+ throw Standard_NoSuchObject(aMsg.str().c_str());
}
Handle(PCDM_Reader) theReader = ReaderFromFormat (aFormat);
OCC_CATCH_SIGNALS
theReader->Read(aMetaData->FileName(),theDocument,this);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
myRetrievableStatus = theReader->GetStatus();
if(myRetrievableStatus > PCDM_RS_AlreadyRetrieved){
Standard_SStream aMsg;
- aMsg << Standard_Failure::Caught() << endl;
- Standard_Failure::Raise(aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
}
myRetrievableStatus = theReader->GetStatus();
aFormat = PCDM_ReadWriter::FileFormat (theIStream, dData);
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
myRetrievableStatus = PCDM_RS_FormatFailure;
Standard_SStream aMsg;
- aMsg << Standard_Failure::Caught() << endl;
- Standard_Failure::Raise(aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
if (aFormat.IsEmpty())
aReader->Read (theIStream, dData, aDoc, this);
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
myRetrievableStatus = aReader->GetStatus();
if (myRetrievableStatus > PCDM_RS_AlreadyRetrieved)
{
Standard_SStream aMsg;
- aMsg << Standard_Failure::Caught() << endl;
- Standard_Failure::Raise(aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
}
Standard_SStream aMsg;
aMsg << "Could not found the item:" << aResourceName <<(char)0;
myRetrievableStatus = PCDM_RS_WrongResource;
- Standard_NoSuchObject::Raise(aMsg);
+ throw Standard_NoSuchObject(aMsg.str().c_str());
}
// Get GUID as a string.
OCC_CATCH_SIGNALS
aReader = Handle(PCDM_RetrievalDriver)::DownCast(Plugin::Load(aPluginId));
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
myReaders.Add(theFormat, aReader);
myRetrievableStatus = PCDM_RS_WrongResource;
- Standard_Failure::Caught()->Reraise();
+ throw anException;
}
if (!aReader.IsNull()) {
aReader->SetFormat(theFormat);
myWriters.Add(theFormat, aDriver);
Standard_SStream aMsg;
aMsg << "Could not found the resource definition:" << aResourceName <<(char)0;
- Standard_NoSuchObject::Raise(aMsg);
+ throw Standard_NoSuchObject(aMsg.str().c_str());
}
// Get GUID as a string.
OCC_CATCH_SIGNALS
aDriver = Handle(PCDM_StorageDriver)::DownCast(Plugin::Load(aPluginId));
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
myWriters.Add(theFormat, aDriver);
myRetrievableStatus = PCDM_RS_WrongResource;
- Standard_Failure::Caught()->Reraise();
+ throw anException;
}
if (aDriver.IsNull())
{
else {
theDefaultFolder=UTL::xgetenv("TEMP");
if(theDefaultFolder.Length()==0)
- Standard_Failure::Raise("cannot determine default folder; HOMEDRIVE and TEMP are undefined");
+ throw Standard_Failure("cannot determine default folder; HOMEDRIVE and TEMP are undefined");
}
#else
TCollection_ExtendedString home=UTL::xgetenv("HOME");
#if !defined No_Exception && !defined No_CDF_MetaDataDriverError
#define CDF_MetaDataDriverError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) CDF_MetaDataDriverError::Raise(MESSAGE);
+ if (CONDITION) throw CDF_MetaDataDriverError(MESSAGE);
#else
#define CDF_MetaDataDriverError_Raise_if(CONDITION, MESSAGE)
#endif
IMPLEMENT_STANDARD_RTTIEXT(CDF_StoreList,Standard_Transient)
-static void CAUGHT(TCollection_ExtendedString& status,const TCollection_ExtendedString& what) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
+static void CAUGHT(const Standard_Failure& theException,TCollection_ExtendedString& status,const TCollection_ExtendedString& what) {
status += what;
- status += F->GetMessageString();
+ status += theException.GetMessageString();
}
CDF_StoreList::CDF_StoreList(const Handle(CDM_Document)& aDocument) {
Handle(CDF_Application) anApp = Handle(CDF_Application)::DownCast (theDocument->Application());
if (anApp.IsNull())
{
- Standard_Failure::Raise("Document has no application, cannot save!");
+ throw Standard_Failure("Document has no application, cannot save!");
}
Handle(PCDM_StorageDriver) aDocumentStorageDriver =
anApp->WriterFromFormat(theDocument->StorageFormat());
{
Standard_SStream aMsg;
aMsg <<"No storage driver does exist for this format: " << theDocument->StorageFormat() << (char)0;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
if(!theMetaDataDriver->FindFolder(theDocument->RequestedFolder())) {
Standard_SStream aMsg; aMsg << "could not find the active dbunit";
aMsg << TCollection_ExtendedString(theDocument->RequestedFolder())<< (char)0;
- Standard_NoSuchObject::Raise(aMsg);
+ throw Standard_NoSuchObject(aMsg.str().c_str());
}
TCollection_ExtendedString theName=theMetaDataDriver->BuildFileName(theDocument);
}
}
- catch (CDF_MetaDataDriverError) {
- CAUGHT(aStatusAssociatedText,TCollection_ExtendedString("metadatadriver failed; reason:"));
+ catch (CDF_MetaDataDriverError anException) {
+ CAUGHT(anException, aStatusAssociatedText, TCollection_ExtendedString("metadatadriver failed; reason:"));
status = PCDM_SS_DriverFailure;
}
- catch (Standard_Failure) {
- CAUGHT(aStatusAssociatedText,TCollection_ExtendedString("driver failed; reason:"));
+ catch (Standard_Failure const& anException) {
+ CAUGHT(anException, aStatusAssociatedText, TCollection_ExtendedString("driver failed; reason:"));
status = PCDM_SS_Failure;
}
}
if(aReferenceIdentifier == 0) return Standard_True;
Handle(CDM_Reference) theReference=Reference(aReferenceIdentifier);
if(theReference.IsNull())
- Standard_NoSuchObject::Raise("CDM_Document::IsInSession: "
+ throw Standard_NoSuchObject("CDM_Document::IsInSession: "
"invalid reference identifier");
return theReference->IsInSession();
}
if(aReferenceIdentifier == 0) return IsStored();
Handle(CDM_Reference) theReference=Reference(aReferenceIdentifier);
if(theReference.IsNull())
- Standard_NoSuchObject::Raise("CDM_Document::IsInSession: "
+ throw Standard_NoSuchObject("CDM_Document::IsInSession: "
"invalid reference identifier");
return theReference->IsStored();
}
(const Standard_Integer aReferenceIdentifier) const
{
if(!IsStored(aReferenceIdentifier))
- Standard_DomainError::Raise("CDM_Document::Name: document is not stored");
+ throw Standard_DomainError("CDM_Document::Name: document is not stored");
if(aReferenceIdentifier == 0) return myMetaData->Name();
Standard_SStream aMsg;
aMsg <<"No document having this presentation: " << x << " does exist."
<< endl << (char)0;
- Standard_NoSuchObject::Raise(aMsg);
+ throw Standard_NoSuchObject(aMsg.str().c_str());
}
return getPresentations()(x);
}
Handle(CDM_MetaData) CDM_Document::MetaData() const
{
if(myMetaData.IsNull())
- Standard_NoSuchObject::Raise("cannot furnish the MetaData of an object "
+ throw Standard_NoSuchObject("cannot furnish the MetaData of an object "
"which is not stored");
return myMetaData;
}
TCollection_ExtendedString CDM_Document::Folder() const {
if(myMetaData.IsNull())
- Standard_NoSuchObject::Raise("cannot furnish the folder of an object "
+ throw Standard_NoSuchObject("cannot furnish the folder of an object "
"which is not stored");
return myMetaData->Folder();
}
{
switch (CanClose()) {
case CDM_CCS_NotOpen:
- Standard_Failure::Raise("cannot close a document that has not been opened");
+ throw Standard_Failure("cannot close a document that has not been opened");
break;
case CDM_CCS_UnstoredReferenced:
- Standard_Failure::Raise("cannot close an unstored document which is referenced");
+ throw Standard_Failure("cannot close an unstored document which is referenced");
break;
case CDM_CCS_ModifiedReferenced:
- Standard_Failure::Raise("cannot close a document which is referenced when "
+ throw Standard_Failure("cannot close a document which is referenced when "
"the document has been modified since it was stored.");
break;
case CDM_CCS_ReferenceRejection:
- Standard_Failure::Raise("cannot close this document because a document "
+ throw Standard_Failure("cannot close this document because a document "
"referencing it refuses");
break;
default:
const Handle(CDM_Application)& CDM_Document::Application() const
{
if(!IsOpened())
- Standard_Failure::Raise("this document has not yet been opened "
+ throw Standard_Failure("this document has not yet been opened "
"by any application");
return myApplication;
}
Standard_SStream aMsg;
aMsg << "this document of format "<< StorageFormat()
<< " has not yet been opened by any application. "<< endl;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
return myApplication->Resources();
}
// FG.Init(f3d,(Standard_Address)&C);
math_GaussSingleIntegration TheLength(FG, U1, U2, order(C));
if (!TheLength.IsDone()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
return Abs(TheLength.Value());
}
// FG.Init(f2d,(Standard_Address)&C);
math_GaussSingleIntegration TheLength(FG, U1, U2, order(C));
if (!TheLength.IsDone()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
return Abs(TheLength.Value());
}
// FG.Init(f3d,(Standard_Address)&C);
math_GaussSingleIntegration TheLength(FG, U1, U2, order(C), Tol);
if (!TheLength.IsDone()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
return Abs(TheLength.Value());
}
// FG.Init(f2d,(Standard_Address)&C);
math_GaussSingleIntegration TheLength(FG, U1, U2, order(C), Tol);
if (!TheLength.IsDone()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
return Abs(TheLength.Value());
}
#ifdef OCCT_DEBUG
cerr<<"Copy not allowed in CSLib_Class2d"<<endl;
#endif
- Standard_ConstructionError::Raise();
- return *this;
+ throw Standard_ConstructionError();
}
//=======================================================================
//function : Transform2d
e2 = TopoDS::Edge(itr.Value());
}
if (e1.IsNull() || e2.IsNull())
- Standard_TypeMismatch::Raise("The algorithm expects a wire consisting of two linear or circular edges.");
+ throw Standard_TypeMismatch("The algorithm expects a wire consisting of two linear or circular edges.");
// Left neighbour.
BRepAdaptor_Curve AC1(e1);
if (AC1.GetType() != GeomAbs_Line && AC1.GetType() != GeomAbs_Circle)
- Standard_TypeMismatch::Raise("A segment or an arc of circle is expected.");
+ throw Standard_TypeMismatch("A segment or an arc of circle is expected.");
TopoDS_Vertex v1, v2;
TopExp::Vertices(e1, v1, v2, Standard_True);
if (v1.IsNull() || v2.IsNull())
- Standard_Failure::Raise("An infinite edge.");
+ throw Standard_Failure("An infinite edge.");
gp_Pnt P1 = BRep_Tool::Pnt(v1);
gp_Pnt P2 = BRep_Tool::Pnt(v2);
// Right neighbour.
BRepAdaptor_Curve AC2(e2);
if (AC2.GetType() != GeomAbs_Line && AC2.GetType() != GeomAbs_Circle)
- Standard_TypeMismatch::Raise("A segment or an arc of circle is expected.");
+ throw Standard_TypeMismatch("A segment or an arc of circle is expected.");
TopExp::Vertices(e2, v1, v2, Standard_True);
if (v1.IsNull() || v2.IsNull())
- Standard_Failure::Raise("An infinite edge.");
+ throw Standard_Failure("An infinite edge.");
P1 = BRep_Tool::Pnt(v1);
P2 = BRep_Tool::Pnt(v2);
TopExp::Vertices(theEdge1, v11, v12, Standard_True);
TopExp::Vertices(theEdge2, v21, v22, Standard_True);
if (v11.IsNull() || v12.IsNull() || v21.IsNull() || v22.IsNull())
- Standard_Failure::Raise("An infinite edge.");
+ throw Standard_Failure("An infinite edge.");
gp_Pnt p11 = BRep_Tool::Pnt(v11);
gp_Pnt p12 = BRep_Tool::Pnt(v12);
pcommon = p12;
}
else
- Standard_Failure::Raise("The edges have no common point.");
+ throw Standard_Failure("The edges have no common point.");
// Reverse the edges in case of need (to construct a wire).
Standard_Boolean is1stReversed(Standard_False), is2ndReversed(Standard_False);
else
mkWire.Add(theEdge2);
if (!mkWire.IsDone())
- Standard_Failure::Raise("Can't make a wire.");
+ throw Standard_Failure("Can't make a wire.");
const TopoDS_Wire& W = mkWire.Wire();
Init(W, thePlane);
break;
}
if (theEdge1.IsNull() || theEdge2.IsNull())
- Standard_ConstructionError::Raise("The fillet algorithms expects a wire consisting of two edges.");
+ throw Standard_ConstructionError("The fillet algorithms expects a wire consisting of two edges.");
Init(theEdge1, theEdge2, thePlane);
}
#endif
if (myListStripe.IsEmpty())
- Standard_Failure::Raise("There are no suitable edges for chamfer or fillet");
+ throw Standard_Failure("There are no suitable edges for chamfer or fillet");
Reset();
myDS = new TopOpeBRepDS_HDataStructure();
OCC_CATCH_SIGNALS
PerformSetOfSurf(itel.Value());
}
- catch(Standard_Failure) {
- Handle(Standard_Failure) exc = Standard_Failure::Caught();
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- cout <<"EXCEPTION Stripe compute " << exc << endl;
+ cout <<"EXCEPTION Stripe compute " << anException << endl;
#endif
+ (void)anException;
badstripes.Append(itel.Value());
done = Standard_True;
if (itel.Value()->Spine()->ErrorStatus()==ChFiDS_Ok)
OCC_CATCH_SIGNALS
PerformFilletOnVertex(j);
}
- catch(Standard_Failure)
- {
- Handle(Standard_Failure) exc = Standard_Failure::Caught();
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- cout <<"EXCEPTION Corner compute " << exc << endl;
+ cout <<"EXCEPTION Corner compute " << anException << endl;
#endif
+ (void)anException;
badvertices.Append(myVDataMap.FindKey(j));
hasresult=Standard_False;
done = Standard_True;
OCC_CATCH_SIGNALS
ChFi3d_StripeEdgeInter (st, aCheckStripe, DStr, tol2d);
}
- catch(Standard_Failure) {
- Handle(Standard_Failure) exc = Standard_Failure::Caught();
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- cout <<"EXCEPTION Fillets compute " << exc << endl;
+ cout <<"EXCEPTION Fillets compute " << anException << endl;
#endif
+ (void)anException;
badstripes.Append(itel.Value());
hasresult=Standard_False;
done = Standard_False;
}
break;
default:
- Standard_NotImplemented::Raise("echec approximation de la pcurve ");
+ throw Standard_NotImplemented("echec approximation de la pcurve ");
}
}
}
ChFiDS_Map& MapESh)
{
if(sp.IsNull() || sp->NbEdges() == 0)
- Standard_Failure::Raise("SolidIndex : Spine incomplete");
+ throw Standard_Failure("SolidIndex : Spine incomplete");
TopoDS_Shape edref= sp->Edges(1);
TopoDS_Shape shellousolid;
if(!MapESo(edref).IsEmpty()) shellousolid = MapESo(edref).First();
Precision::PConfusion());
if (anIntersector.NbSegments() > 0 ||
anIntersector.NbPoints() > 0)
- StdFail_NotDone::Raise ("StripeEdgeInter : fillets have too big radiuses");
+ throw StdFail_NotDone("StripeEdgeInter : fillets have too big radiuses");
}
}
}
sens = -1;
if(CD->SetOfSurfData().IsNull()) return 0;
else if (Vref.IsSame(V1)) Index = CD->SetOfSurfData()->Length();
- else Standard_ConstructionError::Raise("");
+ else throw Standard_ConstructionError("");
}
return Index;
}
else Vref = TopExp::LastVertex(E1);
sens = -1;
if (Vref.IsSame(V1)) return E1;
- else Standard_ConstructionError::Raise("");
+ else throw Standard_ConstructionError("");
}
- return E;
}
//=======================================================================
//function : ConvTol2dToTol3d
{
GeomAPI_ProjectPointOnSurf tool(p3d,S);
if ( tool.NbPoints() != 1 )
- StdFail_NotDone::Raise("");
+ throw StdFail_NotDone("");
else
tool.Parameters(1,u,v);
}
{
GeomAPI_ProjectPointOnCurve tool(FirstP,gc);
if ( tool.NbPoints() != 1 )
- StdFail_NotDone::Raise("");
+ throw StdFail_NotDone("");
else
uf = tool.Parameter(1);
tool.Init(LastP,gc);
if ( tool.NbPoints() != 1 )
- StdFail_NotDone::Raise("");
+ throw StdFail_NotDone("");
else
ul = tool.Parameter(1);
}
//
Bof = BRepLib::BuildCurve3d(E);
if (!Bof) {
- Standard_ConstructionError::Raise("PerformElSpine : BuildCurve3d error");
+ throw Standard_ConstructionError("PerformElSpine : BuildCurve3d error");
}
//
Cv = BRep_Tool::Curve(E, First, Last);
if (!Bof) {
Bof = Concat.Add( TC, 200.*epsV, Standard_True );
if (!Bof) {
- Standard_ConstructionError::Raise("PerformElSpine: spine merged error");
+ throw Standard_ConstructionError("PerformElSpine: spine merged error");
}
}
Eold = E;
//It is checked if the connection is not on a regular edge.
for (It.Initialize(myEFMap(E1)), Nbf= 0 ;It.More();It.Next(), Nbf++) {
if (Nbf>1)
- Standard_ConstructionError::Raise("ChFi3d_Builder:only 2 faces");
+ throw Standard_ConstructionError("ChFi3d_Builder:only 2 faces");
F[Nbf] = TopoDS::Face(It.Value());
}
if(Nbf < 2) return Standard_False;
!BRep_Tool::Degenerated(Ec)) {
for (It.Initialize(myEFMap(Ec)), Nbf= 0 ;It.More();It.Next(), Nbf++) {
if (Nbf>1)
- Standard_ConstructionError::Raise("ChFi3d_Builder:only 2 faces");
+ throw Standard_ConstructionError("ChFi3d_Builder:only 2 faces");
F[Nbf] = TopoDS::Face(It.Value());
}
if(Nbf < 2) return Standard_False;
}
}
Spine->SetErrorStatus(ChFiDS_StartsolFailure);
- Standard_Failure::Raise("StartSol echec");
+ throw Standard_Failure("StartSol echec");
}
//=======================================================================
return; // everything is good !
}
}
- Standard_Failure::Raise("ChFi3d_BuildPlane : echec .");
+ throw Standard_Failure("ChFi3d_BuildPlane : echec .");
}
//=======================================================================
// it is necessary to find the new support face of the fillet :
// connected to FRef along the newedge.
if(newedge.IsNull()) {
- Standard_Failure::Raise
- ("StartSol : chain is not possible, new obstacle not found");
+ throw Standard_Failure("StartSol : chain is not possible, new obstacle not found");
}
if(IsG1(myEFMap,newedge,Fref,Fv)){
- Standard_Failure::Raise
- ("StartSol : chain is not possible, config non processed");
+ throw Standard_Failure("StartSol : chain is not possible, config non processed");
}
else if(Fv.IsNull()){
- Standard_Failure::Raise
- ("StartSol : chain is not possible, new obstacle not found");
+ throw Standard_Failure("StartSol : chain is not possible, new obstacle not found");
}
else{
HS->ChangeSurface().Initialize(Fv);
Handle(ChFiDS_SurfData)& Item)
{
if (Ref == Item)
- Standard_Failure::Raise("InsertAfter : twice the same surfdata.");
+ throw Standard_Failure("InsertAfter : twice the same surfdata.");
ChFiDS_SequenceOfSurfData& Seq =
Stripe->ChangeSetOfSurfData()->ChangeSequence();
Handle(ChFiDS_SurfData)& Item)
{
if (Ref == Item)
- Standard_Failure::Raise("InsertBefore : twice the same surfdata.");
+ throw Standard_Failure("InsertBefore : twice the same surfdata.");
ChFiDS_SequenceOfSurfData& Seq =
Stripe->ChangeSetOfSurfData()->ChangeSequence();
if(forward) Guide.FirstParameter(wf);
else Guide.LastParameter(wl);
}
- else Standard_Failure::Raise("PerformSetOfSurfOnElSpine : Chaining is impossible.");
+ else throw Standard_Failure("PerformSetOfSurfOnElSpine : Chaining is impossible.");
}
// Definition of the domain of patch It1, It2
}
else { // Otherwise invalidation of the stripe.
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("CallPerformSurf : Path failed!");
+ throw Standard_Failure("CallPerformSurf : Path failed!");
}
}
Standard_Boolean possibleon2 = (don2 < 2*(ddeb + dfin));
if((tw1 && !possibleon1) || (tw2 && !possibleon2)) {
Spine->SetErrorStatus(ChFiDS_TwistedSurface);
- Standard_Failure::Raise("adjustment by reprocessing the non-written points");
+ throw Standard_Failure("adjustment by reprocessing the non-written points");
}
// It is checked if there are presentable neighbors
if(tw1){
if(!yaprevon1 || !yanexton1){
Spine->SetErrorStatus(ChFiDS_TwistedSurface);
- Standard_Failure::Raise
- ("adjustment by reprocessing the non-written points: no neighbor");
+ throw Standard_Failure("adjustment by reprocessing the non-written points: no neighbor");
}
ChFiDS_FaceInterference& previntf1 = prevsd->ChangeInterferenceOnS1();
ChFiDS_FaceInterference& nextintf1 = nextsd->ChangeInterferenceOnS1();
}
if(tw2){
if(!yaprevon2 || !yanexton2){
- Standard_Failure::Raise
- ("adjustment by reprocessing the non-written points: no neighbor");
+ throw Standard_Failure("adjustment by reprocessing the non-written points: no neighbor");
}
ChFiDS_FaceInterference& previntf2 = prevsd->ChangeInterferenceOnS2();
ChFiDS_FaceInterference& nextintf2 = nextsd->ChangeInterferenceOnS2();
if (onsame) {
if (!CV1.IsOnArc() && !CV2.IsOnArc())
- Standard_Failure::Raise("Corner OnSame : no point on arc");
+ throw Standard_Failure("Corner OnSame : no point on arc");
else if (CV1.IsOnArc() && CV2.IsOnArc()) {
Standard_Boolean sur1 = 0, sur2 = 0;
for(ex.Init(CV1.Arc(),TopAbs_VERTEX); ex.More(); ex.Next()) {
}
}
- if (Fv.IsNull()) StdFail_NotDone::Raise
- ("OneCorner : face at end not found");
+ if (Fv.IsNull()) throw StdFail_NotDone("OneCorner : face at end not found");
Fv.Orientation(TopAbs_FORWARD);
Fad.Orientation(TopAbs_FORWARD);
}
}
}
- if (Arcprol.IsNull()) /*StdFail_NotDone::Raise
- ("OneCorner : edge a prolonger non trouve");*/
+ if (Arcprol.IsNull()) /*throw StdFail_NotDone("OneCorner : edge a prolonger non trouve");*/
{
PerformIntersectionAtEnd(Index);
return;
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolesp,tol2d,tolreached))
- Standard_Failure::Raise("OneCorner : echec calcul intersection");
+ throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = Cc->FirstParameter();
Ufin = Cc->LastParameter();
}
}
else { // (!inters)
- Standard_NotImplemented::Raise("OneCorner : bouchon non ecrit");
+ throw Standard_NotImplemented("OneCorner : bouchon non ecrit");
}
Standard_Integer IShape = DStr.AddShape(Fv);
TopAbs_Orientation Et = TopAbs_FORWARD;
tol2d, Precision::PConfusion());
if (anIntersector.NbSegments() > 0 ||
anIntersector.NbPoints() > 0)
- StdFail_NotDone::Raise ("OneCorner : fillets have too big radiuses");
+ throw StdFail_NotDone("OneCorner : fillets have too big radiuses");
}
}
TopOpeBRepDS_ListIteratorOfListOfInterference
tol2d, Precision::PConfusion());
if (anIntersector.NbSegments() > 0 ||
anIntersector.NbPoints() > 0)
- StdFail_NotDone::Raise ("OneCorner : fillets have too big radiuses");
+ throw StdFail_NotDone("OneCorner : fillets have too big radiuses");
}
// 31/01/02 akm ^^^
DStr.ChangeShapeInterferences(IShape).Append(Interfc);
//Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolesp,tol2d,tolreached))
- Standard_Failure::Raise("OneCorner : echec calcul intersection");
+ throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();
Ufin = zob3d->LastParameter();
ChFi3d_cherche_face1(myEFMap(E),F1,Face[nb]);
cherche_edge1(Face[nb-1],Face[nb],Edge[nb]);
nb++;
- if (nb>=nn) Standard_Failure::Raise
- ("IntersectionAtEnd : the max number of faces reached");
+ if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of faces reached");
}
if (!findonf2) Edge[nb]=CV2.Arc();
}
ChFi3d_cherche_face1(myEFMap(E),F2,Face[nb]);
cherche_edge1(Face[nb-1],Face[nb],Edge[nb]);
nb++;
- if (nb>=nn) Standard_Failure::Raise
- ("IntersectionAtEnd : the max number of faces reached");
+ if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of faces reached");
}
Edge[nb]=CV2.Arc();
}
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS1();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F1,Face[0],Edge[0],Vtx,isfirst,10*tolesp, // in
Fi,CV1,pfac1,Ufi)) // out
- Standard_Failure::Raise("IntersectionAtEnd: pb intersection Face - Fi");
+ throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi1 = Fi;
if (intersOnSameFailed) { // probable at fillet building
// look for paredge2
}
}
}
- else Standard_Failure::Raise("IntersectionAtEnd: pb intersection Face cb");
+ else throw Standard_Failure("IntersectionAtEnd: pb intersection Face cb");
}
else {
Hc2 = BRep_Tool::CurveOnSurface(E2,Face[nbface-1],Ubid,Ubid);
ChFiDS_FaceInterference& Fi = Fd->ChangeInterferenceOnS2();
if (!IntersUpdateOnSame (HGs,HBs,c3df,F2,F,Edge[nb],Vtx,isfirst,10*tolesp, // in
Fi,CV2,pfac2,Ufi)) // out
- Standard_Failure::Raise("IntersectionAtEnd: pb intersection Face - Fi");
+ throw Standard_Failure("IntersectionAtEnd: pb intersection Face - Fi");
Fi2 = Fi;
if (intersOnSameFailed) { // probable at fillet building
// look for paredge2
else if (containV(F1,V2) || containV(F2,V2))
ori=TopAbs_REVERSED;
else
- Standard_Failure::Raise("IntersectionAtEnd : pb orientation");
+ throw Standard_Failure("IntersectionAtEnd : pb orientation");
if (containV(F1,V1) && containV(F1,V2)) {
dist1=(BRep_Tool::Pnt(V1)).Distance(BRep_Tool::Pnt(Vtx));
#endif
{
if(!CV1.IsOnArc() && !CV2.IsOnArc())
- Standard_Failure::Raise("Corner intersmore : no point on arc");
+ throw Standard_Failure("Corner intersmore : no point on arc");
else if(CV1.IsOnArc() && CV2.IsOnArc()){
Standard_Boolean sur2 = 0;
for(ex.Init(CV1.Arc(),TopAbs_VERTEX); ex.More(); ex.Next()){
}
}
- if(Fv.IsNull()) StdFail_NotDone::Raise
- ("OneCorner : face at end is not found");
+ if(Fv.IsNull()) throw StdFail_NotDone("OneCorner : face at end is not found");
Fv.Orientation(TopAbs_FORWARD);
Fad.Orientation(TopAbs_FORWARD);
cherche_face(myVFMap(Vtx),Arcprol,Fad,Fv,Fv,Fopbis);
Fop.Orientation(TopAbs_FORWARD);
- if(Arcprol.IsNull()) StdFail_NotDone::Raise
- ("OneCorner : edge to be extended is not found");
+ if(Arcprol.IsNull()) throw StdFail_NotDone("OneCorner : edge to be extended is not found");
for(ex.Init(Fopbis,TopAbs_EDGE); ex.More(); ex.Next()){
if(Arcprol.IsSame(ex.Current())) {
OArcprolop = ex.Current().Orientation();
if (!ChFi3d_ComputeCurves(HGs,HBs,Pardeb,Parfin,Cc,
Ps,
Pc,tolesp,tol2d,tolreached))
- Standard_Failure::Raise("OneCorner : failed calculation intersection");
+ throw Standard_Failure("OneCorner : failed calculation intersection");
Udeb = Cc->FirstParameter();
Ufin = Cc->LastParameter();
}
else{
- Standard_NotImplemented::Raise("OneCorner : cap not written");
+ throw Standard_NotImplemented("OneCorner : cap not written");
}
Standard_Integer IShape = DStr.AddShape(Fv);
TopAbs_Orientation Et = TopAbs_FORWARD;
// Standard_Real tolreached;
if (!ChFi3d_ComputeCurves(HBop,HBs,Pardeb,Parfin,zob3d,zob2dop,
zob2dv,tolesp,tol2d,tolreached))
- Standard_Failure::Raise("OneCorner : echec calcul intersection");
+ throw Standard_Failure("OneCorner : echec calcul intersection");
Udeb = zob3d->FirstParameter();
Ufin = zob3d->LastParameter();
nbcouture++;
}
else ChFi3d_cherche_edge(V1,Evive,Fcur,Enext,VV);
- if (Enext.IsNull())Standard_Failure::Raise
- ("PerformMoreThreeCorner: pb in the parsing of edges and faces");
+ if (Enext.IsNull())throw Standard_Failure("PerformMoreThreeCorner: pb in the parsing of edges and faces");
if (Enext.IsSame(edgelibre1)|| Enext.IsSame(edgelibre2)) {
CD.SetValue(ii, cdbid);
Index.SetValue(ii, 0);
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
//=======================================================================
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
//=======================================================================
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
}
else
- Standard_DomainError::Raise("the face is not common to any of edges of the contour");
+ throw Standard_DomainError("the face is not common to any of edges of the contour");
}
}
else csp->SetDists(Dis1,Dis2);
}
else
- Standard_DomainError::Raise("the face is not common to any of edges of the contour");
+ throw Standard_DomainError("the face is not common to any of edges of the contour");
}
}
}
}
else
- Standard_DomainError::Raise("the face is not common to any edges of the contour");
+ throw Standard_DomainError("the face is not common to any edges of the contour");
}
}
chsp = Handle(ChFiDS_ChamfSpine)::DownCast(Spine);
if (chsp.IsNull())
- Standard_ConstructionError::Raise
- ("SimulSurf : this is not the spine of a chamfer");
+ throw Standard_ConstructionError("SimulSurf : this is not the spine of a chamfer");
Standard_Real radius;
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
void ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& ,
const Handle(ChFiDS_HElSpine)& ,
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
void ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& ,
const Handle(ChFiDS_HElSpine)& ,
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("SimulSurf Not Implemented");
+ throw Standard_Failure("SimulSurf Not Implemented");
}
//------------------------MODIFS---------------------------------------
//=======================================================================
chsp = Handle(ChFiDS_ChamfSpine)::DownCast(Spine);
if (chsp.IsNull())
- Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a chamfer");
+ throw Standard_ConstructionError("PerformSurf : this is not the spine of a chamfer");
Standard_Real TolGuide = HGuide->Resolution(tolesp) ;
chsp = Handle(ChFiDS_ChamfSpine)::DownCast(Spine);
if (chsp.IsNull())
- Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a chamfer");
+ throw Standard_ConstructionError("PerformSurf : this is not the spine of a chamfer");
Standard_Boolean gd1,gd2,gf1,gf2;
Handle(BRepBlend_Line) lin;
gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
- if(!done) Standard_Failure::Raise("PerformSurf : Fail of approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
else if (chsp->IsChamfer() == ChFiDS_TwoDist) {
BRepBlend_Chamfer Func(S1,S2,HGuide);
gd1,gd2,gf1,gf2,RecOnS1,RecOnS2);
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
- if(!done) Standard_Failure::Raise("PerformSurf : Fail of approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
else {
Standard_Real d1, angle;
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,Func,lin,S1,S2,Or,gd1,gd2,gf1,gf2);
- if(!done) Standard_Failure::Raise("PerformSurf : Fail of approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
else {
Standard_Real Rtemp;
Data->ChangeVertexLastOnS2() = tmp;
if(!done) return Standard_False; // ratrappage possible PMN 14/05/1998
done = CompleteData(Data,Func,lin,S1,S2,Or2,gd1,gd2,gf1,gf2, Standard_True);
- if(!done) Standard_Failure::Raise("PerformSurf : Fail of approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Fail of approximation!");
}
}
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
void ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& ,
const Handle(ChFiDS_HElSpine)& ,
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
void ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& ,
const Standard_Boolean ,
const math_Vector& )
{
- Standard_Failure::Raise("PerformSurf Not Implemented");
+ throw Standard_Failure("PerformSurf Not Implemented");
}
//=======================================================================
deb = (pivot+1)%3 ; fin = (pivot+2)%3;
CornerAllSame = Standard_True;
}
- else Standard_Failure::Raise("FD en vis a vis non trouvees");
+ else throw Standard_Failure("FD en vis a vis non trouvees");
if (!okinter)
- Standard_Failure::Raise("Echec intersection PCurves OnCommonFace");
+ throw Standard_Failure("Echec intersection PCurves OnCommonFace");
// on a le pivot, le CD deb et le CD fin (enfin on espere !?!) :
// -------------------------------------------------------------
cheminement et creations de Surf data mutantes a 3 ou 5 cotes!!!
NON TRAITE !!!!!! (pour l instant)*/
if(i[pivot][deb] != i[pivot][fin]){
- Standard_NotImplemented::Raise("coin mutant non programme");
+ throw Standard_NotImplemented("coin mutant non programme");
}
/* Autre Remarque : dans le cas ou les indices des Surf data
du deb (de la fin) sur lesquelles ont ete trouvees les intersections
PerformSetOfSurf adapte.*/
if(oksea[pivot] &&
(i[deb][pivot] != i[deb][fin] || i[fin][pivot] != i[fin][deb])){
- Standard_NotImplemented::Raise("coin sur plusieurs faces non programme");
+ throw Standard_NotImplemented("coin sur plusieurs faces non programme");
}
Handle(ChFiDS_SurfData)&
p3d[fin],p2d[fin],p3d[deb],p2d[deb],
gcpiv,pivpc1,pivpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoinpiv))
- StdFail_NotDone::Raise("echec calcul intersection coin-pivot");
+ throw StdFail_NotDone("echec calcul intersection coin-pivot");
gp_Vec norpiv = deru.Crossed(derv);
//intersection coin-deb
p3d[pivot],p2d1,p3d[fin],p2d2,
gcdeb,debpc1,debpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoindeb))
- StdFail_NotDone::Raise("echec calcul intersection coin-deb");
+ throw StdFail_NotDone("echec calcul intersection coin-deb");
Icf = DStr.AddCurve(TopOpeBRepDS_Curve(gcdeb,tolrcoindeb));
//intersection coin-fin
p3dface,p2d1,p3d[deb],p2d2,
gcfin,finpc1,finpc2,deru,derv,ptbid,
tolesp,tol2d,tolrcoinfin))
- StdFail_NotDone::Raise("echec calcul intersection coin-face");
+ throw StdFail_NotDone("echec calcul intersection coin-face");
Icl = DStr.AddCurve(TopOpeBRepDS_Curve(gcfin,tolrcoinfin));
//!c1triangle: intersection coin-face[pivot]
Standard_Integer& intl)
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("SimulSurf : this is not the spine of the fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("SimulSurf : this is not the spine of the fillet");
Handle(BRepBlend_Line) lin;
#ifdef OCCT_DEBUG
// TopAbs_Orientation Or = S1->ChangeSurface().Face().Orientation();
const math_Vector& Soldep)
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of the fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of the fillet");
Handle(BRepBlend_Line) lin;
// Flexible parameters!
PFirst,MaxStep,locfleche,TolGuide,First,Last,
Soldep,4,Inside,Appro,Forward,RecP,RecS,RecRst);
if(!done) {
- Standard_Failure::Raise("SimulSurf : Failed process!");
+ throw Standard_Failure("SimulSurf : Failed process!");
}
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1,nbp);
func,finv,finvp,finvc,
PFirst,MaxStep,locfleche,TolGuide,First,Last,
Soldep,4,Inside,Appro,Forward,RecP,RecS,RecRst);
- if(!done) Standard_Failure::Raise("SimulSurf : Fail !");
+ if(!done) throw Standard_Failure("SimulSurf : Fail !");
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1,nbp);
for(Standard_Integer i = 1; i <= nbp; i++){
const math_Vector& Soldep)
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : it is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : it is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
// Flexible parameters!
func,finv,finvp,finvc,
PFirst,MaxStep,locfleche,TolGuide,First,Last,
Soldep,4,Inside,Appro,Forward,RecP,RecS,RecRst);
- if(!done) Standard_Failure::Raise("SimulSurf : Failed Processing!");
+ if(!done) throw Standard_Failure("SimulSurf : Failed Processing!");
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1,nbp);
for(Standard_Integer i = 1; i <= nbp; i++){
func,finv,finvp,finvc,
PFirst,MaxStep,locfleche,TolGuide,First,Last,
Soldep,4,Inside,Appro,Forward,RecP,RecS,RecRst);
- if(!done) Standard_Failure::Raise("SimulSurf : Fail !");
+ if(!done) throw Standard_Failure("SimulSurf : Fail !");
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1,nbp);
for(Standard_Integer i = 1; i <= nbp; i++){
const math_Vector& Soldep)
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : it is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : it is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
// Flexible parameters!
func, finv1, finvp1, finv2, finvp2,
PFirst, MaxStep, locfleche, TolGuide, First, Last,
Soldep, 4, Inside, Appro, Forward, RecP1, RecRst1, RecP2, RecRst2);
- if(!done) Standard_Failure::Raise("SimulSurf : Failed processing!");
+ if(!done) throw Standard_Failure("SimulSurf : Failed processing!");
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1,nbp);
for(Standard_Integer i = 1; i <= nbp; i++){
PFirst, MaxStep, locfleche, TolGuide, First, Last,
Soldep, 4, Inside, Appro, Forward, RecP1, RecRst1, RecP2, RecRst2);
- if(!done) Standard_Failure::Raise("SimulSurf : Fail !");
+ if(!done) throw Standard_Failure("SimulSurf : Fail !");
Standard_Integer nbp = lin->NbPoints();
sec = new ChFiDS_SecHArray1(1, nbp);
for(Standard_Integer i = 1; i <= nbp; i++){
TopAbs_State& Pos2) const
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Standard_Real TolGuide = HGuide->Resolution(tolesp);
if(fsp->IsConstant()){
BRepBlend_ConstRad Func(S1,S2,HGuide);
#endif
Handle(ChFiDS_SurfData) Data = SeqData(1);
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Standard_Boolean gd1,gd2,gf1,gf2, maybesingular;
Handle(BRepBlend_Line) lin;
TopAbs_Orientation Or = S1->ChangeSurface().Face().Orientation();
ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData
#endif
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (Func.GetMinimalDistance()<=100*tolapp3d);
}
else {
ChFi3d_ResultChron(ch , t_completedata);// result perf CompleteData
#endif
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (Func.GetMinimalDistance()<=100*tolapp3d);
}
if (maybesingular) SplitSurf(SeqData, lin);
{
Handle(ChFiDS_SurfData) Data = SeqData(1);
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
Standard_Real PFirst = First;
Standard_Boolean maybesingular;
Soldep,Inside,Appro,Forward,RecP,RecS,RecRst);
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS2->ChangeSurface().Face().Orientation();
done = CompleteData(Data,func,lin,HS1,HS2,Or,1);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
}
else {
Soldep,Inside,Appro,Forward,RecP,RecS,RecRst);
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS2->ChangeSurface().Face().Orientation();
done = CompleteData(Data,func,lin,HS1,HS2,Or,1);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
}
if (maybesingular) SplitSurf(SeqData, lin);
{
Handle(ChFiDS_SurfData) Data = SeqData(1);;
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
Standard_Real PFirst = First;
Standard_Boolean maybesingular;
Soldep,Inside,Appro,Forward,RecP,RecS,RecRst);
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS1->ChangeSurface().Face().Orientation();
done = CompleteData(Data,func,lin,HS1,HS2,Or,0);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
}
else {
Soldep,Inside,Appro,Forward,RecP,RecS,RecRst);
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS1->ChangeSurface().Face().Orientation();
done = CompleteData(Data,func,lin,HS1,HS2,Or,0);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
}
if (maybesingular) SplitSurf(SeqData, lin);
{
Handle(ChFiDS_SurfData) Data = SeqData(1);;
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
Standard_Real PFirst = First;
Standard_Boolean maybesingular;
Soldep, Inside, Appro, Forward, RecP1, RecRst1, RecP2, RecRst2);
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS1->ChangeSurface().Face().Orientation();
done = CompleteData(Data, func, lin, HS1, HS2, Or);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
}
else {
if(!done) {
Spine->SetErrorStatus(ChFiDS_WalkingFailure);
- Standard_Failure::Raise("PerformSurf : Failed processing!");
+ throw Standard_Failure("PerformSurf : Failed processing!");
}
TopAbs_Orientation Or = HS1->ChangeSurface().Face().Orientation();
done = CompleteData(Data, func, lin, HS1, HS2, Or);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
maybesingular = (func.GetMinimalDistance()<=100*tolapp3d);
Isd1=ChFi3d_IndexOfSurfData(Vtx,st1,Sens1);
Isd2=ChFi3d_IndexOfSurfData(Vtx,st2,Sens2);
}
- // StdFail_NotDone::Raise("TwoCorner : no common face");
+ // throw StdFail_NotDone("TwoCorner : no common face");
Standard_Integer IFaArc1 = 3-IFaCo1, IFaArc2 = 3-IFaCo2;
SeqFil1 = st1->ChangeSetOfSurfData()->ChangeSequence();
SeqFil2 = st2->ChangeSetOfSurfData()->ChangeSequence();
else {
//it is necessary to make difference with
if(!OkinterCC) {
- Standard_Failure::Raise("TwoCorner : No intersection pc pc");
+ throw Standard_Failure("TwoCorner : No intersection pc pc");
}
Handle(ChFiDS_Stripe) stsam, stdif;
Handle(ChFiDS_SurfData) sdsam, sddif;
ifacodif = IFaCo1; ifaopdif = IFaArc1; isfirstdif = isfirst1;
}
else {
- Standard_Failure::Raise("TwoCorner : Config unknown");
+ throw Standard_Failure("TwoCorner : Config unknown");
}
//It is checked if surface ondiff has a point on arc from the side opposed
//to the common face and if this arc is connected to the base face
//opposed to common face of the surface onsame.
ChFiDS_CommonPoint& cpopdif = sddif->ChangeVertex(isfirstdif,ifaopdif);
if(!cpopdif.IsOnArc()) {
- Standard_Failure::Raise
- ("TwoCorner : No point on restriction on surface OnDiff");
+ throw Standard_Failure("TwoCorner : No point on restriction on surface OnDiff");
}
const TopoDS_Edge& Arcopdif = cpopdif.Arc();
const TopoDS_Face& Fopsam = TopoDS::Face(DStr.Shape(sdsam->Index(ifaopsam)));
break;
}
else if(!ex.More()) {
- Standard_Failure::Raise
- ("TwoCorner : No common face to loop the contour");
+ throw Standard_Failure("TwoCorner : No common face to loop the contour");
}
}
#ifdef OCCT_DEBUG
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch , t_remplissage);// result perf filling
#endif
- if(!done) Standard_Failure::Raise("concavites inverted : fail");
+ if(!done) throw Standard_Failure("concavites inverted : fail");
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf update DS
#endif
void ChFiDS_ChamfSpine::GetDist(Standard_Real& Dis) const
{
- if (mChamf != ChFiDS_Sym) Standard_Failure::Raise("Chamfer is not symetric");
+ if (mChamf != ChFiDS_Sym) throw Standard_Failure("Chamfer is not symetric");
Dis = d1;
}
void ChFiDS_ChamfSpine::Dists(Standard_Real& Dis1,
Standard_Real& Dis2)const
{
- if (mChamf != ChFiDS_TwoDist) Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
+ if (mChamf != ChFiDS_TwoDist) throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
Dis1 = d1;
Dis2 = d2;
}
Standard_Real& Angle,
Standard_Boolean& DisOnF1)const
{
- if (mChamf != ChFiDS_DistAngle) Standard_Failure::Raise("Chamfer is not a Two Dists Chamfer");
+ if (mChamf != ChFiDS_DistAngle) throw Standard_Failure("Chamfer is not a Two Dists Chamfer");
Dis = d1;
Angle = angle;
DisOnF1 = dison1;
const TopoDS_Edge& ChFiDS_CommonPoint::Arc()const
{
if (!isonarc){
- Standard_DomainError::Raise("CommonPoint not on Arc");
+ throw Standard_DomainError("CommonPoint not on Arc");
}
return arc;
}
TopAbs_Orientation ChFiDS_CommonPoint::TransitionOnArc()const
{
if (!isonarc){
- Standard_DomainError::Raise("CommonPoint not on Arc");
+ throw Standard_DomainError("CommonPoint not on Arc");
}
return traarc;
}
Standard_Real ChFiDS_CommonPoint::ParameterOnArc()const
{
if (!isonarc){
- Standard_DomainError::Raise("CommonPoint not on Arc");
+ throw Standard_DomainError("CommonPoint not on Arc");
}
return prmarc;
}
inline const TopoDS_Vertex& ChFiDS_CommonPoint::Vertex()const
{
- if (!isvtx) {Standard_DomainError::Raise();}
+ if (!isvtx) {throw Standard_DomainError();}
return vtx;
}
inline const gp_Vec& ChFiDS_CommonPoint::Vector()const
{
if (!hasvector) {
- Standard_DomainError::Raise("ChFiDS_CommonPoint::Vector");
+ throw Standard_DomainError("ChFiDS_CommonPoint::Vector");
}
return vector;
}
Standard_Real ChFiDS_ElSpine::Period() const
{
- if(!periodic) Standard_Failure::Raise("ElSpine non periodique");
+ if(!periodic) throw Standard_Failure("ElSpine non periodique");
return period;
}
void ChFiDS_ElSpine::SetOrigin(const Standard_Real O)
{
- if(!periodic) Standard_Failure::Raise("Elspine non periodique");
+ if(!periodic) throw Standard_Failure("Elspine non periodique");
Handle(Geom_BSplineCurve) bs = Handle(Geom_BSplineCurve)::DownCast(curve.Curve());
if(!bs.IsNull()) {
bs->SetOrigin(O,Precision::PConfusion());
par = parandrad(i).X();
rad = parandrad(i).Y();
if (Abs( rad-StartRad ) > Precision::Confusion())
- Standard_DomainError::Raise("Edge is not constant");
+ throw Standard_DomainError("Edge is not constant");
if (Abs( Ul-par ) <= gp::Resolution())
return StartRad;
if (par > Ul)
Standard_Real ChFiDS_FilSpine::Radius()const
{
- if (!IsConstant()) Standard_DomainError::Raise("Spine is not constant");
+ if (!IsConstant()) throw Standard_DomainError("Spine is not constant");
return parandrad(1).Y();
}
if(npr.IsEmpty()){
if( Rdeb < 0. && Rfin <0. )
- Standard_DomainError::Raise("Impossible to create the law");
+ throw Standard_DomainError("Impossible to create the law");
else if(Rdeb < 0. || Rfin <0.){
Standard_Real r = (Rfin<0.)? Rdeb : Rfin;
Handle(Law_Constant) loi = new Law_Constant();
}
if(k > len){ // no !
if(parandrad.IsEmpty())
- Standard_DomainError::Raise("Radius not defined");
+ throw Standard_DomainError("Radius not defined");
Standard_Integer nbp = parandrad.Length();
if(nbp > 1){
deb = parandrad.First().X();
if (IsConstant(iprec)){
Rdeb = Radius(iprec);
}
- else Standard_DomainError::Raise("AppendLaw : previous constant is missing!");
+ else throw Standard_DomainError("AppendLaw : previous constant is missing!");
lawencours = Standard_True;
}
// the raduis at end.
if (IsConstant(isuiv)) {
Rfin = Radius(isuiv);
}
- else Standard_DomainError::Raise("AppendLaw : next constant is missing!");
+ else throw Standard_DomainError("AppendLaw : next constant is missing!");
}
}
else{
if (IsConstant(ind(1) - 1)){
Rdeb = Radius(ind(1) - 1);
}
- else Standard_DomainError::Raise("AppendLaw : previous constant is missing");
+ else throw Standard_DomainError("AppendLaw : previous constant is missing");
}
else if(parandrad.IsEmpty()){
- Standard_DomainError::Raise("AppendLaw : no radius on vertex");
+ throw Standard_DomainError("AppendLaw : no radius on vertex");
}
else Rdeb = -1.;
lawencours = Standard_True;
else{
if(ind(nbed) < len){
if (IsConstant(ind(nbed) + 1)) Rfin = Radius(ind(nbed) + 1);
- else Standard_DomainError::Raise("AppendLaw : next constant is missing");
+ else throw Standard_DomainError("AppendLaw : next constant is missing");
}
else if(parandrad.IsEmpty()){
- Standard_DomainError::Raise("AppendLaw : no radius on vertex");
+ throw Standard_DomainError("AppendLaw : no radius on vertex");
}
else Rfin = -1.;
}
Handle(Law_Function)& ChFiDS_FilSpine::ChangeLaw(const TopoDS_Edge& E)
{
if(!SplitDone()) {
- Standard_DomainError::Raise("ChFiDS_FilSpine::ChangeLaw : the limits are not up-to-date");
+ throw Standard_DomainError("ChFiDS_FilSpine::ChangeLaw : the limits are not up-to-date");
}
Standard_Integer IE = Index(E);
if (IsConstant(IE)) {
- Standard_DomainError::Raise("ChFiDS_FilSpine::ChangeLaw : no law on constant edges");
+ throw Standard_DomainError("ChFiDS_FilSpine::ChangeLaw : no law on constant edges");
}
Handle(ChFiDS_HElSpine) hsp = ElSpine(IE);
Standard_Real w = 0.5*(FirstParameter(IE) + LastParameter(IE));
Standard_Real ChFiDS_Spine::Period() const
{
- if(!IsPeriodic()) Standard_Failure::Raise("Non-periodic Spine");
+ if(!IsPeriodic()) throw Standard_Failure("Non-periodic Spine");
return abscissa->Value(abscissa->Upper());
}
void ChFiDS_Spine::SetFirstTgt(const Standard_Real W)
{
- if(IsPeriodic()) Standard_Failure::Raise
- ("No extension by tangent on periodic contours");
+ if(IsPeriodic()) throw Standard_Failure("No extension by tangent on periodic contours");
#ifdef OCCT_DEBUG
if(W >= Precision::Confusion())
cout<<"Interior extension at start of the guideline"<<endl;
void ChFiDS_Spine::SetLastTgt(const Standard_Real W)
{
- if(IsPeriodic()) Standard_Failure::Raise
- ("No extension by tangent periodic contours");
+ if(IsPeriodic()) throw Standard_Failure("No extension by tangent periodic contours");
#ifdef OCCT_DEBUG
Standard_Real L = W - abscissa->Value(abscissa->Upper());
inline Standard_Integer ChFiDS_SurfData::IndexOfC1() const
{
- if(!isoncurv1) Standard_Failure::Raise("Interference pas sur courbe");
+ if(!isoncurv1) throw Standard_Failure("Interference pas sur courbe");
return indexOfC1;
}
inline Standard_Integer ChFiDS_SurfData::IndexOfC2() const
{
- if(!isoncurv2) Standard_Failure::Raise("Interference pas sur courbe");
+ if(!isoncurv2) throw Standard_Failure("Interference pas sur courbe");
return indexOfC2;
}
inline Standard_Integer ChFiDS_SurfData::IndexOfC(const Standard_Integer OnS) const
{
if(OnS == 1) {
- if(!isoncurv1) Standard_Failure::Raise("Interference pas sur courbe");
+ if(!isoncurv1) throw Standard_Failure("Interference pas sur courbe");
return indexOfC1;
}
- if(!isoncurv2) Standard_Failure::Raise("Interference pas sur courbe");
+ if(!isoncurv2) throw Standard_Failure("Interference pas sur courbe");
return indexOfC2;
}
Wref,OrFace2,Standard_False);
}
else{
- Standard_NotImplemented::Raise("particular case not written");
+ throw Standard_NotImplemented("particular case not written");
}
}
else if(!CSpine.IsNull()){
Wref,OrFace2,Standard_False);
}
else{
- Standard_NotImplemented::Raise("particular case not written");
+ throw Standard_NotImplemented("particular case not written");
}
}
else if (CSpine->IsChamfer() == ChFiDS_TwoDist) {
Wref,OrFace2,Standard_False);
}
else{
- Standard_NotImplemented::Raise("particular case not written");
+ throw Standard_NotImplemented("particular case not written");
}
}
else {
Wref,OrFace2,Standard_False, DisOnP);
}
else{
- Standard_NotImplemented::Raise("particular case not written");
+ throw Standard_NotImplemented("particular case not written");
}
}
}
GeomAbs_SurfaceType typ1 = S1->GetType();
GeomAbs_SurfaceType typ2 = S2->GetType();
if ( typ1 != GeomAbs_Plane ){
- Standard_ConstructionError::Raise
- ("la face du conge torique doit etre plane");
+ throw Standard_ConstructionError("la face du conge torique doit etre plane");
}
// The guideline is the circle corresponding
// to the section of S2, and other construction elements.
if (typ != GeomAbs_Plane ||
typ1 != GeomAbs_Plane ||
typ2 != GeomAbs_Plane){
- Standard_ConstructionError::Raise
- ("torus joint only between the planes");
+ throw Standard_ConstructionError("torus joint only between the planes");
}
return ChFiKPart_MakeRotule(DStr,Data,S->Plane(),S1->Plane(),
S2->Plane(),OS,OS1,OS2,Radius,OfS);
break;
#endif
default :
- Standard_NotImplemented::Raise("failed approximation of the pcurve ");
+ throw Standard_NotImplemented("failed approximation of the pcurve ");
}
}
else {
- Standard_NotImplemented::Raise("approximate pcurve on the left surface");
+ throw Standard_NotImplemented("approximate pcurve on the left surface");
}
}
#else
if (thePxWidth <= 0 || thePxHeight <= 0)
{
- Aspect_WindowDefinitionError::Raise ("Coordinate(s) out of range");
+ throw Aspect_WindowDefinitionError("Coordinate(s) out of range");
}
else if (NSApp == NULL)
{
- Aspect_WindowDefinitionError::Raise ("Cocoa application should be instantiated before window");
+ throw Aspect_WindowDefinitionError("Cocoa application should be instantiated before window");
return;
}
defer: NO];
if (myHWindow == NULL)
{
- Aspect_WindowDefinitionError::Raise ("Unable to create window");
+ throw Aspect_WindowDefinitionError("Unable to create window");
}
myHView = [[myHWindow contentView] retain];
gp_Lin Contap_ContAna::Line (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (typL != GeomAbs_Line || nbSol == 0) {Standard_DomainError::Raise();}
- if (Index <=0 || Index > nbSol) {Standard_OutOfRange::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (typL != GeomAbs_Line || nbSol == 0) {throw Standard_DomainError();}
+ if (Index <=0 || Index > nbSol) {throw Standard_OutOfRange();}
switch (Index) {
case 1:
return gp_Lin(pt1,dir1);
case 4:
return gp_Lin(pt4,dir4);
}
- Standard_OutOfRange::Raise("Program error in Contap_ContAna");
- return gp_Lin();
+ throw Standard_OutOfRange("Program error in Contap_ContAna");
}
inline Standard_Integer Contap_ContAna::NbContours () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return nbSol;
}
inline GeomAbs_CurveType Contap_ContAna::TypeContour () const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (nbSol == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (nbSol == 0) {throw Standard_DomainError();}
return typL;
}
inline gp_Circ Contap_ContAna::Circle () const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (typL != GeomAbs_Circle || nbSol == 0) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (typL != GeomAbs_Circle || nbSol == 0) {throw Standard_DomainError();}
return gp_Circ(gp_Ax2(pt1,dir1,dir2),prm);
}
void Contap_Contour::Perform (const Handle(Adaptor3d_HSurface)& Surf,
const Handle(Adaptor3d_TopolTool)& Domain)
{
- if (!modeset) {Standard_ConstructionError::Raise();}
+ if (!modeset) {throw Standard_ConstructionError();}
mySFunc.Set(Surf);
myAFunc.Set(Surf);
inline Standard_Integer Contap_Contour::NbLines () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin.Length();
}
inline const Contap_Line &
Contap_Contour::Line (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin(Index);
}
inline Contap_SurfFunction &
Contap_Contour::SurfaceFunction ()
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return mySFunc;
}
Standard_Real&,
Standard_Real&)
{
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Standard_Boolean Contap_HContTool::IsVertex(const Handle(Adaptor2d_HCurve2d)&,
const Standard_Integer,
Handle(Adaptor3d_HVertex)&)
{
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Standard_Integer Contap_HContTool::NbSegments(const Handle(Adaptor2d_HCurve2d)&)
const Standard_Integer,
Standard_Integer&)
{
- Standard_OutOfRange::Raise();
- return Standard_False;
+ throw Standard_OutOfRange();
}
Standard_Boolean Contap_HContTool::HasLastPoint
const Standard_Integer,
Standard_Integer&)
{
- Standard_OutOfRange::Raise();
- return Standard_False;
+ throw Standard_OutOfRange();
}
Standard_Boolean Contap_HContTool::IsAllSolution
const Handle(Adaptor2d_HCurve2d)& Contap_Line::Arc () const
{
- if (typL != Contap_Restriction) {Standard_DomainError::Raise();}
+ if (typL != Contap_Restriction) {throw Standard_DomainError();}
return thearc;
}
}
inline Standard_Integer Contap_Line::NbPnts () const {
- if (typL != Contap_Walking) {Standard_DomainError::Raise();}
+ if (typL != Contap_Walking) {throw Standard_DomainError();}
return(curv->NbPoints());
}
inline const IntSurf_PntOn2S& Contap_Line::Point (const Standard_Integer Index) const {
- if (typL != Contap_Walking) {Standard_DomainError::Raise();}
+ if (typL != Contap_Walking) {throw Standard_DomainError();}
return(curv->Value(Index));
}
inline gp_Lin Contap_Line::Line () const
{
- if (typL != Contap_Lin) {Standard_DomainError::Raise();}
+ if (typL != Contap_Lin) {throw Standard_DomainError();}
return gp_Lin(pt,dir1);
}
inline gp_Circ Contap_Line::Circle () const
{
- if (typL != Contap_Circle) {Standard_DomainError::Raise();}
+ if (typL != Contap_Circle) {throw Standard_DomainError();}
return gp_Circ(gp_Ax2(pt,dir1,dir2),rad);
}
inline const Handle(Adaptor2d_HCurve2d)& Contap_Point::Arc () const {
- if (!onarc) {Standard_DomainError::Raise();}
+ if (!onarc) {throw Standard_DomainError();}
return arc;
}
inline const IntSurf_Transition& Contap_Point::TransitionOnLine () const {
- if (!onarc) {Standard_DomainError::Raise();}
+ if (!onarc) {throw Standard_DomainError();}
return traline;
}
inline const IntSurf_Transition& Contap_Point::TransitionOnArc () const {
- if (!onarc) {Standard_DomainError::Raise();}
+ if (!onarc) {throw Standard_DomainError();}
return traarc;
}
inline Standard_Real Contap_Point::ParameterOnArc () const {
- if (!onarc) {Standard_DomainError::Raise();}
+ if (!onarc) {throw Standard_DomainError();}
return prmarc;
}
inline const Handle(Adaptor3d_HVertex)& Contap_Point::Vertex () const {
- if (!isvtx) {Standard_DomainError::Raise();}
+ if (!isvtx) {throw Standard_DomainError();}
return vtx;
}
inline const gp_Vec& Contap_SurfFunction::Direction3d()
{
- if (IsTangent()) StdFail_UndefinedDerivative::Raise();
+ if (IsTangent()) throw StdFail_UndefinedDerivative();
return d3d;
}
inline const gp_Dir2d& Contap_SurfFunction::Direction2d()
{
- if (IsTangent()) StdFail_UndefinedDerivative::Raise();
+ if (IsTangent()) throw StdFail_UndefinedDerivative();
return d2d;
}
Standard_Real Eps = Precision::PConfusion();
if ( (delta > (2*M_PI + Eps)) || (delta <= 0.0e0) ) {
- Standard_DomainError::Raise( "Convert_CircleToBSplineCurve");
+ throw Standard_DomainError( "Convert_CircleToBSplineCurve");
}
Standard_Integer ii;
MaxDegree <= 0 ||
Dimension <= 0 ||
PolynomialIntervals->RowLength() != 2) {
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:bad arguments");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:bad arguments");
}
myDegree = 0 ;
myDegree = Max(NumCoeffPerCurve->Value(ii)-1,myDegree) ;
}
if ((Continuity > myDegree)&& (NumCurves>1)) {
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:Continuity is too great");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:Continuity is too great");
}
//
// prepare output
MaxDegree <= 0 ||
Dimension <= 0 ||
PolynomialIntervals.RowLength() != 2) {
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:bad arguments");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:bad arguments");
}
myDegree = 0 ;
new TColStd_HArray1OfInteger(1, NumCurves + 1) ;
for (ii = 2 ; ii < NumCurves + 1 ; ii++) {
if ((Continuity(ii) > myDegree)&& (NumCurves>1)) {
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:Continuity is too great");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:Continuity is too great");
}
myMults -> SetValue(ii, myDegree-Continuity(ii) );
Dimension <= 0 ||
PolynomialIntervals.Length() != 2)
{
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:bad arguments");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:bad arguments");
}
TColStd_Array2OfReal ThePolynomialIntervals(1,1,1,2);
poles_array[0],
inversion_problem) ;
if (inversion_problem != 0) {
- Standard_ConstructionError::
- Raise("Convert_CompPolynomialToPoles:inversion_problem");
+ throw Standard_ConstructionError
+ ("Convert_CompPolynomialToPoles:inversion_problem");
}
myDone = Standard_True ;
}
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbPoles)
- Standard_OutOfRange::Raise(" ");
+ throw Standard_OutOfRange(" ");
return poles->Value (Index);
}
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbPoles)
- Standard_OutOfRange::Raise(" ");
+ throw Standard_OutOfRange(" ");
return weights->Value (Index);
}
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbKnots)
- Standard_OutOfRange::Raise(" ");
+ throw Standard_OutOfRange(" ");
return knots->Value (Index);
}
(const Standard_Integer Index) const
{
if (Index < 1 || Index > nbKnots)
- Standard_OutOfRange::Raise(" ");
+ throw Standard_OutOfRange(" ");
return mults->Value (Index);
}
//=======================================================================
if (num_poles != CosNumerator.Length() ||
num_poles != SinNumerator.Length() ||
num_poles != Denominator.Length() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TColStd_Array1OfReal parameters(1,num_poles) ;
TColgp_Array1OfPnt poles_array(1,num_poles) ;
case Convert_TgtThetaOver2_1:
num_spans = 1 ;
if (delta > 0.9999 * M_PI) {
- Standard_ConstructionError::Raise() ;
+ throw Standard_ConstructionError() ;
}
tgt_theta_flag = 1 ;
break ;
case Convert_TgtThetaOver2_2:
num_spans = 2 ;
if (delta > 1.9999 * M_PI) {
- Standard_ConstructionError::Raise() ;
+ throw Standard_ConstructionError() ;
}
tgt_theta_flag = 1 ;
break ;
if (Parameterisation != Convert_TgtThetaOver2 &&
Parameterisation != Convert_RationalC1) {
- Standard_ConstructionError::Raise() ;
+ throw Standard_ConstructionError() ;
}
Handle(TColStd_HArray1OfReal) temp_cos_ptr,
temp_sin_ptr,
if ((NumCoeffPerSurface->Lower()!=1 ) ||
(NumCoeffPerSurface->Upper()!= 2) )
{
- Standard_DomainError::Raise("Convert : Wrong Coefficients");
+ throw Standard_DomainError("Convert : Wrong Coefficients");
}
if ((Coefficients->Lower()!=1 ) ||
(Coefficients->Upper()!= 3*(MaxUDegree+1)*(MaxVDegree+1)))
{
- Standard_DomainError::Raise("Convert : Wrong Coefficients");
+ throw Standard_DomainError("Convert : Wrong Coefficients");
}
// Les Degres
myVDegree = NumCoeffPerSurface->Value(2)-1;
if (myUDegree > MaxUDegree)
- Standard_DomainError::Raise
- ("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
+ throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
if (myVDegree > MaxVDegree)
- Standard_DomainError::Raise
- ("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
+ throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
Handle(TColStd_HArray2OfInteger) NumCoeff =
new (TColStd_HArray2OfInteger)(1, 1, 1, 2);
(NumCoeffPerSurface->LowerCol()!=1) ||
(NumCoeffPerSurface->UpperCol()!=2) )
{
- Standard_DomainError::Raise("Convert : Wrong NumCoeffPerSurface");
+ throw Standard_DomainError("Convert : Wrong NumCoeffPerSurface");
}
if ((Coefficients->Lower()!=1 ) ||
(Coefficients->Upper()!= 3*NbUSurfaces*NbVSurfaces*
(RealUDegree + 1) * (RealVDegree + 1)) )
{
- Standard_DomainError::Raise("Convert : Wrong Coefficients");
+ throw Standard_DomainError("Convert : Wrong Coefficients");
}
// Calcul des degree
}
if (myUDegree > RealUDegree)
- Standard_DomainError::Raise
- ("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
+ throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxUDegree");
if (myVDegree > RealVDegree)
- Standard_DomainError::Raise
- ("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
+ throw Standard_DomainError("Convert : Incoherence beetween NumCoeffPerSurface and MaxVDegree");
Perform (UContinuity, VContinuity,
RealUDegree, RealVDegree,
{
if (num_poles%2 != 0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer ii;
Standard_Integer ordre_deriv = num_poles/2;
ContactOrderArray,Poles,InversionPb);
if (InversionPb !=0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (ii=1; ii<=num_poles; ii++) {
CosNumeratorPtr->SetValue(ii,Poles(ii).X());
DBRep::Set (theNameStr, *(TopoDS_Shape*)theShapePtr);
return theNameStr;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
DBRep::Set(theNameStr, aC);
return theNameStr;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
while (!fin && !IsEnd()) {
myIStream->get(c);
check++;
-// if (!(check % 2)) Storage_StreamExtCharParityError::Raise();
+// if (!(check % 2)) throw Storage_StreamExtCharParityError();
i = (Standard_ExtCharacter)c;
if (c == '\0') fin = Standard_True;
i = (i << 8);
myIStream->get(c);
check++;
-// if ((check % 2) != 0) Storage_StreamExtCharParityError::Raise();
+// if ((check % 2) != 0) throw Storage_StreamExtCharParityError();
// cout << check << endl;
j = (Standard_ExtCharacter)c;
if (c != '\n') fin = Standard_False;
buffer += (Standard_ExtCharacter)i;
}
-// if ((check % 2) != 0) Storage_StreamExtCharParityError::Raise();
+// if ((check % 2) != 0) throw Storage_StreamExtCharParityError();
// cout << check << endl;
}
Storage_BaseDriver& DDF_IOStream::PutReference(const Standard_Integer aValue)
{
*myOStream << aValue << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutReference");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutReference");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutCharacter(const Standard_Character aValue)
{
*myOStream << aValue << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutCharacter");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutCharacter");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutExtCharacter(const Standard_ExtCharacter aValue)
{
*myOStream << (short )aValue << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutExtCharacter");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutExtCharacter");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutInteger(const Standard_Integer aValue)
{
*myOStream << aValue << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutInteger");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutInteger");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutBoolean(const Standard_Boolean aValue)
{
*myOStream << ((Standard_Integer)aValue) << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutBoolean");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutBoolean");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutReal(const Standard_Real aValue)
{
*myOStream << ((Standard_Real)aValue) << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutReal");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutReal");
return *this;
}
Storage_BaseDriver& DDF_IOStream::PutShortReal(const Standard_ShortReal aValue)
{
*myOStream << aValue << " ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise("PutShortReal");
+ if (myOStream->bad()) throw Storage_StreamWriteError("PutShortReal");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetReference(Standard_Integer& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetReference");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetReference");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetCharacter(Standard_Character& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetCharacter");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetCharacter");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetExtCharacter(Standard_ExtCharacter& aValue)
{
short aChar = 0;
- if (!(*myIStream >> aChar)) Storage_StreamTypeMismatchError::Raise("GetExtCharacter");
+ if (!(*myIStream >> aChar)) throw Storage_StreamTypeMismatchError("GetExtCharacter");
aValue = aChar;
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetInteger(Standard_Integer& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetInteger");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetInteger");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetBoolean(Standard_Boolean& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetBoolean");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetBoolean");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetReal(Standard_Real& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetReal");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetReal");
return *this;
}
Storage_BaseDriver& DDF_IOStream::GetShortReal(Standard_ShortReal& aValue)
{
- if (!(*myIStream >> aValue)) Storage_StreamTypeMismatchError::Raise("GetShortReal");
+ if (!(*myIStream >> aValue)) throw Storage_StreamTypeMismatchError("GetShortReal");
return *this;
}
{
*myOStream << DDF_IOStream::MagicNumber() << '\n';
*myOStream << "BEGIN_INFO_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
WriteExtendedLine(dataType);
*myOStream << userInfo.Length() << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
for (i = 1; i <= userInfo.Length(); i++) {
*myOStream << userInfo.Value(i).ToCString() << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
}
Storage_Error DDF_IOStream::EndWriteInfoSection()
{
*myOStream << "END_INFO_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString& dataType,
TColStd_SequenceOfAsciiString& userInfo)
{
- if (!(*myIStream >> nbObj)) Storage_StreamTypeMismatchError::Raise("ReadInfo 1");
+ if (!(*myIStream >> nbObj)) throw Storage_StreamTypeMismatchError("ReadInfo 1");
FlushEndOfLine();
Standard_Integer i,len = 0;
- if (!(*myIStream >> len)) Storage_StreamTypeMismatchError::Raise("ReadInfo 2");
+ if (!(*myIStream >> len)) throw Storage_StreamTypeMismatchError("ReadInfo 2");
FlushEndOfLine();
Storage_Error DDF_IOStream::BeginWriteCommentSection()
{
*myOStream << "BEGIN_COMMENT_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
aSize = aCom.Length();
*myOStream << aSize << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
for (i = 1; i <= aSize; i++) {
WriteExtendedLine(aCom.Value(i));
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
}
Storage_Error DDF_IOStream::EndWriteCommentSection()
{
*myOStream << "END_COMMENT_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString line;
Standard_Integer len,i;
- if (!(*myIStream >> len)) Storage_StreamTypeMismatchError::Raise("ReadComment");
+ if (!(*myIStream >> len)) throw Storage_StreamTypeMismatchError("ReadComment");
FlushEndOfLine();
Storage_Error DDF_IOStream::BeginWriteTypeSection()
{
*myOStream << "BEGIN_TYPE_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void DDF_IOStream::SetTypeSectionSize(const Standard_Integer aSize)
{
*myOStream << aSize << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const TCollection_AsciiString& typeName)
{
*myOStream << typeNum << " " << typeName.ToCString() << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error DDF_IOStream::EndWriteTypeSection()
{
*myOStream << "END_TYPE_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(*myIStream >> i)) Storage_StreamTypeMismatchError::Raise("TypeSectionSize");
+ if (!(*myIStream >> i)) throw Storage_StreamTypeMismatchError("TypeSectionSize");
FlushEndOfLine();
void DDF_IOStream::ReadTypeInformations(Standard_Integer& typeNum,
TCollection_AsciiString& typeName)
{
- if (!(*myIStream >> typeNum)) Storage_StreamTypeMismatchError::Raise("ReadTypeInformations 1");
- if (!(*myIStream >> typeName)) Storage_StreamTypeMismatchError::Raise("ReadTypeInformations 2");
+ if (!(*myIStream >> typeNum)) throw Storage_StreamTypeMismatchError("ReadTypeInformations 1");
+ if (!(*myIStream >> typeName)) throw Storage_StreamTypeMismatchError("ReadTypeInformations 2");
FlushEndOfLine();
}
Storage_Error DDF_IOStream::BeginWriteRootSection()
{
*myOStream << "BEGIN_ROOT_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void DDF_IOStream::SetRootSectionSize(const Standard_Integer aSize)
{
*myOStream << aSize << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void DDF_IOStream::WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)
{
*myOStream << aRef << " " << rootName.ToCString() << " " << rootType.ToCString() << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error DDF_IOStream::EndWriteRootSection()
{
*myOStream << "END_ROOT_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(*myIStream >> i)) Storage_StreamTypeMismatchError::Raise("RootSectionSize");
+ if (!(*myIStream >> i)) throw Storage_StreamTypeMismatchError("RootSectionSize");
FlushEndOfLine();
void DDF_IOStream::ReadRoot(TCollection_AsciiString& rootName, Standard_Integer& aRef,TCollection_AsciiString& rootType)
{
- if (!(*myIStream >> aRef)) Storage_StreamTypeMismatchError::Raise("ReadRoot");
+ if (!(*myIStream >> aRef)) throw Storage_StreamTypeMismatchError("ReadRoot");
ReadWord(rootName);
ReadWord(rootType);
}
Storage_Error DDF_IOStream::BeginWriteRefSection()
{
*myOStream << "BEGIN_REF_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void DDF_IOStream::SetRefSectionSize(const Standard_Integer aSize)
{
*myOStream << aSize << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const Standard_Integer typeNum)
{
*myOStream << reference << " " << typeNum << "\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error DDF_IOStream::EndWriteRefSection()
{
*myOStream << "END_REF_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(*myIStream >> i)) Storage_StreamTypeMismatchError::Raise("RefSectionSize");
+ if (!(*myIStream >> i)) throw Storage_StreamTypeMismatchError("RefSectionSize");
FlushEndOfLine();
return i;
void DDF_IOStream::ReadReferenceType(Standard_Integer& reference,
Standard_Integer& typeNum)
{
- if (!(*myIStream >> reference)) Storage_StreamTypeMismatchError::Raise("ReadReferenceType 1");
- if (!(*myIStream >> typeNum)) Storage_StreamTypeMismatchError::Raise("ReadReferenceType 2");
+ if (!(*myIStream >> reference)) throw Storage_StreamTypeMismatchError("ReadReferenceType 1");
+ if (!(*myIStream >> typeNum)) throw Storage_StreamTypeMismatchError("ReadReferenceType 2");
FlushEndOfLine();
}
Storage_Error DDF_IOStream::BeginWriteDataSection()
{
*myOStream << "BEGIN_DATA_SECTION";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
const Standard_Integer aType)
{
*myOStream << "\n#" << aRef << "=%" << aType;
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void DDF_IOStream::BeginWritePersistentObjectData()
{
*myOStream << "( ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void DDF_IOStream::BeginWriteObjectData()
{
*myOStream << "( ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void DDF_IOStream::EndWriteObjectData()
{
*myOStream << ") ";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void DDF_IOStream::EndWritePersistentObjectData()
{
*myOStream << ")";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error DDF_IOStream::EndWriteDataSection()
{
*myOStream << "\nEND_DATA_SECTION\n";
- if (myOStream->bad()) Storage_StreamWriteError::Raise();
+ if (myOStream->bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
while (c != '#') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myIStream->get(c);
}
- if (!(*myIStream >> aRef)) Storage_StreamTypeMismatchError::Raise("ReadPersistentObjectHeader 1");
+ if (!(*myIStream >> aRef)) throw Storage_StreamTypeMismatchError("ReadPersistentObjectHeader 1");
myIStream->get(c);
while (c != '=') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myIStream->get(c);
}
while (c != '%') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myIStream->get(c);
}
- if (!(*myIStream >> aType)) Storage_StreamTypeMismatchError::Raise("ReadPersistentObjectHeader 2");
+ if (!(*myIStream >> aType)) throw Storage_StreamTypeMismatchError("ReadPersistentObjectHeader 2");
}
//=======================================================================
myIStream->get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myIStream->get(c);
}
myIStream->get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise("BeginReadObjectData");
+ throw Storage_StreamFormatError("BeginReadObjectData");
}
myIStream->get(c);
}
myIStream->get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise("EndReadObjectData");
+ throw Storage_StreamFormatError("EndReadObjectData");
}
myIStream->get(c);
}
myIStream->get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise("EndReadPersistentObjectData");
+ throw Storage_StreamFormatError("EndReadPersistentObjectData");
}
myIStream->get(c);
}
myIStream->get(c);
while (c != '\n') {
if (IsEnd() || (c != ' ')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myIStream->get(c);
}
else if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnRemoval))) {removed.Append(AD);}
else if (AD->IsKind(STANDARD_TYPE(TDF_DeltaOnModification))) {modified.Append(AD);}
else {
- Standard_DomainError::Raise("DDocStd_DumpCommand : unknown delta");
+ throw Standard_DomainError("DDocStd_DumpCommand : unknown delta");
}
}
//
isSelected = MakeXSelection(auxObj, aCurShape, aCntObj, Geometry, Orientation);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
+ catch (Standard_Failure const& anException) {
cout << "%%%INFO:Error: ::TestSingleSelection failed :";
- if (!aFailure.IsNull())
- cout << aFailure->GetMessageString() << endl;
- else
- cout << "%%%INFO:Error: ::TestSingleSelection : Standard_Failure with null caught failure"<< endl;
+ cout << anException.GetMessageString() << endl;
}
catch(...) {
cout << "%%%INFO:Error: ::TestSingleSelection selection failed : unknown exception type";
isSelected = MakeXSelection(auxObj, aCurShape, aCntObj, Geometry, Orientation);
}
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
+ catch (Standard_Failure const& anException) {
cout << "%%%INFO:Error: ::TestSingleSelection failed :";
- if (!aFailure.IsNull())
- cout << aFailure->GetMessageString() << endl;
- else
- cout << "%%%INFO:Error: ::TestSingleSelection : Standard_Failure with null caught failure"<< endl;
+ cout << anException.GetMessageString() << endl;
}
catch(...) {
cout << "%%%INFO:Error: ::TestSingleSelection selection failed : unknown exception type";
Handle(TDataStd_UAttribute) aLineObj = DNaming::GetObjectArg(aFunction, PTRANSF_LINE);
Handle(TNaming_NamedShape) aLineNS = DNaming::GetObjectValue(aLineObj);
gp_Ax1 anAxis;
- if(!DNaming::ComputeAxis(aLineNS, anAxis)) Standard_Failure::Raise();
+ if(!DNaming::ComputeAxis(aLineNS, anAxis)) throw Standard_Failure();
gp_Vec aVector(anAxis.Direction());
aVector.Normalize();
Standard_Real anOffset = DNaming::GetReal(aFunction,PTRANSF_OFF)->Get();
Handle(TDataStd_UAttribute) aLineObj = DNaming::GetObjectArg(aFunction, PTRANSF_LINE);
Handle(TNaming_NamedShape) aLineNS = DNaming::GetObjectValue(aLineObj);
gp_Ax1 anAxis;
- if(!DNaming::ComputeAxis(aLineNS, anAxis)) Standard_Failure::Raise();
+ if(!DNaming::ComputeAxis(aLineNS, anAxis)) throw Standard_Failure();
Standard_Real anAngle = DNaming::GetReal(aFunction,PTRANSF_ANG)->Get();
aTransformation.SetRotation(anAxis, anAngle);
Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue(aPlaneObj);
if(aNS.IsNull() || aNS->IsEmpty() || aNS->Get().IsNull() ||
- aNS->Get().ShapeType() != TopAbs_FACE) Standard_Failure::Raise();
+ aNS->Get().ShapeType() != TopAbs_FACE) throw Standard_Failure();
TopoDS_Face aFace = TopoDS::Face(aNS->Get());
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace);
GeomLib_IsPlanarSurface isPlanarSurface (aSurf);
- if(!isPlanarSurface.IsPlanar()) Standard_Failure::Raise();
+ if(!isPlanarSurface.IsPlanar()) throw Standard_Failure();
gp_Pln aPlane = isPlanarSurface.Plan();
gp_Ax2 aMirrorAx2 = aPlane.Position().Ax2();
aTransformation.SetMirror(aMirrorAx2);
if (TypeS != STANDARD_TYPE(Geom_Plane) &&
TypeS != STANDARD_TYPE(Geom_ConicalSurface) &&
TypeS != STANDARD_TYPE(Geom_CylindricalSurface)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
Standard_Real Angle;
gp_Cylinder Cy(Handle(Geom_CylindricalSurface)::DownCast(S)->Cylinder());
Standard_Real testdir = D.Dot(Cy.Axis().Direction());
if (Abs(testdir) <= 1.-Precision::Angular()) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
Angle = 0.;
}
gp_Cone Co(Handle(Geom_ConicalSurface)::DownCast(S)->Cone());
Standard_Real testdir = D.Dot(Co.Axis().Direction());
if (Abs(testdir) <= 1.-Precision::Angular()) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
Standard_Real umin,umax,vmin,vmax;
BRepTools::UVBounds(F,umin,umax,vmin,vmax);
const Standard_Boolean Flag)
{
if (!badShape.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (myComp) {
void Draft_Modification::Remove(const TopoDS_Face& F)
{
if (!myFMap.Contains(F) || myComp) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
conneF.Clear();
const TopTools_ListOfShape & Draft_Modification::ConnectedFaces(const TopoDS_Face& F)
{
if (!myFMap.Contains(F)) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
if (!IsDone()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
conneF.Clear();
curFace = myFMap.FindFromKey(F).RootFace();
const TopTools_ListOfShape & Draft_Modification::ModifiedFaces()
{
if (!badShape.IsNull()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
conneF.Clear();
Standard_Boolean& RevWires,
Standard_Boolean& RevFace)
{
- if (!IsDone()) {Standard_DomainError::Raise();}
+ if (!IsDone()) {throw Standard_DomainError();}
if (!myFMap.Contains(F) || !myFMap.FindFromKey(F).NewGeometry()) {
return Standard_False;
TopLoc_Location& L,
Standard_Real& Tol)
{
- if (!IsDone()) {Standard_DomainError::Raise();}
+ if (!IsDone()) {throw Standard_DomainError();}
if (!myEMap.Contains(E))
return Standard_False;
gp_Pnt& P,
Standard_Real& Tol)
{
- if (!IsDone()) {Standard_DomainError::Raise();};
+ if (!IsDone()) {throw Standard_DomainError();};
if (!myVMap.Contains(V)) {
return Standard_False;
Standard_Real& Tol)
{
- if (!IsDone()) {Standard_DomainError::Raise();};
+ if (!IsDone()) {throw Standard_DomainError();};
if (!myEMap.Contains(E)) {
return Standard_False;
Standard_Real& Tol)
{
- if (!IsDone()) {Standard_DomainError::Raise();};
+ if (!IsDone()) {throw Standard_DomainError();};
if (!myVMap.Contains(V)) {
return Standard_False;
void Draft_Modification::Perform ()
{
- if (!badShape.IsNull()) Standard_ConstructionError::Raise();
+ if (!badShape.IsNull()) throw Standard_ConstructionError();
if (!myComp) {
myComp = Standard_True;
GeomAdaptor_Curve TheCurve(C);
Extrema_ExtPC myExtPC(P,TheCurve);
if (!myExtPC.IsDone()) {
- Standard_Failure::Raise("Draft_Modification_1::Parameter: ExtremaPC not done.");
+ throw Standard_Failure("Draft_Modification_1::Parameter: ExtremaPC not done.");
}
if (myExtPC.NbExt() >= 1) {
Standard_Real Dist2, Dist2Min = myExtPC.SquareDistance(1);
return itp.Value();
}
}
- Standard_DomainError::Raise(); return 0;
+ throw Standard_DomainError();
}
return itp.Value();
}
}
- Standard_DomainError::Raise(); return itp.Value();
+ throw Standard_DomainError();
}
Standard_SStream aMsg; aMsg << "Could not find the resource:";
aMsg << theKey.ToCString()<< endl;
cout << "could not find the resource:"<<theKey.ToCString()<< endl;
- Draw_Failure::Raise(aMsg);
+ throw Draw_Failure(aMsg.str().c_str());
}
TCollection_AsciiString aPluginLibrary("");
#ifdef OCCT_DEBUG
cout << "could not open: " << aPluginResource->Value(theKey.ToCString())<< " ; reason: "<< error.ToCString() << endl;
#endif
- Draw_Failure::Raise(aMsg);
+ throw Draw_Failure(aMsg.str().c_str());
}
f = aSharedLibrary.DlSymb("PLUGINFACTORY");
if( f == NULL ) {
Standard_SStream aMsg; aMsg << "Could not find the factory in: ";
aMsg << aPluginResource->Value(theKey.ToCString());
aMsg << error.ToCString();
- Draw_Failure::Raise(aMsg);
+ throw Draw_Failure(aMsg.str().c_str());
}
theMapOfFunctions.Bind(theKey, f);
}
cout << theCommands.Result() << endl;
return theCommands.Result();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
#if !defined No_Exception && !defined No_Draw_Failure
#define Draw_Failure_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Draw_Failure::Raise(MESSAGE);
+ if (CONDITION) throw Draw_Failure(MESSAGE);
#else
#define Draw_Failure_Raise_if(CONDITION, MESSAGE)
#endif
if (fres != 0)
code = TCL_ERROR;
}
- catch (Standard_Failure) {
-
- Handle(Standard_Failure) E = Standard_Failure::Caught();
-
+ catch (Standard_Failure const& anException) {
// fail if Draw_ExitOnCatch is set
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
"Draw_ExitOnCatch",TCL_GLOBAL_ONLY);
#endif
- cout << "An exception was caught " << E << endl;
+ cout << "An exception was caught " << anException << endl;
if (cc && Draw::Atoi(cc)) {
#ifdef _WIN32
// get the error message
Standard_SStream ss;
- ss << "** Exception ** " << E << ends;
+ ss << "** Exception ** " << anException << ends;
Tcl_SetResult(interp,(char*)(ss.str().c_str()),TCL_VOLATILE);
code = TCL_ERROR;
}
return Standard_True;
}
else if (vf.IsNull() || vl.IsNull()) {
- Standard_DomainError::Raise("DrawDim::Lin : semi infinite edge");
+ throw Standard_DomainError("DrawDim::Lin : semi infinite edge");
}
else {
l = L->Lin();
Standard_Real DrawDim_Dimension::GetValue() const
{
- if (!is_valued) Standard_DomainError::Raise();
+ if (!is_valued) throw Standard_DomainError();
return myValue;
}
return "Error: Not a geometric object";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
DrawTrSurf::Set (theNameStr, aP);
return buff;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
DrawTrSurf::Set (theNameStr, aP);
return buff;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
Handle(Expr_BinaryExpression) me;
me = this;
if (exp == me) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
if (exp->Contains(me)) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
myFirstOperand = exp;
}
Handle(Expr_BinaryExpression) me;
me = this;
if (exp == me) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
if (exp->Contains(me)) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
mySecondOperand = exp;
}
return mySecondOperand;
}
else {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
}
- return *( ( Handle(Expr_GeneralExpression)* )NULL );
}
Standard_Boolean Expr_BinaryExpression::ContainsUnknowns () const
Expr_BinaryFunction::Expr_BinaryFunction (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
{
if (func->NbOfVariables() != 2) {
- Expr_InvalidFunction::Raise();
+ throw Expr_InvalidFunction();
}
myFunction = func;
CreateFirstOperand(exp1);
Handle(Expr_GeneralExpression) Expr_Difference::NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const
{
if (N <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (!Contains(X)) {
return new Expr_NumericValue(0.0);
#if !defined No_Exception && !defined No_Expr_ExprFailure
#define Expr_ExprFailure_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_ExprFailure::Raise(MESSAGE);
+ if (CONDITION) throw Expr_ExprFailure(MESSAGE);
#else
#define Expr_ExprFailure_Raise_if(CONDITION, MESSAGE)
#endif
myFunction = func;
myDerivate = withX;
if (deg <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
myDegree = deg;
UpdateExpression();
Standard_Real Expr_FunctionDerivative::Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& values) const
{
if (vars.Length() != values.Length()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return myExp->Evaluate(vars,values);
}
Handle(Expr_GeneralExpression) Expr_GeneralExpression::NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const
{
if (N <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Handle(Expr_GeneralExpression) first = Derivative(X);
if (N > 1) {
Standard_Real Expr_GeneralExpression::EvaluateNumeric() const
{
if (ContainsUnknowns()) {
- Expr_NotEvaluable::Raise();
+ throw Expr_NotEvaluable();
}
Expr_Array1OfNamedUnknown tabvr(1,1);
TColStd_Array1OfReal tabvl(1,1);
#if !defined No_Exception && !defined No_Expr_InvalidAssignment
#define Expr_InvalidAssignment_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_InvalidAssignment::Raise(MESSAGE);
+ if (CONDITION) throw Expr_InvalidAssignment(MESSAGE);
#else
#define Expr_InvalidAssignment_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Expr_InvalidFunction
#define Expr_InvalidFunction_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_InvalidFunction::Raise(MESSAGE);
+ if (CONDITION) throw Expr_InvalidFunction(MESSAGE);
#else
#define Expr_InvalidFunction_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Expr_InvalidOperand
#define Expr_InvalidOperand_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_InvalidOperand::Raise(MESSAGE);
+ if (CONDITION) throw Expr_InvalidOperand(MESSAGE);
#else
#define Expr_InvalidOperand_Raise_if(CONDITION, MESSAGE)
#endif
const Handle(Expr_GeneralExpression)& Expr_NamedConstant::SubExpression (const Standard_Integer ) const
{
- Standard_OutOfRange::Raise();
- Handle(Expr_GeneralExpression)* bid = new Handle(Expr_GeneralExpression);
- return *bid;
+ throw Standard_OutOfRange();
}
Handle(Expr_GeneralExpression) Expr_NamedConstant::Simplified () const
Standard_Real Expr_NamedFunction::Evaluate (const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& values) const
{
if (vars.Length() != values.Length()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return myExp->Evaluate(vars,values);
}
const Handle(Expr_GeneralExpression)& Expr_NamedUnknown::AssignedExpression () const
{
if (!IsAssigned()) {
- Expr_NotAssigned::Raise();
+ throw Expr_NotAssigned();
}
return myExpression;
}
{
Handle(Expr_NamedUnknown) me = this;
if (exp->Contains(me)) {
- Expr_InvalidAssignment::Raise();
+ throw Expr_InvalidAssignment();
}
myExpression = exp;
}
const Handle(Expr_GeneralExpression)& Expr_NamedUnknown::SubExpression (const Standard_Integer I) const
{
if (!IsAssigned()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (I != 1) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return AssignedExpression();
}
if (myExpression == var) {
Handle(Expr_NamedUnknown) me = this;
if (with->Contains(me)) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
Assign(with);
}
return vals(i-vars.Lower()+vals.Lower());
}
}
- Expr_NotEvaluable::Raise();
+ throw Expr_NotEvaluable();
}
return myExpression->Evaluate(vars,vals);
}
#if !defined No_Exception && !defined No_Expr_NotAssigned
#define Expr_NotAssigned_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_NotAssigned::Raise(MESSAGE);
+ if (CONDITION) throw Expr_NotAssigned(MESSAGE);
#else
#define Expr_NotAssigned_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Expr_NotEvaluable
#define Expr_NotEvaluable_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Expr_NotEvaluable::Raise(MESSAGE);
+ if (CONDITION) throw Expr_NotEvaluable(MESSAGE);
#else
#define Expr_NotEvaluable_Raise_if(CONDITION, MESSAGE)
#endif
const Handle(Expr_GeneralExpression)& Expr_NumericValue::SubExpression(const Standard_Integer) const
{
- Standard_OutOfRange::Raise();
- Handle(Expr_GeneralExpression)* bid=NULL;
- return *bid;
+ throw Standard_OutOfRange();
}
Handle(Expr_GeneralExpression) Expr_NumericValue::Simplified() const
{
Handle(Expr_PolyExpression) me = this;
if (exp == me) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
if (exp->Contains(me)) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
myOperands(index) = exp;
}
void Expr_PolyExpression::RemoveOperand (const Standard_Integer index)
{
if (myOperands.Length() <= 2) {
- Standard_DimensionMismatch::Raise();
+ throw Standard_DimensionMismatch();
}
myOperands.Remove(index);
}
void Expr_RUIterator::Next ()
{
if (!More()) {
- Standard_NoMoreObject::Raise();
+ throw Standard_NoMoreObject();
}
myCurrent++;
}
void Expr_RelationIterator::Next ()
{
if (!More()) {
- Standard_NoMoreObject::Raise();
+ throw Standard_NoMoreObject();
}
current++;
}
Handle(Expr_SingleRelation) Expr_RelationIterator::Value () const
{
if (!More()) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
return myRelation(current);
}
Handle(Expr_GeneralRelation) Expr_SingleRelation::SubRelation (const Standard_Integer ) const
{
- Standard_OutOfRange::Raise();
- Handle(Expr_GeneralRelation) bid;
- return bid;
+ throw Standard_OutOfRange();
}
Standard_Integer Expr_SingleRelation::NbOfSingleRelations() const
Handle(Expr_GeneralExpression) Expr_Sum::NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const
{
if (N <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Expr_SequenceOfGeneralExpression opsder;
Standard_Integer i;
}
if (alreadyHere) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
if (myRelations.Length() <= 1) {
- Standard_DimensionMismatch::Raise();
+ throw Standard_DimensionMismatch();
}
myRelations.Remove(position);
}
{
Handle(Expr_UnaryExpression) me = this;
if (exp == me) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
if (exp->Contains(me)) {
- Expr_InvalidOperand::Raise();
+ throw Expr_InvalidOperand();
}
myOperand = exp;
}
const Handle(Expr_GeneralExpression)& Expr_UnaryExpression::SubExpression (const Standard_Integer I) const
{
if (I != 1) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return myOperand;
}
Expr_UnaryFunction::Expr_UnaryFunction (const Handle(Expr_GeneralFunction)& func, const Handle(Expr_GeneralExpression)& exp)
{
if (func->NbOfVariables() != 1) {
- Expr_InvalidFunction::Raise();
+ throw Expr_InvalidFunction();
}
myFunction = func;
CreateOperand(exp);
Handle(Expr_GeneralExpression) Expr_UnaryMinus::NDerivative (const Handle(Expr_NamedUnknown)& X, const Standard_Integer N) const
{
if (N <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Handle(Expr_GeneralExpression) myder = Operand();
myder = myder->NDerivative(X,N);
void Expr_UnknownIterator::Next ()
{
if (!More()) {
- Standard_NoMoreObject::Raise();
+ throw Standard_NoMoreObject();
}
myCurrent++;
}
Handle(Expr_GeneralExpression) ExprIntrp_GenExp::Expression () const
{
if (!done) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
return myExpression;
}
Handle(Expr_GeneralRelation) ExprIntrp_GenRel::Relation () const
{
if (!done) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
return myRelation;
}
#if !defined No_Exception && !defined No_ExprIntrp_SyntaxError
#define ExprIntrp_SyntaxError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) ExprIntrp_SyntaxError::Raise(MESSAGE);
+ if (CONDITION) throw ExprIntrp_SyntaxError(MESSAGE);
#else
#define ExprIntrp_SyntaxError_Raise_if(CONDITION, MESSAGE)
#endif
namexp = new Expr_NamedUnknown(thename);
}
if (!namexp->IsKind(STANDARD_TYPE(Expr_NamedUnknown))) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
ExprIntrp_Recept.Push(namexp);
}
const TCollection_AsciiString& aStr = ExprIntrp_GetResult();
const char* s = aStr.ToCString();
if ( *s != 'X' && *s != 'x' ) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
s++;
Standard_Integer rank = atoi(s);
Standard_Integer deg = aStr.IntegerValue();
Standard_Integer thedeg = ExprIntrp_Recept.PopValue();
if (deg != thedeg) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
ExprIntrp_Recept.PushValue(deg);
}
TCollection_AsciiString name = ExprIntrp_Recept.PopName();
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.GetFunction(name);
if (thefunc.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Standard_Integer rank,degree;
Handle(Expr_NamedUnknown) thediff;
rank = ExprIntrp_Recept.PopValue();
degree = ExprIntrp_Recept.PopValue();
if ((rank > nbvars) || (rank < 1)) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
thediff = thefunc->Variable(rank);
thefunc = new Expr_FunctionDerivative(thefunc,thediff,degree);
{
Handle(Expr_GeneralFunction) thefunc = ExprIntrp_Recept.PopFunction();
if (thefunc.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Standard_Integer nbargs = thefunc->NbOfVariables();
if (nbargs == 1) {
Handle(Expr_GeneralExpression) arg2 = ExprIntrp_Recept.Pop();
Handle(Expr_GeneralExpression) arg1 = ExprIntrp_Recept.Pop();
if (arg1.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Handle(Expr_BinaryFunction) res =
new Expr_BinaryFunction(thefunc,arg1,arg2);
for (Standard_Integer i = 1; i<= nbargs; i++) {
arg = ExprIntrp_Recept.Pop();
if (arg.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
tabarg(nbargs-i+1) = arg;
}
Expr_UnknownIterator rit(resstand);
while (rit.More()) {
if (!var.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
else {
var = rit.Value();
rit.Next();
}
if (var.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
else {
Handle(Expr_GeneralExpression) res = resstand->NDerivative(var,ExprIntrp_Recept.PopValue());
else {
Handle(Expr_NamedFunction) thefunc = ExprIntrp_Recept.GetFunction(name);
if (thefunc.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Standard_Integer nbargs = thefunc->NbOfVariables();
if (nbargs != 1) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Handle(Expr_NamedUnknown) var = thefunc->Variable(1);
Handle(Expr_FunctionDerivative) thefuncder =
else {
Handle(Expr_NamedFunction) thefunc = ExprIntrp_Recept.GetFunction(name);
if (thefunc.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Standard_Integer nbargs = thefunc->NbOfVariables();
if (nbargs == 1) {
else if (nbargs == 2) {
Handle(Expr_GeneralExpression) arg1 = ExprIntrp_Recept.Pop();
if (arg1.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Handle(Expr_BinaryFunction) res =
new Expr_BinaryFunction(thefunc,arg1,op);
for (Standard_Integer i = 1; i< nbargs; i++) {
arg = ExprIntrp_Recept.Pop();
if (arg.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
tabarg(nbargs-i) = arg;
}
const TCollection_AsciiString& thename = ExprIntrp_GetResult();
Handle(Expr_NamedExpression) nameexp = ExprIntrp_Recept.GetNamed(thename);
if (nameexp.IsNull()) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
if (!nameexp->IsKind(STANDARD_TYPE(Expr_NamedUnknown))) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
Handle(Expr_NamedUnknown) var = Handle(Expr_NamedUnknown)::DownCast(nameexp);
var->Deassign();
extern "C" void ExprIntrperror(char* msg)
{
ExprIntrp_close();
- ExprIntrp_SyntaxError::Raise(msg);
+ throw ExprIntrp_SyntaxError(msg);
}
}
else {
if (!namexp->IsKind(STANDARD_TYPE(Expr_NamedUnknown))) {
- ExprIntrp_SyntaxError::Raise();
+ throw ExprIntrp_SyntaxError();
}
namu = Handle(Expr_NamedUnknown)::DownCast(namexp);
}
definition de la courbe.
-----------------------------------------------------------------------------*/
- if (NbU < 2) { Standard_OutOfRange::Raise(); }
+ if (NbU < 2) { throw Standard_OutOfRange(); }
Standard_Real U = Tool1::FirstParameter(C);
Standard_Real PasU = (Tool1::LastParameter(C) - U)/ (NbU - 1);
definition de la courbe.
-----------------------------------------------------------------------------*/
- if (NbU < 2) { Standard_OutOfRange::Raise(); }
+ if (NbU < 2) { throw Standard_OutOfRange(); }
Standard_Real U1, U2, U11, U12;
Standard_Real Uinf = Tool1::FirstParameter(C);
Standard_Real Ulast = Tool1::LastParameter(C);
Standard_Real Extrema_ExtCC::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if ((N <= 0) || (N > mynbext)) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_ExtCC::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return mynbext;
}
Extrema_POnCurv& P1,
Extrema_POnCurv& P2) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if ((N <= 0) || (N > mynbext)) throw Standard_OutOfRange();
P1 = mypoints.Value(2*N-1);
P2 = mypoints.Value(2*N);
}
Standard_Real Extrema_ExtCC2d::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if ((N <= 0) || (N > mynbext)) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_ExtCC2d::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return mynbext;
}
Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if ((N <= 0) || (N > mynbext)) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if ((N <= 0) || (N > mynbext)) throw Standard_OutOfRange();
P1 = mypoints.Value(2*N-1);
P2 = mypoints.Value(2*N);
}
Standard_Boolean Extrema_ExtCC2d::IsParallel() const
{
- if (!myDone) StdFail_NotDone::Raise();
+ if (!myDone) throw StdFail_NotDone();
return myIsPar;
}
Standard_Real Extrema_ExtCS::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if (myIsPar && N != 1) StdFail_InfiniteSolutions::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if (myIsPar && N != 1) throw StdFail_InfiniteSolutions();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_ExtCS::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return myPOnC.Length();
}
Extrema_POnCurv& P1,
Extrema_POnSurf& P2) const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
P1 = myPOnC.Value(N);
P2 = myPOnS.Value(N);
}
//
Standard_Integer NbSolutions() {
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return NbRoots;
}
//
Standard_Boolean InfiniteRoots() {
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return infinite_roots;
}
//
Standard_Real Value(const Standard_Integer& n) {
if((!done)||(n>NbRoots)) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return Roots[n-1];
}
}// if (!bOut || !bIn) {
}// else
}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Elips&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Hypr&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Circ&, const gp_Parab&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Elips&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Hypr&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Elips&, const gp_Parab&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Hypr&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Hypr&, const gp_Parab&)
-{
- Standard_NotImplemented::Raise();
-}
-//=======================================================================
-//function : Extrema_ExtElC
-//purpose :
-//=======================================================================
-Extrema_ExtElC::Extrema_ExtElC (const gp_Parab&, const gp_Parab&)
-{
- Standard_NotImplemented::Raise();
-}
+
//=======================================================================
//function : IsDone
//purpose :
Standard_Boolean Extrema_ExtElC::IsParallel () const
{
if (!IsDone()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myIsPar;
}
Standard_Integer Extrema_ExtElC::NbExt () const
{
if (IsParallel()) {
- StdFail_InfiniteSolutions::Raise();
+ throw StdFail_InfiniteSolutions();
}
return myNbExt;
}
Standard_Real Extrema_ExtElC::SquareDistance (const Standard_Integer N) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (myIsPar) {
if (N < 1 || N > 2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
}
else {
if (N < 1 || N > NbExt()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
}
return mySqDist[N-1];
Extrema_POnCurv& P2) const
{
if (N < 1 || N > NbExt()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
P1 = myPoint[N-1][0];
P2 = myPoint[N-1][1];
//! The circles can be parallel or identical.
Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Circ& C2);
- //! Calculates the distance between a circle and an
- //! elipse.
- Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Elips& C2);
-
- //! Calculates the distance between a circle and a
- //! hyperbola.
- Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Hypr& C2);
-
- //! Calculates the distance between a circle and a
- //! parabola.
- Standard_EXPORT Extrema_ExtElC(const gp_Circ& C1, const gp_Parab& C2);
-
- //! Calculates the distance between two elipses.
- //! The elipses can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Elips& C2);
-
- //! Calculates the distance between an elipse and a
- //! hyperbola.
- Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Hypr& C2);
-
- //! Calculates the distance between an elipse and a
- //! parabola.
- Standard_EXPORT Extrema_ExtElC(const gp_Elips& C1, const gp_Parab& C2);
-
- //! Calculates the distance between two hyperbolas.
- //! The hyperbolas can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC(const gp_Hypr& C1, const gp_Hypr& C2);
-
- //! Calculates the distance between a hyperbola and a
- //! parabola.
- Standard_EXPORT Extrema_ExtElC(const gp_Hypr& C1, const gp_Parab& C2);
-
- //! Calculates the distance between two parabolas
- //! The parabolas can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC(const gp_Parab& C1, const gp_Parab& C2);
-
//! Returns True if the distances are found.
Standard_EXPORT Standard_Boolean IsDone() const;
}
//============================================================================
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Elips2d&, const gp_Elips2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Elips2d&, const gp_Hypr2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Elips2d&, const gp_Parab2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Hypr2d&, const gp_Hypr2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Hypr2d&, const gp_Parab2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
-Extrema_ExtElC2d::Extrema_ExtElC2d (const gp_Parab2d&, const gp_Parab2d&)
-{
- Standard_NotImplemented::Raise();
-}
-//============================================================================
-
Standard_Boolean Extrema_ExtElC2d::IsDone () const { return myDone; }
//============================================================================
Standard_Boolean Extrema_ExtElC2d::IsParallel () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myIsPar;
}
//============================================================================
Standard_Integer Extrema_ExtElC2d::NbExt () const
{
- if (IsParallel()) { StdFail_InfiniteSolutions::Raise(); }
+ if (IsParallel()) { throw StdFail_InfiniteSolutions(); }
return myNbExt;
}
//============================================================================
Standard_Real Extrema_ExtElC2d::SquareDistance (const Standard_Integer N) const
{
if (!(N == 1 && myDone)) {
- if (N < 1 || N > NbExt()) { Standard_OutOfRange::Raise(); }
+ if (N < 1 || N > NbExt()) { throw Standard_OutOfRange(); }
}
return mySqDist[N-1];
}
Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const
{
- if (N < 1 || N > NbExt()) { Standard_OutOfRange::Raise(); }
+ if (N < 1 || N > NbExt()) { throw Standard_OutOfRange(); }
P1 = myPoint[N-1][0];
P2 = myPoint[N-1][1];
}
//! parabola.
Standard_EXPORT Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Parab2d& C2);
- //! Calculates the distance between two elipses.
- //! The elipses can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Elips2d& C2);
-
- //! Calculates the distance between an elipse and a
- //! hyperbola.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Hypr2d& C2);
-
- //! Calculates the distance between an elipse and a
- //! parabola.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Elips2d& C1, const gp_Parab2d& C2);
-
- //! Calculates the distance between two hyperbolas.
- //! The hyperbolas can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Hypr2d& C1, const gp_Hypr2d& C2);
-
- //! Calculates the distance between a hyperbola and a
- //! parabola.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Hypr2d& C1, const gp_Parab2d& C2);
-
- //! Calculates the distance between two parabolas
- //! The parabolas can be parallel or identical.
- Standard_EXPORT Extrema_ExtElC2d(const gp_Parab2d& C1, const gp_Parab2d& C2);
-
//! Returns True if the distances are found.
Standard_EXPORT Standard_Boolean IsDone() const;
Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
const gp_Cone& S)
-{
- Perform(C, S);
-}
+{ Perform(C, S);}
void Extrema_ExtElCS::Perform(const gp_Lin& ,
const gp_Cone& )
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElCS::Extrema_ExtElCS(const gp_Lin& C,
const gp_Torus& S)
-{
- Perform(C, S);
-}
+{ Perform(C, S);}
void Extrema_ExtElCS::Perform(const gp_Lin& ,
const gp_Torus& )
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
const gp_Cone& S)
-{
- Perform(C, S);
-}
+{ Perform(C, S);}
void Extrema_ExtElCS::Perform(const gp_Circ& ,
const gp_Cone& )
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
const gp_Sphere& S)
-{
- Perform(C, S);
-}
+{ Perform(C, S);}
void Extrema_ExtElCS::Perform(const gp_Circ& ,
const gp_Sphere& )
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElCS::Extrema_ExtElCS(const gp_Circ& C,
const gp_Torus& S)
-{
- Perform(C, S);
-}
+{ Perform(C, S);}
void Extrema_ExtElCS::Perform(const gp_Circ& ,
const gp_Torus& )
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Standard_Integer Extrema_ExtElCS::NbExt() const
{
- if (myIsPar) StdFail_InfiniteSolutions::Raise();
+ if (myIsPar) throw StdFail_InfiniteSolutions();
return myNbExt;
}
Standard_Real Extrema_ExtElCS::SquareDistance(const Standard_Integer N) const
{
- if (myIsPar && N != 1) StdFail_InfiniteSolutions::Raise();
+ if (myIsPar && N != 1) throw StdFail_InfiniteSolutions();
return mySqDist->Value(N);
}
Extrema_POnCurv& P1,
Extrema_POnSurf& P2) const
{
- if (myIsPar) StdFail_InfiniteSolutions::Raise();
+ if (myIsPar) throw StdFail_InfiniteSolutions();
P1 = myPoint1->Value(N);
P2 = myPoint2->Value(N);
}
Extrema_ExtElSS::Extrema_ExtElSS(const gp_Pln& S1, const gp_Sphere& S2)
-{
- Perform(S1, S2);
-}
+{ Perform(S1, S2);}
//void Extrema_ExtElSS::Perform(const gp_Pln& S1, const gp_Sphere& S2)
myDone = Standard_True;
myIsPar = Standard_False;
myNbExt = 0;
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElSS::Extrema_ExtElSS(const gp_Sphere& S1, const gp_Sphere& S2)
-{
- Perform(S1, S2);
-}
+{ Perform(S1, S2);}
//void Extrema_ExtElSS::Perform(const gp_Sphere& S1, const gp_Sphere& S2)
void Extrema_ExtElSS::Perform(const gp_Sphere& , const gp_Sphere& )
{
-
myDone = Standard_True;
myIsPar = Standard_False;
myNbExt = 0;
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElSS::Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cylinder& S2)
-{
- Perform(S1, S2);
-}
+{ Perform(S1, S2);}
//void Extrema_ExtElSS::Perform(const gp_Sphere& S1, const gp_Cylinder& S2)
myDone = Standard_True;
myIsPar = Standard_False;
myNbExt = 0;
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElSS::Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cone& S2)
-{
- Perform(S1, S2);
-}
+{ Perform(S1, S2);}
//void Extrema_ExtElSS::Perform(const gp_Sphere& S1, const gp_Cone& S2)
myDone = Standard_True;
myIsPar = Standard_False;
myNbExt = 0;
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Extrema_ExtElSS::Extrema_ExtElSS(const gp_Sphere& S1, const gp_Torus& S2)
-{
- Perform(S1, S2);
-}
+{ Perform(S1, S2);}
//void Extrema_ExtElSS::Perform(const gp_Sphere& S1, const gp_Torus& S2)
myDone = Standard_True;
myIsPar = Standard_False;
myNbExt = 0;
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
Standard_Boolean Extrema_ExtElSS::IsParallel() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return myIsPar;
}
Standard_Integer Extrema_ExtElSS::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
- if (myIsPar) StdFail_InfiniteSolutions::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if (myIsPar) throw StdFail_InfiniteSolutions();
return myNbExt;
}
Standard_Real Extrema_ExtElSS::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if (myIsPar && N != 1) StdFail_InfiniteSolutions::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if (myIsPar && N != 1) throw StdFail_InfiniteSolutions();
return mySqDist->Value(N);
}
Extrema_POnSurf& P1,
Extrema_POnSurf& P2) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if (myIsPar) StdFail_InfiniteSolutions::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if (myIsPar) throw StdFail_InfiniteSolutions();
P1 = myPOnS1->Value(N);
P2 = myPOnS2->Value(N);
}
Standard_Integer Extrema_ExtPElC::NbExt () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myNbExt;
}
//=============================================================================
Standard_Real Extrema_ExtPElC::SquareDistance (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return mySqDist[N-1];
}
//=============================================================================
Standard_Boolean Extrema_ExtPElC::IsMin (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return myIsMin[N-1];
}
//=============================================================================
const Extrema_POnCurv& Extrema_ExtPElC::Point (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return myPoint[N-1];
}
//=============================================================================
Standard_Integer Extrema_ExtPElC2d::NbExt () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myNbExt;
}
//=============================================================================
Standard_Real Extrema_ExtPElC2d::SquareDistance (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return mySqDist[N-1];
}
//=============================================================================
Standard_Boolean Extrema_ExtPElC2d::IsMin (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return myIsMin[N-1];
}
//=============================================================================
const Extrema_POnCurv2d& Extrema_ExtPElC2d::Point (const Standard_Integer N) const
{
- if ((N < 1) || (N > NbExt())) { Standard_OutOfRange::Raise(); }
+ if ((N < 1) || (N > NbExt())) { throw Standard_OutOfRange(); }
return myPoint[N-1];
}
//=============================================================================
Standard_Integer Extrema_ExtPElS::NbExt () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myNbExt;
}
//=============================================================================
Standard_Real Extrema_ExtPElS::SquareDistance (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
return mySqDist[N-1];
}
//=============================================================================
const Extrema_POnSurf& Extrema_ExtPElS::Point (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
return myPoint[N-1];
}
//=============================================================================
Standard_Integer Extrema_ExtPExtS::NbExt () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
if (myIsAnalyticallyComputable)
return myNbExt;
else
Standard_Real Extrema_ExtPExtS::SquareDistance (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
if (myIsAnalyticallyComputable)
// modified by NIZHNY-MKK Thu Sep 18 14:48:39 2003.BEGIN
// return myValue[N];
const Extrema_POnSurf& Extrema_ExtPExtS::Point (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
if (myIsAnalyticallyComputable) {
// modified by NIZHNY-MKK Thu Sep 18 14:47:40 2003.BEGIN
// return myPoint[N];
Standard_Integer Extrema_ExtPRevS::NbExt() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myNbExt;
}
Standard_Real Extrema_ExtPRevS::SquareDistance(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
if (myIsAnalyticallyComputable)
return mySqDist[N-1];
else
const Extrema_POnSurf& Extrema_ExtPRevS::Point(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
- if ((N < 1) || (N > myNbExt)) { Standard_OutOfRange::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
+ if ((N < 1) || (N > myNbExt)) { throw Standard_OutOfRange(); }
if (myIsAnalyticallyComputable)
return myPoint[N-1];
else
Standard_Real Extrema_ExtPS::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_ExtPS::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return mySqDist.Length();
}
const Extrema_POnSurf& Extrema_ExtPS::Point(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return myPoints.Value(N);
}
Standard_Real Extrema_ExtSS::SquareDistance(const Standard_Integer N) const
{
- if(!myDone) StdFail_NotDone::Raise();
- if (myIsPar && N != 1) StdFail_InfiniteSolutions::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!myDone) throw StdFail_NotDone();
+ if (myIsPar && N != 1) throw StdFail_InfiniteSolutions();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_ExtSS::NbExt() const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
return mySqDist.Length();
}
Extrema_POnSurf& P1,
Extrema_POnSurf& P2) const
{
- if(!myDone) StdFail_NotDone::Raise();
+ if(!myDone) throw StdFail_NotDone();
P1 = myPOnS1.Value(N);
P2 = myPOnS2.Value(N);
}
Standard_Boolean Extrema_FuncExtCS::Value(const math_Vector& UV,
math_Vector& F)
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
myt = UV(1);
myU = UV(2);
math_Vector& F,
math_Matrix& Df)
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
myt = UV(1);
myU = UV(2);
Standard_Integer Extrema_FuncExtCS::GetStateNumber()
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
#if 0
math_Vector Sol(1, 3), UVSol(1, 3);
UVSol(1) = myt; UVSol(2) = myU; UVSol(3) = myV;
Standard_Real Extrema_FuncExtCS::SquareDistance(const Standard_Integer N) const
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
return mySqDist.Value(N);
}
const Extrema_POnCurv& Extrema_FuncExtCS::PointOnCurve(const Standard_Integer N) const
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
return myPoint1.Value(N);
}
const Extrema_POnSurf& Extrema_FuncExtCS::PointOnSurface(const Standard_Integer N) const
{
- if (!myCinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myCinit || !mySinit) throw Standard_TypeMismatch();
return myPoint2.Value(N);
}
Standard_Boolean Extrema_FuncExtPC::Value (const Standard_Real U, Standard_Real& F)
{
if (!myPinit || !myCinit)
- Standard_TypeMismatch::Raise("No init");
+ throw Standard_TypeMismatch("No init");
myU = U;
Vec D1c;
Standard_Boolean Extrema_FuncExtPC::Derivative (const Standard_Real U, Standard_Real& D1f)
{
- if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !myCinit) throw Standard_TypeMismatch();
Standard_Real F;
return Values(U,F,D1f); /* on fait appel a Values pour simplifier la
sauvegarde de l'etat. */
Standard_Real& D1f)
{
if (!myPinit || !myCinit)
- Standard_TypeMismatch::Raise("No init");
+ throw Standard_TypeMismatch("No init");
Pnt myPc_old = myPc, myP_old = myP;
Standard_Integer Extrema_FuncExtPC::GetStateNumber ()
{
- if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !myCinit) throw Standard_TypeMismatch();
mySqDist.Append(myPc.SquareDistance(myP));
// It is necessary to always compute myD1f.
Standard_Real Extrema_FuncExtPC::SquareDistance (const Standard_Integer N) const
{
- if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !myCinit) throw Standard_TypeMismatch();
return mySqDist.Value(N);
}
//=============================================================================
Standard_Boolean Extrema_FuncExtPC::IsMin (const Standard_Integer N) const
{
- if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !myCinit) throw Standard_TypeMismatch();
return (myIsMin.Value(N) == 1);
}
//=============================================================================
const POnC & Extrema_FuncExtPC::Point (const Standard_Integer N) const
{
- if (!myPinit || !myCinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !myCinit) throw Standard_TypeMismatch();
return myPoint.Value(N);
}
//=============================================================================
Standard_Boolean Extrema_FuncExtSS::Value (const math_Vector& UV,
math_Vector& F)
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
myU1 = UV(1);
myV1 = UV(2);
myU2 = UV(3);
math_Vector& F,
math_Matrix& Df)
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
myU1 = UV(1);
myV1 = UV(2);
myU2 = UV(3);
Standard_Integer Extrema_FuncExtSS::GetStateNumber ()
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
#if 0
math_Vector Sol(1, 4), UVSol(1, 4);
UVSol(1) = myU1; UVSol(2) = myV1; UVSol(3) = myU2; UVSol(4) = myV2;
Standard_Real Extrema_FuncExtSS::SquareDistance (const Standard_Integer N) const
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
return mySqDist.Value(N);
}
const Extrema_POnSurf& Extrema_FuncExtSS::PointOnS1 (const Standard_Integer N) const
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
return myPoint1.Value(N);
}
//=======================================================================
const Extrema_POnSurf& Extrema_FuncExtSS::PointOnS2 (const Standard_Integer N) const
{
- if (!myS1init || !myS2init) Standard_TypeMismatch::Raise();
+ if (!myS1init || !myS2init) throw Standard_TypeMismatch();
return myPoint2.Value(N);
}
Standard_Boolean Extrema_FuncPSNorm::Value (const math_Vector& UV,
math_Vector& F)
{
- if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !mySinit) throw Standard_TypeMismatch();
myU = UV(1);
myV = UV(2);
gp_Vec Dus, Dvs;
math_Vector& F,
math_Matrix& Df)
{
- if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !mySinit) throw Standard_TypeMismatch();
myU = UV(1);
myV = UV(2);
gp_Vec Dus, Dvs, Duus, Dvvs, Duvs;
Standard_Integer Extrema_FuncPSNorm::GetStateNumber ()
{
- if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !mySinit) throw Standard_TypeMismatch();
//comparison of solution with previous solutions
Standard_Integer i = 1, nbSol = mySqDist.Length();
Standard_Real tol2d = Precision::PConfusion() * Precision::PConfusion();
Standard_Real Extrema_FuncPSNorm::SquareDistance (const Standard_Integer N) const
{
- if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !mySinit) throw Standard_TypeMismatch();
return mySqDist.Value(N);
}
//=============================================================================
const Extrema_POnSurf& Extrema_FuncPSNorm::Point (const Standard_Integer N) const
{
- if (!myPinit || !mySinit) Standard_TypeMismatch::Raise();
+ if (!myPinit || !mySinit) throw Standard_TypeMismatch();
return myPoint.Value(N);
}
Standard_Real Extrema_GExtPC::SquareDistance(const Standard_Integer N) const
{
- if(!mydone) StdFail_NotDone::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!mydone) throw StdFail_NotDone();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return mySqDist.Value(N);
}
Standard_Integer Extrema_GExtPC::NbExt() const
{
- if(!mydone) StdFail_NotDone::Raise();
+ if(!mydone) throw StdFail_NotDone();
return mySqDist.Length();
}
Standard_Boolean Extrema_GExtPC::IsMin(const Standard_Integer N) const
{
- if(!mydone) StdFail_NotDone::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!mydone) throw StdFail_NotDone();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return myismin.Value(N);
}
const ThePOnC & Extrema_GExtPC::Point(const Standard_Integer N) const
{
- if(!mydone) StdFail_NotDone::Raise();
- if ((N < 1) || (N > mySqDist.Length())) Standard_OutOfRange::Raise();
+ if(!mydone) throw StdFail_NotDone();
+ if ((N < 1) || (N > mySqDist.Length())) throw Standard_OutOfRange();
return mypoint.Value(N);
}
Standard_Real Extrema_GLocateExtPC::SquareDistance () const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
Standard_Real d=0;
if ((type == GeomAbs_BezierCurve)) {
d = myLocExtPC.SquareDistance();
Standard_Boolean Extrema_GLocateExtPC::IsMin () const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
Standard_Boolean b=0;
if ((type == GeomAbs_BezierCurve)) {
b = myLocExtPC.IsMin();
const ThePOnC & Extrema_GLocateExtPC::Point () const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
if (type == GeomAbs_BezierCurve) {
return myLocExtPC.Point();
}
//=======================================================================
Standard_Integer Extrema_GenExtCS::NbExt() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.NbExt();
}
//=======================================================================
Standard_Real Extrema_GenExtCS::SquareDistance(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.SquareDistance(N);
}
//=======================================================================
const Extrema_POnCurv& Extrema_GenExtCS::PointOnCurve(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.PointOnCurve(N);
}
//=======================================================================
const Extrema_POnSurf& Extrema_GenExtCS::PointOnSurface(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.PointOnSurface(N);
}
Standard_Integer Extrema_GenExtPC::NbExt () const {
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.NbExt();
}
Standard_Real Extrema_GenExtPC::SquareDistance (const Standard_Integer N) const {
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.SquareDistance(N);
}
Standard_Boolean Extrema_GenExtPC::IsMin (const Standard_Integer N) const {
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.IsMin(N);
}
const POnC & Extrema_GenExtPC::Point (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.Point(N);
}
//=============================================================================
myvsup = Vsup;
if ((myusample < 2) ||
- (myvsample < 2)) { Standard_OutOfRange::Raise(); }
+ (myvsample < 2)) { throw Standard_OutOfRange(); }
myF.Initialize(S);
Standard_Integer Extrema_GenExtPS::NbExt () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.NbExt();
}
//=============================================================================
Standard_Real Extrema_GenExtPS::SquareDistance (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.SquareDistance(N);
}
//=============================================================================
const Extrema_POnSurf& Extrema_GenExtPS::Point (const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.Point(N);
}
//=============================================================================
Standard_Integer Extrema_GenExtSS::NbExt() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.NbExt();
}
Standard_Real Extrema_GenExtSS::SquareDistance(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.SquareDistance(N);
}
const Extrema_POnSurf& Extrema_GenExtSS::PointOnS1(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.PointOnS1(N);
}
const Extrema_POnSurf& Extrema_GenExtSS::PointOnS2(const Standard_Integer N) const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myF.PointOnS2(N);
}
Standard_Real Extrema_GenLocateExtCC::SquareDistance() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return mySqDist;
}
//=============================================================================
void Extrema_GenLocateExtCC::Point (POnC& P1, POnC& P2)
const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
P1 = myPoint1;
P2 = myPoint2;
}
Standard_Real Extrema_GenLocateExtCS::SquareDistance() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return mySqDist;
}
const Extrema_POnCurv& Extrema_GenLocateExtCS::PointOnCurve() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myPoint1;
}
const Extrema_POnSurf& Extrema_GenLocateExtCS::PointOnSurface() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myPoint2;
}
Standard_Real Extrema_GenLocateExtPC::SquareDistance() const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
return myF.SquareDistance(1);
}
Standard_Boolean Extrema_GenLocateExtPC::IsMin () const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
return myF.IsMin(1);
}
const POnC & Extrema_GenLocateExtPC::Point () const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
return myF.Point(1);
}
//=======================================================================
Standard_Real Extrema_GenLocateExtPS::SquareDistance () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return mySqDist;
}
//=======================================================================
const Extrema_POnSurf& Extrema_GenLocateExtPS::Point () const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myPoint;
}
Standard_Real Extrema_GenLocateExtSS::SquareDistance() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return mySqDist;
}
const Extrema_POnSurf& Extrema_GenLocateExtSS::PointOnS1() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myPoint1;
}
const Extrema_POnSurf& Extrema_GenLocateExtSS::PointOnS2() const
{
- if (!IsDone()) { StdFail_NotDone::Raise(); }
+ if (!IsDone()) { throw StdFail_NotDone(); }
return myPoint2;
}
Standard_Real Extrema_LocateExtCC::SquareDistance() const {
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
return mySqDist;
}
void Extrema_LocateExtCC::Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const {
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
P1 = myPoint1;
P2 = myPoint2;
}
Standard_Real Extrema_LocateExtCC2d::SquareDistance() const {
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
return mySqDist;
}
void Extrema_LocateExtCC2d::Point (Extrema_POnCurv2d& P1,
Extrema_POnCurv2d& P2) const
{
- if (!myDone) { StdFail_NotDone::Raise(); }
+ if (!myDone) { throw StdFail_NotDone(); }
P1 = myPoint1;
P2 = myPoint2;
}
{
if(myDepTable(Dimension1, Dimension2) == 0)
- Standard_DomainError::Raise("FEmTool_Assembly::AddMatrix");
+ throw Standard_DomainError("FEmTool_Assembly::AddMatrix");
const TColStd_Array1OfInteger & T1 = myRefTable->Value(Dimension1,Element)->Array1();
const TColStd_Array1OfInteger & T2 = myRefTable->Value(Dimension2,Element)->Array1();
//=======================================================================
void FEmTool_Assembly::Solution(math_Vector& Solution) const
{
- if(!IsSolved) StdFail_NotDone::Raise("FEmTool_Assembly::Solution");
+ if(!IsSolved) throw StdFail_NotDone("FEmTool_Assembly::Solution");
if(G.IsEmpty()) H->Solve(B, Solution);
else {
const TColStd_Array2OfReal& Coeffs)
{
Standard_Integer i, j, degBase, deg;
- if (IndexOfElement > myNbElements || IndexOfElement < 1) Standard_OutOfRange::Raise();
+ if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange();
degBase = myBase->WorkDegree();
deg = myDegree(IndexOfElement);
Standard_Integer iBase = (IndexOfElement - 1)*(degBase + 1)*myDimension,
void FEmTool_Curve::GetElement(const Standard_Integer IndexOfElement, TColStd_Array2OfReal& Coeffs)
{
Standard_Integer i, j, degBase, deg;
- if (IndexOfElement > myNbElements || IndexOfElement < 1) Standard_OutOfRange::Raise();
+ if (IndexOfElement > myNbElements || IndexOfElement < 1) throw Standard_OutOfRange();
degBase = myBase->WorkDegree();
deg = myDegree(IndexOfElement);
Standard_Integer iBase = (IndexOfElement - 1)*(degBase + 1)*myDimension,
Standard_Real& Length)
{
Standard_Integer Low, High, deg, degBase, i, Ptr;
- if(FirstU > LastU) Standard_OutOfRange::Raise("FEmTool_Curve::Length");
+ if(FirstU > LastU) throw Standard_OutOfRange("FEmTool_Curve::Length");
if(myKnots->Value(1) > FirstU) Low = 1;
else
HasPoly(IndexOfElement) = HasDeri(IndexOfElement) = HasSecn(IndexOfElement) = 0;
myLength(IndexOfElement) = -1;
}
- else if(Degree > myBase->WorkDegree()) Standard_OutOfRange::Raise("FEmTool_Curve::SetDegree");
+ else if(Degree > myBase->WorkDegree()) throw Standard_OutOfRange("FEmTool_Curve::SetDegree");
}
myBase(TheBase)
{
if(DerOrder < 0 || DerOrder > 3)
- Standard_ConstructionError::Raise("FEmTool_ElementsOfRefMatrix");
+ throw Standard_ConstructionError("FEmTool_ElementsOfRefMatrix");
myDerOrder = DerOrder;
myNbEquations = (myBase->WorkDegree()+2)*(myBase->WorkDegree()+1)/2;
Standard_Boolean FEmTool_ElementsOfRefMatrix::Value(const math_Vector& X, math_Vector& F)
{
- if(F.Length() < myNbEquations) Standard_OutOfRange::Raise("FEmTool_ElementsOfRefMatrix::Value");
+ if(F.Length() < myNbEquations) throw Standard_OutOfRange("FEmTool_ElementsOfRefMatrix::Value");
Standard_Real u = X(X.Lower());
TColStd_Array1OfReal Basis(0,myBase->WorkDegree()), Aux(0,myBase->WorkDegree());
if (myOrder != Order) {
//Calculating RefMatrix
- if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
+ if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 2;
Handle(PLib_HermitJacobi) theBase = new PLib_HermitJacobi(WDeg, ConstraintOrder);
//=======================================================================
Handle(TColStd_HArray2OfInteger) FEmTool_LinearFlexion::DependenceTable() const
{
- if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearFlexion::DependenceTable");
+ if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearFlexion::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearJerk::Hessian");
+ throw Standard_OutOfRange("FEmTool_LinearJerk::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
- Standard_DomainError::Raise("FEmTool_LinearJerk::Hessian");
+ throw Standard_DomainError("FEmTool_LinearJerk::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
void FEmTool_LinearFlexion::Gradient(const Standard_Integer Dimension,math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearFlexion::Gradient");
+ throw Standard_OutOfRange("FEmTool_LinearFlexion::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);
//Calculating RefMatrix
if (myOrder != Order) {
- if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
+ if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 3;
Handle(TColStd_HArray2OfInteger) FEmTool_LinearJerk::DependenceTable() const
{
- if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearJerk::DependenceTable");
+ if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearJerk::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearJerk::Hessian");
+ throw Standard_OutOfRange("FEmTool_LinearJerk::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
- Standard_DomainError::Raise("FEmTool_LinearJerk::Hessian");
+ throw Standard_DomainError("FEmTool_LinearJerk::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
void FEmTool_LinearJerk::Gradient(const Standard_Integer Dimension,math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearJerk::Gradient");
+ throw Standard_OutOfRange("FEmTool_LinearJerk::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);
if (myOrder != Order) {
//Calculating RefMatrix
- if (WorkDegree > WDeg) Standard_ConstructionError::Raise("Degree too high");
+ if (WorkDegree > WDeg) throw Standard_ConstructionError("Degree too high");
Order = myOrder;
Standard_Integer DerOrder = 1;
Handle(PLib_HermitJacobi) theBase = new PLib_HermitJacobi(WDeg, ConstraintOrder);
Handle(TColStd_HArray2OfInteger) FEmTool_LinearTension::DependenceTable() const
{
- if(myCoeff.IsNull()) Standard_DomainError::Raise("FEmTool_LinearTension::DependenceTable");
+ if(myCoeff.IsNull()) throw Standard_DomainError("FEmTool_LinearTension::DependenceTable");
Handle(TColStd_HArray2OfInteger) DepTab =
new TColStd_HArray2OfInteger(myCoeff->LowerCol(), myCoeff->UpperCol(),
if(Dimension1 < DepTab->LowerRow() || Dimension1 > DepTab->UpperRow() ||
Dimension2 < DepTab->LowerCol() || Dimension2 > DepTab->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearTension::Hessian");
+ throw Standard_OutOfRange("FEmTool_LinearTension::Hessian");
if(DepTab->Value(Dimension1,Dimension2) == 0)
- Standard_DomainError::Raise("FEmTool_LinearTension::Hessian");
+ throw Standard_DomainError("FEmTool_LinearTension::Hessian");
Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), degH = Min(2*myOrder+1, deg);
void FEmTool_LinearTension::Gradient(const Standard_Integer Dimension, math_Vector& G)
{
if(Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol())
- Standard_OutOfRange::Raise("FEmTool_LinearTension::Gradient");
+ throw Standard_OutOfRange("FEmTool_LinearTension::Gradient");
Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1);
//=======================================================================
void FEmTool_ProfileMatrix::Solve(const math_Vector& B,math_Vector& X) const
{
- if (!IsDecomp) StdFail_NotDone::Raise("Decomposition must be done");
+ if (!IsDecomp) throw StdFail_NotDone("Decomposition must be done");
Standard_Integer i, j, jj,DiagAddr, CurrAddr;
Standard_Real Sum;
Standard_Boolean FEmTool_ProfileMatrix::Prepare()
{
- Standard_NotImplemented::Raise("FEmTool_ProfileMatrix::Prepare");
- return Standard_False;
+ throw Standard_NotImplemented("FEmTool_ProfileMatrix::Prepare");
}
// void FEmTool_ProfileMatrix::Solve(const math_Vector& B,const math_Vector& Init,math_Vector& X,math_Vector& Residual,const Standard_Real Tolerance,const Standard_Integer NbIterations) const
void FEmTool_ProfileMatrix::Solve(const math_Vector& ,const math_Vector& ,math_Vector& ,math_Vector& ,const Standard_Real ,const Standard_Integer ) const
{
- Standard_NotImplemented::Raise("FEmTool_ProfileMatrix::Solve");
+ throw Standard_NotImplemented("FEmTool_ProfileMatrix::Solve");
}
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Integer t = InverseInt (aValue);
- if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#else
- if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
Storage_BaseDriver& FSD_BinaryFile::PutCharacter(const Standard_Character aValue)
{
- if (!fwrite(&aValue,sizeof(Standard_Character),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_Character),1,myStream)) throw Storage_StreamWriteError();
return *this;
}
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_ExtCharacter t = InverseExtChar (aValue);
- if (!fwrite(&t,sizeof(Standard_ExtCharacter),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_ExtCharacter),1,myStream)) throw Storage_StreamWriteError();
#else
- if (!fwrite(&aValue,sizeof(Standard_ExtCharacter),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_ExtCharacter),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Integer t = InverseInt (aValue);
- if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#else
- if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
theOStream.write ((char*)&t, sizeof(Standard_Integer));
if (theOStream.fail())
{
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
}
}
#else
Standard_Integer t = aValue ? 1 : 0;
#endif
- if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) throw Storage_StreamWriteError();
return *this;
}
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Real t = InverseReal (aValue);
- if (!fwrite(&t,sizeof(Standard_Real),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_Real),1,myStream)) throw Storage_StreamWriteError();
#else
- if (!fwrite(&aValue,sizeof(Standard_Real),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_Real),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_ShortReal t = InverseShortReal (aValue);
- if (!fwrite(&t,sizeof(Standard_ShortReal),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&t,sizeof(Standard_ShortReal),1,myStream)) throw Storage_StreamWriteError();
#else
- if (!fwrite(&aValue,sizeof(Standard_ShortReal),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(&aValue,sizeof(Standard_ShortReal),1,myStream)) throw Storage_StreamWriteError();
#endif
return *this;
}
Storage_BaseDriver& FSD_BinaryFile::GetReference(Standard_Integer& aValue)
{
if (!fread(&aValue,sizeof(Standard_Integer),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseInt (aValue);
#endif
if (theIStream.gcount() != sizeof(Standard_Integer))
{
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
}
#if OCCT_BINARY_FILE_DO_INVERSE
Storage_BaseDriver& FSD_BinaryFile::GetCharacter(Standard_Character& aValue)
{
if (!fread(&aValue,sizeof(Standard_Character),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
return *this;
}
Storage_BaseDriver& FSD_BinaryFile::GetExtCharacter(Standard_ExtCharacter& aValue)
{
if (!fread(&aValue,sizeof(Standard_ExtCharacter),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseExtChar (aValue);
#endif
Storage_BaseDriver& FSD_BinaryFile::GetInteger(Standard_Integer& aValue)
{
if (!fread(&aValue,sizeof(Standard_Integer),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseInt (aValue);
#endif
if (theIStream.gcount() != sizeof(Standard_Integer))
{
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
}
#if OCCT_BINARY_FILE_DO_INVERSE
{
Standard_Integer anInt = 0;
if (!fread(&anInt,sizeof(Standard_Integer),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
anInt = InverseInt (anInt);
#endif
Storage_BaseDriver& FSD_BinaryFile::GetReal(Standard_Real& aValue)
{
if (!fread(&aValue,sizeof(Standard_Real),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseReal (aValue);
#endif
Storage_BaseDriver& FSD_BinaryFile::GetShortReal(Standard_ShortReal& aValue)
{
if (!fread(&aValue,sizeof(Standard_ShortReal),1,myStream))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseShortReal (aValue);
#endif
strlen(FSD_BinaryFile::MagicNumber()),
1,
myStream))
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
myHeader.binfo = ftell(myStream);
WriteHeader();
PutInteger(size);
if (size > 0) {
- if (!fwrite(aString.ToCString(),aString.Length(),1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fwrite(aString.ToCString(),aString.Length(),1,myStream)) throw Storage_StreamWriteError();
}
}
theOStream.write (theString.ToCString(), theString.Length());
if (theOStream.fail())
{
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
}
}
GetInteger(size);
if (size > 0) {
Standard_Character *c = (Standard_Character *)Standard::Allocate((size+1) * sizeof(Standard_Character));
- if (!fread(c,size,1,myStream)) Storage_StreamWriteError::Raise();
+ if (!fread(c,size,1,myStream)) throw Storage_StreamWriteError();
c[size] = '\0';
aString = c;
Standard::Free(c);
if (!theIStream.good())
{
- Storage_StreamReadError::Raise();
+ throw Storage_StreamReadError();
}
theIStream.read (c, size);
if (theIStream.gcount() != size)
{
- Storage_StreamReadError::Raise();
+ throw Storage_StreamReadError();
}
c[size] = '\0';
anExtStr = aString.ToExtString();
#endif
if (!fwrite(anExtStr,sizeof(Standard_ExtCharacter)*aString.Length(),1,myStream))
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
}
}
theOStream.write((char*)anExtStr, sizeof(Standard_ExtCharacter)*theString.Length());
if (theOStream.fail())
{
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
}
}
Standard_ExtCharacter *c = (Standard_ExtCharacter *)
Standard::Allocate((size+1) * sizeof(Standard_ExtCharacter));
if (!fread(c,size*sizeof(Standard_ExtCharacter),1,myStream))
- Storage_StreamWriteError::Raise();
+ throw Storage_StreamWriteError();
c[size] = '\0';
#if OCCT_BINARY_FILE_DO_INVERSE
for (Standard_Integer i=0; i < size; i++)
if (!theIStream.good())
{
- Storage_StreamReadError::Raise();
+ throw Storage_StreamReadError();
}
const std::streamsize aNbBytes = std::streamsize(sizeof(Standard_ExtCharacter) * size);
theIStream.read ((char *)c, aNbBytes);
if (theIStream.gcount() != aNbBytes)
{
- Storage_StreamReadError::Raise();
+ throw Storage_StreamReadError();
}
c[size] = '\0';
Storage_BaseDriver& FSD_CmpFile::PutReference(const Standard_Integer aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
i = aValue;
myStream << i << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::PutExtCharacter(const Standard_ExtCharacter aValue)
{
myStream << (short )aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::PutInteger(const Standard_Integer aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue)
{
myStream << ((Standard_Integer)aValue) << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue)
{
myStream << ((Standard_Real)aValue) << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::GetReference(Standard_Integer& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
// SGI : donne une erreur mais a une bonne valeur pour les caracteres ecrits
// signes (-80 fait ios::badbit, mais la variable i est initialisee)
//
- if (i == 0) Storage_StreamTypeMismatchError::Raise();
+ if (i == 0) throw Storage_StreamTypeMismatchError();
myStream.clear(ios::goodbit);
}
aValue = (char)i;
Storage_BaseDriver& FSD_CmpFile::GetExtCharacter(Standard_ExtCharacter& aValue)
{
short aChar = 0;
- if (!(myStream >> aChar)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aChar)) throw Storage_StreamTypeMismatchError();
aValue = aChar;
return *this;
}
Storage_BaseDriver& FSD_CmpFile::GetInteger(Standard_Integer& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
Storage_BaseDriver& FSD_CmpFile::GetBoolean(Standard_Boolean& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
cerr << "\t buffer is" << realbuffer<< endl;
#endif
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
}
if (!OSD::CStringToReal(realbuffer,aValue)) {
#ifdef OCCT_DEBUG
cerr << "%%%ERROR: read error of double at offset " << myStream.tellg() << endl;
cerr << "\t buffer is" << realbuffer<< endl;
#endif
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
}
return *this;
Standard_Real r = 0.0;
realbuffer[0] = '\0';
- if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
if (!OSD::CStringToReal(realbuffer,r))
- Storage_StreamTypeMismatchError::Raise();
+ throw Storage_StreamTypeMismatchError();
aValue = (Standard_ShortReal)r;
{
myStream << FSD_CmpFile::MagicNumber() << '\n';
myStream << "BEGIN_INFO_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
WriteExtendedLine(dataType);
myStream << userInfo.Length() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= userInfo.Length(); i++) {
myStream << userInfo.Value(i).ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
}
Storage_Error FSD_CmpFile::EndWriteInfoSection()
{
myStream << "END_INFO_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString& dataType,
TColStd_SequenceOfAsciiString& userInfo)
{
- if (!(myStream >> nbObj)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> nbObj)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Standard_Integer i,len = 0;
- if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Storage_Error FSD_CmpFile::BeginWriteCommentSection()
{
myStream << "BEGIN_COMMENT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
aSize = aCom.Length();
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= aSize; i++) {
WriteExtendedLine(aCom.Value(i));
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
}
Storage_Error FSD_CmpFile::EndWriteCommentSection()
{
myStream << "END_COMMENT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString line;
Standard_Integer len,i;
- if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Storage_Error FSD_CmpFile::BeginWriteTypeSection()
{
myStream << "BEGIN_TYPE_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_CmpFile::SetTypeSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const TCollection_AsciiString& typeName)
{
myStream << typeNum << " " << typeName.ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_CmpFile::EndWriteTypeSection()
{
myStream << "END_TYPE_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
void FSD_CmpFile::ReadTypeInformations(Standard_Integer& typeNum,
TCollection_AsciiString& typeName)
{
- if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
- if (!(myStream >> typeName)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
+ if (!(myStream >> typeName)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
Storage_Error FSD_CmpFile::BeginWriteRootSection()
{
myStream << "BEGIN_ROOT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_CmpFile::SetRootSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_CmpFile::WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)
{
myStream << aRef << " " << rootName.ToCString() << " " << rootType.ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_CmpFile::EndWriteRootSection()
{
myStream << "END_ROOT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
void FSD_CmpFile::ReadRoot(TCollection_AsciiString& rootName, Standard_Integer& aRef,TCollection_AsciiString& rootType)
{
- if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
ReadWord(rootName);
ReadWord(rootType);
}
Storage_Error FSD_CmpFile::BeginWriteRefSection()
{
myStream << "BEGIN_REF_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_CmpFile::SetRefSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const Standard_Integer typeNum)
{
myStream << reference << " " << typeNum << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_CmpFile::EndWriteRefSection()
{
myStream << "END_REF_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
return i;
void FSD_CmpFile::ReadReferenceType(Standard_Integer& reference,
Standard_Integer& typeNum)
{
- if (!(myStream >> reference)) Storage_StreamTypeMismatchError::Raise();
- if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> reference)) throw Storage_StreamTypeMismatchError();
+ if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
Storage_Error FSD_CmpFile::BeginWriteDataSection()
{
myStream << "BEGIN_DATA_SECTION";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
const Standard_Integer aType)
{
myStream << "\n#" << aRef << "%" << aType << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_CmpFile::BeginWritePersistentObjectData()
{
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_CmpFile::BeginWriteObjectData()
{
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_CmpFile::EndWriteObjectData()
{
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_CmpFile::EndWritePersistentObjectData()
{
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_CmpFile::EndWriteDataSection()
{
myStream << "\nEND_DATA_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
while (c != '#') {
if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
- if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
myStream.get(c);
while (c != '%') {
if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
- if (!(myStream >> aType)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
}
myStream.get(c);
while (c != '\n' && (c != '\r')) {
if (IsEnd() || (c != ' ')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
}
}
else {
- Storage_StreamExtCharParityError::Raise();
+ throw Storage_StreamExtCharParityError();
}
}
else {
- Storage_StreamExtCharParityError::Raise();
+ throw Storage_StreamExtCharParityError();
}
}
}
Storage_BaseDriver& FSD_File::PutReference(const Standard_Integer aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
i = aValue;
myStream << i << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::PutExtCharacter(const Standard_ExtCharacter aValue)
{
myStream << (short )aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::PutInteger(const Standard_Integer aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue)
{
myStream << ((Standard_Integer)aValue) << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue)
{
myStream << ((Standard_Real)aValue) << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue)
{
myStream << aValue << " ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return *this;
}
Storage_BaseDriver& FSD_File::GetReference(Standard_Integer& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
// SGI : donne une erreur mais a une bonne valeur pour les caracteres ecrits
// signes (-80 fait ios::badbit, mais la variable i est initialisee)
//
- if (i == 0) Storage_StreamTypeMismatchError::Raise();
+ if (i == 0) throw Storage_StreamTypeMismatchError();
myStream.clear(ios::goodbit); // .clear(0) is not portable
}
aValue = (char)i;
Storage_BaseDriver& FSD_File::GetExtCharacter(Standard_ExtCharacter& aValue)
{
short aChar = 0;
- if (!(myStream >> aChar)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aChar)) throw Storage_StreamTypeMismatchError();
aValue = aChar;
return *this;
}
Storage_BaseDriver& FSD_File::GetInteger(Standard_Integer& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
Storage_BaseDriver& FSD_File::GetBoolean(Standard_Boolean& aValue)
{
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
}
char realbuffer[100];
realbuffer[0] = '\0';
- if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
- if (!OSD::CStringToReal(realbuffer,aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
+ if (!OSD::CStringToReal(realbuffer,aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#else
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#endif
Standard_Real r = 0.0;
realbuffer[0] = '\0';
- if (!(myStream >> realbuffer)) Storage_StreamTypeMismatchError::Raise();
- if (!OSD::CStringToReal(realbuffer,r)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> realbuffer)) throw Storage_StreamTypeMismatchError();
+ if (!OSD::CStringToReal(realbuffer,r)) throw Storage_StreamTypeMismatchError();
aValue = r;
return *this;
#else
- if (!(myStream >> aValue)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aValue)) throw Storage_StreamTypeMismatchError();
return *this;
#endif
}
{
myStream << FSD_File::MagicNumber() << '\n';
myStream << "BEGIN_INFO_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
WriteExtendedLine(dataType);
myStream << userInfo.Length() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= userInfo.Length(); i++) {
myStream << userInfo.Value(i).ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
}
Storage_Error FSD_File::EndWriteInfoSection()
{
myStream << "END_INFO_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString& dataType,
TColStd_SequenceOfAsciiString& userInfo)
{
- if (!(myStream >> nbObj)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> nbObj)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Standard_Integer i,len = 0;
- if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Storage_Error FSD_File::BeginWriteCommentSection()
{
myStream << "BEGIN_COMMENT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
aSize = aCom.Length();
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
for (i = 1; i <= aSize; i++) {
WriteExtendedLine(aCom.Value(i));
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
}
Storage_Error FSD_File::EndWriteCommentSection()
{
myStream << "END_COMMENT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
TCollection_ExtendedString line;
Standard_Integer len,i;
- if (!(myStream >> len)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> len)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
Storage_Error FSD_File::BeginWriteTypeSection()
{
myStream << "BEGIN_TYPE_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_File::SetTypeSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const TCollection_AsciiString& typeName)
{
myStream << typeNum << " " << typeName.ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_File::EndWriteTypeSection()
{
myStream << "END_TYPE_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
void FSD_File::ReadTypeInformations(Standard_Integer& typeNum,
TCollection_AsciiString& typeName)
{
- if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
- if (!(myStream >> typeName)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
+ if (!(myStream >> typeName)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
Storage_Error FSD_File::BeginWriteRootSection()
{
myStream << "BEGIN_ROOT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_File::SetRootSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_File::WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)
{
myStream << aRef << " " << rootName.ToCString() << " " << rootType.ToCString() << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_File::EndWriteRootSection()
{
myStream << "END_ROOT_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
void FSD_File::ReadRoot(TCollection_AsciiString& rootName, Standard_Integer& aRef,TCollection_AsciiString& rootType)
{
- if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
ReadWord(rootName);
ReadWord(rootType);
}
Storage_Error FSD_File::BeginWriteRefSection()
{
myStream << "BEGIN_REF_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
void FSD_File::SetRefSectionSize(const Standard_Integer aSize)
{
myStream << aSize << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
const Standard_Integer typeNum)
{
myStream << reference << " " << typeNum << "\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_File::EndWriteRefSection()
{
myStream << "END_REF_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
{
Standard_Integer i;
- if (!(myStream >> i)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> i)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
return i;
void FSD_File::ReadReferenceType(Standard_Integer& reference,
Standard_Integer& typeNum)
{
- if (!(myStream >> reference)) Storage_StreamTypeMismatchError::Raise();
- if (!(myStream >> typeNum)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> reference)) throw Storage_StreamTypeMismatchError();
+ if (!(myStream >> typeNum)) throw Storage_StreamTypeMismatchError();
FlushEndOfLine();
}
Storage_Error FSD_File::BeginWriteDataSection()
{
myStream << "BEGIN_DATA_SECTION";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
const Standard_Integer aType)
{
myStream << "\n#" << aRef << "=%" << aType;
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_File::BeginWritePersistentObjectData()
{
myStream << "( ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_File::BeginWriteObjectData()
{
myStream << "( ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_File::EndWriteObjectData()
{
myStream << ") ";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
void FSD_File::EndWritePersistentObjectData()
{
myStream << ")";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
}
//=======================================================================
Storage_Error FSD_File::EndWriteDataSection()
{
myStream << "\nEND_DATA_SECTION\n";
- if (myStream.bad()) Storage_StreamWriteError::Raise();
+ if (myStream.bad()) throw Storage_StreamWriteError();
return Storage_VSOk;
}
while (c != '#') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
- if (!(myStream >> aRef)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aRef)) throw Storage_StreamTypeMismatchError();
myStream.get(c);
while (c != '=') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
while (c != '%') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
- if (!(myStream >> aType)) Storage_StreamTypeMismatchError::Raise();
+ if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
}
myStream.get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
myStream.get(c);
while (c != '(') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
myStream.get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
myStream.get(c);
while (c != ')') {
if (IsEnd() || (c != ' ') || (c == '\n')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
myStream.get(c);
while (c != '\n') {
if (IsEnd() || (c != ' ')) {
- Storage_StreamFormatError::Raise();
+ throw Storage_StreamFormatError();
}
myStream.get(c);
}
Degree(9)
{
if (P1.IsEqual(P2, Precision::Confusion()))
- Standard_NullValue::Raise("FairCurve : P1 and P2 are confused");
+ throw Standard_NullValue("FairCurve : P1 and P2 are confused");
if (Height <= 0)
- Standard_NegativeValue::Raise("FairCurve : Height is not positive");
+ throw Standard_NegativeValue("FairCurve : Height is not positive");
//
// Initialize by a straight line (2 poles)
//
// ==================================================================
{
if (P1.IsEqual(NewP2, Precision::Confusion()))
- Standard_NullValue::Raise("FairCurve : P1 and P2 are confused");
+ throw Standard_NullValue("FairCurve : P1 and P2 are confused");
Angles(P1, NewP2);
NewP1 = P1;
}
// ==================================================================
{
if (NewP1.IsEqual(P2, Precision::Confusion()))
- Standard_NullValue::Raise("FairCurve : P1 and P2 are confused");
+ throw Standard_NullValue("FairCurve : P1 and P2 are confused");
Angles(NewP1, P2);
NewP2 = P2;
}
inline void FairCurve_Batten::SetHeight(const Standard_Real Height)
{
if (Height <= 0)
- Standard_NegativeValue::Raise("FairCurve : Height is no positive");
+ throw Standard_NegativeValue("FairCurve : Height is no positive");
NewHeight = Height;
}
Standard_Integer FilletSurf_Builder::NbSurface() const
{
if (IsDone()!=FilletSurf_IsNotOk) return myIntBuild.NbSurface();
- StdFail_NotDone::Raise("FilletSurf_Builder::NbSurface");
- return 0;
+ throw StdFail_NotDone("FilletSurf_Builder::NbSurface");
}
//=======================================================================
const Handle(Geom_Surface)& FilletSurf_Builder::SurfaceFillet(const Standard_Integer Index) const
{
- if ( (Index<1)||(Index>NbSurface())) Standard_OutOfRange::Raise("FilletSurf_Builder::SurfaceFillet");
+ if ( (Index<1)||(Index>NbSurface())) throw Standard_OutOfRange("FilletSurf_Builder::SurfaceFillet");
return myIntBuild.SurfaceFillet(Index);
}
Standard_Real FilletSurf_Builder::TolApp3d(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::TolApp3d");
+ throw Standard_OutOfRange("FilletSurf_Builder::TolApp3d");
return myIntBuild.TolApp3d(Index);
}
const TopoDS_Face& FilletSurf_Builder::SupportFace1(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::SupportFace1");
+ throw Standard_OutOfRange("FilletSurf_Builder::SupportFace1");
return myIntBuild.SupportFace1(Index);
}
const TopoDS_Face& FilletSurf_Builder::SupportFace2(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::SupportFace2");
+ throw Standard_OutOfRange("FilletSurf_Builder::SupportFace2");
return myIntBuild.SupportFace2(Index);
}
const Handle(Geom_Curve)& FilletSurf_Builder::CurveOnFace1(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::CurveOnFace1");
+ throw Standard_OutOfRange("FilletSurf_Builder::CurveOnFace1");
return myIntBuild.CurveOnFace1(Index);
}
const Handle(Geom_Curve)& FilletSurf_Builder::CurveOnFace2(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::CurveOnFace2");
+ throw Standard_OutOfRange("FilletSurf_Builder::CurveOnFace2");
return myIntBuild.CurveOnFace2(Index);
}
const Handle(Geom2d_Curve)& FilletSurf_Builder::PCurveOnFace1(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise( "FilletSurf_Builder::PCurveOnFace1");
+ throw Standard_OutOfRange( "FilletSurf_Builder::PCurveOnFace1");
return myIntBuild.PCurveOnFace1(Index);
}
const Handle(Geom2d_Curve)& FilletSurf_Builder::PCurve1OnFillet(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::PCurve1OnFillet");
+ throw Standard_OutOfRange("FilletSurf_Builder::PCurve1OnFillet");
return myIntBuild.PCurve1OnFillet(Index);
}
const Handle(Geom2d_Curve)& FilletSurf_Builder::PCurveOnFace2(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::PCurveOnFace2");
+ throw Standard_OutOfRange("FilletSurf_Builder::PCurveOnFace2");
return myIntBuild.PCurveOnFace2(Index);
}
const Handle(Geom2d_Curve)& FilletSurf_Builder::PCurve2OnFillet(const Standard_Integer Index) const
{
if ( (Index<1)||(Index>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::PCurve2OnFillet");
+ throw Standard_OutOfRange("FilletSurf_Builder::PCurve2OnFillet");
return myIntBuild.PCurve2OnFillet(Index);
}
Standard_Real FilletSurf_Builder::FirstParameter() const
{
if (IsDone()==FilletSurf_IsNotOk)
- StdFail_NotDone::Raise("FilletSurf_Builder::FirstParameter");
+ throw StdFail_NotDone("FilletSurf_Builder::FirstParameter");
return myIntBuild.FirstParameter();
}
Standard_Real FilletSurf_Builder::LastParameter() const
{
if (IsDone()==FilletSurf_IsNotOk)
- StdFail_NotDone::Raise("FilletSurf_Builder::LastParameter");
+ throw StdFail_NotDone("FilletSurf_Builder::LastParameter");
return myIntBuild.LastParameter();
}
FilletSurf_StatusType FilletSurf_Builder::StartSectionStatus() const
{
if (IsDone()==FilletSurf_IsNotOk)
- StdFail_NotDone::Raise("FilletSurf_Builder::StartSectionStatus" );
+ throw StdFail_NotDone("FilletSurf_Builder::StartSectionStatus" );
return myIntBuild.StartSectionStatus();
}
FilletSurf_StatusType FilletSurf_Builder::EndSectionStatus() const
{
if (IsDone()==FilletSurf_IsNotOk)
- StdFail_NotDone::Raise("FilletSurf_Builder::StartSectionStatus");
+ throw StdFail_NotDone("FilletSurf_Builder::StartSectionStatus");
return myIntBuild.EndSectionStatus();
}
Standard_Integer FilletSurf_Builder::NbSection(const Standard_Integer IndexSurf) const
{
if (IsDone()==FilletSurf_IsNotOk)
- StdFail_NotDone::Raise("FilletSurf_Builder::NbSection)");
- else if ( (IndexSurf<1)||(IndexSurf>NbSurface())) Standard_OutOfRange::Raise
- ("FilletSurf_Builder::NbSection");
+ throw StdFail_NotDone("FilletSurf_Builder::NbSection)");
+ else if ( (IndexSurf<1)||(IndexSurf>NbSurface())) throw Standard_OutOfRange("FilletSurf_Builder::NbSection");
return myIntBuild.NbSection(IndexSurf);
}
Handle(Geom_TrimmedCurve)& Circ) const
{
if ((IndexSurf<1)||(IndexSurf>NbSurface()))
- Standard_OutOfRange::Raise("FilletSurf_Builder::Section NbSurface");
+ throw Standard_OutOfRange("FilletSurf_Builder::Section NbSurface");
else if ((IndexSec<1)||(IndexSec>NbSection(IndexSurf)))
- Standard_OutOfRange::Raise("FilletSurf_Builder::Section NbSection");
+ throw Standard_OutOfRange("FilletSurf_Builder::Section NbSection");
else myIntBuild.Section(IndexSurf, IndexSec,Circ);
}
{
Handle(ChFiDS_SurfData) Data = SeqData(1);
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
- if(fsp.IsNull()) Standard_ConstructionError::Raise
- ("PerformSurf : this is not the spine of a fillet");
+ if(fsp.IsNull()) throw Standard_ConstructionError("PerformSurf : this is not the spine of a fillet");
Handle(BRepBlend_Line) lin;
TopAbs_Orientation Or = S1->ChangeSurface().Face().Orientation();
- if(!fsp->IsConstant()) Standard_ConstructionError::Raise
- ("PerformSurf : no variable radiuses");
+ if(!fsp->IsConstant()) throw Standard_ConstructionError("PerformSurf : no variable radiuses");
// Standard_Boolean maybesingular; //pour scinder les Surfdata singulieres
BRepBlend_ConstRad Func(S1,S2,Guide);
Standard_False, Data->ChangeVertexLastOnS2(), tolesp);
}
done = CompleteData(Data,Func,lin,S1,S2,Or,0,0,0,0);
- if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
+ if(!done) throw Standard_Failure("PerformSurf : Failed approximation!");
// maybesingular = (Func.GetMinimalDistance()<=100*tolapp3d);
Standard_Boolean ok = Standard_False;
if(!Forward){
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
- Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
+ throw Standard_DomainError("BlendFunc_CSConstRad::Section : Not implemented");
}
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
- Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
+ throw Standard_DomainError("BlendFunc_CSConstRad::Section : Not implemented");
}
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
- Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
+ throw Standard_DomainError("BlendFunc_CSConstRad::Section : Not implemented");
}
Standard_Boolean FilletSurf_InternalBuilder::Done() const
TheCone = new Geom_ConicalSurface(C);
}
-GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& , //C,
- const gp_Pnt& ) //P )
-{
- Standard_NotImplemented::Raise("GC_MakeConicalSurface");
-}
-
-GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& , //C,
- const Standard_Real) // Dist )
-{
- Standard_NotImplemented::Raise("GC_MakeConicalSurface");
-}
-
//=========================================================================
// Creation of a cone by four points. +
// two first give the axis. +
}
-GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax1& , //Axis,
- const gp_Pnt& , //P1 ,
- const gp_Pnt& ) //P2 )
-{
- Standard_NotImplemented::Raise("GC_MakeConicalSurface");
-}
-
-
-GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Lin& , //Axis,
- const gp_Pnt& , //P1 ,
- const gp_Pnt& ) //P2 )
-{
- Standard_NotImplemented::Raise("GC_MakeConicalSurface");
-}
-
-
//=========================================================================
//=========================================================================
//! Creates a ConicalSurface from a non persistent Cone from package gp.
Standard_EXPORT GC_MakeConicalSurface(const gp_Cone& C);
- //! Make a ConicalSurface from Geom <TheCone> parallel to another
- //! ConicalSurface <Cone> and passing through a Pnt <Point>.
- Standard_EXPORT GC_MakeConicalSurface(const gp_Cone& Cone, const gp_Pnt& Point);
-
- //! Make a ConicalSurface from Geom <TheCone> parallel to another
- //! ConicalSurface <Cone> at the distance <Dist> which can
- //! be greater or lower than zero.
- Standard_EXPORT GC_MakeConicalSurface(const gp_Cone& Cone, const Standard_Real Dist);
-
//! Make a ConicalSurface from Geom <TheCone> passing through 3
//! Pnt <P1>,<P2>,<P3>.
//! Its axis is <P1P2> and the radius of its base is
//! <P3P4> is colinear to <P1P2>.
Standard_EXPORT GC_MakeConicalSurface(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, const gp_Pnt& P4);
- //! Make a ConicalSurface by its axis <Axis> and and two points.
- Standard_EXPORT GC_MakeConicalSurface(const gp_Ax1& Axis, const gp_Pnt& P1, const gp_Pnt& P2);
-
- //! Make a ConicalSurface by its axis <Axis> and and two points.
- Standard_EXPORT GC_MakeConicalSurface(const gp_Lin& Axis, const gp_Pnt& P1, const gp_Pnt& P2);
-
//! Make a ConicalSurface with two points and two radius.
//! The axis of the solution is the line passing through
//! <P1> and <P2>.
#include <StdFail_NotDone.hxx>
#include <TColgp_Array1OfPnt.hxx>
-GC_MakePlane::GC_MakePlane(const gp_Ax2& ) //A2)
-{
- Standard_NotImplemented::Raise("GC_MakePlane");
-}
-
GC_MakePlane::GC_MakePlane(const gp_Pln& Pl)
{
TheError = gce_Done;
DEFINE_STANDARD_ALLOC
-
-
- //! Creates a plane located in 3D space with an axis placement
- //! two axis. The "ZDirection" of "A2" is the direction normal
- //! to the plane. The "Location" point of "A2" is the origin of
- //! the plane. The "XDirection" and "YDirection" of "A2" define
- //! the directions of the U isoparametric and V isoparametric
- //! curves.
- Standard_EXPORT GC_MakePlane(const gp_Ax2& A2);
-
-
//! Creates a plane from a non persistent plane from package gp.
Standard_EXPORT GC_MakePlane(const gp_Pln& Pl);
}
}
-GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl,
- const gp_Pnt& , // P,
- const Standard_Real )//Height)
-{
- Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder");
-}
-
-GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl,
- const gp_Pnt& , // P1,
- const gp_Pnt& ) // P2)
-{
- Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder");
-}
-
const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCylinder::
Value() const
{
//! In the other case it has the opposite orientation.
Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Ax1& A1, const Standard_Real Radius, const Standard_Real Height);
- //! Make a RectangularTrimmedSurface <Cylinder> from gp by
- //! a cylinder from gp.
- //! It is trimmed by the point <P> and the heigh <Heigh>.
- //! <Height> can be greater than zero or lower than zero.
- //! in the first case the limit section is in the side of
- //! the positives V paramters of <Cyl> and in the other
- //! side if <Heigh> is lower than zero.
- Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Cylinder& Cyl, const gp_Pnt& P, const Standard_Real Height);
-
- //! Make a RectangularTrimmedSurface <Cylinder> from gp by
- //! a cylinder from gp.
- //! It is trimmed by the two points <P1> and <P2>.
- //! Warning
- //! If an error occurs (that is, when IsDone returns
- //! false), the Status function returns:
- //! - gce_NegativeRadius if Radius is less than 0.0, or
- //! - gce_ConfusedPoints if the points P1 and P2 are coincident.
- //! - gce_ColinearPoints if the points P1, P2 and P3 are collinear.
- Standard_EXPORT GC_MakeTrimmedCylinder(const gp_Cylinder& Cyl, const gp_Pnt& P1, const gp_Pnt& P2);
-
//! Returns the constructed trimmed cylinder.
//! Exceptions
//! StdFail_NotDone if no trimmed cylinder is constructed.
{
Standard_Real L = GCPnts_AbscissaPoint::Length(C);
if (L < Precision::Confusion()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Real Abscis = Abscissa;
Standard_Real UU0 = U0;
/* if (L < Precision::Confusion()) {
cout<<"FirstParameter = "<<C.FirstParameter()<<endl;
cout<<"LastParameter = "<<C.LastParameter()<<endl;
- Standard_ConstructionError::Raise("GCPnts_AbscissaPoint::GCPnts_AbscissaPoint");
+ throw Standard_ConstructionError("GCPnts_AbscissaPoint::GCPnts_AbscissaPoint");
}
*/
Standard_Real Abscis = Abscissa;
void GProp_GProps::Add (const GProp_GProps& Item, const Standard_Real Density) {
- if (Density <= gp::Resolution()) Standard_DomainError::Raise();
+ if (Density <= gp::Resolution()) throw Standard_DomainError();
if (loc.Distance (Item.loc) <= gp::Resolution ()) {
gp_XYZ GXYZ = (Item.g.XYZ()).Multiplied (Item.dim * Density);
g.SetXYZ (g.XYZ().Multiplied (dim));
}
gp_Pln GProp_PEquation::Plane() const {
- if (!IsPlanar()) Standard_NoSuchObject::Raise();
+ if (!IsPlanar()) throw Standard_NoSuchObject();
return gp_Pln(g,v1);
}
gp_Lin GProp_PEquation::Line() const {
- if (!IsLinear()) Standard_NoSuchObject::Raise();
+ if (!IsLinear()) throw Standard_NoSuchObject();
return gp_Lin(g,gp_Dir(v1));
}
gp_Pnt GProp_PEquation::Point() const {
- if (!IsPoint()) Standard_NoSuchObject::Raise();
+ if (!IsPoint()) throw Standard_NoSuchObject();
return g;
}
void GProp_PEquation::Box(gp_Pnt& P , gp_Vec& V1,
gp_Vec& V2 , gp_Vec& V3) const {
- if (!IsSpace()) Standard_NoSuchObject::Raise();
+ if (!IsSpace()) throw Standard_NoSuchObject();
P = g;
V1 = v1;
V2 = v2;
void GProp_PGProps::AddPoint (const gp_Pnt& P, const Standard_Real Density)
{
- if (Density <= gp::Resolution()) Standard_DomainError::Raise();
+ if (Density <= gp::Resolution()) throw Standard_DomainError();
Standard_Real Xp, Yp, Zp;
P.Coord (Xp, Yp, Zp);
Standard_Real Ixy = - Xp * Yp;
GProp_PGProps::GProp_PGProps (const Array1OfPnt& Pnts,const Array1OfReal& Density)
{
- if (Pnts.Length() != Density.Length()) Standard_DomainError::Raise();
+ if (Pnts.Length() != Density.Length()) throw Standard_DomainError();
Standard_Integer ip = Pnts.Lower();
Standard_Integer id = Density.Lower();
while (id <= Pnts.Upper()) {
Standard_Real D = Density (id);
- if (D <= gp::Resolution()) Standard_DomainError::Raise();
+ if (D <= gp::Resolution()) throw Standard_DomainError();
AddPoint(Pnts (ip),D);
ip++; id++;
}
GProp_PGProps::GProp_PGProps (const Array2OfPnt& Pnts,const Array2OfReal& Density)
{
- if (Pnts.ColLength() != Density.ColLength() || Pnts.RowLength() != Density.RowLength()) Standard_DomainError::Raise();
+ if (Pnts.ColLength() != Density.ColLength() || Pnts.RowLength() != Density.RowLength()) throw Standard_DomainError();
Standard_Integer ip = Pnts.LowerRow();
Standard_Integer id = Density.LowerRow();
Standard_Integer jp = Pnts.LowerCol();
while (jp <= Pnts.UpperCol()) {
while (ip <= Pnts.UpperRow()) {
Standard_Real D = Density (id, jd);
- if (D <= gp::Resolution()) Standard_DomainError::Raise();
+ if (D <= gp::Resolution()) throw Standard_DomainError();
AddPoint(Pnts (ip, jp),D);
ip++; id++;
}
Standard_Real& Mass,
Pnt& G)
{
- if (Pnts.Length() != Density.Length()) Standard_DimensionError::Raise();
+ if (Pnts.Length() != Density.Length()) throw Standard_DimensionError();
Standard_Integer ip = Pnts.Lower();
Standard_Integer id = Density.Lower();
Mass = Density (id);
Standard_Real& Mass,
Pnt& G)
{
- if (Pnts.RowLength() != Density.RowLength() || Pnts.ColLength() != Density.ColLength()) Standard_DimensionError::Raise();
+ if (Pnts.RowLength() != Density.RowLength() || Pnts.ColLength() != Density.ColLength()) throw Standard_DimensionError();
Standard_Integer ip = Pnts.LowerRow();
Standard_Integer id = Density.LowerRow();
Standard_Integer jp = Pnts.LowerCol();
#if !defined No_Exception && !defined No_GProp_UndefinedAxis
#define GProp_UndefinedAxis_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) GProp_UndefinedAxis::Raise(MESSAGE);
+ if (CONDITION) throw GProp_UndefinedAxis(MESSAGE);
#else
#define GProp_UndefinedAxis_Raise_if(CONDITION, MESSAGE)
#endif
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = gp_Pnt2d(pnttg1sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame2(Index) == 0) {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
PntSol = gp_Pnt2d(pnttg2sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
CenterOn3 (const Standard_Integer Index ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParArg = parcen3(Index);
PntSol = pnttg1sol(Index);
Standard_Boolean GccAna_Circ2d2TanOn::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
return Standard_True;
Standard_Boolean GccAna_Circ2d2TanOn::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame2(Index) == 0) { return Standard_False; }
return Standard_True;
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
}
else if (Qualified1.IsUnqualified()) { ok = Standard_True; }
else {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
if (ok) {
}
else if (Qualified2.IsUnqualified()) { WellDone = Standard_False; }
else {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
}
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
TColStd_Array1OfReal Radius(1,2);
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol= Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Radius=0;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Lin2d L1(Qualified1.Qualified());
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Boolean invers = Standard_False;
gp_Pnt2d center1(C1.Location());
gp_Pnt2d center2(C2.Location());
gp_Pnt2d center3;
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else if ( C(2).Location().IsEqual(C(1).Location(),Precision::Confusion())){
WellDone = Standard_True;
}
gp_Circ2d GccAna_Circ2d2TanRad::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = gp_Pnt2d(pnttg1sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame2(Index) == 0) {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
PntSol = gp_Pnt2d(pnttg2sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Boolean GccAna_Circ2d2TanRad::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
Standard_Boolean GccAna_Circ2d2TanRad::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame2(Index) == 0) { return Standard_False; }
return Standard_True;
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsOutside() ||
Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer i ;
Standard_Real dist = Radius*2.0 + R1;
Standard_Real distance = L2.Distance(center1);
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if ( distance-dist >Tol) { WellDone = Standard_True; }
else if (Qualified1.IsEnclosed()) {
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer i ;
Standard_Real dispc1 = C1.Distance(Point2);
gp_Dir2d dir1(Point2.XY()-(C1.Location().XY()));
gp_Pnt2d center1(C1.Location());
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if ( dispc1-Radius*2.0 > Tol) { WellDone = Standard_True; }
else if (Qualified1.IsEnclosed()) {
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() ||
Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer nbsol = 0;
Standard_Real cxloc = Point2.X();
Standard_Real cyloc = Point2.Y();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if ( displ1-Radius*2.0 > Tol) { WellDone = Standard_True; }
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Lin2d L1 = Qualified1.Qualified();
gp_Pnt2d origin2(lx2loc,ly2loc);
gp_Dir2d normL1(x1dir,y1dir);
gp_Dir2d normL2(x2dir,y2dir);
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (L1.Direction().IsParallel(L2.Direction(),Precision::Angular())) {
WellDone = Standard_True;
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
WellDone = Standard_False;
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Point1.Distance(Point2)-Radius*2.0 > Tol) { WellDone = Standard_True; }
else {
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
ThisSolution (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return cirsol(Index);
}
GccEnt_Position& Qualif2 ,
GccEnt_Position& Qualif3 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const {
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
if (TheSame1(Index) == 0) {
ParArg = pararg1(Index);
PntSol = gp_Pnt2d(pnttg1sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
if (TheSame2(Index) == 0) {
ParArg = pararg2(Index);
PntSol = gp_Pnt2d(pnttg2sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
if (TheSame3(Index) == 0) {
ParArg = pararg3(Index);
PntSol = gp_Pnt2d(pnttg3sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
IsTheSame1 (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (TheSame1(Index) == 0)
return Standard_False;
IsTheSame2 (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (TheSame2(Index) == 0)
return Standard_False;
IsTheSame3 (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (TheSame3(Index) == 0)
return Standard_False;
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = 1.e-14;
Handle(GccInt_Bisec) bissol;
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 || Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 || Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Standard_Real xcencir1 = circle1.Location().X();
Standard_Real ycencir1 = circle1.Location().Y();
Standard_Integer GccAna_Circ2dBisec::NbSolutions () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return NbrSol;
}
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.0,0.0);
gp_Circ2d GccAna_Circ2dTanCen::
ThisSolution (const Standard_Integer Index) const
{
- if (Index > NbrSol || Index <= 0) { Standard_OutOfRange::Raise(); }
+ if (Index > NbrSol || Index <= 0) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
PntSol = gp_Pnt2d(pnttg1sol(Index));
ParSol = par1sol(Index);
ParArg = pararg1(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
IsTheSame1 (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (TheSame1(Index) == 0)
return Standard_False;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
TColStd_Array1OfReal Coef(1,2);
gp_Circ2d C1 = Qualified1.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
Standard_Integer nbsol = 0;
Standard_Integer signe = 0;
gp_Circ2d GccAna_Circ2dTanOnRad::ThisSolution (const Standard_Integer Index) const
{
if (Index > NbrSol || Index <= 0) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return cirsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
ParSol = par1sol(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
ParArg = parcen3(Index);
Standard_Boolean GccAna_Circ2dTanOnRad::IsTheSame1 (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 ||Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (TheSame1(Index) == 0)
return Standard_False;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer nbsol = 0;
gp_Dir2d dir1(L1.Direction());
gp_Dir2d normL1(-dir1.Y(),dir1.X());
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else if ((OnLine.Direction()).IsParallel(dir1,Tol)) {
WellDone = Standard_True;
}
NbrSol = 0;
Standard_Real dp1lin = OnLine.Distance(Point1);
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (dp1lin > Radius+Tol) { WellDone = Standard_True; }
Standard_Real xc;
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
TColgp_Array1OfPnt2d Center(1,4);
TColgp_Array1OfDir2d dir1on(1,4);
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
Standard_Real R1 = C1.Radius();
Standard_Real R2 = OnCirc.Radius();
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
// Processing. +
//=========================================================================
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
L1 = Qualified1.Qualified();
if ((dist1-Radius>Tol) || (Tol<Radius-dist2)) { WellDone=Standard_True; }
Standard_Real dist1 = Point1.Distance(OnCirc.Location())-Roncirc;
Standard_Real dist2 = Point1.Distance(OnCirc.Location())+Roncirc;
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else if ((dist1-Radius > Tol) || (Tol < Radius-dist2)) {
WellDone = Standard_True;
}
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
- if ((Index <=0) || (Index > NbrSol)) Standard_OutOfRange::Raise();
+ if ((Index <=0) || (Index > NbrSol)) throw Standard_OutOfRange();
Handle(GccInt_Bisec) bissol;
Standard_Real xdir = line.Direction().X();
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if ((Index <=0) || (Index > NbrSol))
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
Handle(GccInt_Bisec) bissol;
Standard_Real xpoint = point.X();
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real R1 = C1.Radius();
- if (Qualified1.IsEnclosed()) { GccEnt_BadQualifier::Raise(); }
+ if (Qualified1.IsEnclosed()) { throw GccEnt_BadQualifier(); }
// ============================
else if (Tol < R1-ThePoint.Distance(C1.Location())) {
WellDone = Standard_True;
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
if (Qualified1.IsEnclosed() || Qualified2.IsEnclosed()) {
// =======================================================
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else {
Standard_Real R1 = C1.Radius();
gp_Lin2d GccAna_Lin2d2Tan::
ThisSolution (const Standard_Integer Index) const {
- if (Index > NbrSol || Index <= 0) { Standard_OutOfRange::Raise(); }
+ if (Index > NbrSol || Index <= 0) { throw Standard_OutOfRange(); }
return linsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
NbSolutions () const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return NbrSol;
}
ThisSolution (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 || Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return linsol(Index);
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Cosa = TheLine.Direction().X();
Standard_Real Sina = TheLine.Direction().Y();
if (Qualified1.IsEnclosed()) {
// ============================
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else {
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Integer GccAna_Lin2dTanObl::
NbSolutions () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return NbrSol;
}
ThisSolution (const Standard_Integer Index) const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
if (Index <= 0 || Index > NbrSol)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return linsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
Standard_Real xdir = (Lin1.Direction()).X();
Standard_Real ydir = (Lin1.Direction()).Y();
- if (Qualified1.IsEnclosed()) { GccEnt_BadQualifier::Raise(); }
+ if (Qualified1.IsEnclosed()) { throw GccEnt_BadQualifier(); }
// ============================
else if (Qualified1.IsEnclosing()) {
// ==================================
Standard_Integer GccAna_Lin2dTanPar::NbSolutions () const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return NbrSol;
}
gp_Lin2d GccAna_Lin2dTanPar::ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 || Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 || Index > NbrSol) { throw Standard_OutOfRange(); }
return linsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& Pnt) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
if (Qualified1.IsEnclosed()) {
// ============================
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else if (Qualified1.IsEnclosing()) {
// ==================================
if (Qualified1.IsEnclosed()) {
// ============================
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else if (Qualified1.IsEnclosing()) {
// ==================================
Standard_Integer GccAna_Lin2dTanPer::
NbSolutions () const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
return NbrSol;
}
gp_Lin2d GccAna_Lin2dTanPer::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 || Index > NbrSol) { Standard_RangeError::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 || Index > NbrSol) { throw Standard_RangeError(); }
return linsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& Pnt) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
ThisSolution () const
{
if (!WellDone)
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
return bissol;
}
#if !defined No_Exception && !defined No_GccAna_NoSolution
#define GccAna_NoSolution_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) GccAna_NoSolution::Raise(MESSAGE);
+ if (CONDITION) throw GccAna_NoSolution(MESSAGE);
#else
#define GccAna_NoSolution_Raise_if(CONDITION, MESSAGE)
#endif
gp_Lin2d GccAna_Pnt2dBisec::
ThisSolution () const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (!HasSol) { GccAna_NoSolution::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (!HasSol) { throw GccAna_NoSolution(); }
return linsol;
}
#if !defined No_Exception && !defined No_GccEnt_BadQualifier
#define GccEnt_BadQualifier_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) GccEnt_BadQualifier::Raise(MESSAGE);
+ if (CONDITION) throw GccEnt_BadQualifier(MESSAGE);
#else
#define GccEnt_BadQualifier_Raise_if(CONDITION, MESSAGE)
#endif
gp_Circ2d GccInt_Bisec::
Circle() const {
- Standard_NotImplemented::Raise();
- return gp_Circ2d();
+ throw Standard_NotImplemented();
}
gp_Elips2d GccInt_Bisec::
Ellipse() const {
- Standard_NotImplemented::Raise();
- return gp_Elips2d();
+ throw Standard_NotImplemented();
}
gp_Hypr2d GccInt_Bisec::
Hyperbola() const {
- Standard_NotImplemented::Raise();
- return gp_Hypr2d();
+ throw Standard_NotImplemented();
}
gp_Lin2d GccInt_Bisec::
Line() const {
- Standard_NotImplemented::Raise();
- return gp_Lin2d();
+ throw Standard_NotImplemented();
}
gp_Parab2d GccInt_Bisec::
Parabola() const {
- Standard_NotImplemented::Raise();
- return gp_Parab2d();
+ throw Standard_NotImplemented();
}
gp_Pnt2d GccInt_Bisec::
Point() const {
- Standard_NotImplemented::Raise();
- return gp_Pnt2d();
+ throw Standard_NotImplemented();
}
const Standard_Boolean Periodic)
{
if (Degree < 1 || Degree > Geom_BSplineCurve::MaxDegree()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
- if (CPoles.Length() < 2) Standard_ConstructionError::Raise();
- if (CKnots.Length() != CMults.Length()) Standard_ConstructionError::Raise();
+ if (CPoles.Length() < 2) throw Standard_ConstructionError();
+ if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError();
for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) {
if (CKnots (I+1) - CKnots (I) <= Epsilon (Abs(CKnots (I)))) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (CPoles.Length() != BSplCLib::NbPoles(Degree,Periodic,CMults))
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
//=======================================================================
Periodic);
if (Weights.Length() != Poles.Length())
- Standard_ConstructionError::Raise("Geom_BSplineCurve");
+ throw Standard_ConstructionError("Geom_BSplineCurve");
Standard_Integer i;
for (i = Weights.Lower(); i <= Weights.Upper(); i++) {
if (Weights(i) <= gp::Resolution())
- Standard_ConstructionError::Raise("Geom_BSplineCurve");
+ throw Standard_ConstructionError("Geom_BSplineCurve");
}
// check really rational
if (Degree == deg) return;
if (Degree < deg || Degree > Geom_BSplineCurve::MaxDegree()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer FromK1 = FirstUKnotIndex ();
Standard_Integer ToK2 = LastUKnotIndex ();
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
- Standard_ConstructionError::Raise("Geom_BSplineCurve::InsertKnots");
+ throw Standard_ConstructionError("Geom_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return;
Standard_Integer I2 = LastUKnotIndex ();
if ( !periodic && (Index <= I1 || Index >= I2) ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else if ( periodic && (Index < I1 || Index > I2)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
const TColgp_Array1OfPnt & oldpoles = poles->Array1();
const Standard_Real U2)
{
if (U2 < U1)
- Standard_DomainError::Raise("Geom_BSplineCurve::Segment");
+ throw Standard_DomainError("Geom_BSplineCurve::Segment");
Standard_Real NewU1, NewU2;
Standard_Real U,DU=0,aDDU=0;
Standard_Real Period = LastParameter() - FirstParameter();
DU = U2 - U1;
if (DU - Period > Precision::PConfusion())
- Standard_DomainError::Raise("Geom_BSplineCurve::Segment");
+ throw Standard_DomainError("Geom_BSplineCurve::Segment");
if (DU > Period)
DU = Period;
aDDU = DU;
(const Standard_Integer Index,
const Standard_Real K)
{
- if (Index < 1 || Index > knots->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange();
Standard_Real DK = Abs(Epsilon (K));
if (Index == 1) {
- if (K >= knots->Value(2) - DK) Standard_ConstructionError::Raise();
+ if (K >= knots->Value(2) - DK) throw Standard_ConstructionError();
}
else if (Index == knots->Length()) {
if (K <= knots->Value (knots->Length()-1) + DK) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
else {
if (K <= knots->Value(Index-1) + DK ||
K >= knots->Value(Index+1) - DK ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (K != knots->Value (Index)) {
void Geom_BSplineCurve::SetOrigin(const Standard_Integer Index)
{
if (!periodic)
- Standard_NoSuchObject::Raise("Geom_BSplineCurve::SetOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineCurve::SetOrigin");
Standard_Integer i,k;
Standard_Integer first = FirstUKnotIndex();
Standard_Integer last = LastUKnotIndex();
if ((Index < first) || (Index > last))
- Standard_DomainError::Raise("Geom_BSplineCurve::SetOrigin");
+ throw Standard_DomainError("Geom_BSplineCurve::SetOrigin");
Standard_Integer nbknots = knots->Length();
Standard_Integer nbpoles = poles->Length();
const Standard_Real Tol)
{
if (!periodic)
- Standard_NoSuchObject::Raise("Geom_BSplineCurve::SetOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineCurve::SetOrigin");
//U est il dans la period.
Standard_Real uf = FirstParameter(), ul = LastParameter();
Standard_Real u = U, period = ul - uf;
(const Standard_Integer Index,
const gp_Pnt& P)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
poles->SetValue (Index, P);
maxderivinvok = 0;
}
(const Standard_Integer Index,
const Standard_Real W)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
- if (W <= gp::Resolution ()) Standard_ConstructionError::Raise();
+ if (W <= gp::Resolution ()) throw Standard_ConstructionError();
Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution());
{
if (Index1 < 1 || Index1 > poles->Length() ||
Index2 < 1 || Index2 > poles->Length() || Index1 > Index2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array1OfPnt npoles(1, poles->Length());
gp_Pnt P0;
{
if (UDegree < 1 || UDegree > Geom_BSplineSurface::MaxDegree () ||
VDegree < 1 || VDegree > Geom_BSplineSurface::MaxDegree ()) {
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
if (SPoles.ColLength () < 2 || SPoles.RowLength () < 2) {
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
if (SUKnots.Length() != SUMults.Length() ||
SVKnots.Length() != SVMults.Length()) {
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
Standard_Integer i;
for (i = SUKnots.Lower(); i < SUKnots.Upper(); i++) {
if (SUKnots(i+1) - SUKnots(i) <= Epsilon(Abs(SUKnots(i)))) {
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
}
for (i = SVKnots.Lower(); i < SVKnots.Upper(); i++) {
if (SVKnots(i+1) - SVKnots(i) <= Epsilon(Abs(SVKnots(i)))) {
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
}
if (SPoles.ColLength() != BSplCLib::NbPoles(UDegree,UPeriodic,SUMults))
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
if (SPoles.RowLength() != BSplCLib::NbPoles(VDegree,VPeriodic,SVMults))
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
//=======================================================================
// check weights
if (Weights.ColLength() != Poles.ColLength())
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
if (Weights.RowLength() != Poles.RowLength())
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
Standard_Integer i,j;
for (i = Weights.LowerRow(); i <= Weights.UpperRow(); i++) {
for (j = Weights.LowerCol(); j <= Weights.UpperCol(); j++) {
if (Weights(i,j) <= gp::Resolution())
- Standard_ConstructionError::Raise("Geom_BSplineSurface");
+ throw Standard_ConstructionError("Geom_BSplineSurface");
}
}
{
if (UDegree != udeg) {
if ( UDegree < udeg || UDegree > Geom_BSplineSurface::MaxDegree())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Standard_Integer FromK1 = FirstUKnotIndex();
Standard_Integer ToK2 = LastUKnotIndex();
if (VDegree != vdeg) {
if ( VDegree < vdeg || VDegree > Geom_BSplineSurface::MaxDegree())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Standard_Integer FromK1 = FirstVKnotIndex();
Standard_Integer ToK2 = LastVKnotIndex();
const Standard_Real V2)
{
if ((U2 < U1) || (V2 < V1))
- Standard_DomainError::Raise("Geom_BSplineSurface::Segment");
+ throw Standard_DomainError("Geom_BSplineSurface::Segment");
Standard_Real deltaU = Max(Abs(U2),Abs(U1));
Standard_Real EpsU = Epsilon(deltaU);
deltaU = U2 - U1;
if (uperiodic) {
Standard_Real aUPeriod = uknots->Last() - uknots->First();
if (deltaU - aUPeriod > Precision::PConfusion())
- Standard_DomainError::Raise("Geom_BSplineSurface::Segment");
+ throw Standard_DomainError("Geom_BSplineSurface::Segment");
if (deltaU > aUPeriod)
deltaU = aUPeriod;
}
if (vperiodic) {
Standard_Real aVPeriod = vknots->Last() - vknots->First();
if (deltaV - aVPeriod > Precision::PConfusion())
- Standard_DomainError::Raise("Geom_BSplineSurface::Segment");
+ throw Standard_DomainError("Geom_BSplineSurface::Segment");
if (deltaV > aVPeriod)
deltaV = aVPeriod;
}
{
if ((U2 < U1) || (V2 < V1))
- Standard_DomainError::Raise("Geom_BSplineSurface::CheckAndSegment");
+ throw Standard_DomainError("Geom_BSplineSurface::CheckAndSegment");
Standard_Real deltaU = Max(Abs(U2),Abs(U1));
Standard_Real EpsU = Epsilon(deltaU);
deltaU = U2 - U1;
if (uperiodic) {
Standard_Real aUPeriod = uknots->Last() - uknots->First();
if (deltaU - aUPeriod > Precision::PConfusion())
- Standard_DomainError::Raise("Geom_BSplineSurface::CheckAndSegment");
+ throw Standard_DomainError("Geom_BSplineSurface::CheckAndSegment");
if (deltaU > aUPeriod)
deltaU = aUPeriod;
}
if (vperiodic) {
Standard_Real aVPeriod = vknots->Last() - vknots->First();
if (deltaV - aVPeriod > Precision::PConfusion())
- Standard_DomainError::Raise("Geom_BSplineSurface::CheckAndSegment");
+ throw Standard_DomainError("Geom_BSplineSurface::CheckAndSegment");
if (deltaV > aVPeriod)
deltaV = aVPeriod;
}
(const Standard_Integer UIndex,
const Standard_Real K )
{
- if (UIndex < 1 || UIndex > uknots->Length()) Standard_OutOfRange::Raise();
+ if (UIndex < 1 || UIndex > uknots->Length()) throw Standard_OutOfRange();
Standard_Integer NewIndex = UIndex;
Standard_Real DU = Abs(Epsilon (K));
if (UIndex == 1) {
- if (K >= uknots->Value (2) - DU) Standard_ConstructionError::Raise();
+ if (K >= uknots->Value (2) - DU) throw Standard_ConstructionError();
}
else if (UIndex == uknots->Length()) {
if (K <= uknots->Value (uknots->Length()-1) + DU) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
else {
if (K <= uknots->Value (NewIndex-1) + DU ||
K >= uknots->Value (NewIndex+1) - DU ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
Standard_Integer Upper = UK.Upper();
if (Lower < 1 || Lower > uknots->Length() ||
Upper < 1 || Upper > uknots->Length() ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (Lower > 1) {
if (Abs (UK (Lower) - uknots->Value (Lower-1)) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Upper < uknots->Length ()) {
if (Abs (UK (Upper) - uknots->Value (Upper+1)) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
Standard_Real K1 = UK (Lower);
uknots->SetValue (i, UK(i));
if (i != Lower) {
if (Abs (UK(i) - K1) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
K1 = UK (i);
}
(const Standard_Integer VIndex,
const Standard_Real K)
{
- if (VIndex < 1 || VIndex > vknots->Length()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > vknots->Length()) throw Standard_OutOfRange();
Standard_Integer NewIndex = VIndex + vknots->Lower() - 1;
Standard_Real DV = Abs(Epsilon (K));
if (VIndex == 1) {
if (K >= vknots->Value (2) - DV) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
else if (VIndex == vknots->Length()) {
if (K <= vknots->Value (vknots->Length()-1) + DV) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
else {
if (K <= vknots->Value (NewIndex-1) + DV ||
K >= vknots->Value (NewIndex+1) - DV ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
Standard_Integer Upper = VK.Upper();
if (Lower < 1 || Lower > vknots->Length() ||
Upper < 1 || Upper > vknots->Length() ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (Lower > 1) {
if (Abs (VK (Lower) - vknots->Value (Lower-1)) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Upper < vknots->Length ()) {
if (Abs (VK (Upper) - vknots->Value (Upper+1)) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
Standard_Real K1 = VK (Lower);
vknots->SetValue (i, VK(i));
if (i != Lower) {
if (Abs (VK(i) - K1) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
K1 = VK (i);
}
Period = aMaxVal - aMinVal;
if(Period <= eps)
- Standard_OutOfRange::Raise("Geom_BSplineSurface::PeriodicNormalization: Uparameter is too great number");
+ throw Standard_OutOfRange("Geom_BSplineSurface::PeriodicNormalization: Uparameter is too great number");
Standard_Boolean isLess, isGreater;
isLess = aMinVal - Uparameter > 0;
Period = aMaxVal - aMinVal;
if(Period <= eps)
- Standard_OutOfRange::Raise("Geom_BSplineSurface::PeriodicNormalization: Vparameter is too great number");
+ throw Standard_OutOfRange("Geom_BSplineSurface::PeriodicNormalization: Vparameter is too great number");
Standard_Boolean isLess, isGreater;
isLess = aMinVal - Vparameter > 0;
const Standard_Integer VIndex,
const Standard_Real Weight)
{
- if (Weight <= gp::Resolution()) Standard_ConstructionError::Raise();
+ if (Weight <= gp::Resolution()) throw Standard_ConstructionError();
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (UIndex < 1 || UIndex > Weights.ColLength() ||
VIndex < 1 || VIndex > Weights.RowLength() ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Weights (UIndex+Weights.LowerRow()-1, VIndex+Weights.LowerCol()-1) = Weight;
Rational(Weights, urational, vrational);
{
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (VIndex < 1 || VIndex > Weights.RowLength()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (CPoleWeights.Lower() < 1 ||
CPoleWeights.Lower() > Weights.ColLength() ||
CPoleWeights.Upper() < 1 ||
CPoleWeights.Upper() > Weights.ColLength() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Weights (I+Weights.LowerRow()-1, VIndex+Weights.LowerCol()-1) =
CPoleWeights (I);
{
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (UIndex < 1 || UIndex > Weights.ColLength()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (CPoleWeights.Lower() < 1 ||
CPoleWeights.Lower() > Weights.RowLength() ||
CPoleWeights.Upper() < 1 ||
CPoleWeights.Upper() > Weights.RowLength() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I)<=gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Weights (UIndex+Weights.LowerRow()-1, I+Weights.LowerCol()-1) =
CPoleWeights (I);
void Geom_BSplineSurface::SetUOrigin(const Standard_Integer Index)
{
if (!uperiodic)
- Standard_NoSuchObject::Raise("Geom_BSplineSurface::SetUOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineSurface::SetUOrigin");
Standard_Integer i,j,k;
Standard_Integer first = FirstUKnotIndex();
Standard_Integer last = LastUKnotIndex();
if ((Index < first) || (Index > last))
- Standard_DomainError::Raise("Geom_BSplineCurve::SetUOrigin");
+ throw Standard_DomainError("Geom_BSplineCurve::SetUOrigin");
Standard_Integer nbknots = uknots->Length();
Standard_Integer nbpoles = poles->ColLength();
void Geom_BSplineSurface::SetVOrigin(const Standard_Integer Index)
{
if (!vperiodic)
- Standard_NoSuchObject::Raise("Geom_BSplineSurface::SetVOrigin");
+ throw Standard_NoSuchObject("Geom_BSplineSurface::SetVOrigin");
Standard_Integer i,j,k;
Standard_Integer first = FirstVKnotIndex();
Standard_Integer last = LastVKnotIndex();
if ((Index < first) || (Index > last))
- Standard_DomainError::Raise("Geom_BSplineCurve::SetVOrigin");
+ throw Standard_DomainError("Geom_BSplineCurve::SetVOrigin");
Standard_Integer nbknots = vknots->Length();
Standard_Integer nbpoles = poles->RowLength();
const TColgp_Array1OfPnt& CPoles)
{
if (VIndex < 1 || VIndex > poles->RowLength()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (CPoles.Lower() < 1 || CPoles.Lower() > poles->ColLength() ||
CPoles.Upper() < 1 || CPoles.Upper() > poles->ColLength()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
const TColgp_Array1OfPnt& CPoles)
{
if (UIndex < 1 || UIndex > poles->ColLength() ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
if (CPoles.Lower() < 1 || CPoles.Lower() > poles->RowLength() ||
CPoles.Upper() < 1 || CPoles.Upper() > poles->RowLength() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
UIndex2 < 1 || UIndex2 > poles->UpperRow() || UIndex1 > UIndex2 ||
VIndex1 < 1 || VIndex1 > poles->UpperCol() ||
VIndex2 < 1 || VIndex2 > poles->UpperCol() || VIndex1 > VIndex2) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
TColgp_Array2OfPnt npoles(1, poles->UpperRow(), 1, poles->UpperCol());
uknots->Array1(),umults->Array1(),
Knots,&Mults,nbpoles,nbknots,
ParametricTolerance,Add))
- Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertUKnots");
+ throw Standard_ConstructionError("Geom_BSplineSurface::InsertUKnots");
if ( nbpoles == poles->ColLength()) return;
vknots->Array1(),vmults->Array1(),
Knots,&Mults,nbpoles,nbknots,
ParametricTolerance, Add))
- Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertVKnots");
+ throw Standard_ConstructionError("Geom_BSplineSurface::InsertVKnots");
if ( nbpoles == poles->RowLength()) return;
Standard_Integer I2 = LastUKnotIndex ();
if ( !uperiodic && (Index <= I1 || Index >= I2) ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else if ( uperiodic && (Index < I1 || Index > I2)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
const TColgp_Array2OfPnt & oldpoles = poles->Array2();
Standard_Integer I2 = LastVKnotIndex ();
if ( !vperiodic && (Index <= I1 || Index >= I2) ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else if ( vperiodic && (Index < I1 || Index > I2)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
const TColgp_Array2OfPnt & oldpoles = poles->Array2();
{
Standard_Integer nbpoles = Poles.Length();
if(nbpoles < 2 || nbpoles > (Geom_BezierCurve::MaxDegree() + 1))
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
// copy the poles
Handle(TColgp_HArray1OfPnt) npoles =
new TColgp_HArray1OfPnt(1,nbpoles);
// copy the poles
Standard_Integer nbpoles = Poles.Length();
if(nbpoles < 2 || nbpoles > (Geom_BezierCurve::MaxDegree() + 1))
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Handle(TColgp_HArray1OfPnt) npoles =
new TColgp_HArray1OfPnt(1,nbpoles);
// check the weights
if (Weights.Length() != nbpoles)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Standard_Integer i;
for (i = 1; i <= nbpoles; i++) {
if (Weights(i) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if(Deg < Degree() ||
Deg > Geom_BezierCurve::MaxDegree())
- Standard_ConstructionError::Raise("Geom_BezierCurve::Increase");
+ throw Standard_ConstructionError("Geom_BezierCurve::Increase");
Handle(TColgp_HArray1OfPnt) npoles =
new TColgp_HArray1OfPnt(1,Deg+1);
if(nbpoles >= Geom_BezierCurve::MaxDegree() ||
Weight <= gp::Resolution())
- Standard_ConstructionError::Raise("Geom_BezierCurve::InsertPoleAfter");
+ throw Standard_ConstructionError("Geom_BezierCurve::InsertPoleAfter");
if(Index < 0 || Index > nbpoles)
- Standard_OutOfRange::Raise("Geom_BezierCurve::InsertPoleAfter");
+ throw Standard_OutOfRange("Geom_BezierCurve::InsertPoleAfter");
Standard_Integer i;
Standard_Integer nbpoles = NbPoles();
if(nbpoles <= 2)
- Standard_ConstructionError::Raise("Geom_BezierCurve::RemovePole");
+ throw Standard_ConstructionError("Geom_BezierCurve::RemovePole");
if(Index < 1 || Index > nbpoles)
- Standard_OutOfRange::Raise("Geom_BezierCurve::RemovePole");
+ throw Standard_OutOfRange("Geom_BezierCurve::RemovePole");
Standard_Integer i;
const gp_Pnt& P)
{
if(Index < 1 || Index > NbPoles())
- Standard_OutOfRange::Raise("Geom_BezierCurve::SetPole");
+ throw Standard_OutOfRange("Geom_BezierCurve::SetPole");
TColgp_Array1OfPnt& cpoles = poles->ChangeArray1();
cpoles(Index) = P;
Standard_Integer nbpoles = NbPoles();
if(Index < 1 || Index > nbpoles)
- Standard_OutOfRange::Raise("Geom_BezierCurve::SetWeight");
+ throw Standard_OutOfRange("Geom_BezierCurve::SetWeight");
if(Weight <= gp::Resolution ())
- Standard_ConstructionError::Raise("Geom_BezierCurve::SetWeight");
+ throw Standard_ConstructionError("Geom_BezierCurve::SetWeight");
// compute new rationality
Standard_Boolean wasrat = IsRational();
const Standard_Integer N) const
{
if(N < 1)
- Standard_RangeError::Raise("Geom_BezierCurve::DN");
+ throw Standard_RangeError("Geom_BezierCurve::DN");
gp_Vec V;
TColStd_Array1OfReal bidknots(1,2); bidknots(1) = 0.; bidknots(2) = 1.;
const gp_Pnt& Geom_BezierCurve::Pole (const Standard_Integer Index) const
{
if(Index < 1 || Index > poles->Length())
- Standard_OutOfRange::Raise("Geom_BezierCurve::Pole");
+ throw Standard_OutOfRange("Geom_BezierCurve::Pole");
return poles->Value(Index);
}
void Geom_BezierCurve::Poles (TColgp_Array1OfPnt& P) const
{
if(P.Length() != poles->Length())
- Standard_DimensionError::Raise("Geom_BezierCurve::Poles");
+ throw Standard_DimensionError("Geom_BezierCurve::Poles");
P = poles->Array1();
}
(const Standard_Integer Index) const
{
if(Index < 1 || Index > poles->Length())
- Standard_OutOfRange::Raise("Geom_BezierCurve::Weight");
+ throw Standard_OutOfRange("Geom_BezierCurve::Weight");
if (IsRational())
return weights->Value(Index);
else
Standard_Integer nbpoles = NbPoles();
if(W.Length() != nbpoles)
- Standard_DimensionError::Raise("Geom_BezierCurve::Weights");
+ throw Standard_DimensionError("Geom_BezierCurve::Weights");
if (IsRational())
W = weights->Array1();
else {
Standard_Integer NbVPoles = SurfacePoles.RowLength();
if (NbUPoles < 2 || NbUPoles > MaxDegree()+1 ||
NbVPoles < 2 || NbVPoles > MaxDegree()+1) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Handle(TColgp_HArray2OfPnt) npoles =
NbVPoles < 2 || NbVPoles > MaxDegree()+1 ||
NbVPoles != PoleWeights.RowLength() ||
NbUPoles != PoleWeights.ColLength() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer Row = PoleWeights.LowerRow();
Row = PoleWeights.LowerRow();
while (Row <= PoleWeights.UpperRow()) {
if (PoleWeights(Row, Col) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Row++;
}
{
if (UDeg < UDegree() || UDeg > Geom_BezierSurface::MaxDegree() ||
VDeg < VDegree() || VDeg > Geom_BezierSurface::MaxDegree() ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer oldUDeg = UDegree();
const TColgp_Array1OfPnt& CPoles)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (VIndex < 1 || VIndex > Poles.RowLength()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > Poles.RowLength()) throw Standard_OutOfRange();
if (CPoles.Length() != Poles.ColLength()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Handle(TColgp_HArray2OfPnt) npoles =
const TColStd_Array1OfReal& CPoleWeights)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (VIndex < 1 || VIndex > Poles.RowLength()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > Poles.RowLength()) throw Standard_OutOfRange();
if (CPoles.Length() != Poles.ColLength() ||
CPoleWeights.Length() != CPoles.Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer Index = CPoleWeights.Lower();
while (Index <= CPoleWeights.Upper()) {
if (CPoleWeights (Index) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Index++;
}
const TColgp_Array1OfPnt& CPoles)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (UIndex < 1 || UIndex > Poles.ColLength()) Standard_OutOfRange::Raise();
+ if (UIndex < 1 || UIndex > Poles.ColLength()) throw Standard_OutOfRange();
if (CPoles.Length() != Poles.RowLength()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Handle(TColgp_HArray2OfPnt) npoles =
const TColStd_Array1OfReal& CPoleWeights)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (UIndex < 1 || UIndex > Poles.ColLength()) Standard_OutOfRange::Raise();
+ if (UIndex < 1 || UIndex > Poles.ColLength()) throw Standard_OutOfRange();
if (CPoles.Length() != Poles.RowLength() ||
CPoleWeights.Length() != CPoles.Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer Index = CPoleWeights.Lower();
while (Index <= CPoleWeights.Upper()) {
if (CPoleWeights(Index) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Index++;
}
void Geom_BezierSurface::RemovePoleCol (const Standard_Integer VIndex)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (VIndex < 1 || VIndex > Poles.RowLength()) Standard_OutOfRange::Raise();
- if (Poles.RowLength() <= 2) Standard_ConstructionError::Raise();
+ if (VIndex < 1 || VIndex > Poles.RowLength()) throw Standard_OutOfRange();
+ if (Poles.RowLength() <= 2) throw Standard_ConstructionError();
Handle(TColgp_HArray2OfPnt) npoles =
new TColgp_HArray2OfPnt(1,poles->ColLength(),1,poles->RowLength()-1);
void Geom_BezierSurface::RemovePoleRow (const Standard_Integer UIndex)
{
const TColgp_Array2OfPnt & Poles = poles->Array2();
- if (UIndex < 1 || UIndex > Poles.ColLength()) Standard_OutOfRange::Raise();
- if (Poles.ColLength() <= 2) Standard_ConstructionError::Raise();
+ if (UIndex < 1 || UIndex > Poles.ColLength()) throw Standard_OutOfRange();
+ if (Poles.ColLength() <= 2) throw Standard_ConstructionError();
Handle(TColgp_HArray2OfPnt) npoles =
new TColgp_HArray2OfPnt(1,poles->ColLength()-1,1,poles->RowLength());
if (UIndex < 1 ||
UIndex > Poles.ColLength() ||
VIndex < 1 ||
- VIndex > Poles.RowLength() ) Standard_OutOfRange::Raise();
+ VIndex > Poles.RowLength() ) throw Standard_OutOfRange();
Poles (UIndex, VIndex) = P;
}
{
if (Weight <= gp::Resolution())
- Standard_ConstructionError::Raise("Geom_BezierSurface::SetPole");
+ throw Standard_ConstructionError("Geom_BezierSurface::SetPole");
if (UIndex < 1 ||
UIndex > poles->ColLength() ||
VIndex < 1 ||
VIndex > poles->RowLength())
- Standard_OutOfRange::Raise("Geom_BezierSurface::SetPole");
+ throw Standard_OutOfRange("Geom_BezierSurface::SetPole");
poles->SetValue(UIndex, VIndex, P);
const TColStd_Array1OfReal& CPoleWeights)
{
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
- if (VIndex < 1 || VIndex > Poles.RowLength()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > Poles.RowLength()) throw Standard_OutOfRange();
if (CPoles.Lower() < 1 ||
CPoles.Lower() > Poles.ColLength() ||
CPoles.Upper() > Poles.ColLength() ||
CPoleWeights.Lower() != CPoles.Lower() ||
CPoleWeights.Upper() != CPoles.Upper()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer I;
const TColgp_Array1OfPnt& CPoles)
{
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
- if (VIndex < 1 || VIndex > Poles.RowLength()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > Poles.RowLength()) throw Standard_OutOfRange();
if (CPoles.Lower() < 1 ||
CPoles.Lower() > Poles.ColLength() ||
CPoles.Upper() < 1 ||
CPoles.Upper() > Poles.ColLength()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (Standard_Integer I = CPoles.Lower(); I <= CPoles.Upper(); I++) {
Poles (I, VIndex) = CPoles (I);
const TColgp_Array1OfPnt& CPoles)
{
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
- if (UIndex < 1 || UIndex > Poles.ColLength()) Standard_OutOfRange::Raise();
+ if (UIndex < 1 || UIndex > Poles.ColLength()) throw Standard_OutOfRange();
if (CPoles.Lower() < 1 ||
CPoles.Lower() > Poles.RowLength() ||
CPoles.Upper() < 1 ||
- CPoles.Upper() > Poles.RowLength()) Standard_ConstructionError::Raise();
+ CPoles.Upper() > Poles.RowLength()) throw Standard_ConstructionError();
for (Standard_Integer I = CPoles.Lower(); I <= CPoles.Upper(); I++) {
Poles (UIndex, I) = CPoles (I);
const TColStd_Array1OfReal& CPoleWeights)
{
TColgp_Array2OfPnt & Poles = poles->ChangeArray2();
- if (UIndex < 1 || UIndex > Poles.ColLength()) Standard_OutOfRange::Raise();
+ if (UIndex < 1 || UIndex > Poles.ColLength()) throw Standard_OutOfRange();
if (CPoles.Lower() < 1 ||
CPoles.Lower() > Poles.RowLength() ||
CPoles.Upper() > Poles.RowLength() ||
CPoleWeights.Lower() != CPoles.Lower() ||
CPoleWeights.Upper() != CPoles.Upper()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer I;
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (Weight <= gp::Resolution())
- Standard_ConstructionError::Raise("Geom_BezierSurface::SetWeight");
+ throw Standard_ConstructionError("Geom_BezierSurface::SetWeight");
if (UIndex < 1 ||
UIndex > Weights.ColLength() ||
VIndex < 1 ||
- VIndex > Weights.RowLength()) Standard_OutOfRange::Raise();
+ VIndex > Weights.RowLength()) throw Standard_OutOfRange();
if (Abs (Weight - Weights (UIndex, VIndex)) > gp::Resolution()) {
Weights (UIndex, VIndex) = Weight;
}
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
- if (VIndex < 1 || VIndex > Weights.RowLength()) Standard_OutOfRange::Raise();
+ if (VIndex < 1 || VIndex > Weights.RowLength()) throw Standard_OutOfRange();
if (CPoleWeights.Length() != Weights.ColLength()) {
- Standard_ConstructionError::Raise("Geom_BezierSurface::SetWeightCol");
+ throw Standard_ConstructionError("Geom_BezierSurface::SetWeightCol");
}
I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Weights (I, VIndex) = CPoleWeights (I);
I++;
TColStd_Array2OfReal & Weights = weights->ChangeArray2();
if (UIndex < 1 || UIndex > Weights.ColLength())
- Standard_OutOfRange::Raise("Geom_BezierSurface::SetWeightRow");
+ throw Standard_OutOfRange("Geom_BezierSurface::SetWeightRow");
if (CPoleWeights.Lower() < 1 ||
CPoleWeights.Lower() > Weights.RowLength() ||
CPoleWeights.Upper() < 1 ||
CPoleWeights.Upper() > Weights.RowLength() ) {
- Standard_ConstructionError::Raise("Geom_BezierSurface::SetWeightRow");
+ throw Standard_ConstructionError("Geom_BezierSurface::SetWeightRow");
}
I = CPoleWeights.Lower();
while (I <= CPoleWeights.Upper()) {
if (CPoleWeights(I) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Weights (UIndex, I) = CPoleWeights (I);
I++;
Geom_Circle::Geom_Circle (const Ax2& A2, const Standard_Real R) : radius (R) {
- if (R < 0.0) Standard_ConstructionError::Raise();
+ if (R < 0.0) throw Standard_ConstructionError();
pos = A2;
}
void Geom_Circle::SetRadius (const Standard_Real R) {
- if (R < 0.0) Standard_ConstructionError::Raise();
+ if (R < 0.0) throw Standard_ConstructionError();
radius = R;
}
{
if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
pos = A3;
}
void Geom_ConicalSurface::SetRadius (const Standard_Real R) {
- if (R < 0.0) Standard_ConstructionError::Raise();
+ if (R < 0.0) throw Standard_ConstructionError();
radius = R;
}
void Geom_ConicalSurface::SetSemiAngle (const Standard_Real Ang) {
if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
semiAngle = Ang;
}
const Standard_Real R)
: radius (R) {
- if (R < 0.0) Standard_ConstructionError::Raise();
+ if (R < 0.0) throw Standard_ConstructionError();
pos = A3;
}
void Geom_CylindricalSurface::SetRadius (const Standard_Real R) {
- if (R < 0.0) { Standard_ConstructionError::Raise(); }
+ if (R < 0.0) { throw Standard_ConstructionError(); }
radius = R;
}
: majorRadius (MajorRadius), minorRadius (MinorRadius) {
if (MajorRadius < MinorRadius || MinorRadius < 0.0 ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
pos = A;
}
void Geom_Ellipse::SetMajorRadius (const Standard_Real MajorRadius) {
- if (MajorRadius < minorRadius) Standard_ConstructionError::Raise ();
+ if (MajorRadius < minorRadius) throw Standard_ConstructionError();
else majorRadius = MajorRadius;
}
void Geom_Ellipse::SetMinorRadius (const Standard_Real MinorRadius) {
if (MinorRadius < 0 || majorRadius < MinorRadius) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
else { minorRadius = MinorRadius; }
}
Handle(Geom_Geometry) Geom_Geometry::Copy() const {
Handle(Geom_Geometry) G;
- Standard_ConstructionError::Raise();
- return G;
+ throw Standard_ConstructionError();
}
: majorRadius (MajorRadius), minorRadius (MinorRadius) {
if (MajorRadius < 0.0 || MinorRadius < 0.0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
pos = A;
}
void Geom_Hyperbola::SetMajorRadius (const Standard_Real MajorRadius) {
- if (MajorRadius < 0.0) Standard_ConstructionError::Raise();
+ if (MajorRadius < 0.0) throw Standard_ConstructionError();
else majorRadius = MajorRadius;
}
void Geom_Hyperbola::SetMinorRadius (const Standard_Real MinorRadius) {
- if (MinorRadius < 0.0) Standard_ConstructionError::Raise();
+ if (MinorRadius < 0.0) throw Standard_ConstructionError();
else minorRadius = MinorRadius;
}
// Raise exception if still C0
if (isC0)
- Standard_ConstructionError::Raise("Offset on C0 curve");
+ throw Standard_ConstructionError("Offset on C0 curve");
}
//
if(isTrimmed)
D3( U, Ptemp, Vtemp, Vtemp, VN);
break;
default:
- Standard_NotImplemented::Raise("Exception: "
+ throw Standard_NotImplemented("Exception: "
"Derivative order is greater than 3. Cannot compute of derivative.");
}
// Raise exception if still C0
if (isC0)
- Standard_ConstructionError::Raise("Offset with no C1 Surface");
+ throw Standard_ConstructionError("Offset with no C1 Surface");
}
if(isTrimmed)
{
#ifdef CHECK
if (myBasisSurfContinuity == GeomAbs_C0)
- Geom_UndefinedValue::Raise();
+ throw Geom_UndefinedValue();
#endif
if (equivSurf.IsNull())
myEvaluator->D0(U, V, P);
#ifdef CHECK
if (myBasisSurfContinuity == GeomAbs_C0 ||
myBasisSurfContinuity == GeomAbs_C1)
- Geom_UndefinedDerivative::Raise();
+ throw Geom_UndefinedDerivative();
#endif
if (equivSurf.IsNull())
myEvaluator->D1(U, V, P, D1U, D1V);
if (myBasisSurfContinuity == GeomAbs_C0 ||
myBasisSurfContinuity == GeomAbs_C1 ||
myBasisSurfContinuity == GeomAbs_C2)
- Geom_UndefinedDerivative::Raise();
+ throw Geom_UndefinedDerivative();
#endif
if (equivSurf.IsNull())
myEvaluator->D2(U, V, P, D1U, D1V, D2U, D2V, D2UV);
{
#ifdef CHECK
if (!(basisSurf->IsCNu (4) && basisSurf->IsCNv (4))) {
- Geom_UndefinedDerivative::Raise();
+ throw Geom_UndefinedDerivative();
}
#endif
if (equivSurf.IsNull())
Standard_RangeError_Raise_if (Nu < 0 || Nv < 0 || Nu + Nv < 1, " ");
#ifdef CHECK
if (!(basisSurf->IsCNu (Nu) && basisSurf->IsCNv (Nv))) {
- Geom_UndefinedDerivative::Raise();
+ throw Geom_UndefinedDerivative();
}
#endif
gp_Vec D(0,0,0);
#ifdef OCCT_DEBUG
cout<<" surface osculatrice nulle "<<endl;
#endif
- //Standard_ConstructionError::Raise("Geom_OsculatingSurface");
+ //throw Standard_ConstructionError("Geom_OsculatingSurface");
OsculSurf=Standard_False;
}
else
Geom_Parabola::Geom_Parabola (const Ax2& A2, const Standard_Real Focal)
: focalLength (Focal) {
- if(Focal < 0.0) Standard_ConstructionError::Raise();
+ if(Focal < 0.0) throw Standard_ConstructionError();
pos = A2;
}
void Geom_Parabola::SetFocal (const Standard_Real Focal) {
- if (Focal < 0.0) Standard_ConstructionError::Raise();
+ if (Focal < 0.0) throw Standard_ConstructionError();
focalLength = Focal;
}
}
else {
if ( U1 == U2)
- Standard_ConstructionError::Raise
- ("Geom_RectangularTrimmedSurface::U1==U2");
+ throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::U1==U2");
if (basisSurf->IsUPeriodic()) {
UsameSense = USense;
if ((Udeb-utrim1 > Precision::PConfusion()) ||
(utrim2-Ufin > Precision::PConfusion()))
- Standard_ConstructionError::Raise
- ("Geom_RectangularTrimmedSurface::U parameters out of range");
+ throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::U parameters out of range");
}
}
}
else {
if ( V1 == V2)
- Standard_ConstructionError::Raise
- ("Geom_RectangularTrimmedSurface::V1==V2");
+ throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::V1==V2");
if (basisSurf->IsVPeriodic()) {
VsameSense = VSense;
if ((Vdeb-vtrim1 > Precision::PConfusion()) ||
(vtrim2-Vfin > Precision::PConfusion()))
- Standard_ConstructionError::Raise
- ("Geom_RectangularTrimmedSurface::V parameters out of range");
+ throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::V parameters out of range");
}
}
Geom_SphericalSurface::Geom_SphericalSurface (const Ax3& A, const Standard_Real R)
: radius (R) {
- if (R < 0.0) Standard_ConstructionError::Raise();
+ if (R < 0.0) throw Standard_ConstructionError();
pos = A;
}
void Geom_SphericalSurface::SetRadius (const Standard_Real R) {
- if (R < 0.0) { Standard_ConstructionError::Raise(); }
+ if (R < 0.0) { throw Standard_ConstructionError(); }
radius = R;
}
Ax2 Geom_SurfaceOfRevolution::ReferencePlane() const {
- Standard_NotImplemented::Raise ();
- return gp_Ax2();
+ throw Standard_NotImplemented();
}
: majorRadius (MajorRadius), minorRadius (MinorRadius) {
if (MinorRadius < 0.0 || MajorRadius < 0.0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
else {
pos = A3;
void Geom_ToroidalSurface::SetMajorRadius (const Standard_Real MajorRadius) {
if (MajorRadius - minorRadius <= gp::Resolution())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
else
majorRadius = MajorRadius;
}
void Geom_ToroidalSurface::SetMinorRadius (const Standard_Real MinorRadius) {
if (MinorRadius < 0.0 || majorRadius - MinorRadius <= gp::Resolution())
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
else
minorRadius = MinorRadius;
}
{
Standard_Boolean sameSense = Standard_True;
if (U1 == U2)
- Standard_ConstructionError::Raise("Geom_TrimmedCurve::U1 == U2");
+ throw Standard_ConstructionError("Geom_TrimmedCurve::U1 == U2");
Standard_Real Udeb = basisCurve->FirstParameter();
Standard_Real Ufin = basisCurve->LastParameter();
if ((Udeb - uTrim1 > Precision::PConfusion()) ||
(uTrim2 - Ufin > Precision::PConfusion()))
- Standard_ConstructionError::Raise
- ("Geom_TrimmedCurve::parameters out of range");
+ throw Standard_ConstructionError("Geom_TrimmedCurve::parameters out of range");
}
#if !defined No_Exception && !defined No_Geom_UndefinedDerivative
#define Geom_UndefinedDerivative_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Geom_UndefinedDerivative::Raise(MESSAGE);
+ if (CONDITION) throw Geom_UndefinedDerivative(MESSAGE);
#else
#define Geom_UndefinedDerivative_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Geom_UndefinedValue
#define Geom_UndefinedValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Geom_UndefinedValue::Raise(MESSAGE);
+ if (CONDITION) throw Geom_UndefinedValue(MESSAGE);
#else
#define Geom_UndefinedValue_Raise_if(CONDITION, MESSAGE)
#endif
const Standard_Boolean Periodic)
{
if (Degree < 1 || Degree > Geom2d_BSplineCurve::MaxDegree()) {
- Standard_ConstructionError::Raise("BSpline curve : invalid degree");
+ throw Standard_ConstructionError("BSpline curve : invalid degree");
}
- if (CPoles.Length() < 2) Standard_ConstructionError::Raise("BSpline curve : at least 2 poles required");
- if (CKnots.Length() != CMults.Length()) Standard_ConstructionError::Raise("BSpline curve : Knot and Mult array size mismatch");
+ if (CPoles.Length() < 2) throw Standard_ConstructionError("BSpline curve : at least 2 poles required");
+ if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError("BSpline curve : Knot and Mult array size mismatch");
for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) {
if (CKnots (I+1) - CKnots (I) <= Epsilon (Abs(CKnots (I)))) {
- Standard_ConstructionError::Raise("BSpline curve : Knots interval values too close");
+ throw Standard_ConstructionError("BSpline curve : Knots interval values too close");
}
}
if (CPoles.Length() != BSplCLib::NbPoles(Degree,Periodic,CMults))
- Standard_ConstructionError::Raise("BSpline curve : # Poles and degree mismatch");
+ throw Standard_ConstructionError("BSpline curve : # Poles and degree mismatch");
}
//=======================================================================
Periodic);
if (Weights.Length() != Poles.Length())
- Standard_ConstructionError::Raise("Geom2d_BSplineCurve :Weights and Poles array size mismatch");
+ throw Standard_ConstructionError("Geom2d_BSplineCurve :Weights and Poles array size mismatch");
Standard_Integer i;
for (i = Weights.Lower(); i <= Weights.Upper(); i++) {
if (Weights(i) <= gp::Resolution()) {
- Standard_ConstructionError::Raise("Geom2d_BSplineCurve: Weights values too small");
+ throw Standard_ConstructionError("Geom2d_BSplineCurve: Weights values too small");
}
}
if (Degree == deg) return;
if (Degree < deg || Degree > Geom2d_BSplineCurve::MaxDegree()) {
- Standard_ConstructionError::Raise("BSpline curve : IncreaseDegree : bad degree value");
+ throw Standard_ConstructionError("BSpline curve : IncreaseDegree : bad degree value");
}
Standard_Integer FromK1 = FirstUKnotIndex ();
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
- Standard_ConstructionError::Raise("Geom2d_BSplineCurve::InsertKnots");
+ throw Standard_ConstructionError("Geom2d_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return;
Standard_Integer I2 = LastUKnotIndex ();
if (Index < I1 || Index > I2) {
- Standard_OutOfRange::Raise("BSpline curve : RemoveKnot : index out of range");
+ throw Standard_OutOfRange("BSpline curve : RemoveKnot : index out of range");
}
const TColgp_Array1OfPnt2d & oldpoles = poles->Array1();
const gp_Pnt2d& P,
const Standard_Real Weight)
{
- if (Index < 0 || Index > poles->Length()) Standard_OutOfRange::Raise("BSpline curve : InsertPoleAfter: Index and #pole mismatch");
+ if (Index < 0 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : InsertPoleAfter: Index and #pole mismatch");
- if (Weight <= gp::Resolution()) Standard_ConstructionError::Raise("BSpline curve : InsertPoleAfter: Weight too small");
+ if (Weight <= gp::Resolution()) throw Standard_ConstructionError("BSpline curve : InsertPoleAfter: Weight too small");
if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier) {
- Standard_ConstructionError::Raise("BSpline curve : InsertPoleAfter : bad knotSet type");
+ throw Standard_ConstructionError("BSpline curve : InsertPoleAfter : bad knotSet type");
}
const TColStd_Array1OfReal& cknots = knots->Array1();
void Geom2d_BSplineCurve::RemovePole
(const Standard_Integer Index)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise("BSpline curve :RemovePole : Index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve :RemovePole : Index and #pole mismatch");
- if (poles->Length() <= 2) Standard_ConstructionError::Raise("BSpline curve : RemovePole : #pole is already minimum");
+ if (poles->Length() <= 2) throw Standard_ConstructionError("BSpline curve : RemovePole : #pole is already minimum");
if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier)
- Standard_ConstructionError::Raise("BSpline curve : RemovePole: bad knotSet type");
+ throw Standard_ConstructionError("BSpline curve : RemovePole: bad knotSet type");
Standard_Integer i;
Handle(TColStd_HArray1OfReal) nknots =
const Standard_Real aU2)
{
if (aU2 < aU1)
- Standard_DomainError::Raise("Geom2d_BSplineCurve::Segment");
+ throw Standard_DomainError("Geom2d_BSplineCurve::Segment");
//
Standard_Real AbsUMax = Max(Abs(FirstParameter()),Abs(LastParameter()));
Standard_Real Eps = Max (Epsilon(AbsUMax), Precision::PConfusion());
Standard_Real Period = LastParameter() - FirstParameter();
DU = U2 - U1;
if (DU - Period > Precision::PConfusion())
- Standard_DomainError::Raise("Geom2d_BSplineCurve::Segment");
+ throw Standard_DomainError("Geom2d_BSplineCurve::Segment");
if (DU > Period)
DU = Period;
}
(const Standard_Integer Index,
const Standard_Real K)
{
- if (Index < 1 || Index > knots->Length()) Standard_OutOfRange::Raise("BSpline curve : SetKnot: Index and #pole mismatch");
+ if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve : SetKnot: Index and #pole mismatch");
Standard_Real DK = Abs(Epsilon (K));
if (Index == 1) {
- if (K >= knots->Value(2) - DK) Standard_ConstructionError::Raise("BSpline curve :SetKnot :K out of range");
+ if (K >= knots->Value(2) - DK) throw Standard_ConstructionError("BSpline curve :SetKnot :K out of range");
}
else if (Index == knots->Length()) {
if (K <= knots->Value (knots->Length()-1) + DK) {
- Standard_ConstructionError::Raise("BSpline curve : SetKnot : K out of range");
+ throw Standard_ConstructionError("BSpline curve : SetKnot : K out of range");
}
}
else {
if (K <= knots->Value(Index-1) + DK ||
K >= knots->Value(Index+1) - DK ) {
- Standard_ConstructionError::Raise("BSpline curve : SetKnot: K out of range");
+ throw Standard_ConstructionError("BSpline curve : SetKnot: K out of range");
}
}
if (K != knots->Value (Index)) {
void Geom2d_BSplineCurve::SetOrigin(const Standard_Integer Index)
{
if (!periodic)
- Standard_NoSuchObject::Raise("Geom2d_BSplineCurve::SetOrigin");
+ throw Standard_NoSuchObject("Geom2d_BSplineCurve::SetOrigin");
Standard_Integer i,k;
Standard_Integer first = FirstUKnotIndex();
Standard_Integer last = LastUKnotIndex();
if ((Index < first) || (Index > last))
- Standard_DomainError::Raise("Geom2d_BSplineCurve::SetOrigin");
+ throw Standard_DomainError("Geom2d_BSplineCurve::SetOrigin");
Standard_Integer nbknots = knots->Length();
Standard_Integer nbpoles = poles->Length();
(const Standard_Integer Index,
const gp_Pnt2d& P)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise("BSpline curve : SetPole : index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : SetPole : index and #pole mismatch");
poles->SetValue (Index, P);
maxderivinvok = 0;
}
(const Standard_Integer Index,
const Standard_Real W)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise("BSpline curve : SetWeight: Index and #pole mismatch");
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange("BSpline curve : SetWeight: Index and #pole mismatch");
- if (W <= gp::Resolution ()) Standard_ConstructionError::Raise("BSpline curve : SetWeight: Weight too small");
+ if (W <= gp::Resolution ()) throw Standard_ConstructionError("BSpline curve : SetWeight: Weight too small");
Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution());
{
if (Index1 < 1 || Index1 > poles->Length() ||
Index2 < 1 || Index2 > poles->Length() || Index1 > Index2) {
- Standard_OutOfRange::Raise("BSpline curve : MovePoint: Index and #pole mismatch");
+ throw Standard_OutOfRange("BSpline curve : MovePoint: Index and #pole mismatch");
}
TColgp_Array1OfPnt2d npoles(1, poles->Length());
gp_Pnt2d P0;
Standard_Integer nbpoles = Poles.Length();
if (Weights.Length() != nbpoles)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Standard_Integer i;
for (i = 1; i <= nbpoles; i++) {
if (Weights(i) <= gp::Resolution()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
const Standard_Boolean Sense)
: radius(Radius) {
- if (Radius < 0.0) { Standard_ConstructionError::Raise(); }
+ if (Radius < 0.0) { throw Standard_ConstructionError(); }
pos = gp_Ax22d(A, Sense);
}
: radius (Radius) {
- if (Radius < 0.0) { Standard_ConstructionError::Raise(); }
+ if (Radius < 0.0) { throw Standard_ConstructionError(); }
pos = A;
}
void Geom2d_Circle::SetRadius (const Standard_Real R)
{
- if (R < 0.0) { Standard_ConstructionError::Raise(); }
+ if (R < 0.0) { throw Standard_ConstructionError(); }
radius = R;
}
:majorRadius (MajorRadius), minorRadius (MinorRadius){
if (MajorRadius < MinorRadius || MinorRadius < 0.0 ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
pos = gp_Ax22d(MajorAxis, Sense);
}
: majorRadius (MajorRadius), minorRadius (MinorRadius)
{
if (MajorRadius < MinorRadius || MinorRadius < 0.0 ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
pos = Axis;
}
void Geom2d_Ellipse::SetMajorRadius (const Standard_Real MajorRadius)
{
if (MajorRadius < minorRadius)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
else
majorRadius = MajorRadius;
}
void Geom2d_Ellipse::SetMinorRadius (const Standard_Real MinorRadius)
{
if (MinorRadius < 0 || majorRadius < MinorRadius)
- { Standard_ConstructionError::Raise(); }
+ { throw Standard_ConstructionError(); }
else
{ minorRadius = MinorRadius; }
}
: majorRadius (MajorRadius), minorRadius (MinorRadius)
{
if( MajorRadius < 0.0|| MinorRadius < 0.0)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
pos = gp_Ax22d(A, Sense);
}
: majorRadius (MajorRadius), minorRadius (MinorRadius)
{
if( MajorRadius < 0.0|| MinorRadius < 0.0)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
pos = Axis;
}
void Geom2d_Hyperbola::SetMajorRadius (const Standard_Real MajorRadius)
{
if (MajorRadius < 0.0)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
else
majorRadius = MajorRadius;
}
void Geom2d_Hyperbola::SetMinorRadius (const Standard_Real MinorRadius)
{
if (MinorRadius < 0.0 )
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
else
minorRadius = MinorRadius;
}
// Raise exception if still C0
if (isC0)
- Standard_ConstructionError::Raise("Offset on C0 curve");
+ throw Standard_ConstructionError("Offset on C0 curve");
}
//
if(isTrimmed)
case 2: D2( U, PBidon, VBidon, VN); break;
case 3: D3( U, PBidon, VBidon, VBidon, VN); break;
default:
- Standard_NotImplemented::Raise("Exception: Derivative order is greater than 3. "
+ throw Standard_NotImplemented("Exception: Derivative order is greater than 3. "
"Cannot compute of derivative.");
}
const Standard_Boolean Sense)
: focalLength (Focal)
{
- if (Focal < 0.0) { Standard_ConstructionError::Raise(); }
+ if (Focal < 0.0) { throw Standard_ConstructionError(); }
pos = gp_Ax22d(MirrorAxis, Sense);
}
Geom2d_Parabola::Geom2d_Parabola (const gp_Ax22d& Axis, const Standard_Real Focal)
: focalLength (Focal)
{
- if (Focal < 0.0) { Standard_ConstructionError::Raise(); }
+ if (Focal < 0.0) { throw Standard_ConstructionError(); }
pos = Axis;
}
void Geom2d_Parabola::SetFocal (const Standard_Real Focal)
{
- if (Focal < 0.0) Standard_ConstructionError::Raise();
+ if (Focal < 0.0) throw Standard_ConstructionError();
focalLength = Focal;
}
uTrim1 (U1),
uTrim2 (U2)
{
- if(C.IsNull()) Standard_ConstructionError::Raise("Geom2d_TrimmedCurve:: C is null");
+ if(C.IsNull()) throw Standard_ConstructionError("Geom2d_TrimmedCurve:: C is null");
// kill trimmed basis curves
Handle(Geom2d_TrimmedCurve) T = Handle(Geom2d_TrimmedCurve)::DownCast(C);
if (!T.IsNull())
{
Standard_Boolean sameSense = Standard_True;
if (U1 == U2)
- Standard_ConstructionError::Raise("Geom2d_TrimmedCurve::U1 == U2");
+ throw Standard_ConstructionError("Geom2d_TrimmedCurve::U1 == U2");
Standard_Real Udeb = basisCurve->FirstParameter();
Standard_Real Ufin = basisCurve->LastParameter();
if ((Udeb - uTrim1 > Precision::PConfusion()) ||
(uTrim2 - Ufin > Precision::PConfusion())) {
- Standard_ConstructionError::Raise
- ("Geom_TrimmedCurve::parameters out of range");
+ throw Standard_ConstructionError("Geom_TrimmedCurve::parameters out of range");
}
}
#if !defined No_Exception && !defined No_Geom2d_UndefinedDerivative
#define Geom2d_UndefinedDerivative_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Geom2d_UndefinedDerivative::Raise(MESSAGE);
+ if (CONDITION) throw Geom2d_UndefinedDerivative(MESSAGE);
#else
#define Geom2d_UndefinedDerivative_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Geom2d_UndefinedValue
#define Geom2d_UndefinedValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Geom2d_UndefinedValue::Raise(MESSAGE);
+ if (CONDITION) throw Geom2d_UndefinedValue(MESSAGE);
#else
#define Geom2d_UndefinedValue_Raise_if(CONDITION, MESSAGE)
#endif
theCurve1 = new Geom2d_TrimmedCurve(myCurve1, aU1, aU2);
theCurve2 = new Geom2d_TrimmedCurve(myCurve2, aV1, aV2);
}
-
-//=======================================================================
-//function : Segment
-//purpose :
-//=======================================================================
-
-void Geom2dAPI_InterCurveCurve::Segment (const Standard_Integer Index,
- Handle(Geom2d_Curve)&) const
-{
- Standard_NotImplemented::Raise(" ");
- (void)Index; // avoid compiler warning in Release mode
- Standard_OutOfRange_Raise_if(Index < 0 || Index > NbSegments(),
- "Geom2dAPI_InterCurveCurve::Segment");
-}
//! computing of self-intersections on a curve.
Standard_EXPORT void Segment (const Standard_Integer Index, Handle(Geom2d_Curve)& Curve1, Handle(Geom2d_Curve)& Curve2) const;
- //! Use this syntax to get solutions of
- //! tangential intersections only in case of a self-intersected curve.
- //! Output value Curve1 is the intersection segment of the curve
- //! defined by number Index. An intersection segment is a
- //! portion of the initial curve limited by two points. The distance
- //! between each point of this segment to another portion of the curve is
- //! less or equal to the tolerance value assigned at the time of
- //! construction or in the function Init (this value is defaulted to 1.0e-6).
- //! Exceptions
- //! Standard_OutOfRange if Index is not in the range [ 1,NbSegments ],
- //! where NbSegments is the number of computed tangential intersections.
- Standard_EXPORT void Segment (const Standard_Integer Index, Handle(Geom2d_Curve)& Curve1) const;
-
//! return the algorithmic object from Intersection.
const Geom2dInt_GInter& Intersector() const;
gp_Vec2d a_vector ;
if (PointsArray.Length() < 3) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!TangentFlags.Value(1)) {
degree = 3 ;
if ( PointsArray.Length() < 3) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (PointsArray.Length() == 3) {
degree = 2 ;
myPoints->Upper()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
BuildParameters(PeriodicFlag,
PointsPtr->Array1(),
if (PeriodicFlag) {
if ((PointsPtr->Length()) + 1 != ParametersPtr->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
myTangents =
myPoints->Upper()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
result =
CheckParameters(ParametersPtr->Array1()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (ii = myPoints->Lower() ; ii <= myPoints->Upper() ; ii++) {
myTangentFlags = TangentFlagsPtr ;
if (Tangents.Length() != myPoints->Length() ||
TangentFlagsPtr->Length() != myPoints->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
result =
CheckTangents(Tangents,
myParameters->Array1()) ;
}
else {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myTangentFlags->Array1(),
myTolerance) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
ScaleTangents(myPoints->Array1(),
myTangents->ChangeArray1(),
const Handle(Geom2d_BSplineCurve)& Geom2dAPI_Interpolate::Curve() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise(" ");
+ throw StdFail_NotDone(" ");
return myCurve;
}
const GeomAbs_Shape Continuity,
const Standard_Real Tol2D)
{
- if (Params.Length() != Points.Length()) Standard_OutOfRange::Raise("");
+ if (Params.Length() != Points.Length()) throw Standard_OutOfRange("");
Standard_Real Tol3D = 0.; // dummy argument for BSplineCompute.
Standard_Integer Nbp = Params.Length();
const Handle(Geom2d_BSplineCurve)& Geom2dAPI_PointsToBSpline::Curve() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise(" ");
+ throw StdFail_NotDone(" ");
return myCurve;
}
break;
default:
- Standard_DomainError::Raise("Geom2dAdaptor::MakeCurve, OtherCurve");
+ throw Standard_DomainError("Geom2dAdaptor::MakeCurve, OtherCurve");
}
case GeomAbs_G2: return GeomAbs_G2;
default:
- Standard_NoSuchObject::Raise("Geom2dAdaptor_Curve::Continuity");
+ throw Standard_NoSuchObject("Geom2dAdaptor_Curve::Continuity");
}
}
else if (myTypeCurve == GeomAbs_OtherCurve) {
- Standard_NoSuchObject::Raise("Geom2dAdaptor_Curve::Continuity");
+ throw Standard_NoSuchObject("Geom2dAdaptor_Curve::Continuity");
}
else {
return GeomAbs_CN;
}
-
- // portage WNT
- return GeomAbs_CN;
}
//=======================================================================
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("Geom2dAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("Geom2dAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
switch(S){
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("GeomAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("Geom2dAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("Geom2dAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
switch(S){
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("GeomAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
else if (myTypeCurve == GeomAbs_BSplineCurve)
return myBSplineCurve->Degree();
else
- Standard_NoSuchObject::Raise();
- // portage WNT
- return 0;
+ throw Standard_NoSuchObject();
}
//=======================================================================
else if (myTypeCurve == GeomAbs_BSplineCurve)
return myBSplineCurve->NbPoles();
else
- Standard_NoSuchObject::Raise();
- // portage WNT
- return 0;
+ throw Standard_NoSuchObject();
}
//=======================================================================
Standard_Integer Geom2dAdaptor_Curve::NbKnots() const
{
if ( myTypeCurve != GeomAbs_BSplineCurve)
- Standard_NoSuchObject::Raise("Geom2dAdaptor_Curve::NbKnots");
+ throw Standard_NoSuchObject("Geom2dAdaptor_Curve::NbKnots");
return myBSplineCurve->NbKnots();
}
inline void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C)
{
- if ( C.IsNull()) Standard_NullObject::Raise();
+ if ( C.IsNull()) throw Standard_NullObject();
load(C,C->FirstParameter(),C->LastParameter());
}
const Standard_Real UFirst,
const Standard_Real ULast)
{
- if ( C.IsNull()) Standard_NullObject::Raise();
+ if ( C.IsNull()) throw Standard_NullObject();
- if ( UFirst > ULast) Standard_ConstructionError::Raise();
+ if ( UFirst > ULast) throw Standard_ConstructionError();
load(C,UFirst,ULast);
}
Standard_Integer TheFirst = C->FirstUKnotIndex ();
Standard_Integer TheLast = C->LastUKnotIndex ();
- if (FromK1 == ToK2) Standard_DomainError::Raise();
+ if (FromK1 == ToK2) throw Standard_DomainError();
Standard_Integer FirstK = Min (FromK1, ToK2);
Standard_Integer LastK = Max (FromK1, ToK2);
- if (FirstK < TheFirst || LastK > TheLast) Standard_OutOfRange::Raise();
+ if (FirstK < TheFirst || LastK > TheLast) throw Standard_OutOfRange();
Handle(Geom2d_BSplineCurve) NewCurve = Handle(Geom2d_BSplineCurve)::DownCast(C->Copy());
MaxSegments, MaxDegree);
if (ApprCOffs.HasResult())
TheCurve = ApprCOffs.Curve();
- else Standard_ConstructionError::Raise();
+ else throw Standard_ConstructionError();
}
- else { Standard_DomainError::Raise("No such curve"); }
+ else { throw Standard_DomainError("No such curve"); }
}
MaxSegments, MaxDegree);
if (ApprCOffs.HasResult())
TheCurve = ApprCOffs.Curve();
- else Standard_ConstructionError::Raise();
+ else throw Standard_ConstructionError();
}
- else { Standard_DomainError::Raise(); }
+ else { throw Standard_DomainError(); }
}
return TheCurve;
}
}
else
- Standard_Failure::Raise("Courbes non jointives");
+ throw Standard_Failure("Courbes non jointives");
return cont ;
}
PreLast,First,
Standard_True,
Standard_True)<GeomAbs_C0)
- Standard_ConstructionError::Raise("Geom2dConvert curves not C0") ; //renvoi d'une erreur
+ throw Standard_ConstructionError("Geom2dConvert curves not C0") ; //renvoi d'une erreur
else{
if (Continuity(ArrayOfCurves(i-1),
ArrayOfCurves(i),
fusion=C.Add(Curve1,
local_tolerance(j-1)); //fusion de deux courbes adjacentes
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
+ throw Standard_ConstructionError("Geom2dConvert Concatenation Error") ;
Curve2=C.BSplineCurve();
}
Curve2->SetPeriodic(); //1 seule courbe C1
Geom2dConvert_CompCurveToBSplineCurve C(ArrayOfConcatenated->Value(i));
fusion=C.Add(Curve1,ArrayOfToler(j-1)); //fusion de deux courbes adjacentes
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
+ throw Standard_ConstructionError("Geom2dConvert Concatenation Error") ;
ArrayOfConcatenated->SetValue(i,C.BSplineCurve());
}
}
Standard_True,
ArrayOfToler(i-1),
AngularTolerance)<GeomAbs_C0)
- Standard_ConstructionError::Raise("Geom2dConvert curves not C0") ; //renvoi d'une erreur
+ throw Standard_ConstructionError("Geom2dConvert curves not C0") ; //renvoi d'une erreur
else{
if (Continuity(ArrayOfCurves(i-1),
ArrayOfCurves(i),
fusion=C.Add(Curve1,
local_tolerance(j-1)); //fusion de deux courbes adjacentes
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
+ throw Standard_ConstructionError("Geom2dConvert Concatenation Error") ;
Curve2=C.BSplineCurve();
}
}
Geom2dConvert_CompCurveToBSplineCurve C (ArrayOfConcatenated->Value(i));
fusion=C.Add(Curve1,ArrayOfToler(j-1)); //fusion de deux courbes adjacentes
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
+ throw Standard_ConstructionError("Geom2dConvert Concatenation Error") ;
ArrayOfConcatenated->SetValue(i,C.BSplineCurve());
}
}
for (i=1;i<ArrayOfConcatenated->Length();i++){
fusion=C.Add(ArrayOfConcatenated->Value(i),tolerance, Standard_True);
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("Geom2dConvert Concatenation Error") ;
+ throw Standard_ConstructionError("Geom2dConvert Concatenation Error") ;
}
}
BS=C.BSplineCurve();
) {
- if (ContinuityRange < 0) Standard_RangeError::Raise();
+ if (ContinuityRange < 0) throw Standard_RangeError();
Standard_Integer FirstIndex = BasisCurve->FirstUKnotIndex();
Standard_Integer LastIndex = BasisCurve->LastUKnotIndex();
const Standard_Real ParametricTolerance)
{
if (U2 - U1 < ParametricTolerance)
- Standard_DomainError::Raise("GeomConvert_BSplineCurveToBezierSurface");
+ throw Standard_DomainError("GeomConvert_BSplineCurveToBezierSurface");
Standard_Real Uf = U1, Ul = U2;
Standard_Real PTol = ParametricTolerance/2 ;
(const Standard_Integer Index)
{
if ( Index < 1 || Index > myCurve->NbKnots()-1) {
- Standard_OutOfRange::Raise("Geom2dConvert_BSplineCurveToBezierCurve");
+ throw Standard_OutOfRange("Geom2dConvert_BSplineCurveToBezierCurve");
}
Standard_Integer Deg = myCurve->Degree();
const gp_Vec2d& theD1) const
{
if (theD1.SquareMagnitude() <= gp::Resolution())
- Standard_NullValue::Raise("Geom2dEvaluator_OffsetCurve: Undefined normal vector "
- "because tangent vector has zero-magnitude!");
+ throw Standard_NullValue("Geom2dEvaluator_OffsetCurve: Undefined normal vector "
+ "because tangent vector has zero-magnitude!");
gp_Dir2d aNormal(theD1.Y(), -theD1.X());
theValue.ChangeCoord().Add(aNormal.XY() * myOffset);
if (R3 <= gp::Resolution())
{
if (R2 <= gp::Resolution())
- Standard_NullValue::Raise("Geom2dEvaluator_OffsetCurve: Null derivative");
+ throw Standard_NullValue("Geom2dEvaluator_OffsetCurve: Null derivative");
//We try another computation but the stability is not very good.
DNdir.Multiply(R);
DNdir.Subtract(Ndir.Multiplied(Dr / R));
if (R5 <= gp::Resolution())
{
if (R4 <= gp::Resolution())
- Standard_NullValue::Raise("Geom2dEvaluator_OffsetCurve: Null derivative");
+ throw Standard_NullValue("Geom2dEvaluator_OffsetCurve: Null derivative");
//We try another computation but the stability is not very good dixit ISG.
// V2 = P" (U) :
D2Ndir.Subtract(DNdir.Multiplied(2.0 * Dr / R2));
if (R7 <= gp::Resolution())
{
if (R6 <= gp::Resolution())
- Standard_NullValue::Raise("Geom2dEvaluator_OffsetCurve: Null derivative");
+ throw Standard_NullValue("Geom2dEvaluator_OffsetCurve: Null derivative");
//We try another computation but the stability is not very good dixit ISG.
// V3 = P"' (U) :
D3Ndir.Subtract(D2Ndir.Multiplied(3.0 * myOffset * Dr / R2));
gp_Circ2d Geom2dGcc_Circ2d2TanOn::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (Invert) {
Qualif1 = qualifier2(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (Invert) {
if (TheSame2(Index) == 0) {
ParArg = pararg2(Index);
PntSol = pnttg2sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
else {
if (TheSame1(Index) == 0) {
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (!Invert) {
if (TheSame2(Index) == 0) {
ParArg = pararg2(Index);
PntSol = pnttg2sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
else {
if (TheSame1(Index) == 0) {
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParArg = parcen3(Index);
PntSol = pntcen(Index);
Standard_Boolean Geom2dGcc_Circ2d2TanOn::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (Invert) {
if (TheSame2(Index) == 0) { return Standard_False; }
else { return Standard_True; }
Standard_Boolean Geom2dGcc_Circ2d2TanOn::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (!Invert) {
if (TheSame2(Index) == 0) { return Standard_False; }
else { return Standard_True; }
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Intp.IsDone()) {
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Intp.IsDone()) {
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Intp.IsDone()) {
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (Intp.IsDone()) {
gp_Circ2d Geom2dGcc_Circ2d2TanOnGeo::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = gp_Pnt2d(pnttg1sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame2(Index) == 0) {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
PntSol = gp_Pnt2d(pnttg2sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
CenterOn3 (const Standard_Integer Index ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParArg = parcen3(Index);
PntSol = gp_Pnt2d(pntcen(Index));
Standard_Boolean Geom2dGcc_Circ2d2TanOnGeo::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) StdFail_NotDone::Raise();
- if (Index <= 0 ||Index > NbrSol) Standard_OutOfRange::Raise();
+ if (!WellDone) throw StdFail_NotDone();
+ if (Index <= 0 ||Index > NbrSol) throw Standard_OutOfRange();
if (TheSame1(Index) == 0)
return Standard_False;
Standard_Boolean Geom2dGcc_Circ2d2TanOnGeo::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) StdFail_NotDone::Raise();
- if (Index <= 0 ||Index > NbrSol) Standard_OutOfRange::Raise();
+ if (!WellDone) throw StdFail_NotDone();
+ if (Index <= 0 ||Index > NbrSol) throw Standard_OutOfRange();
if (TheSame2(Index) == 0)
return Standard_False;
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Real Tol = Abs(Tolerance);
WhichQualifier (GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
Qualif1 = qualifier1;
Qualif2 = qualifier2;
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
if (TheSame1 == 0) {
ParSol = 0;
ParArg = 0;
PntSol = pnttg1sol;
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = 0;
ParArg = 0;
CenterOn3 (Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParArg = 0;
PntSol = pntcen;
Standard_Boolean Geom2dGcc_Circ2d2TanOnIter::
IsTheSame1 () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
if (TheSame1 == 0)
return Standard_False;
Standard_Boolean Geom2dGcc_Circ2d2TanOnIter::
IsTheSame2 () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return Standard_False;
}
pararg1(1,aNbSolMAX) ,
pararg2(1,aNbSolMAX)
{
- if (Radius < 0.) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.) { throw Standard_NegativeValue(); }
else {
Geom2dAdaptor_Curve C1 = Qualified1.Qualified();
Geom2dAdaptor_Curve C2 = Qualified2.Qualified();
}
else {
WellDone = Standard_False;
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
}
}
gp_Lin2d l1(LL1->Lin2d());
if (Qualified1.IsEnclosing()) {
WellDone = Standard_False;
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else {
GccEnt_QualifiedLin Ql1 = GccEnt_QualifiedLin(l1,
}
else {
WellDone = Standard_False;
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
}
}
gp_Lin2d l1(LL1->Lin2d());
if (Qualified1.IsEnclosing()) {
WellDone = Standard_False;
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else {
GccEnt_QualifiedLin Ql1 = GccEnt_QualifiedLin(l1,
gp_Lin2d l2(LL2->Lin2d());
if (Qualified2.IsEnclosing()) {
WellDone = Standard_False;
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
}
else {
GccEnt_QualifiedLin Ql2 = GccEnt_QualifiedLin(l2,
pararg1(1,8) ,
pararg2(1,8)
{
- if (Radius < 0.) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.) { throw Standard_NegativeValue(); }
else {
Geom2dAdaptor_Curve C1 = Qualified1.Qualified();
Handle(Geom2d_Curve) CC1 = C1.Curve();
pararg1(1,2) ,
pararg2(1,2)
{
- if (Radius < 0.) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.) { throw Standard_NegativeValue(); }
else {
//=============================================================================
gp_Circ2d Geom2dGcc_Circ2d2TanRad::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (Invert) {
Qualif1 = qualifier2(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (Invert) {
if (TheSame2(Index) == 0) {
ParArg = pararg2(Index);
PntSol = pnttg2sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
else {
if (TheSame1(Index) == 0) {
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (!Invert) {
if (TheSame2(Index) == 0) {
ParArg = pararg2(Index);
PntSol = pnttg2sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
else {
if (TheSame1(Index) == 0) {
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
}
Standard_Boolean Geom2dGcc_Circ2d2TanRad::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (Invert) {
if (TheSame2(Index) == 0) { return Standard_False; }
else { return Standard_True; }
Standard_Boolean Geom2dGcc_Circ2d2TanRad::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (!Invert) {
if (TheSame2(Index) == 0) { return Standard_False; }
else { return Standard_True; }
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Lin2d L1 = Qualified1.Qualified();
gp_Pnt2d origin1(lxloc,lyloc);
gp_Dir2d normL1(-y1dir,x1dir);
Geom2dAdaptor_Curve Cu2= Qualified2.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Qualified1.IsEnclosed() && Qualified2.IsEnclosed()) {
// =======================================================
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
gp_Pnt2d center1(C1.Location());
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Qualified1.IsEnclosed() && Qualified2.IsEnclosed()) {
// =======================================================
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Qualified1.IsEnclosed()) {
// ===========================
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Qualified1.IsEnclosed() && Qualified2.IsEnclosed()) {
// =======================================================
gp_Circ2d Geom2dGcc_Circ2d2TanRadGeo::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = gp_Pnt2d(pnttg1sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame2(Index) == 0) {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
PntSol = gp_Pnt2d(pnttg2sol(Index));
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Boolean Geom2dGcc_Circ2d2TanRadGeo::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
return Standard_True;
Standard_Boolean Geom2dGcc_Circ2d2TanRadGeo::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame2(Index) == 0) { return Standard_False; }
return Standard_True;
gp_Circ2d Geom2dGcc_Circ2d3Tan::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
GccEnt_Position& Qualif2 ,
GccEnt_Position& Qualif3) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame2(Index) == 0) {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
PntSol = pnttg2sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame3(Index) == 0) {
ParSol = par3sol(Index);
ParArg = pararg3(Index);
PntSol = pnttg3sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Boolean Geom2dGcc_Circ2d3Tan::IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
return Standard_True;
}
Standard_Boolean Geom2dGcc_Circ2d3Tan::
IsTheSame2 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame2(Index) == 0) { return Standard_False; }
return Standard_True;
}
Standard_Boolean Geom2dGcc_Circ2d3Tan::
IsTheSame3 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame3(Index) == 0) { return Standard_False; }
return Standard_True;
}
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Lin2d L1 = Qualified1.Qualified();
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Lin2d L1 = Qualified1.Qualified();
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1(gp_Ax2d(Point3,gp_Dir2d(1.,0.)),0.);
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Dir2d dirx(1.,0.);
Qualified2.IsOutside() || Qualified2.IsUnqualified()) ||
!(Qualified3.IsEnclosed() || Qualified3.IsEnclosing() ||
Qualified3.IsOutside() || Qualified3.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
gp_Circ2d C1 = Qualified1.Qualified();
GccEnt_Position& Qualif2 ,
GccEnt_Position& Qualif3 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
Qualif1 = qualifier1;
Qualif2 = qualifier2;
Tangency1 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
if (TheSame1 == 0) {
ParSol = par1sol;
ParArg = pararg1;
PntSol = pnttg1sol;
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Tangency2 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = par2sol;
ParArg = pararg2;
Tangency3 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = par3sol;
ParArg = pararg3;
Standard_Boolean Geom2dGcc_Circ2d3TanIter::
IsTheSame1 () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
if (TheSame1 == 0)
return Standard_False;
Standard_Boolean Geom2dGcc_Circ2d3TanIter::
IsTheSame2 () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
if (TheSame3 == 0)
return Standard_False;
Standard_Boolean Geom2dGcc_Circ2d3TanIter::
IsTheSame3 () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return Standard_True;
}
gp_Circ2d Geom2dGcc_Circ2dTanCen::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
WhichQualifier(const Standard_Integer Index,
GccEnt_Position& Qualif1) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else { Qualif1 = qualifier1(Index); }
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Boolean Geom2dGcc_Circ2dTanCen::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
return Standard_True;
}
Geom2dAdaptor_Curve curve = Qualified1.Qualified();
Extrema_ExtPC2d distmin(Pcenter,curve,Geom2dGcc_CurveTool::NbSamples(curve),
Geom2dGcc_CurveTool::EpsX(curve,Tol),Tol);
- if (!distmin.IsDone() ) { Standard_Failure::Raise(); }
+ if (!distmin.IsDone() ) { throw Standard_Failure(); }
Standard_Integer nbext = distmin.NbExt();
- if(nbext==0) { Standard_Failure::Raise(); }
+ if(nbext==0) { throw Standard_Failure(); }
while (i<=nbext) {
thePar = distmin.Point(i).Parameter();
if (distmin.SquareDistance(i)<theDist2(1) &&
gp_Circ2d Geom2dGcc_Circ2dTanCenGeo::
ThisSolution (const Standard_Integer Index) const
{
- if (Index > NbrSol || Index <= 0) Standard_OutOfRange::Raise();
+ if (Index > NbrSol || Index <= 0) throw Standard_OutOfRange();
return cirsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
PntSol = gp_Pnt2d(pnttg1sol(Index));
parcen3(1,8)
{
if (Radius < 0.) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
Geom2dAdaptor_Curve C1 = Qualified1.Qualified();
parcen3(1,8)
{
if (Radius < 0.) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
gp_Pnt2d point1(Point1->Pnt2d());
gp_Circ2d Geom2dGcc_Circ2dTanOnRad::
ThisSolution (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
return cirsol(Index);
}
WhichQualifier (const Standard_Integer Index,
GccEnt_Position& Qualif1) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else { Qualif1 = qualifier1(Index); }
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
if (TheSame1(Index) == 0) {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
PntSol = pnttg1sol(Index);
}
- else { StdFail_NotDone::Raise(); }
+ else { throw StdFail_NotDone(); }
}
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParArg = parcen3(Index);
PntSol = pntcen3(Index);
Standard_Boolean Geom2dGcc_Circ2dTanOnRad::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
if (TheSame1(Index) == 0) { return Standard_False; }
return Standard_True;
}
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer nbrcote1 = 0;
TColStd_Array1OfReal Coef(1,2);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
- if (Radius < 0.0) { Standard_NegativeValue::Raise(); }
+ if (Radius < 0.0) { throw Standard_NegativeValue(); }
else {
if (Qualified1.IsEnclosed()) {
// ===========================
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
TColStd_Array1OfReal cote1(1,2);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
if (Radius < 0.0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
if (Qualified1.IsEnclosed()) {
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
TColStd_Array1OfReal cote1(1,2);
Standard_Real R1 = C1.Radius();
if (Radius < 0.0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
if (Qualified1.IsEnclosed()) {
NbrSol = 0;
if (!(Qualified1.IsEnclosed() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Standard_Integer nbrcote1=0;
gp_Dir2d norm1(-dir1.Y(),dir1.X());
if (Radius < 0.0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
if (Qualified1.IsEnclosed()) {
NbrSol = 0;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
TColStd_Array1OfReal cote1(1,2);
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
if (Radius < 0.0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
if (Qualified1.IsEnclosed()) {
NbrSol = 0;
if (Radius < 0.0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
else {
// gp_Dir2d Dir(-y1dir,x1dir);
{
if (Index > NbrSol || Index <= 0)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return cirsol(Index);
}
WhichQualifier(const Standard_Integer Index ,
GccEnt_Position& Qualif1 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
}
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const{
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
ParSol = par1sol(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const {
if (!WellDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
else if (Index <= 0 ||Index > NbrSol) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else {
ParArg = parcen3(Index);
Standard_Boolean Geom2dGcc_Circ2dTanOnRadGeo::
IsTheSame1 (const Standard_Integer Index) const
{
- if (!WellDone) StdFail_NotDone::Raise();
- if (Index <= 0 ||Index > NbrSol) Standard_OutOfRange::Raise();
+ if (!WellDone) throw StdFail_NotDone();
+ if (Index <= 0 ||Index > NbrSol) throw Standard_OutOfRange();
if (TheSame1(Index) == 0)
return Standard_False;
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
}
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
}
#if !defined No_Exception && !defined No_Geom2dGcc_IsParallel
#define Geom2dGcc_IsParallel_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Geom2dGcc_IsParallel::Raise(MESSAGE);
+ if (CONDITION) throw Geom2dGcc_IsParallel(MESSAGE);
#else
#define Geom2dGcc_IsParallel_Raise_if(CONDITION, MESSAGE)
#endif
gp_Lin2d Geom2dGcc_Lin2d2Tan::
ThisSolution (const Standard_Integer Index) const
{
- if (Index > NbrSol || Index <= 0) { Standard_OutOfRange::Raise(); }
+ if (Index > NbrSol || Index <= 0) { throw Standard_OutOfRange(); }
return linsol(Index);
}
GccEnt_Position& Qualif1,
GccEnt_Position& Qualif2) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
Qualif1 = qualifier1(Index);
Qualif2 = qualifier2(Index);
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
//Standard_Real Tol = Abs(Tolang);
WellDone = Standard_False;
- if (Qualified1.IsEnclosed()) { GccEnt_BadQualifier::Raise(); }
+ if (Qualified1.IsEnclosed()) { throw GccEnt_BadQualifier(); }
gp_Circ2d C1 = Qualified1.Qualified();
Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified();
Standard_Real U1 = Geom2dGcc_CurveTool::FirstParameter(Cu2);
Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
!(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() ||
Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified();
gp_Lin2d Geom2dGcc_Lin2d2TanIter::
ThisSolution () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return linsol;
}
WhichQualifier (GccEnt_Position& Qualif1 ,
GccEnt_Position& Qualif2 ) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
Qualif1 = qualifier1;
Qualif2 = qualifier2;
Tangency1 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& Pnt) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = par1sol;
ParArg = pararg1;
Tangency2 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& Pnt) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = par2sol;
ParArg = pararg2;
gp_Lin2d Geom2dGcc_Lin2dTanObl::
ThisSolution (const Standard_Integer Index) const {
- if (Index > NbrSol || Index <= 0) { Standard_OutOfRange::Raise(); }
+ if (Index > NbrSol || Index <= 0) { throw Standard_OutOfRange(); }
return linsol(Index);
}
WhichQualifier (const Standard_Integer Index,
GccEnt_Position& Qualif1) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else { Qualif1 = qualifier1(Index); }
}
Standard_Real& ParSol,
Standard_Real& ParArg,
gp_Pnt2d& PntSol) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par1sol(Index);
ParArg = pararg1(Index);
Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Index <= 0 ||Index > NbrSol) { throw Standard_OutOfRange(); }
else {
ParSol = par2sol(Index);
ParArg = pararg2(Index);
WellDone = Standard_False;
if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() ||
Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
- GccEnt_BadQualifier::Raise();
+ throw GccEnt_BadQualifier();
return;
}
Paral2 = Standard_False;
gp_Lin2d Geom2dGcc_Lin2dTanOblIter::ThisSolution () const
{
- if (!WellDone) StdFail_NotDone::Raise();
+ if (!WellDone) throw StdFail_NotDone();
return linsol;
}
void Geom2dGcc_Lin2dTanOblIter::
WhichQualifier (GccEnt_Position& Qualif1) const
{
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
Qualif1 = qualifier1;
}
Tangency1 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
else {
ParSol = par1sol;
ParArg = pararg1;
Intersection2 (Standard_Real& ParSol ,
Standard_Real& ParArg ,
gp_Pnt2d& PntSol ) const {
- if (!WellDone) { StdFail_NotDone::Raise(); }
- else if (Paral2) { Geom2dGcc_IsParallel::Raise(); }
+ if (!WellDone) { throw StdFail_NotDone(); }
+ else if (Paral2) { throw Geom2dGcc_IsParallel(); }
else {
PntSol = pntint2sol;
ParSol = par2sol;
gp_Vec a_vector ;
if (PointsArray.Length() < 3) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!TangentFlags.Value(1)) {
degree = 3 ;
if ( PointsArray.Length() < 3) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (PointsArray.Length() == 3) {
degree = 2 ;
myPoints->Upper()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
BuildParameters(PeriodicFlag,
PointsPtr->Array1(),
if (PeriodicFlag) {
if ((PointsPtr->Length()) + 1 != ParametersPtr->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
myTangents =
myPoints->Upper()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
result =
CheckParameters(ParametersPtr->Array1()) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (ii = myPoints->Lower() ; ii <= myPoints->Upper() ; ii++) {
myTangentFlags = TangentFlagsPtr ;
if (Tangents.Length() != myPoints->Length() ||
TangentFlagsPtr->Length() != myPoints->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
result =
CheckTangents(Tangents,
}
}
else {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myTangentFlags->Array1(),
myTolerance) ;
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if(Scale) {
const Handle(Geom_BSplineCurve)& GeomAPI_Interpolate::Curve() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise(" ");
+ throw StdFail_NotDone(" ");
return myCurve;
}
const GeomAbs_Shape Continuity,
const Standard_Real Tol3D)
{
- if (Params.Length() != Points.Length()) Standard_OutOfRange::Raise("");
+ if (Params.Length() != Points.Length()) throw Standard_OutOfRange("");
Standard_Real Tol2D = 0.; // dummy argument for BSplineCompute.
Standard_Integer Nbp = Params.Length();
const Handle(Geom_BSplineCurve)& GeomAPI_PointsToBSpline::Curve() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomAPI_PointsToBSpline::Curve ");
+ throw StdFail_NotDone("GeomAPI_PointsToBSpline::Curve ");
return myCurve;
}
break;
default:
- Standard_DomainError::Raise("GeomAdaptor::MakeCurve : OtherCurve");
+ throw Standard_DomainError("GeomAdaptor::MakeCurve : OtherCurve");
}
break;
case GeomAbs_OtherSurface:
- Standard_DomainError::Raise("GeomAdaptor::MakeSurface : OtherSurface");
+ throw Standard_DomainError("GeomAdaptor::MakeSurface : OtherSurface");
break;
}
case GeomAbs_G1: return GeomAbs_G1;
case GeomAbs_G2: return GeomAbs_G2;
default:
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::Continuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::Continuity");
}
}
else if (myTypeCurve == GeomAbs_OtherCurve) {
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::Contunuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::Contunuity");
}
return GeomAbs_CN;
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("GeomAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
switch(S){
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("GeomAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("Geom2dAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("Geom2dAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
switch(S){
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("GeomAdaptor_Curve::NbIntervals");
+ throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals");
break;
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
else if (myTypeCurve == GeomAbs_BSplineCurve)
return myBSplineCurve->Degree();
else
- Standard_NoSuchObject::Raise();
- // portage WNT
- return 0;
+ throw Standard_NoSuchObject();
}
//=======================================================================
else if (myTypeCurve == GeomAbs_BSplineCurve)
return myBSplineCurve->NbPoles();
else
- Standard_NoSuchObject::Raise();
- // portage WNT
- return 0;
+ throw Standard_NoSuchObject();
}
//=======================================================================
Standard_Integer GeomAdaptor_Curve::NbKnots() const
{
if ( myTypeCurve != GeomAbs_BSplineCurve)
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::NbKnots");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::NbKnots");
return myBSplineCurve->NbKnots();
}
Handle(Geom_BezierCurve) GeomAdaptor_Curve::Bezier() const
{
if ( myTypeCurve != GeomAbs_BezierCurve)
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::Bezier");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::Bezier");
return Handle(Geom_BezierCurve)::DownCast (myCurve);
}
Handle(Geom_BSplineCurve) GeomAdaptor_Curve::BSpline() const
{
if ( myTypeCurve != GeomAbs_BSplineCurve)
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::BSpline");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::BSpline");
return myBSplineCurve;
}
Handle(Geom_OffsetCurve) GeomAdaptor_Curve::OffsetCurve() const
{
if ( myTypeCurve != GeomAbs_OffsetCurve)
- Standard_NoSuchObject::Raise("GeomAdaptor_Curve::OffsetCurve");
+ throw Standard_NoSuchObject("GeomAdaptor_Curve::OffsetCurve");
return Handle(Geom_OffsetCurve)::DownCast(myCurve);
}
inline void GeomAdaptor_Curve::Load(const Handle(Geom_Curve)& C)
{
- if ( C.IsNull()) Standard_NullObject::Raise();
+ if ( C.IsNull()) throw Standard_NullObject();
load(C,C->FirstParameter(),C->LastParameter());
}
const Standard_Real UFirst,
const Standard_Real ULast)
{
- if ( C.IsNull()) Standard_NullObject::Raise();
+ if ( C.IsNull()) throw Standard_NullObject();
- if ( UFirst > ULast) Standard_ConstructionError::Raise();
+ if ( UFirst > ULast) throw Standard_ConstructionError();
load(C,UFirst,ULast);
}
case GeomAbs_C1 :
case GeomAbs_C0 : return GeomAbs_C0;
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UContinuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::UContinuity");
break;
}
case GeomAbs_SurfaceOfExtrusion:
return GC.Continuity();
}
case GeomAbs_OtherSurface:
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UContinuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::UContinuity");
case GeomAbs_Plane:
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_C1 :
case GeomAbs_C0 : return GeomAbs_C0;
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VContinuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::VContinuity");
break;
}
case GeomAbs_SurfaceOfRevolution:
return GC.Continuity();
}
case GeomAbs_OtherSurface:
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VContinuity");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::VContinuity");
case GeomAbs_Plane:
case GeomAbs_Cylinder:
case GeomAbs_Cone:
switch(S)
{
case GeomAbs_G1:
- case GeomAbs_G2: Standard_DomainError::Raise("GeomAdaptor_Curve::NbUIntervals");
+ case GeomAbs_G2: throw Standard_DomainError("GeomAdaptor_Curve::NbUIntervals");
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
case GeomAbs_C2: BaseS = GeomAbs_C3; break;
switch(S)
{
case GeomAbs_G1:
- case GeomAbs_G2: Standard_DomainError::Raise("GeomAdaptor_Curve::NbVIntervals");
+ case GeomAbs_G2: throw Standard_DomainError("GeomAdaptor_Curve::NbVIntervals");
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
case GeomAbs_C2: BaseS = GeomAbs_C3; break;
switch(S)
{
case GeomAbs_G1:
- case GeomAbs_G2: Standard_DomainError::Raise("GeomAdaptor_Curve::UIntervals");
+ case GeomAbs_G2: throw Standard_DomainError("GeomAdaptor_Curve::UIntervals");
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
case GeomAbs_C2: BaseS = GeomAbs_C3; break;
switch(S)
{
case GeomAbs_G1:
- case GeomAbs_G2: Standard_DomainError::Raise("GeomAdaptor_Curve::VIntervals");
+ case GeomAbs_G2: throw Standard_DomainError("GeomAdaptor_Curve::VIntervals");
case GeomAbs_C0: BaseS = GeomAbs_C1; break;
case GeomAbs_C1: BaseS = GeomAbs_C2; break;
case GeomAbs_C2: BaseS = GeomAbs_C3; break;
gp_Pln GeomAdaptor_Surface::Plane() const
{
if (mySurfaceType != GeomAbs_Plane)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Plane");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Plane");
return Handle(Geom_Plane)::DownCast (mySurface)->Pln();
}
gp_Cylinder GeomAdaptor_Surface::Cylinder() const
{
if (mySurfaceType != GeomAbs_Cylinder)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Cylinder");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Cylinder");
return Handle(Geom_CylindricalSurface)::DownCast (mySurface)->Cylinder();
}
gp_Cone GeomAdaptor_Surface::Cone() const
{
if (mySurfaceType != GeomAbs_Cone)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Cone");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Cone");
return Handle(Geom_ConicalSurface)::DownCast (mySurface)->Cone();
}
gp_Sphere GeomAdaptor_Surface::Sphere() const
{
if (mySurfaceType != GeomAbs_Sphere)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Sphere");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Sphere");
return Handle(Geom_SphericalSurface)::DownCast (mySurface)->Sphere();
}
gp_Torus GeomAdaptor_Surface::Torus() const
{
if (mySurfaceType != GeomAbs_Torus)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Torus");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Torus");
return Handle(Geom_ToroidalSurface)::DownCast (mySurface)->Torus();
}
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Degree();
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::UDegree");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::UDegree");
}
//=======================================================================
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbPoles();
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUPoles");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::NbUPoles");
}
//=======================================================================
(Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.Degree();
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::VDegree");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::VDegree");
}
//=======================================================================
(Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbPoles();
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVPoles");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::NbVPoles");
}
//=======================================================================
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
return myBasisCurve.NbKnots();
}
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbUKnots");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::NbUKnots");
}
//=======================================================================
{
if (mySurfaceType == GeomAbs_BSplineSurface)
return myBSplineSurface->NbVKnots();
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::NbVKnots");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::NbVKnots");
}
//=======================================================================
//function : IsURational
Handle(Geom_BezierSurface) GeomAdaptor_Surface::Bezier() const
{
if (mySurfaceType != GeomAbs_BezierSurface)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Bezier");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Bezier");
return Handle(Geom_BezierSurface)::DownCast (mySurface);
}
Handle(Geom_BSplineSurface) GeomAdaptor_Surface::BSpline() const
{
if (mySurfaceType != GeomAbs_BSplineSurface)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BSpline");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::BSpline");
return myBSplineSurface;
}
gp_Ax1 GeomAdaptor_Surface::AxeOfRevolution() const
{
if (mySurfaceType != GeomAbs_SurfaceOfRevolution)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::AxeOfRevolution");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::AxeOfRevolution");
return Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->Axis();
}
gp_Dir GeomAdaptor_Surface::Direction() const
{
if (mySurfaceType != GeomAbs_SurfaceOfExtrusion)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::Direction");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::Direction");
return Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->Direction();
}
else if (mySurfaceType == GeomAbs_SurfaceOfRevolution)
C = Handle(Geom_SurfaceOfRevolution)::DownCast (mySurface)->BasisCurve();
else
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisCurve");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::BasisCurve");
return Handle(GeomAdaptor_HCurve)(new GeomAdaptor_HCurve(C));
}
Handle(Adaptor3d_HSurface) GeomAdaptor_Surface::BasisSurface() const
{
if (mySurfaceType != GeomAbs_OffsetSurface)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::BasisSurface");
return new GeomAdaptor_HSurface
(Handle(Geom_OffsetSurface)::DownCast (mySurface)->BasisSurface(),
myUFirst,myULast,myVFirst,myVLast);
Standard_Real GeomAdaptor_Surface::OffsetValue() const
{
if (mySurfaceType != GeomAbs_OffsetSurface)
- Standard_NoSuchObject::Raise("GeomAdaptor_Surface::BasisSurface");
+ throw Standard_NoSuchObject("GeomAdaptor_Surface::BasisSurface");
return Handle(Geom_OffsetSurface)::DownCast (mySurface)->Offset();
}
inline void GeomAdaptor_Surface::Load(const Handle(Geom_Surface)& S)
{
- if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
+ if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
Standard_Real U1,U2,V1,V2;
S->Bounds(U1,U2,V1,V2);
const Standard_Real TolU,
const Standard_Real TolV)
{
- if ( S.IsNull()) Standard_NullObject::Raise("GeomAdaptor_Surface::Load");
+ if ( S.IsNull()) throw Standard_NullObject("GeomAdaptor_Surface::Load");
if(UFirst>ULast || VFirst>VLast)
- Standard_ConstructionError::Raise("GeomAdaptor_Surface::Load");
+ throw Standard_ConstructionError("GeomAdaptor_Surface::Load");
load(S,UFirst,ULast,VFirst,VLast,TolU,TolV);
}
Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::VPeriod() const
{
- Standard_DomainError::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::VPeriod");
- return 0.0e0 ;
+ throw Standard_DomainError("GeomAdaptor_SurfaceOfLinearExtrusion::VPeriod");
}
//=======================================================================
gp_Cone GeomAdaptor_SurfaceOfLinearExtrusion::Cone() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Cone");
- return gp_Cone();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::Cone");
}
//=======================================================================
gp_Sphere GeomAdaptor_SurfaceOfLinearExtrusion::Sphere() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Sphere");
- return gp_Sphere();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::Sphere");
}
//=======================================================================
gp_Torus GeomAdaptor_SurfaceOfLinearExtrusion::Torus() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Torus");
- return gp_Torus();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::Torus");
}
gp_Ax1 GeomAdaptor_SurfaceOfLinearExtrusion::AxeOfRevolution() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Axes");
- return gp_Ax1();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::Axes");
}
//=======================================================================
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsURational() const
{
- Standard_NoSuchObject::Raise
- ("GeomAdaptor_SurfaceOfLinearExtrusion::IsURational");
- return Standard_False;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::IsURational");
}
//=======================================================================
//function : IsVRational
Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVRational() const
{
- Standard_NoSuchObject::Raise
- ("GeomAdaptor_SurfaceOfLinearExtrusion::IsVRational");
- return Standard_False;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::IsVRational");
}
//=======================================================================
//function : Bezier
Handle(Geom_BezierSurface) GeomAdaptor_SurfaceOfLinearExtrusion::Bezier() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::Bezier");
- return Handle(Geom_BezierSurface)() ;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::Bezier");
}
//=======================================================================
Handle(Geom_BSplineSurface) GeomAdaptor_SurfaceOfLinearExtrusion::BSpline() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfLinearExtrusion::BSpline");
- return Handle(Geom_BSplineSurface)() ;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfLinearExtrusion::BSpline");
}
//=======================================================================
while ( Dist < Precision::Confusion() && Ratio < 100);
if ( Ratio >= 100 ) {
- Standard_ConstructionError::Raise("Adaptor3d_SurfaceOfRevolution : Axe and meridian are confused");
+ throw Standard_ConstructionError("Adaptor3d_SurfaceOfRevolution : Axe and meridian are confused");
}
Ox = ( (Oz^gp_Vec(PP.XYZ()-O.XYZ()))^Oz);
}
Standard_Integer GeomAdaptor_SurfaceOfRevolution::NbVKnots() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::NbVKnots");
- return 0;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfRevolution::NbVKnots");
}
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsURational() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::IsURational");
- return Standard_False;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfRevolution::IsURational");
}
//=======================================================================
Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVRational() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::IsVRational");
- return Standard_False;
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfRevolution::IsVRational");
}
Handle(Geom_BezierSurface) GeomAdaptor_SurfaceOfRevolution::Bezier() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::Bezier");
- return Handle(Geom_BezierSurface)();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfRevolution::Bezier");
}
Handle(Geom_BSplineSurface) GeomAdaptor_SurfaceOfRevolution::BSpline() const
{
- Standard_NoSuchObject::Raise("GeomAdaptor_SurfaceOfRevolution::BSpline");
- return Handle(Geom_BSplineSurface)();
+ throw Standard_NoSuchObject("GeomAdaptor_SurfaceOfRevolution::BSpline");
}
//=======================================================================
{
Standard_Integer TheFirst = C->FirstUKnotIndex ();
Standard_Integer TheLast = C->LastUKnotIndex ();
- if (FromK1 == ToK2) Standard_DomainError::Raise();
+ if (FromK1 == ToK2) throw Standard_DomainError();
Standard_Integer FirstK = Min (FromK1, ToK2);
Standard_Integer LastK = Max (FromK1, ToK2);
- if (FirstK < TheFirst || LastK > TheLast) Standard_DomainError::Raise();
+ if (FirstK < TheFirst || LastK > TheLast) throw Standard_DomainError();
Handle(Geom_BSplineCurve) C1
= Handle(Geom_BSplineCurve)::DownCast(C->Copy ());
MaxSegments, MaxDegree);
if (ApprCOffs.HasResult())
TheCurve = ApprCOffs.Curve();
- else Standard_ConstructionError::Raise();
+ else throw Standard_ConstructionError();
}
- else { Standard_DomainError::Raise("No such curve"); }
+ else { throw Standard_DomainError("No such curve"); }
}
else {
TheConic->MajorRadius(), TheConic->MinorRadius());
/* if (Parameterisation == Convert_TgtThetaOver2_1 ||
Parameterisation == Convert_TgtThetaOver2_2) {
- Standard_DomainError::Raise(); }
+ throw Standard_DomainError(); }
else if ( Parameterisation == Convert_QuasiAngular) {
Convert_EllipseToBSplineCurve Convert (E2d,
gp_Circ2d C2d (gp::OX2d(), TheConic->Radius());
/* if (Parameterisation == Convert_TgtThetaOver2_1 ||
Parameterisation == Convert_TgtThetaOver2_2) {
- Standard_DomainError::Raise(); }
+ throw Standard_DomainError(); }
else if ( Parameterisation == Convert_QuasiAngular) {
Convert_CircleToBSplineCurve Convert (C2d,
MaxSegments, MaxDegree);
if (ApprCOffs.HasResult())
TheCurve = ApprCOffs.Curve();
- else Standard_ConstructionError::Raise();
+ else throw Standard_ConstructionError();
}
- else { Standard_DomainError::Raise("No such curve"); }
+ else { throw Standard_DomainError("No such curve"); }
}
return TheCurve;
PreLast,First,
Standard_True,Standard_True);
if (Cont<GeomAbs_C0)
- Standard_ConstructionError::Raise("GeomConvert curves not C0") ;
+ throw Standard_ConstructionError("GeomConvert curves not C0") ;
else{
if (Cont>=GeomAbs_G1)
tabG1(i-1)=Standard_True; //True=G1 continuity
fusion=C.Add(Curve1,
local_tolerance(j-1)); //merge of two consecutive curves
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("GeomConvert Concatenation Error") ;
+ throw Standard_ConstructionError("GeomConvert Concatenation Error") ;
Curve2=C.BSplineCurve();
}
Curve2->SetPeriodic();
GeomConvert_CompCurveToBSplineCurve C (ArrayOfConcatenated->Value(i));
fusion=C.Add(Curve1,ArrayOfToler(j-1)); //merge of two consecutive curves
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("GeomConvert Concatenation Error") ;
+ throw Standard_ConstructionError("GeomConvert Concatenation Error") ;
ArrayOfConcatenated->SetValue(i,C.BSplineCurve());
}
}
local_tolerance(i-1),
AngularTolerance);
if (Cont<GeomAbs_C0)
- Standard_ConstructionError::Raise("GeomConvert curves not C0");
+ throw Standard_ConstructionError("GeomConvert curves not C0");
else{
if (Cont>=GeomAbs_G1)
tabG1(i-1)=Standard_True; //True=G1 continuity
fusion=C.Add(Curve1,
local_tolerance(j-1)); //merge of two consecutive curves
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("GeomConvert Concatenation Error") ;
+ throw Standard_ConstructionError("GeomConvert Concatenation Error") ;
Curve2=C.BSplineCurve();
}
}
GeomConvert_CompCurveToBSplineCurve C (ArrayOfConcatenated->Value(i));
fusion=C.Add(Curve1, local_tolerance(j-1), Standard_True);
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("GeomConvert Concatenation Error");
+ throw Standard_ConstructionError("GeomConvert Concatenation Error");
ArrayOfConcatenated->SetValue(i,C.BSplineCurve());
}
}
for (i=1;i<ArrayOfConcatenated->Length();i++){
fusion=C.Add(ArrayOfConcatenated->Value(i),tolerance);
if (fusion==Standard_False)
- Standard_ConstructionError::Raise("GeomConvert Concatenation Error") ;
+ throw Standard_ConstructionError("GeomConvert Concatenation Error") ;
}
}
BS=C.BSplineCurve();
Standard_Integer FirstV = S->FirstVKnotIndex ();
Standard_Integer LastU = S->LastUKnotIndex ();
Standard_Integer LastV = S->LastVKnotIndex ();
- if (FromUK1 == ToUK2 || FromVK1 == ToVK2) Standard_DomainError::Raise();
+ if (FromUK1 == ToUK2 || FromVK1 == ToVK2) throw Standard_DomainError();
Standard_Integer FirstUK = Min (FromUK1, ToUK2);
Standard_Integer LastUK = Max (FromUK1, ToUK2);
Standard_Integer FirstVK = Min (FromVK1, ToVK2);
Standard_Integer LastVK = Max (FromVK1, ToVK2);
if (FirstUK < FirstU || LastUK > LastU ||
- FirstVK < FirstV || LastVK > LastV) { Standard_DomainError::Raise(); }
+ FirstVK < FirstV || LastVK > LastV) { throw Standard_DomainError(); }
Handle(Geom_BSplineSurface) S1= Handle(Geom_BSplineSurface)::DownCast(S->Copy());
const Standard_Boolean USplit,
const Standard_Boolean SameOrientation )
{
- if (FromK1 == ToK2) Standard_DomainError::Raise();
+ if (FromK1 == ToK2) throw Standard_DomainError();
Handle(Geom_BSplineSurface) S1 = Handle(Geom_BSplineSurface)::DownCast(S->Copy());
Standard_Integer LastU = S->LastUKnotIndex ();
Standard_Integer FirstUK = Min (FromK1, ToK2);
Standard_Integer LastUK = Max (FromK1, ToK2);
- if (FirstUK < FirstU || LastUK > LastU) Standard_DomainError::Raise();
+ if (FirstUK < FirstU || LastUK > LastU) throw Standard_DomainError();
S1->Segment( S1->UKnot(FirstUK),
S1->UKnot(LastUK),
Standard_Integer LastV = S->LastVKnotIndex ();
Standard_Integer FirstVK = Min (FromK1, ToK2);
Standard_Integer LastVK = Max (FromK1, ToK2);
- if (FirstVK < FirstV || LastVK > LastV) Standard_DomainError::Raise();
+ if (FirstVK < FirstV || LastVK > LastV) throw Standard_DomainError();
S1->Segment( S1->UKnot(S1->FirstUKnotIndex()),
S1->UKnot(S1->LastUKnotIndex()),
const Standard_Boolean SameOrientation )
{
if (Abs (FromParam1 - ToParam2) <= Abs(ParametricTolerance)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
Handle(Geom_BSplineSurface) NewSurface
= Handle(Geom_BSplineSurface)::DownCast(S->Copy());
Precision::IsPositiveInfinite(ULast) ||
Precision::IsNegativeInfinite(VFirst) ||
Precision::IsPositiveInfinite(VLast) ) {
- Standard_DomainError::Raise("");
+ throw Standard_DomainError("");
}
Handle(Geom_BSplineSurface) TheSurface;
) {
- if (ContinuityRange < 0) Standard_RangeError::Raise();
+ if (ContinuityRange < 0) throw Standard_RangeError();
Standard_Integer FirstIndex = BasisCurve->FirstUKnotIndex();
Standard_Integer LastIndex = BasisCurve->LastUKnotIndex();
const Standard_Real ParametricTolerance)
{
if (U2 - U1 < ParametricTolerance)
- Standard_DomainError::Raise("GeomConvert_BSplineCurveToBezierSurface");
+ throw Standard_DomainError("GeomConvert_BSplineCurveToBezierSurface");
Standard_Real Uf = U1, Ul = U2;
Standard_Real PTol = ParametricTolerance/2 ;
(const Standard_Integer Index)
{
if ( Index < 1 || Index > myCurve->NbKnots()-1) {
- Standard_OutOfRange::Raise("GeomConvert_BSplineCurveToBezierCurve");
+ throw Standard_OutOfRange("GeomConvert_BSplineCurveToBezierCurve");
}
Standard_Integer Deg = myCurve->Degree();
if (UContinuityRange < 0 || VContinuityRange < 0) {
- Standard_RangeError::Raise();
+ throw Standard_RangeError();
}
Standard_Integer FirstUIndex = BasisSurface->FirstUKnotIndex ();
{
if ( (U2 - U1 < ParametricTolerance) ||
(V2 - V1 < ParametricTolerance) )
- Standard_DomainError::Raise("GeomConvert_BSplineSurfaceToBezierSurface");
+ throw Standard_DomainError("GeomConvert_BSplineSurfaceToBezierSurface");
Standard_Real Uf=U1, Ul=U2, Vf=V1, Vl=V2, PTol = ParametricTolerance/2;
Standard_Integer I1, I2;
{
if (UIndex < 1 || UIndex > mySurface->NbUKnots()-1 ||
VIndex < 1 || VIndex > mySurface->NbVKnots()-1 ) {
- Standard_OutOfRange::Raise("GeomConvert_BSplineSurfaceToBezierSurface");
+ throw Standard_OutOfRange("GeomConvert_BSplineSurfaceToBezierSurface");
}
Standard_Integer UDeg = mySurface->UDegree();
Standard_Integer VDeg = mySurface->VDegree();
decu = 3;
break;
default:
- Standard_ConstructionError::Raise(
+ throw Standard_ConstructionError(
"GeomConvert_CompBezierSurfacesToBSpl:: UContinuity error");
}
decv = 3;
break;
default:
- Standard_ConstructionError::Raise(
+ throw Standard_ConstructionError(
"GeomConvert_CompBezierSurfacesToBSpl:: VContinuity error");
}
gp_XYZ Ndir = (theD1.XYZ()).Crossed(myOffsetDir.XYZ());
Standard_Real R = Ndir.Modulus();
if (R <= gp::Resolution())
- Standard_NullValue::Raise("GeomEvaluator_OffsetCurve: Undefined normal vector "
+ throw Standard_NullValue("GeomEvaluator_OffsetCurve: Undefined normal vector "
"because tangent vector has zero-magnitude!");
Ndir.Multiply(myOffset / R);
Standard_Real Dr = Ndir.Dot(DNdir);
if (R3 <= gp::Resolution()) {
if (R2 <= gp::Resolution())
- Standard_NullValue::Raise("GeomEvaluator_OffsetCurve: Null derivative");
+ throw Standard_NullValue("GeomEvaluator_OffsetCurve: Null derivative");
//We try another computation but the stability is not very good.
DNdir.Multiply(R);
DNdir.Subtract(Ndir.Multiplied(Dr / R));
if (R5 <= gp::Resolution()) {
if (R4 <= gp::Resolution())
- Standard_NullValue::Raise("GeomEvaluator_OffsetCurve: Null derivative");
+ throw Standard_NullValue("GeomEvaluator_OffsetCurve: Null derivative");
//We try another computation but the stability is not very good
//dixit ISG.
// V2 = P" (U) :
Standard_Real D3r = Ndir.Dot(D3Ndir) + 3.0 * DNdir.Dot(D2Ndir);
if (R7 <= gp::Resolution()) {
if (R6 <= gp::Resolution())
- Standard_NullValue::Raise("CSLib_Offset: Null derivative");
+ throw Standard_NullValue("CSLib_Offset: Null derivative");
// V3 = P"' (U) :
D3Ndir.Subtract(D2Ndir.Multiplied(3.0 * Dr / R2));
D3Ndir.Subtract(DNdir.Multiplied(3.0 * ((D2r / R2) + (Dr*Dr / R4))));
}
if (NStatus != CSLib_Defined)
- Geom_UndefinedValue::Raise(
+ throw Geom_UndefinedValue(
"GeomEvaluator_OffsetSurface::CalculateD0(): Unable to calculate normal");
theValue.SetXYZ(theValue.XYZ() + myOffset * aSign * Normal.XYZ());
}
if (NStatus != CSLib_Defined)
- Geom_UndefinedValue::Raise(
+ throw Geom_UndefinedValue(
"GeomEvaluator_OffsetSurface::CalculateD1(): Unable to calculate normal");
theValue.SetXYZ(theValue.XYZ() + myOffset * aSign * Normal.XYZ());
CSLib::Normal(MaxOrder, DerNUV, MagTol, theU, theV, Umin, Umax, Vmin, Vmax,
NStatus, Normal, OrderU, OrderV);
if (NStatus != CSLib_Defined)
- Geom_UndefinedValue::Raise(
+ throw Geom_UndefinedValue(
"GeomEvaluator_OffsetSurface::CalculateD2(): Unable to calculate normal");
theValue.SetXYZ(theValue.XYZ() + myOffset * aSign * Normal.XYZ());
CSLib::Normal(MaxOrder, DerNUV, MagTol, theU, theV, Umin, Umax, Vmin, Vmax,
NStatus, Normal, OrderU, OrderV);
if (NStatus != CSLib_Defined)
- Geom_UndefinedValue::Raise(
+ throw Geom_UndefinedValue(
"GeomEvaluator_OffsetSurface::CalculateD3(): Unable to calculate normal");
theValue.SetXYZ(theValue.XYZ() + myOffset * aSign * Normal.XYZ());
CSLib::Normal(MaxOrder, DerNUV, MagTol, theU, theV, Umin, Umax, Vmin, Vmax,
NStatus, Normal, OrderU, OrderV);
if (NStatus != CSLib_Defined)
- Geom_UndefinedValue::Raise(
+ throw Geom_UndefinedValue(
"GeomEvaluator_OffsetSurface::CalculateDN(): Unable to calculate normal");
gp_Vec D;
}
}
else {
- Standard_ConstructionError::Raise(" ");
+ throw Standard_ConstructionError(" ");
}
return C1->NbPoles();
if(Type == GeomFill_CoonsStyle) {
if(NbUPoles < 4 || NbVPoles < 4)
- Standard_ConstructionError::Raise("GeomFill_BSplineCurves: invalid filling style");
+ throw Standard_ConstructionError("GeomFill_BSplineCurves: invalid filling style");
}
TColgp_Array1OfPnt P1(1,NbUPoles);
}
if(!IsOK)
- Standard_OutOfRange::Raise("GeomFill_BSplineCurves: Courbes non jointives");
+ throw Standard_OutOfRange("GeomFill_BSplineCurves: Courbes non jointives");
Standard_Integer NbUPoles = CC1->NbPoles();
Standard_Integer NbVPoles = CC2->NbPoles();
}
if(!IsOK)
- Standard_OutOfRange::Raise("GeomFill_BezierCurves: Courbes non jointives");
+ throw Standard_OutOfRange("GeomFill_BezierCurves: Courbes non jointives");
CC1->Poles(P1);
CC2->Poles(P2);
{
// voir s il ne faudrait pas utiliser LProp ou autre.
if (!HasNormals())
- Standard_Failure::Raise("BoundWithSurf Norm : pas de contrainte");
+ throw Standard_Failure("BoundWithSurf Norm : pas de contrainte");
// Handle(Adaptor3d_HSurface)& S = myConS.GetSurface();
// Handle(Adaptor2d_HCurve2d)& C2d = myConS.GetCurve();
gp_Vec& DN) const
{
if (!HasNormals())
- Standard_Failure::Raise("BoundWithSurf Norm : pas de contrainte");
+ throw Standard_Failure("BoundWithSurf Norm : pas de contrainte");
// Handle(Adaptor3d_HSurface)& S = myConS.GetSurface();
// Handle(Adaptor2d_HCurve2d)& C2d = myConS.GetCurve();
gp_Pnt2d P2d;
gp_Vec GeomFill_Boundary::Norm(const Standard_Real ) const
{
- Standard_Failure::Raise("GeomFill_Boundary::Norm : Undefined normals");
- return gp_Vec();
+ throw Standard_Failure("GeomFill_Boundary::Norm : Undefined normals");
}
void GeomFill_Boundary::D1Norm(const Standard_Real , gp_Vec& , gp_Vec& ) const
{
- Standard_Failure::Raise("GeomFill_Boundary::Norm : Undefined normals");
+ throw Standard_Failure("GeomFill_Boundary::Norm : Undefined normals");
}
void GeomFill_ConstrainedFilling::ReBuild()
{
- if(!appdone) Standard_Failure::Raise
- ("GeomFill_ConstrainedFilling::ReBuild Approx non faite");
+ if(!appdone) throw Standard_Failure("GeomFill_ConstrainedFilling::ReBuild Approx non faite");
MatchKnots();
PerformS0();
PerformS1();
Init(P1, P2, P3, P4, W1, W2, W3, W4);
}
-
-//=======================================================================
-//function : GeomFill_Curved
-//purpose :
-//=======================================================================
-
-GeomFill_Curved::GeomFill_Curved(const TColgp_Array1OfPnt& P1,
- const TColgp_Array1OfPnt& P2,
- const TColgp_Array1OfPnt& P3)
-{
- Init(P1, P2, P3);
-}
-
-
-//=======================================================================
-//function : GeomFill_Curved
-//purpose :
-//=======================================================================
-
-GeomFill_Curved::GeomFill_Curved(const TColgp_Array1OfPnt& P1,
- const TColgp_Array1OfPnt& P2,
- const TColgp_Array1OfPnt& P3,
- const TColStd_Array1OfReal& W1,
- const TColStd_Array1OfReal& W2,
- const TColStd_Array1OfReal& W3)
-{
- Init(P1, P2, P3, W1, W2, W3);
-}
-
-
//=======================================================================
//function : GeomFill_Curved
//purpose :
}
-//=======================================================================
-//function : Init
-//purpose :
-//=======================================================================
-
-void GeomFill_Curved::Init(const TColgp_Array1OfPnt& , // P1,
- const TColgp_Array1OfPnt& , // P2,
- const TColgp_Array1OfPnt& )// P3)
-{
- Standard_NotImplemented::Raise(" ");
-}
-
-
-//=======================================================================
-//function : Init
-//purpose :
-//=======================================================================
-
-void GeomFill_Curved::Init(const TColgp_Array1OfPnt& , // P1,
- const TColgp_Array1OfPnt& , // P2,
- const TColgp_Array1OfPnt& , // P3,
- const TColStd_Array1OfReal& , // W1,
- const TColStd_Array1OfReal& , // W2,
- const TColStd_Array1OfReal& ) // W3)
-{
- Standard_NotImplemented::Raise(" ");
-}
-
-
//=======================================================================
//function : Init
//purpose :
Standard_EXPORT GeomFill_Curved(const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3, const TColgp_Array1OfPnt& P4, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2, const TColStd_Array1OfReal& W3, const TColStd_Array1OfReal& W4);
- Standard_EXPORT GeomFill_Curved(const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3);
-
- Standard_EXPORT GeomFill_Curved(const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2, const TColStd_Array1OfReal& W3);
-
Standard_EXPORT GeomFill_Curved(const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2);
Standard_EXPORT GeomFill_Curved(const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2);
Standard_EXPORT void Init (const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3, const TColgp_Array1OfPnt& P4, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2, const TColStd_Array1OfReal& W3, const TColStd_Array1OfReal& W4);
- Standard_EXPORT void Init (const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3);
-
- Standard_EXPORT void Init (const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColgp_Array1OfPnt& P3, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2, const TColStd_Array1OfReal& W3);
-
Standard_EXPORT void Init (const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2);
Standard_EXPORT void Init (const TColgp_Array1OfPnt& P1, const TColgp_Array1OfPnt& P2, const TColStd_Array1OfReal& W1, const TColStd_Array1OfReal& W2);
(Surf->Surface().UContinuity()) : (Surf->Surface().VContinuity());
OrderU = OrderV = 0;
#ifdef CHECK
- if (Cont == GeomAbs_C0) Geom_UndefinedValue::Raise();
+ if (Cont == GeomAbs_C0) throw Geom_UndefinedValue();
#endif
gp_Pnt P;
Surf->D1(U, V, P, D1U, D1V);
if (NStatus != CSLib_Defined) {
if (Cont==GeomAbs_C0 ||
Cont==GeomAbs_C1) {
- Geom_UndefinedValue::Raise();
+ throw Geom_UndefinedValue();
}
Standard_Integer MaxOrder=3;
TColgp_Array2OfVec DerNUV(0,MaxOrder,0,MaxOrder);
<< DerSurf(i,j).Y() <<"," << DerSurf(i,j).Z() << endl;
}
#endif
- Geom_UndefinedValue::Raise();
+ throw Geom_UndefinedValue();
}
}
}
(Surf->Surface().UContinuity()) : (Surf->Surface().VContinuity());
if (Cont==GeomAbs_C0 ||
Cont==GeomAbs_C1) {
- Geom_UndefinedDerivative::Raise();
+ throw Geom_UndefinedDerivative();
}
#endif
gp_Vec d2u, d2v, d2uv;
CSLib::Normal(MaxOrder,DerNUV,MagTol,U,V,Umin,Umax,Vmin,Vmax,
NStatus,Normal,OrderU,OrderV);
- if (NStatus != CSLib_Defined) Geom_UndefinedValue::Raise();
+ if (NStatus != CSLib_Defined) throw Geom_UndefinedValue();
D1UNormal = CSLib::DNNormal(1,0,DerNUV,OrderU,OrderV);
D1VNormal = CSLib::DNNormal(0,1,DerNUV,OrderU,OrderV);
GeomAbs_Shape Cont = (Surf->Surface().UContinuity() < Surf->Surface().VContinuity()) ?
(Surf->Surface().UContinuity()) : (Surf->Surface().VContinuity());
if (Cont == GeomAbs_C0 || Continuity == GeomAbs_C1 ||
- Cont == GeomAbs_C2) { Geom_UndefinedDerivative::Raise(); }
+ Cont == GeomAbs_C2) { throw Geom_UndefinedDerivative(); }
#endif
gp_Vec d3u, d3uuv, d3uvv, d3v;
gp_Pnt P;
CSLib::Normal(MaxOrder,DerNUV,MagTol,U,V,Umin,Umax,Vmin,Vmax,
NStatus,Normal,OrderU,OrderV);
- if (NStatus != CSLib_Defined) Geom_UndefinedValue::Raise();
+ if (NStatus != CSLib_Defined) throw Geom_UndefinedValue();
D1UNormal = CSLib::DNNormal(1,0,DerNUV,OrderU,OrderV);
D1VNormal = CSLib::DNNormal(0,1,DerNUV,OrderU,OrderV);
{
Standard_Real NewParam = (myKnots->Value(i-1) + myKnots->Value(i))/2.;
if (NewParam - myKnots->Value(i-1) < gp::Resolution())
- Standard_ConstructionError::Raise("GeomFill_DiscreteTrihedron : impassable singularities on path curve");
+ throw Standard_ConstructionError("GeomFill_DiscreteTrihedron : impassable singularities on path curve");
myKnots->InsertBefore(i, NewParam);
i--;
}
case GeomAbs_C2:
case GeomAbs_C3:
case GeomAbs_CN: tmpS = GeomAbs_CN; break;
- default: Standard_OutOfRange::Raise();
+ default: throw Standard_OutOfRange();
}
return myCurve->NbIntervals(tmpS);
case GeomAbs_C2:
case GeomAbs_C3:
case GeomAbs_CN: tmpS = GeomAbs_CN; break;
- default: Standard_OutOfRange::Raise();
+ default: throw Standard_OutOfRange();
}
myCurve->Intervals(TT, tmpS);
Handle(Geom_Curve) GeomFill_EvolvedSection::ConstantSection() const
{
Standard_Real Err, scale;
- if (!IsConstant(Err)) StdFail_NotDone::Raise("The Law is not Constant!");
+ if (!IsConstant(Err)) throw StdFail_NotDone("The Law is not Constant!");
gp_Trsf T;
gp_Pnt P(0, 0, 0);
scale = myLaw->Value(First) +
const gp_Vec& Normal)
{
if (Tangent.IsParallel(Normal, 0.01) )
- Standard_ConstructionError::Raise(
+ throw Standard_ConstructionError(
"GeomFill_Fixed : Two parallel vectors !");
T = Tangent;
T.Normalize();
case GeomAbs_C2:
case GeomAbs_C3:
case GeomAbs_CN: tmpS = GeomAbs_CN; break;
- default: Standard_OutOfRange::Raise();
+ default: throw Standard_OutOfRange();
}
NbTrimmed = myCurve->NbIntervals(tmpS);
case GeomAbs_C2:
case GeomAbs_C3:
case GeomAbs_CN: tmpS = GeomAbs_CN; break;
- default: Standard_OutOfRange::Raise();
+ default: throw Standard_OutOfRange();
}
if (!isSngl) {
Standard_Real& LastAngle)
{
if (myCurve.IsNull())
- Standard_ConstructionError::Raise(
+ throw Standard_ConstructionError(
"GeomFill_LocationGuide::The path is not setted !!");
//repere fixe
cout << "DEDX = " << DEDX << endl;
cout << "DEDT = " << DEDT << endl;
#endif
- Standard_ConstructionError::Raise(
+ throw Standard_ConstructionError(
"LocationGuide::D1 : No Result dans la derivee");
}
// void GeomFill_LocationGuide::Rotation(gp_Pnt& Centre) const
void GeomFill_LocationGuide::Rotation(gp_Pnt& ) const
{
- Standard_NotImplemented::Raise("GeomFill_LocationGuide::Rotation");
+ throw Standard_NotImplemented("GeomFill_LocationGuide::Rotation");
}
//==================================================================
Standard_Boolean GeomFill_LocationLaw::D1(const Standard_Real, gp_Mat&, gp_Vec&,gp_Mat&, gp_Vec&,TColgp_Array1OfPnt2d&,TColgp_Array1OfVec2d&)
{
- Standard_NotImplemented::Raise("GeomFill_LocationLaw::D1");
- return 0;
+ throw Standard_NotImplemented("GeomFill_LocationLaw::D1");
}
Standard_Boolean GeomFill_LocationLaw::D2(const Standard_Real,
gp_Mat&, gp_Vec&,
TColgp_Array1OfPnt2d&,TColgp_Array1OfVec2d&,TColgp_Array1OfVec2d&)
{
- Standard_NotImplemented::Raise("GeomFill_LocationLaw::D2");
- return 0;
+ throw Standard_NotImplemented("GeomFill_LocationLaw::D2");
}
Standard_Integer GeomFill_LocationLaw::Nb2dCurves() const
// void GeomFill_LocationLaw::Resolution(const Standard_Integer Index,const Standard_Real Tol,Standard_Real& TolU,Standard_Real& TolV) const
void GeomFill_LocationLaw::Resolution(const Standard_Integer ,const Standard_Real ,Standard_Real& ,Standard_Real& ) const
{
- Standard_NotImplemented::Raise("GeomFill_LocationLaw::Resolution");
+ throw Standard_NotImplemented("GeomFill_LocationLaw::Resolution");
}
void GeomFill_LocationLaw::SetTolerance(const Standard_Real,
}
void GeomFill_LocationLaw::Rotation(gp_Pnt&) const
{
- Standard_NotImplemented::Raise("GeomFill_SectionLaw::Rotation");
+ throw Standard_NotImplemented("GeomFill_SectionLaw::Rotation");
}
Handle(Geom_Curve) GeomFill_NSections::ConstantSection() const
{
// Standard_Real Err;
-// if (!IsConstant(Err)) StdFail_NotDone::Raise("The Law is not Constant!");
+// if (!IsConstant(Err)) throw StdFail_NotDone("The Law is not Constant!");
Handle(Geom_Curve) C;
C = Handle(Geom_Curve)::DownCast( mySections(1)->Copy());
return C;
Handle(Geom_Curve) GeomFill_NSections::CirclSection(const Standard_Real V) const
{
Standard_Real Err;
- if (!IsConicalLaw(Err)) StdFail_NotDone::Raise("The Law is not Conical!");
+ if (!IsConicalLaw(Err)) throw StdFail_NotDone("The Law is not Conical!");
GeomAdaptor_Curve AC1(mySections(1));
GeomAdaptor_Curve AC2(mySections(mySections.Length()));
default :
{
- Standard_ConstructionError::Raise
- ("GeomFill::Init : Unknown Option");
+ throw Standard_ConstructionError("GeomFill::Init : Unknown Option");
}
}
}
for ( i = 1; i<NSections.Length(); i++) {
if ( Abs(SeqP.Value(i+1)-SeqP.Value(i)) < Precision::PConfusion()) {
- Standard_ConstructionError::Raise
- ("GeomFill_Pipe::Init with NSections : invalid parameters");
+ throw Standard_ConstructionError("GeomFill_Pipe::Init with NSections : invalid parameters");
}
}
myIsDone = Standard_True;
}
//else {
- // Standard_ConstructionError::Raise ("GeomFill_Pipe::Perform : Cannot make a surface");
+ // throw Standard_ConstructionError("GeomFill_Pipe::Perform : Cannot make a surface");
//}
}
}
myIsDone = Standard_True;
}
//else {
- // Standard_ConstructionError::Raise ("GeomFill_Pipe::Perform : Cannot make a surface");
+ // throw Standard_ConstructionError("GeomFill_Pipe::Perform : Cannot make a surface");
//}
}
else {
// generate a sequence of the section by <SweepSectionGenerator>
// and approximate this sequence.
- if (myType != 4) Standard_ConstructionError::Raise("GeomFill_Pipe");
+ if (myType != 4) throw Standard_ConstructionError("GeomFill_Pipe");
GeomFill_SweepSectionGenerator Section(myAdpPath, myAdpFirstSect,
myAdpLastSect,myRadius);
#endif
}
#endif
- //StdFail_NotDone::Raise("Pipe : App not done");
+ //throw StdFail_NotDone("Pipe : App not done");
}
else {
Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots,
Standard_Integer GeomFill_Profiler::Degree() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
Handle(Geom_BSplineCurve) C =
Handle(Geom_BSplineCurve)::DownCast(mySequence(1));
Standard_Integer GeomFill_Profiler::NbPoles() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
Handle(Geom_BSplineCurve) C =
Handle(Geom_BSplineCurve)::DownCast(mySequence(1));
TColgp_Array1OfPnt& Poles) const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
Standard_DomainError_Raise_if( Poles.Length() != NbPoles(),
"GeomFill_Profiler::Poles");
TColStd_Array1OfReal& Weights) const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
Standard_DomainError_Raise_if( Weights.Length() != NbPoles(),
"GeomFill_Profiler::Weights");
Standard_Integer GeomFill_Profiler::NbKnots() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
Handle(Geom_BSplineCurve) C =
Handle(Geom_BSplineCurve)::DownCast(mySequence(1));
TColStd_Array1OfInteger& Mults ) const
{
if ( !myIsDone)
- StdFail_NotDone::Raise("GeomFill_Profiler::Degree");
+ throw StdFail_NotDone("GeomFill_Profiler::Degree");
#ifndef No_Exception
Standard_Integer n = NbKnots();
Standard_Boolean GeomFill_SectionLaw::D1(const Standard_Real,TColgp_Array1OfPnt&,TColgp_Array1OfVec&,TColStd_Array1OfReal&,TColStd_Array1OfReal& )
{
- Standard_NotImplemented::Raise("GeomFill_SectionLaw::D1");
- return 0;
+ throw Standard_NotImplemented("GeomFill_SectionLaw::D1");
}
Standard_Boolean GeomFill_SectionLaw::D2(const Standard_Real,TColgp_Array1OfPnt& ,TColgp_Array1OfVec&,TColgp_Array1OfVec&,TColStd_Array1OfReal&,TColStd_Array1OfReal&,TColStd_Array1OfReal&)
{
- Standard_NotImplemented::Raise("GeomFill_SectionLaw::D2");
- return 0;
+ throw Standard_NotImplemented("GeomFill_SectionLaw::D2");
}
Handle(Geom_BSplineSurface) GeomFill_SectionLaw::BSplineSurface() const
gp_Pnt GeomFill_SectionLaw::BarycentreOfSurf() const
{
- Standard_NotImplemented::Raise("GeomFill_SectionLaw::BarycentreOfSurf");
- return gp_Pnt(0.0, 0.0, 0.0);
+ throw Standard_NotImplemented("GeomFill_SectionLaw::BarycentreOfSurf");
}
void GeomFill_SectionLaw::GetMinimalWeight(TColStd_Array1OfReal&) const
{
- Standard_NotImplemented::Raise("GeomFill_SectionLaw::GetMinimalWeight");
+ throw Standard_NotImplemented("GeomFill_SectionLaw::GetMinimalWeight");
}
Standard_Boolean GeomFill_SectionLaw::IsConstant(Standard_Real& Error) const
Handle(Geom_Curve) GeomFill_SectionLaw::ConstantSection() const
{
Handle(Geom_Curve) C;
- Standard_DomainError::Raise("GeomFill_SectionLaw::ConstantSection");
- return C;
+ throw Standard_DomainError("GeomFill_SectionLaw::ConstantSection");
}
Standard_Boolean GeomFill_SectionLaw::IsConicalLaw(Standard_Real& Error) const
CirclSection(const Standard_Real) const
{
Handle(Geom_Curve) C;
- Standard_DomainError::Raise("GeomFill_SectionLaw::CirclSection");
- return C;
+ throw Standard_DomainError("GeomFill_SectionLaw::CirclSection");
}
Standard_Real angle;
if (!isplan)
- Standard_Failure::Raise("Illegal usage: can't rotate non-planar profile");
+ throw Standard_Failure("Illegal usage: can't rotate non-planar profile");
gp_Dir ProfileNormal = TheAxe.Direction();
gp_Dir SpineStartDir = Paxe.Direction();
// gp_Trsf Rot;
// if (!isplan)
- // Standard_Failure::Raise("Illegal usage: can't rotate non-planar profile");
+ // throw Standard_Failure("Illegal usage: can't rotate non-planar profile");
// gp_Dir ProfileNormal = TheAxe.Direction();
// gp_Dir SpineStartDir = Paxe.Direction();
case GeomAbs_C0: HCS = GeomAbs_C2; break;
case GeomAbs_C1: HCS = GeomAbs_C3; break;
case GeomAbs_C2: HCS = GeomAbs_CN; break;
- default: Standard_DomainError::Raise();
+ default: throw Standard_DomainError();
}
return myHCurve->NbIntervals(HCS);
}
case GeomAbs_C0: HCS = GeomAbs_C2; break;
case GeomAbs_C1: HCS = GeomAbs_C3; break;
case GeomAbs_C2: HCS = GeomAbs_CN; break;
- default: Standard_DomainError::Raise();
+ default: throw Standard_DomainError();
}
myHCurve->Intervals(T, HCS);
}
D3(U,C,D1C,D2C,D3C);
return D3C;
default:
- Standard_NotImplemented::Raise("Exception: Derivative order is greater than 3. "
+ throw Standard_NotImplemented("Exception: Derivative order is greater than 3. "
"Cannot compute of derivative.");
}
-
- return gp_Vec();
-
}
Standard_Real GeomFill_SnglrFunc::Resolution(const Standard_Real R3D) const
{
Standard_Integer ind = IndexOfTrace+1;
if (IndexOfTrace > myLoc->TraceNumber())
- Standard_OutOfRange::Raise(" GeomFill_Sweep::ErrorOnTrace");
+ throw Standard_OutOfRange(" GeomFill_Sweep::ErrorOnTrace");
UError = CError->Value(1, ind);
VError = CError->Value(2, ind);
{
Standard_Integer ind = IndexOfTrace+1;
if (IndexOfTrace > myLoc->TraceNumber())
- Standard_OutOfRange::Raise(" GeomFill_Sweep::Trace");
+ throw Standard_OutOfRange(" GeomFill_Sweep::Trace");
return myCurve2d->Value(ind);
}
(const Standard_Integer Index) const
{
if (Index > myTrsfs.Length())
- Standard_RangeError::Raise
- ("GeomFill_SweepSectionGenerator::Transformation");
+ throw Standard_RangeError("GeomFill_SweepSectionGenerator::Transformation");
return myTrsfs(Index);
}
gp_Vec& ,gp_Vec&,gp_Vec&,
gp_Vec&,gp_Vec&,gp_Vec& )
{
- Standard_NotImplemented::Raise(" GeomFill_TrihedronLaw::D2");
- return Standard_False;
+ throw Standard_NotImplemented(" GeomFill_TrihedronLaw::D2");
}
Standard_Boolean GeomFill_TrihedronLaw::D2(const Standard_Real,
gp_Vec& ,gp_Vec&,gp_Vec&,
gp_Vec&,gp_Vec& ,gp_Vec&)
{
- Standard_NotImplemented::Raise(" GeomFill_TrihedronLaw::D2");
- return Standard_False;
+ throw Standard_NotImplemented(" GeomFill_TrihedronLaw::D2");
}
void GeomFill_TrihedronLaw::SetInterval(const Standard_Real First,
case GeomAbs_Cone: quad1.SetValue(HS1->Surface().Cone()); break;
case GeomAbs_Sphere: quad1.SetValue(HS1->Surface().Sphere()); break;
case GeomAbs_Torus: quad1.SetValue(HS1->Surface().Torus()); break;
- default: Standard_ConstructionError::Raise("GeomInt_IntSS::MakeCurve");
+ default: throw Standard_ConstructionError("GeomInt_IntSS::MakeCurve");
}
}
quad1.SetValue(myHS1->Surface().Torus());
break;
default:
- Standard_ConstructionError::Raise("GeomInt_LineConstructor::Parameters");
+ throw Standard_ConstructionError("GeomInt_LineConstructor::Parameters");
}
quad1.Parameters(Ptref,U1,V1);
}
aP = ElCLib::Value(aT, GLine->Parabola());
break;
default:
- Standard_ConstructionError::Raise("GeomInt_LineConstructor::Parameters");
+ throw Standard_ConstructionError("GeomInt_LineConstructor::Parameters");
}
}
inline Standard_Integer GeomInt_LineConstructor::NbParts () const
{
- if (!done) { StdFail_NotDone::Raise(); }
+ if (!done) { throw StdFail_NotDone(); }
return (seqp.Length() / 2);
}
Standard_Real& WFirst,
Standard_Real& WLast) const
{
- if (!done) { StdFail_NotDone::Raise(); }
+ if (!done) { throw StdFail_NotDone(); }
WFirst = seqp(2*I-1);
WLast = seqp(2*I);
}
DEFINE_STANDARD_ALLOC
-
- //! Raises Construction Error
- Standard_EXPORT GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox();
-
Standard_EXPORT GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
DEFINE_STANDARD_ALLOC
-
- //! Raises Construction Error
- Standard_EXPORT GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox();
-
//! compute the solution point with the close point
Standard_EXPORT GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox(const TColStd_Array1OfReal& Param, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency);
GeomLProp_CLProps clp1(C1,u1,n1,tl);
GeomLProp_CLProps clp2(C2,u2,n2,tl);
if(!(clp1.Value().IsEqual(clp2.Value(),tl))) {
- Standard_Failure::Raise("Courbes non jointives");
+ throw Standard_Failure("Courbes non jointives");
}
Standard_Integer min = Min(n1,n2);
if ( min >= 1 ) {
Curve3d = GeomH3d;
}
else {
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
}
return Curve3d;
const Standard_Real RequestedLast,
Handle(Geom2d_Curve)& NewCurvePtr)
{
- if(CurvePtr.IsNull()) Standard_Failure::Raise();
+ if(CurvePtr.IsNull()) throw Standard_Failure();
if (Abs(LastOnCurve - RequestedLast) <= Tolerance &&
Abs(FirstOnCurve - RequestedFirst) <= Tolerance)
{
// Interpolation des contraintes
math_Matrix Mat(1, 4, 1, 4);
if (!PLib::HermiteCoefficients(0., 1., 1, 1, Mat))
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
for (jj=1; jj<=4; jj++) {
gp_XYZ aux(0.,0.,0.);
}
if (aDef->NbPoles() != aIn->NbPoles())
- Standard_ConstructionError::Raise("Inconsistent poles's number");
+ throw Standard_ConstructionError("Inconsistent poles's number");
for (ii=1; ii<=aDef->NbPoles(); ii++) {
P = aIn->Pole(ii);
// Concatenation
Ok = Concat.Add(Bezier, Tol, After);
- if (!Ok) Standard_ConstructionError::Raise("ExtendCurveToPoint");
+ if (!Ok) throw Standard_ConstructionError("ExtendCurveToPoint");
Curve = Concat.BSplineCurve();
}
NewDenominator,
status);
if (status!=0)
- Standard_ConstructionError::Raise("GeomLib Multiplication Error") ;
+ throw Standard_ConstructionError("GeomLib Multiplication Error") ;
for (i = 1 ; i <= new_num_u_poles ; i++) {
for (j = 1 ; j <= new_num_v_poles ; j++) {
for (k = 1 ; k <= 3 ; k++) {
const gp_Pln& GeomLib_IsPlanarSurface::Plan() const
{
- if (!IsPlan) StdFail_NotDone::Raise(" GeomLib_IsPlanarSurface");
+ if (!IsPlan) throw StdFail_NotDone(" GeomLib_IsPlanarSurface");
return myPlan;
}
Bounds(aA, aB);
if (Index == 1) return aA;
else if (Index == aN) return aB;
- else Standard_OutOfRange::Raise("GeomLib_LogSample::GetParameter");
+ else throw Standard_OutOfRange("GeomLib_LogSample::GetParameter");
}
Standard_Real v = myF + Exp(myexp*Index);
myLinCont = new GeomPlate_HSequenceOfCurveConstraint;
myPntCont = new GeomPlate_HSequenceOfPointConstraint;
if (myNbIter<1)
- Standard_ConstructionError::Raise("GeomPlate : Number of iteration must be >= 1");
+ throw Standard_ConstructionError("GeomPlate : Number of iteration must be >= 1");
if (NTCurve==0)
- Standard_ConstructionError::Raise("GeomPlate : the bounds Array is null");
+ throw Standard_ConstructionError("GeomPlate : the bounds Array is null");
if (Tang->Length()==0)
- Standard_ConstructionError::Raise("GeomPlate : the constraints Array is null");
+ throw Standard_ConstructionError("GeomPlate : the constraints Array is null");
Standard_Integer nbp = 0;
Standard_Integer i ;
for ( i=1;i<=NTCurve;i++)
{ nbp+=NPoints->Value(i);
}
if (nbp==0)
- Standard_ConstructionError::Raise("GeomPlate : the resolution is impossible if the number of constraints points is 0");
+ throw Standard_ConstructionError("GeomPlate : the resolution is impossible if the number of constraints points is 0");
if (myDegree<2)
- Standard_ConstructionError::Raise("GeomPlate ; the degree resolution must be upper of 2");
+ throw Standard_ConstructionError("GeomPlate ; the degree resolution must be upper of 2");
// Remplissage des champs passage de l'ancien constructeur au nouveau
for(i=1;i<=NTCurve;i++)
{ Handle(GeomPlate_CurveConstraint) Cont = new GeomPlate_CurveConstraint
myTolAng(TolAng),
myNbBounds(0)
{ if (myNbIter<1)
- Standard_ConstructionError::Raise("GeomPlate : Number of iteration must be >= 1");
+ throw Standard_ConstructionError("GeomPlate : Number of iteration must be >= 1");
if (myDegree<2)
- Standard_ConstructionError::Raise("GeomPlate : the degree resolution must be upper of 2");
+ throw Standard_ConstructionError("GeomPlate : the degree resolution must be upper of 2");
myLinCont = new GeomPlate_HSequenceOfCurveConstraint;
myPntCont = new GeomPlate_HSequenceOfPointConstraint;
mySurfInitIsGive=Standard_True;
myTolAng(TolAng),
myNbBounds(0)
{ if (myNbIter<1)
- Standard_ConstructionError::Raise("GeomPlate : Number of iteration must be >= 1");
+ throw Standard_ConstructionError("GeomPlate : Number of iteration must be >= 1");
if (myDegree<2)
- Standard_ConstructionError::Raise("GeomPlate : the degree resolution must be upper of 2");
+ throw Standard_ConstructionError("GeomPlate : the degree resolution must be upper of 2");
myLinCont = new GeomPlate_HSequenceOfCurveConstraint;
myPntCont = new GeomPlate_HSequenceOfPointConstraint;
mySurfInitIsGive=Standard_False;
for (Standard_Integer l=1;l<=NTLinCont;l++)
myInitOrder->SetValue(l,l);
if (!CourbeJointive(myTol3d))
- {// Standard_Failure::Raise("Curves are not joined");
+ {// throw Standard_Failure("Curves are not joined");
#ifdef OCCT_DEBUG
cout<<"WARNING : Courbes non jointives a "<<myTol3d<<" pres"<<endl;
#endif
if ( NTPntCont != 0)
nopt = 1; //Calcul par la methode du plan d'inertie
else if (!CourbeJoint || NTLinCont != myNbBounds)
- {// Standard_Failure::Raise("Curves are not joined");
+ {// throw Standard_Failure("Curves are not joined");
#ifdef OCCT_DEBUG
cout<<"WARNING : Courbes non jointives a "<<myTol3d<<" pres"<<endl;
#endif
{
myOrder=Tang;
if ((Tang<-1)||(Tang>2))
- Standard_Failure::Raise("GeomPlate : The continuity is not G0 G1 or G2");
+ throw Standard_Failure("GeomPlate : The continuity is not G0 G1 or G2");
myNbPoints=NPt;
myConstG0=Standard_True;
myConstG1=Standard_True;
// BS1=Handle(BRepAdaptor_HSurface)::DownCast(myFrontiere->
// ChangeCurve().GetSurface());
// Surf = BRep_Tool::Surface(BS1->ChangeSurface().Face());
- Standard_Failure::Raise(
+ throw Standard_Failure(
"GeomPlate_CurveConstraint : Surface must be GeomAdaptor_Surface");
}
gp_Pnt& P,gp_Vec& V1,gp_Vec& V2) const
{ gp_Pnt2d P2d;
if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D1(P2d.Coord(1),P2d.Coord(2),P,V1,V2);
gp_Vec& V3,gp_Vec& V4,gp_Vec& V5) const
{ gp_Pnt2d P2d;
if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
P2d = myFrontiere->ChangeCurve().GetCurve()->Value(U);
myFrontiere->ChangeCurve().GetSurface()->D2(P2d.Coord(1),P2d.Coord(2),P,V1,V2,V3,V4,V5);
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetG1Criterion(const Handle(Law_Function) &G1Crit)
{ if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
myG1Crit=G1Crit;
myConstG1=Standard_False;
}
//---------------------------------------------------------
void GeomPlate_CurveConstraint :: SetG2Criterion(const Handle(Law_Function) &G2Crit)
{ if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
myG2Crit=G2Crit;
myConstG2=Standard_False;
}
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: G1Criterion(const Standard_Real U) const
{ if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
if (myConstG1)
return myTolAng;
else
//---------------------------------------------------------
Standard_Real GeomPlate_CurveConstraint :: G2Criterion(const Standard_Real U) const
{ if (!my3dCurve.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
if (myConstG2)
return myTolCurv;
else
//------------------------------------------------------------
GeomLProp_SLProps &GeomPlate_CurveConstraint::LPropSurf(const Standard_Real U)
{ if (myFrontiere.IsNull())
- Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
gp_Pnt2d P2d= myFrontiere->ChangeCurve().GetCurve()->Value(U);
myLProp.SetParameters(P2d.X(),P2d.Y());
return myLProp;
myTolDist(TolDist),
hasPnt2dOnSurf(Standard_False)
{ if ((myOrder>1)||(myOrder<-1))
- Standard_Failure::Raise("GeomPlate_PointConstraint : the constraint must 0 or -1 with a point");
+ throw Standard_Failure("GeomPlate_PointConstraint : the constraint must 0 or -1 with a point");
}
//---------------------------------------------------------
// Fonction : Surface
//---------------------------------------------------------
//Handle(Geom_Surface) GeomPlate_PointConstraint::Surface() const
-//{ Standard_Failure::Raise("GeomPlate_PointConstraint.cxx : The surface does not exist");
+//{ throw Standard_Failure("GeomPlate_PointConstraint.cxx : The surface does not exist");
//}
//------------------------------------------------------------
//Fonction : LPropSurf
//------------------------------------------------------------
GeomLProp_SLProps &GeomPlate_PointConstraint::LPropSurf()
{ // if (myFrontiere.IsNull())
- // Standard_Failure::Raise("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
+ // throw Standard_Failure("GeomPlate_CurveConstraint.cxx : Curve must be on a Surface");
// gp_Pnt2d P2d= myFrontiere->ChangeCurve().GetCurve()->Value(U);
myLProp.SetParameters(myU,myV);
return myLProp;
void GeomPlate_Surface::UReverse()
{
- //Standard_Failure::Raise("UReverse");
+ //throw Standard_Failure("UReverse");
}
//=======================================================================
Standard_Real GeomPlate_Surface::UReversedParameter(const Standard_Real U) const
-{ //Standard_Failure::Raise("UReversedParameter");
+{ //throw Standard_Failure("UReversedParameter");
return (-U);
}
//=======================================================================
void GeomPlate_Surface::VReverse()
-{ //Standard_Failure::Raise("VReverse");
+{ //throw Standard_Failure("VReverse");
}
//=======================================================================
Standard_Real GeomPlate_Surface::VReversedParameter(const Standard_Real V) const
-{ //Standard_Failure::Raise("VReversedParameter");
+{ //throw Standard_Failure("VReversedParameter");
return (-V);
}
//void GeomPlate_Surface::TransformParameters(Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const
void GeomPlate_Surface::TransformParameters(Standard_Real& , Standard_Real& , const gp_Trsf& ) const
-{//Standard_Failure::Raise("TransformParameters");
+{//throw Standard_Failure("TransformParameters");
}
//gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& T) const
gp_GTrsf2d GeomPlate_Surface::ParametricTransformation(const gp_Trsf& ) const
-{//Standard_Failure::Raise("ParametricTransformation");
+{//throw Standard_Failure("ParametricTransformation");
return gp_GTrsf2d();
}
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsUClosed() const
-{ //Standard_Failure::Raise("IsUClosed(");
+{ //throw Standard_Failure("IsUClosed(");
//return 1;
return 0;
}
//=======================================================================
Standard_Boolean GeomPlate_Surface::IsVClosed() const
-{ //Standard_Failure::Raise("IsVClosed(");
+{ //throw Standard_Failure("IsVClosed(");
//return 1;
return 0;
}
//Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real U) const
Handle(Geom_Curve) GeomPlate_Surface::UIso(const Standard_Real ) const
-{ //Standard_Failure::Raise("UIso");
+{ //throw Standard_Failure("UIso");
return Handle(Geom_Curve)();
}
//Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real V) const
Handle(Geom_Curve) GeomPlate_Surface::VIso(const Standard_Real ) const
-{ //Standard_Failure::Raise("VIso");
+{ //throw Standard_Failure("VIso");
return Handle(Geom_Curve)();
}
//=======================================================================
GeomAbs_Shape GeomPlate_Surface::Continuity() const
-{ //Standard_Failure::Raise("Continuity()");
+{ //throw Standard_Failure("Continuity()");
return GeomAbs_Shape();
}
//Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer N) const
Standard_Boolean GeomPlate_Surface::IsCNu(const Standard_Integer ) const
-{ Standard_Failure::Raise("IsCNu");
- return 1;
+{
+ throw Standard_Failure("IsCNu");
}
//Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer N) const
Standard_Boolean GeomPlate_Surface::IsCNv(const Standard_Integer ) const
-{ Standard_Failure::Raise("IsCNv");
- return 1;
+{
+ throw Standard_Failure("IsCNv");
}
//void GeomPlate_Surface::D3(const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV) const
void GeomPlate_Surface::D3(const Standard_Real , const Standard_Real , gp_Pnt& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& , gp_Vec& ) const
-{ Standard_Failure::Raise("D3");
+{ throw Standard_Failure("D3");
}
//gp_Vec GeomPlate_Surface::DN(const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv) const
gp_Vec GeomPlate_Surface::DN(const Standard_Real , const Standard_Real , const Standard_Integer , const Standard_Integer ) const
-{ Standard_Failure::Raise("DN");
- return gp_Vec();
+{
+ throw Standard_Failure("DN");
}
//void GeomPlate_Surface::Transform(const gp_Trsf& T)
void GeomPlate_Surface::Transform(const gp_Trsf& )
-{ //Standard_Failure::Raise("Transform");
+{ //throw Standard_Failure("Transform");
}
//=======================================================================
void GeomPlate_Surface::SetBounds(const Standard_Real Umin, const Standard_Real Umax, const Standard_Real Vmin, const Standard_Real Vmax)
{
- if ((Umin>Umax) || (Vmin>Vmax)) Standard_Failure::Raise("Bounds haven't the good sense");
- if ((Umin==Umax) || (Vmin==Vmax)) Standard_Failure::Raise("Bounds are equal");
+ if ((Umin>Umax) || (Vmin>Vmax)) throw Standard_Failure("Bounds haven't the good sense");
+ if ((Umin==Umax) || (Vmin==Vmax)) throw Standard_Failure("Bounds are equal");
myUmin=Umin;myUmax=Umax;myVmin=Vmin;myVmax=Vmax;
}
mycurve = bspl;
}
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomToIGES_GeomCurve: can't trim bspline" << endl;
cout << "Warning: Exception in Segment(): " ;
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
}
res = TransferCurve(GeomConvert::CurveToBSplineCurve(start),U1,U2);
return res;
}
- catch(Standard_Failure){
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "writing non-planar offset curve."<<endl;
cout << "Warning: GeomConvert::CurveToBSplineCurve raised an exception: ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
}
aRadius = CS->RefRadius();
aSemiAngle = CS->SemiAngle();
if (aSemiAngle < 0. || aSemiAngle > M_PI/2.) {
- Standard_DomainError::Raise("Conicalsurface not STEP conformant");
+ throw Standard_DomainError("Conicalsurface not STEP conformant");
}
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
break;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
cout <<"EXCEPTION in GeomTools_Curve2dSet::ReadCurve2d(..)!!!" << endl;
- cout << anExc << endl;
+ cout << anException << endl;
#endif
+ (void)anException;
}
return C;
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
cout <<"EXCEPTION in GeomTools_CurveSet::ReadCurve(..)!!!" << endl;
- cout << anExc << endl;
+ cout << anException << endl;
#endif
+ (void)anException;
}
return C;
}
return "Error: Not a geometric object";
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
break;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
cout <<"EXCEPTION in GeomTools_SurfaceSet::ReadSurface(..)!!!" << endl;
- cout << anExc << endl;
+ cout << anException << endl;
#endif
+ (void)anException;
}
return S;
}
Standard_Integer anIndex = myBounds->NbBounds;
if (anIndex >= myMaxBounds)
{
- Standard_OutOfRange::Raise ("TOO many BOUNDS");
+ throw Standard_OutOfRange("TOO many BOUNDS");
}
myBounds->Bounds[anIndex] = theEdgeNumber;
Standard_Integer anIndex = myBounds->NbBounds;
if (anIndex >= myMaxBounds)
{
- Standard_OutOfRange::Raise ("TOO many BOUND");
+ throw Standard_OutOfRange("TOO many BOUND");
}
myBounds->Bounds[anIndex] = theEdgeNumber;
Standard_Integer anIndex = myIndices->NbElements;
if (anIndex >= myMaxEdges)
{
- Standard_OutOfRange::Raise ("TOO many EDGE");
+ throw Standard_OutOfRange("TOO many EDGE");
}
Standard_Integer aVertIndex = theVertexIndex - 1;
if (theVertexIndex <= 0
|| aVertIndex >= myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD EDGE vertex index");
+ throw Standard_OutOfRange("BAD EDGE vertex index");
}
myIndices->SetIndex (anIndex, aVertIndex);
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
Graphic3d_Vec3& aVec = myAttribs->ChangeValue<Graphic3d_Vec3> (theIndex - 1);
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVCol != 0)
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
if (theIndex < 1
|| theIndex > myMaxVertexs)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
if (theIndex < 1
|| theIndex > myMaxBounds)
{
- Standard_OutOfRange::Raise ("BAD BOUND index");
+ throw Standard_OutOfRange("BAD BOUND index");
}
Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
const Graphic3d_Vec3& aVec = myAttribs->Value<Graphic3d_Vec3> (theIndex - 1);
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
Standard_Integer aColorInt = 0;
VertexColor (theIndex, aColorInt);
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVNor != 0)
if (theIndex < 1
|| theIndex > myAttribs->NbElements)
{
- Standard_OutOfRange::Raise ("BAD VERTEX index");
+ throw Standard_OutOfRange("BAD VERTEX index");
}
if (myVTex != 0)
|| theIndex <= 0
|| theIndex > myIndices->NbElements)
{
- Standard_OutOfRange::Raise ("BAD EDGE index");
+ throw Standard_OutOfRange("BAD EDGE index");
}
return Standard_Integer(myIndices->Index (theIndex - 1) + 1);
}
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
- Standard_OutOfRange::Raise ("BAD BOUND index");
+ throw Standard_OutOfRange("BAD BOUND index");
}
return myBounds->Bounds[theIndex - 1];
}
|| theIndex <= 0
|| theIndex > myBounds->NbBounds)
{
- Standard_OutOfRange::Raise(" BAD BOUND index");
+ throw Standard_OutOfRange(" BAD BOUND index");
}
const Graphic3d_Vec4& aVec = myBounds->Colors[theIndex - 1];
{
if (theEdgeLineWidth <= 0.0)
{
- Aspect_AspectFillAreaDefinitionError::Raise ("Bad value for EdgeLineWidth");
+ throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
}
}
{
if (theWidth <= 0.0)
{
- Aspect_AspectFillAreaDefinitionError::Raise ("Bad value for EdgeLineWidth");
+ throw Aspect_AspectFillAreaDefinitionError("Bad value for EdgeLineWidth");
}
myEdgeWidth = (float )theWidth;
}
{
if (myWidth <= 0.0f)
{
- Aspect_AspectLineDefinitionError::Raise ("Graphic3d_AspectLine3d, Bad value for LineWidth");
+ throw Aspect_AspectLineDefinitionError("Graphic3d_AspectLine3d, Bad value for LineWidth");
}
}
{
if (theWidth <= 0.0f)
{
- Aspect_AspectLineDefinitionError::Raise ("Graphic3d_AspectLine3d, Bad value for LineWidth");
+ throw Aspect_AspectLineDefinitionError("Graphic3d_AspectLine3d, Bad value for LineWidth");
}
myWidth = theWidth;
}
{
if (theScale <= 0.0)
{
- Aspect_AspectMarkerDefinitionError::Raise ("Bad value for MarkerScale");
+ throw Aspect_AspectMarkerDefinitionError("Bad value for MarkerScale");
}
}
{
if (theScale <= 0.0f)
{
- Aspect_AspectMarkerDefinitionError::Raise ("Bad value for MarkerScale");
+ throw Aspect_AspectMarkerDefinitionError("Bad value for MarkerScale");
}
myScale = theScale;
}
if (theExpansionFactor <= 0.0)
{
- Graphic3d_AspectTextDefinitionError::Raise ("Bad value for TextScaleFactor");
+ throw Graphic3d_AspectTextDefinitionError("Bad value for TextScaleFactor");
}
}
{
if (theFactor <= 0.0)
{
- Graphic3d_AspectTextDefinitionError::Raise ("Bad value for TextScaleFactor");
+ throw Graphic3d_AspectTextDefinitionError("Bad value for TextScaleFactor");
}
myFactor = theFactor;
}
#if !defined No_Exception && !defined No_Graphic3d_AspectTextDefinitionError
#define Graphic3d_AspectTextDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_AspectTextDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_AspectTextDefinitionError(MESSAGE);
#else
#define Graphic3d_AspectTextDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Graphic3d_GroupDefinitionError
#define Graphic3d_GroupDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_GroupDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_GroupDefinitionError(MESSAGE);
#else
#define Graphic3d_GroupDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for SetAmbient < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for SetAmbient < 0. or > 1.0");
}
myColorCoef[Graphic3d_TOR_AMBIENT] = theValue;
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for SetDiffuse < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for SetDiffuse < 0. or > 1.0");
}
myColorCoef[Graphic3d_TOR_DIFFUSE] = theValue;
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for SetEmissive < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for SetEmissive < 0. or > 1.0");
}
myColorCoef[Graphic3d_TOR_EMISSION] = theValue;
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for SetSpecular < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for SetSpecular < 0. or > 1.0");
}
myColorCoef[Graphic3d_TOR_SPECULAR] = theValue;
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for SetTransparency < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for SetTransparency < 0. or > 1.0");
}
myTransparencyCoef = theValue;
{
if (theValue < 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for refraction index < 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for refraction index < 1.0");
}
myRefractionIndex = theValue;
if (theValue < 0.0f
|| theValue > 1.0f)
{
- Graphic3d_MaterialDefinitionError::Raise ("Bad value for Shininess < 0. or > 1.0");
+ throw Graphic3d_MaterialDefinitionError("Bad value for Shininess < 0. or > 1.0");
}
myShininess = theValue;
{
if (theRank < 1 || theRank > NumberOfMaterials())
{
- Standard_OutOfRange::Raise ("BAD index of material");
+ throw Standard_OutOfRange("BAD index of material");
}
const RawMaterial& aMat = THE_MATERIALS[theRank - 1];
return aMat.StringName;
{
if (theRank < 1 || theRank > NumberOfMaterials())
{
- Standard_OutOfRange::Raise ("BAD index of material");
+ throw Standard_OutOfRange("BAD index of material");
}
const RawMaterial& aMat = THE_MATERIALS[theRank - 1];
return aMat.MaterialType;
#if !defined No_Exception && !defined No_Graphic3d_MaterialDefinitionError
#define Graphic3d_MaterialDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_MaterialDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_MaterialDefinitionError(MESSAGE);
#else
#define Graphic3d_MaterialDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Graphic3d_PriorityDefinitionError
#define Graphic3d_PriorityDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_PriorityDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_PriorityDefinitionError(MESSAGE);
#else
#define Graphic3d_PriorityDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
|| !aProgramFile.Exists())
{
std::cerr << "Standard GLSL programs are not found in: " << THE_SHADERS_FOLDER.ToCString() << std::endl;
- Standard_Failure::Raise ("CSF_ShadersDirectory or CASROOT is set incorrectly");
- return THE_SHADERS_FOLDER;
+ throw Standard_Failure("CSF_ShadersDirectory or CASROOT is set incorrectly");
}
}
return THE_SHADERS_FOLDER;
#if !defined No_Exception && !defined No_Graphic3d_StructureDefinitionError
#define Graphic3d_StructureDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_StructureDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_StructureDefinitionError(MESSAGE);
#else
#define Graphic3d_StructureDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
{
if (theRank < 1 || theRank > NumberOfTextures())
{
- Standard_OutOfRange::Raise ("BAD index of texture");
+ throw Standard_OutOfRange("BAD index of texture");
}
TCollection_AsciiString aFileName (NameOfTexture_to_FileName[theRank - 1]);
{
if (theRank < 1 || theRank > NumberOfTextures())
{
- Standard_OutOfRange::Raise ("BAD index of texture");
+ throw Standard_OutOfRange("BAD index of texture");
}
TCollection_AsciiString aFileName (NameOfTexture_to_FileName[theRank - 1]);
{
if(theRank < 1 || theRank > NumberOfTextures())
{
- Standard_OutOfRange::Raise ("BAD index of texture");
+ throw Standard_OutOfRange("BAD index of texture");
}
TCollection_AsciiString aFileName (NameOfTexture_to_FileName[theRank - 1]);
std::cerr << "Both environment variables CSF_MDTVTexturesDirectory and CASROOT are undefined!\n"
<< "At least one should be defined to use standard Textures.\n";
#endif
- Standard_Failure::Raise ("CSF_MDTVTexturesDirectory and CASROOT are undefined");
- return VarName;
+ throw Standard_Failure("CSF_MDTVTexturesDirectory and CASROOT are undefined");
}
const OSD_Path aDirPath (VarName);
std::cerr << " CSF_MDTVTexturesDirectory or CASROOT not correctly setted\n";
std::cerr << " not all files are found in : "<< VarName.ToCString() << std::endl;
#endif
- Standard_Failure::Raise ("CSF_MDTVTexturesDirectory or CASROOT not correctly setted");
- return VarName;
+ throw Standard_Failure("CSF_MDTVTexturesDirectory or CASROOT not correctly setted");
}
}
return VarName;
#if !defined No_Exception && !defined No_Graphic3d_TransformError
#define Graphic3d_TransformError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_TransformError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_TransformError(MESSAGE);
#else
#define Graphic3d_TransformError_Raise_if(CONDITION, MESSAGE)
#endif
}
else
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
}
}
{
if (!IsZoomOrRotate (theMode))
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
}
myMode = theMode;
{
if (!IsTrihedronOr2d (theMode))
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetPersistence(), wrong persistence mode.");
}
myMode = theMode;
{
if (!IsZoomOrRotate())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::AnchorPoint(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::AnchorPoint(), wrong persistence mode.");
}
return gp_Pnt (myParams.Params3d.PntX, myParams.Params3d.PntY, myParams.Params3d.PntZ);
{
if (!IsZoomOrRotate())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetAnchorPoint(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetAnchorPoint(), wrong persistence mode.");
}
myParams.Params3d.PntX = thePnt.X();
{
if (!IsTrihedronOr2d())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::Corner2d(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::Corner2d(), wrong persistence mode.");
}
return myParams.Params2d.Corner;
{
if (!IsTrihedronOr2d())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetCorner2d(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetCorner2d(), wrong persistence mode.");
}
myParams.Params2d.Corner = thePos;
{
if (!IsTrihedronOr2d())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::Offset2d(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::Offset2d(), wrong persistence mode.");
}
return Graphic3d_Vec2i (myParams.Params2d.OffsetX, myParams.Params2d.OffsetY);
{
if (!IsTrihedronOr2d())
{
- Standard_ProgramError::Raise ("Graphic3d_TransformPers::SetOffset2d(), wrong persistence mode.");
+ throw Standard_ProgramError("Graphic3d_TransformPers::SetOffset2d(), wrong persistence mode.");
}
myParams.Params2d.OffsetX = theOffset.x();
void Graphic3d_Vector::Normalize () {
if (Abs (MyNorme) <= RealEpsilon ())
- Graphic3d_VectorError::Raise ("The norm is null");
+ throw Graphic3d_VectorError("The norm is null");
if (!IsNormalized()) // CQO CTS40181
{
#if !defined No_Exception && !defined No_Graphic3d_VectorError
#define Graphic3d_VectorError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Graphic3d_VectorError::Raise(MESSAGE);
+ if (CONDITION) throw Graphic3d_VectorError(MESSAGE);
#else
#define Graphic3d_VectorError_Raise_if(CONDITION, MESSAGE)
#endif
{
myLLProps.SetParameter(Param);
if (!myLLProps.IsTangentDefined())
- Standard_Failure::Raise("HLRBRep_Data::LocalGeometry2D");
+ throw Standard_Failure("HLRBRep_Data::LocalGeometry2D");
myLLProps.Tangent(Tg);
Cu = myLLProps.Curvature();
if (Cu > Epsilon(1.) && !Precision::IsInfinite(Cu)) myLLProps.Normal(Nm);
myFLProps.SetCurve(aCurve);
myFLProps.SetParameter(Param);
if (!myFLProps.IsTangentDefined())
- Standard_Failure::Raise("HLRBRep_Data::LocalGeometry2D");
+ throw Standard_Failure("HLRBRep_Data::LocalGeometry2D");
myFLProps.Tangent(Tg);
Cu = myFLProps.Curvature();
if (Cu > Epsilon(1.) && !Precision::IsInfinite(Cu)) myFLProps.Normal(Nm);
current = 3;
}
else
- Standard_NoSuchObject::Raise("EdgeBuilder::NextVertex : No current edge");
+ throw Standard_NoSuchObject("EdgeBuilder::NextVertex : No current edge");
}
//=======================================================================
else if (current == 2)
return right->Vertex();
else
- Standard_NoSuchObject::Raise("EdgeBuilder::Current : No current vertex");
- return left->Vertex(); // only for WNT.
+ throw Standard_NoSuchObject("EdgeBuilder::Current : No current vertex");
}
//=======================================================================
else if (current == 2)
return right->IsBoundary();
else
- Standard_NoSuchObject::Raise
- ("EdgeBuilder::IsBoundary : No current vertex");
- return left->IsBoundary(); // only for WNT.
+ throw Standard_NoSuchObject("EdgeBuilder::IsBoundary : No current vertex");
}
//=======================================================================
else if (current == 2)
return right->IsInterference();
else
- Standard_NoSuchObject::Raise
- ("EdgeBuilder::IsInterference : No current vertex");
- return left->IsInterference(); // only for WNT.
+ throw Standard_NoSuchObject("EdgeBuilder::IsInterference : No current vertex");
}
//=======================================================================
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "An exception was catched when hiding edge " << E;
cout << " by the face " << FI << endl;
- Handle(Standard_Failure) fail = Standard_Failure::Caught();
- cout << fail << endl;
+ cout << anException << endl;
#endif
+ (void)anException;
}
}
}
de = DS[i-1]->NbEdges ();
df = DS[i-1]->NbFaces ();
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
if (myDebug)
{
cout << "An exception was catched when preparing the Shape " << i;
cout << " and computing its OutLines " << endl;
- Handle(Standard_Failure) fail = Standard_Failure::Caught();
- cout << fail << endl;
+ cout << anException << endl;
}
DS[i-1] = new HLRBRep_Data(0,0,0);
dv = 0;
else if (fromInterf)
return myIterator.Value().Intersection();
else
- Standard_NoSuchObject::Raise("HLRBRep_VertexList::Current");
- return myTool.CurrentVertex(); // only for WNT.
+ throw Standard_NoSuchObject("HLRBRep_VertexList::Current");
}
//=======================================================================
if (fromEdge)
return myTool.CurrentOrientation();
else
- Standard_DomainError::Raise("HLRBRep_VertexList::Orientation");
- return TopAbs_EXTERNAL; // only for WNT.
+ throw Standard_DomainError("HLRBRep_VertexList::Orientation");
}
//=======================================================================
if (fromInterf)
return myIterator.Value().Transition();
else
- Standard_DomainError::Raise("HLRBRep_VertexList::Transition");
- return TopAbs_EXTERNAL; // only for WNT.
+ throw Standard_DomainError("HLRBRep_VertexList::Transition");
}
//=======================================================================
if (fromInterf)
return myIterator.Value().BoundaryTransition();
else
- Standard_DomainError::Raise("HLRBRep_VertexList::BoundaryTransition");
- return TopAbs_EXTERNAL; // only for WNT.
+ throw Standard_DomainError("HLRBRep_VertexList::BoundaryTransition");
}
case Contap_Restriction :
{
- Standard_ProgramError::Raise("HLRTopoBRep_DSFiller::InsertFace : Restriction");
+ throw Standard_ProgramError("HLRTopoBRep_DSFiller::InsertFace : Restriction");
}
break;
}
return myLines(I).myLin.Location().Y();
case Hatch_ANYLINE :
- Standard_OutOfRange::Raise("Hatcher : not an X or Y line");
- return 0.;
+ throw Standard_OutOfRange("Hatcher : not an X or Y line");
}
return 0.;
const Standard_Integer J) const
{
if (myLines(I).myInters.IsEmpty()) {
- if (J != 1 || !myOrient) Standard_OutOfRange::Raise();
+ if (J != 1 || !myOrient) throw Standard_OutOfRange();
return RealFirst();
}
else {
Standard_Real& Par2) const
{
if (myLines(I).myInters.IsEmpty()) {
- if (J != 1) Standard_OutOfRange::Raise();
+ if (J != 1) throw Standard_OutOfRange();
Index = 0;
Par2 = 0;
}
const Standard_Integer J) const
{
if (myLines(I).myInters.IsEmpty()) {
- if (J != 1 || !myOrient) Standard_OutOfRange::Raise();
+ if (J != 1 || !myOrient) throw Standard_OutOfRange();
return RealLast();
}
else {
Standard_Real& Par2) const
{
if (myLines(I).myInters.IsEmpty()) {
- if (J != 1) Standard_OutOfRange::Raise();
+ if (J != 1) throw Standard_OutOfRange();
Index = 0;
Par2 = 0;
}
Standard_Real Polemax=Polesinit(max).Y();
if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))){
if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y())
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ throw Standard_DimensionError("Hermit Impossible Tolerance");
if ((max==0)||(max==3))
{
for (i=0;i<=3;i++)
if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles))))
{
if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y())
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ throw Standard_DimensionError("Hermit Impossible Tolerance");
if ((max==0)||(max==3))
{
for (i=0;i<=3;i++)
InsertKnots(BS2,Utol1,Utol2);
}
if ((BS2->Knot(2)<TolKnots)||(BS2->Knot(BS2->NbKnots()-1)>(1-TolKnots))) //checking of the knots tolerance
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ throw Standard_DimensionError("Hermit Impossible Tolerance");
else{
if ((Upos2==1.0)&&(Utol2==1.0)&&(Uint2==1.0)) //test on the final inserted knots
InsertKnots(BS1,BS2->Knot(2),1.0);
InsertKnots(BS2,Utol1,Utol2);
}
if ((BS2->Knot(2)<TolKnots)||(BS2->Knot(BS2->NbKnots()-1)>(1-TolKnots))) //checking of the knots tolerance
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ throw Standard_DimensionError("Hermit Impossible Tolerance");
else{
if ((Upos2==1.0)&&(Utol2==1.0)&&(Uint2==1.0)) //test on the final inserted knots
InsertKnots(BS1,BS2->Knot(2),1.0);
InsertKnots(BS2,Utol1,Utol2);
}
if ((BS2->Knot(2)<TolKnots)||(BS2->Knot(BS2->NbKnots()-1)>(1-TolKnots))) //checking of the knots tolerance
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ throw Standard_DimensionError("Hermit Impossible Tolerance");
else{
if ((Upos2==1.0)&&(Utol2==1.0)&&(Uint2==1.0)) //test on the final inserted knots
Knotmin=BS2->Knot(2);
void IFGraph_SubPartsIterator::GetParts
(IFGraph_SubPartsIterator& other)
{
- if (Model() != other.Model()) Interface_InterfaceError::Raise
- ("SubPartsIterator : GetParts");
+ if (Model() != other.Model()) throw Interface_InterfaceError("SubPartsIterator : GetParts");
// On AJOUTE les Parts de other, sans perdre les siennes propres
// (meme principe que le constructeur ci-dessus)
Standard_Integer nb = thegraph.Size();
void IFGraph_SubPartsIterator::SetPartNum (const Standard_Integer num)
{
- if (num <= 0 || num > theparts->Length()) Standard_OutOfRange::Raise
- ("IFGraph_SubPartsIterator : SetPartNum");
+ if (num <= 0 || num > theparts->Length()) throw Standard_OutOfRange("IFGraph_SubPartsIterator : SetPartNum");
thepart = num;
}
Standard_Boolean IFGraph_SubPartsIterator::IsSingle () const
{
- if (thecurr < 1 || thecurr > theparts->Length()) Standard_NoSuchObject::Raise
- ("IFGraph_SubPartsIterator : IsSingle");
+ if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : IsSingle");
return (theparts->Value(thecurr) == 1);
}
Handle(Standard_Transient) IFGraph_SubPartsIterator::FirstEntity
() const
{
- if (thecurr < 1 || thecurr > theparts->Length()) Standard_NoSuchObject::Raise
- ("IFGraph_SubPartsIterator : FirstEntity");
+ if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : FirstEntity");
Standard_Integer nument = thefirsts->Value(thecurr);
- if (nument == 0) Standard_NoSuchObject::Raise
- ("IFGraph_SubPartsIterator : FirstEntity (current part is empty)");
+ if (nument == 0) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : FirstEntity (current part is empty)");
return thegraph.Entity(nument);
}
Interface_EntityIterator IFGraph_SubPartsIterator::Entities () const
{
- if (thecurr < 1 || thecurr > theparts->Length()) Standard_NoSuchObject::Raise
- ("IFGraph_SubPartsIterator : Entities");
+ if (thecurr < 1 || thecurr > theparts->Length()) throw Standard_NoSuchObject("IFGraph_SubPartsIterator : Entities");
Interface_EntityIterator iter;
Standard_Integer nb = thegraph.Size();
Standard_Integer nument = thefirsts->Value(thecurr);
#ifdef OCCT_DEBUG
if (thedico.IsBound(command)) {
cout << "**** XSTEP commands, name conflict on " << command << " first defined remains ****" << endl;
-// Standard_DomainError::Raise("IFSelect_Activator : Add");
+// throw Standard_DomainError("IFSelect_Activator : Add");
}
#endif
Handle(Standard_Transient) IFSelect_ContextModif::ValueOriginal () const
{
- if (thecurr <= 0) Standard_NoSuchObject::Raise("IFSelect_ContextModif");
+ if (thecurr <= 0) throw Standard_NoSuchObject("IFSelect_ContextModif");
return thegraf.Entity(thecurr);
}
Handle(Standard_Transient) IFSelect_ContextModif::ValueResult () const
{
- if (thecurr <= 0) Standard_NoSuchObject::Raise("IFSelect_ContextModif");
+ if (thecurr <= 0) throw Standard_NoSuchObject("IFSelect_ContextModif");
Handle(Standard_Transient) ent,newent;
ent = thegraf.Entity(thecurr);
if (themap.IsNull()) newent = ent;
Handle(Standard_Transient) IFSelect_ContextWrite::Value() const
{
if (thecurr < 1 || thecurr > thenbent)
- Standard_NoSuchObject::Raise("IFSelect_ContextWrite:Value");
+ throw Standard_NoSuchObject("IFSelect_ContextWrite:Value");
Standard_Integer num = theapply->ItemNum (thecurr);
return themodel->Value(num);
}
void IFSelect_Editor::SetNbValues (const Standard_Integer nbval)
{
- if (nbval > thevalues.Upper()) Standard_OutOfRange::Raise("IFSelect_Editor:SetNbValues");
+ if (nbval > thevalues.Upper()) throw Standard_OutOfRange("IFSelect_Editor:SetNbValues");
thenbval = nbval;
}
(const Handle(Standard_Transient)& ent)
{
Standard_Integer num = themodel->Number(ent);
- if (num == 0) Interface_InterfaceError::Raise
- ("PacketList:Add, Entity not in Model");
- if (thelast == 0) Interface_InterfaceError::Raise
- ("PacketList:Add, no Packet yet added");
+ if (num == 0) throw Interface_InterfaceError("PacketList:Add, Entity not in Model");
+ if (thelast == 0) throw Interface_InterfaceError("PacketList:Add, no Packet yet added");
if (theflags(num) != 0) return;
theflags(num) = 1;
thedupls(num) ++;
{
Interface_EntityIterator input = InputResult(G);
KeepInputEntity (input); // selon type voulu
- if (input.NbEntities() > 1) Interface_InterfaceError::Raise
- ("SelectAnyList : more than ONE Entity in input");
+ if (input.NbEntities() > 1) throw Interface_InterfaceError("SelectAnyList : more than ONE Entity in input");
if (input.NbEntities() == 0) return input;
Handle(Standard_Transient) ent;
else if (stat < 0) status = IFSelect_RetError;
else status = IFSelect_RetFail;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption ReadFile par Exception : ****\n";
- sout << Standard_Failure::Caught()->GetMessageString();
+ sout << anException.GetMessageString();
sout<<"\n Abandon"<<endl;
status = IFSelect_RetFail;
}
const Interface_Graph& IFSelect_WorkSession::Graph ()
{
ComputeGraph();
- if (thegraph.IsNull()) Standard_DomainError::Raise
- ("IFSelect WorkSession : Graph not available");
+ if (thegraph.IsNull()) throw Standard_DomainError("IFSelect WorkSession : Graph not available");
return thegraph->Graph();
}
OCC_CATCH_SIGNALS
iter = EvalSelection(sel); // appel normal (donc, code pas duplique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption EvalSelection par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
errhand = theerrhand;
OCC_CATCH_SIGNALS
res = SelectionResult(sel); // appel normal (->code unique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption SelectionResult par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
errhand = theerrhand;
OCC_CATCH_SIGNALS
EvaluateFile(); // appel normal (donc, code pas duplique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption EvaluateFile par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
checks.CCheck(0)->AddFail ("Exception Raised -> Abandon");
}
OCC_CATCH_SIGNALS
return SendSplit(); // appel normal (donc, code pas duplique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption SendSplit par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
checks.CCheck(0)->AddFail ("Exception Raised -> Abandon");
}
ComputeGraph(computegraph);
checks = thecopier->SendAll(filename,thegraph->Graph(),thelibrary,theprotocol);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption SendAll par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
errhand = theerrhand;
checks.CCheck(0)->AddFail ("Exception Raised -> Abandon");
ComputeGraph(computegraph);
return SendSelected (filename,sel); // appel normal
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption SendSelected par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
checks.CCheck(0)->AddFail ("Exception Raised -> Abandon");
errhand = theerrhand;
OCC_CATCH_SIGNALS
C.Print(S,myModel, (level == 3));
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout<<" **** Interruption DumpModel par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
OCC_CATCH_SIGNALS
EvaluateSelection(sel); // appel normal (->code unique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
sout<<" **** Interruption EvaluateSelection par Exception **** Intitule\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
errhand = theerrhand;
OCC_CATCH_SIGNALS
EvaluateDispatch(disp,mode); // appel normal (->code unique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
sout<<" **** Interruption EvaluateDispatch par Exception **** Intitule\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
errhand = theerrhand;
OCC_CATCH_SIGNALS
EvaluateComplete(mode); // appel normal (donc, code pas duplique)
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
sout<<" **** Interruption EvaluateComplete par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
errhand = theerrhand;
if (mode == 0) sout<<endl;
if (mode == 2) sout<<")"<<endl;
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
sout<<" **** Interruption ListEntities par Exception : ****\n";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<"\n Abandon"<<endl;
}
}
allnbResDataLocs->Lower() != 1 || allnbResDataLocs->Upper() != num ||
allResDataLocs->Lower() != 1 || allResDataLocs->Upper() != num ||
allResults->Lower() != 1 || allResults->Upper() != num )
- Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Init");
+ throw Standard_DimensionMismatch("IGESAppli_ElementsResults : Init");
for (Standard_Integer i = 1; i <= num; i ++) {
Standard_Integer nl = nbLayers->Value(i);
Standard_Integer nrl = allnbResDataLocs->Value(i);
if (allResDataLocs->Value(i)->Lower() != 1 ||
allResDataLocs->Value(i)->Upper() != nrl)
- Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : DataLoc");
+ throw Standard_DimensionMismatch("IGESAppli_ElementsResults : DataLoc");
if (allResults->Value(i)->Lower() != 1 ||
allResults->Value(i)->Upper() != nl*nrl*nbResults)
- Standard_DimensionMismatch::Raise("IGESAppli_ElementsResults : Results");
+ throw Standard_DimensionMismatch("IGESAppli_ElementsResults : Results");
}
theNote = aNote;
void IGESAppli_ElementResults::SetFormNumber (const Standard_Integer form)
{
- if (form < 0 || form > 34) Standard_OutOfRange::Raise
- ("IGESAppli_ElementResults : SetFormNumber");
+ if (form < 0 || form > 34) throw Standard_OutOfRange("IGESAppli_ElementResults : SetFormNumber");
InitTypeAndForm(148,form);
}
const Handle(TCollection_HAsciiString)& aName)
{
if (allNodes->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESAppli_FiniteElement : Init");
+ throw Standard_DimensionMismatch("IGESAppli_FiniteElement : Init");
theTopology = aType;
theNodes = allNodes;
theName = aName;
(const Handle(Interface_HArray1OfHAsciiString)& allProperties)
{
if (allProperties->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESAppli_FlowLineSpec : Init");
+ throw Standard_DimensionMismatch("IGESAppli_FlowLineSpec : Init");
theNameAndModifiers = allProperties;
InitTypeAndForm(406,14);
}
(allNativeLevels->Lower() != 1 || allNativeLevels->Length() != num) ||
(allPhysLevels->Lower() != 1 || allPhysLevels->Length() != num) ||
(allExchIdents->Lower() != 1 || allExchIdents->Length() != num) )
- Standard_DimensionMismatch::Raise("IGESAppli_LevelToPWBLayerMap: Init");
+ throw Standard_DimensionMismatch("IGESAppli_LevelToPWBLayerMap: Init");
theNbPropertyValues = nbPropVal;
theExchangeFileLevelNumber = allExchLevels;
theNativeLevel = allNativeLevels;
const Handle(IGESDefs_HArray1OfTabularData)& allTabData)
{
if (allTabData->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESAppli_NodalConstraint : Init");
+ throw Standard_DimensionMismatch("IGESAppli_NodalConstraint : Init");
theType = aType;
theNode = aNode;
theTabularDataProps = allTabData;
allTransParams->Length() != allNodes->Length()) ||
(allRotParams->Lower() != 1 ||
allRotParams->Length() != allNodes->Length()) )
- Standard_DimensionMismatch::Raise
- ("IGESAppli_NodalDisplAndRot : Init(Lengths of arrays inconsistent)");
+ throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot : Init(Lengths of arrays inconsistent)");
for (Standard_Integer i= 1; i <= allNodes->Length(); i++)
{
Handle(TColgp_HArray1OfXYZ) temp2 = allRotParams->Value(i);
if ((temp1->Lower() != 1 || temp1->Length() != allNotes->Length()) ||
(temp2->Lower() != 1 || temp2->Length() != allNotes->Length()) )
- Standard_DimensionMismatch::Raise
- ("IGESAppli_NodalDisplAndRot: Init(No. of Param per Node != Nbcases)");
+ throw Standard_DimensionMismatch("IGESAppli_NodalDisplAndRot: Init(No. of Param per Node != Nbcases)");
}
theNotes = allNotes;
allNodes->Length() != allNodeIdentifiers->Length() ||
allData->LowerCol() != 1 || allData->LowerRow() != 1 ||
allNodes->Length() != allData->UpperRow() )
- Standard_DimensionMismatch::Raise("IGESAppli_NodalResults : Init");
+ throw Standard_DimensionMismatch("IGESAppli_NodalResults : Init");
theNote = aNote;
theSubCaseNum = aNumber;
theTime = aTime;
void IGESAppli_NodalResults::SetFormNumber (const Standard_Integer form)
{
- if (form < 0 || form > 34) Standard_OutOfRange::Raise
- ("IGESAppli_NodalResults : SetFormNumber");
+ if (form < 0 || form > 34) throw Standard_OutOfRange("IGESAppli_NodalResults : SetFormNumber");
InitTypeAndForm(146,form);
}
const Handle(TColStd_HArray1OfInteger)& allLevelNums)
{
if (allLevelNums->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESAppli_PWBArtworkStackup : Init");
+ throw Standard_DimensionMismatch("IGESAppli_PWBArtworkStackup : Init");
theNbPropertyValues = nbPropVal;
theArtworkStackupIdent = anArtIdent;
theLevelNumbers = allLevelNums;
allJoins->Lower() != 1 || allJoins->Length() != num ||
allFlowNames->Lower() != 1 || allFlowNames->Length() != num ||
allContFlowAssocs->Lower() != 1 || allContFlowAssocs->Length() != num )
- Standard_DimensionMismatch::Raise("IGESAppli_PipingFlow : Init");
+ throw Standard_DimensionMismatch("IGESAppli_PipingFlow : Init");
theNbContextFlags = nbContextFlags;
theTypeOfFlow = aFlowType;
theFlowAssociativities = allFlowAssocs;
{
if (aNameArray->Lower() != 1 || allEntities->Lower() != 1 ||
aNameArray->Length() != allEntities->Length())
- Standard_DimensionMismatch::Raise("IGESBasic_ExternalRefFileIndex: Init");
+ throw Standard_DimensionMismatch("IGESBasic_ExternalRefFileIndex: Init");
theNames = aNameArray;
theEntities = allEntities;
(const Handle(Interface_HArray1OfHAsciiString)& aNameArray)
{
if (aNameArray->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESBasic_ExternalReferenceFile : Init");
+ throw Standard_DimensionMismatch("IGESBasic_ExternalReferenceFile : Init");
theNames = aNameArray;
InitTypeAndForm(406,12);
}
// ptv and rln September 14, 2000 BUC60743
// Protection against empty groups
if (!allEntities.IsNull() && (allEntities->Lower() != 1))
- Standard_DimensionMismatch::Raise("IGESBasic_Group : Init");
+ throw Standard_DimensionMismatch("IGESBasic_Group : Init");
theEntities = allEntities;
if (FormNumber() == 0) InitTypeAndForm(402,1);
}
void IGESBasic_Group::SetUser
(const Standard_Integer type, const Standard_Integer form)
{
- if (type <= 5000) Standard_OutOfRange::Raise("IGESBasic_Group::SetUser");
+ if (type <= 5000) throw Standard_OutOfRange("IGESBasic_Group::SetUser");
InitTypeAndForm (type,form);
}
const Handle(IGESData_HArray1OfIGESEntity)& allChildren)
{
if (!allChildren.IsNull() && allChildren->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESBasic_SingleParent : Init");
+ throw Standard_DimensionMismatch("IGESBasic_SingleParent : Init");
theParentEntity = aParentEntity;
theChildren = allChildren;
theNbParentEntities = nbParentEntities;
const Handle(IGESData_HArray1OfIGESEntity)& allAssocEntities)
{
if (!allAssocEntities.IsNull() && allAssocEntities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESBasic_SubfigureDef : Init");
+ throw Standard_DimensionMismatch("IGESBasic_SubfigureDef : Init");
theDepth = aDepth;
theName = aName;
theAssocEntities = allAssocEntities;
{
Standard_Integer num, nb = theXYZ->Length();
if (datatype < 1 || datatype > 3 || nb == 0 || (polyline && datatype == 3))
- Standard_DomainError::Raise ("IGESConvGeom_GeomBuilder : MakeCopiousData");
+ throw Standard_DomainError("IGESConvGeom_GeomBuilder : MakeCopiousData");
Standard_Integer nbd = datatype+1; // 1->2 2->3 et 3->6
if (datatype == 3) nbd = 6;
if (!ent.IsNull()) {
if (themodel.IsNull()) S<<" D??? ";
else if ( (num = themodel->Number(ent)) == 0) S<<" 0:D?????";
-// Interface_InterfaceError::Raise ("IGESDumper : PrintDNum");
+// throw Interface_InterfaceError("IGESDumper : PrintDNum");
else {
S<<Interface_MSG::Blanks(num,9)<<num<<":D"<<2*num-1<<Interface_MSG::Blanks(2*num-1,9);
}
Handle(IGESData_IGESEntity) IGESData_IGESEntity::UniqueParent () const
{
if (NbTypedProperties(STANDARD_TYPE(IGESData_SingleParentEntity)) != 1)
- Interface_InterfaceError::Raise ("IGESEntity : UniqueParent");
+ throw Interface_InterfaceError("IGESEntity : UniqueParent");
else {
DeclareAndCast(IGESData_SingleParentEntity,PP,
TypedProperty(STANDARD_TYPE(IGESData_SingleParentEntity)));
return PP->SingleParent();
}
- return this; // ne rime a rien (cf exception) mais calme le compilateur
}
void IGESData_IGESWriter::SectionS ()
{
- if (thesect != 0) Interface_InterfaceError::Raise("IGESWriter : SectionS");
+ if (thesect != 0) throw Interface_InterfaceError("IGESWriter : SectionS");
thesect = 1;
}
void IGESData_IGESWriter::SectionG (const IGESData_GlobalSection& header)
{
- if (thesect != 1) Interface_InterfaceError::Raise("IGESWriter : SectionG");
+ if (thesect != 1) throw Interface_InterfaceError("IGESWriter : SectionG");
thesect = 2;
thesep = header.Separator();
theendm = header.EndMark();
void IGESData_IGESWriter::SectionsDP ()
{
- if (thesect != 2) Interface_InterfaceError::Raise("IGESWriter : SectionsDP");
+ if (thesect != 2) throw Interface_InterfaceError("IGESWriter : SectionsDP");
thesect = 3;
thecurr.SetMax (MaxcarsP);
thestep = IGESData_ReadEnd;
void IGESData_IGESWriter::SectionT ()
{
- if (thesect != 3) Interface_InterfaceError::Raise("IGESWriter : SectionT");
+ if (thesect != 3) throw Interface_InterfaceError("IGESWriter : SectionT");
thesect = 4;
thepnum.SetValue(thepnum.Length(),thepars->Length()+1);
}
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadEnd)
- Interface_InterfaceError::Raise("IGESWriter : DirPart");
+ throw Interface_InterfaceError("IGESWriter : DirPart");
Standard_Integer v[17]; Standard_Character res1[9],res2[9],label[9],snum[9];
Standard_Integer nument = themodel->Number(anent);
if (nument == 0) return;
{
char text[20];
if (thesect != 3 && thestep != IGESData_ReadDir)
- Interface_InterfaceError::Raise("IGESWriter : OwnParams");
+ throw Interface_InterfaceError("IGESWriter : OwnParams");
thepnum.SetValue(themodel->Number(anent),thepars->Length()+1);
thecurr.Clear();
sprintf(text,"%d",anent->TypeNumber());
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
- Interface_InterfaceError::Raise("IGESWriter : Properties");
+ throw Interface_InterfaceError("IGESWriter : Properties");
thestep = IGESData_ReadProps;
if (!anent->ArePresentProperties()) return;
Send(anent->NbProperties());
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
- Interface_InterfaceError::Raise("IGESWriter : Associativities");
+ throw Interface_InterfaceError("IGESWriter : Associativities");
thestep = IGESData_ReadAssocs;
if (!anent->ArePresentAssociativities() && !anent->ArePresentProperties())
return; // Properties suivent : ne pas les omettre !
void IGESData_IGESWriter::EndEntity ()
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
- Interface_InterfaceError::Raise("IGESWriter : EndEntity");
+ throw Interface_InterfaceError("IGESWriter : EndEntity");
AddChar(theendm);
if (thecurr.Length() > 0) thepars->Append(thecurr.Moved());
thestep = IGESData_ReadEnd;
blancs[i] = (char)(blancs[i] ^ (150 + (i & 3)));
}
- if (thesect != 4) Interface_InterfaceError::Raise
- ("IGESWriter not ready for Print");
+ if (thesect != 4) throw Interface_InterfaceError("IGESWriter not ready for Print");
// Start Section (assez simple, somme toute). Attention si commentaires
Handle(TCollection_HAsciiString) line;
Standard_Integer nbs = 1;
theoffst += thetsize;
thetsize = size;
if (autoadv) theadv = (theoffst + thetsize == theisize);
- if (theoffst + thetsize > theisize) Interface_InterfaceError::Raise
- ("IGESDAta ParamCursor : required Term size overpass whole Item size");
+ if (theoffst + thetsize > theisize) throw Interface_InterfaceError("IGESDAta ParamCursor : required Term size overpass whole Item size");
}
void IGESData_ParamCursor::SetOne (const Standard_Boolean autoadv)
{
Standard_Integer num = themodel->Number(ent);
if (num == 0) return Standard_False;
- if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : HasParent");
- if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : HasParent");
+ if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : HasParent");
+ if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : HasParent");
if (therefs(num) != 0 || theassocs(num) != 0) return Standard_True;
return Standard_False;
}
Handle(IGESData_IGESEntity) parent;
Standard_Integer num = themodel->Number(ent);
if (num == 0) return parent;
- if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : Parent");
- if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : Parent");
+ if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : Parent");
+ if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : Parent");
if (therefs(num) != 0) parent = themodel->Entity (therefs (num));
if (theassocs(num) != 0) parent = themodel->Entity (theassocs (num));
return parent;
{
Standard_Integer num = themodel->Number(ent);
if (num == 0) return Standard_False;
- if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : HasParentByAssociativity");
- if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
- ("IGESData_ToolLocation : HasParentByAssociativity");
+ if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : HasParentByAssociativity");
+ if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : HasParentByAssociativity");
if (theassocs(num) != 0) return Standard_True;
return Standard_False;
}
(orders->Lower() != 1 || orders->Length() != len) ||
(numItems->Lower() != 1 || numItems->Length() != len) ||
(items->Lower() != 1 || items->Length() != len) )
- Standard_DimensionMismatch::Raise("IGESDefs_AssociativityDef : Init");
+ throw Standard_DimensionMismatch("IGESDefs_AssociativityDef : Init");
theBackPointerReqs = requirements;
theClassOrders = orders;
if (attrTypes->Lower() != 1 || attrValueDataTypes->Lower() != 1 ||
attrValueDataTypes->Length() != nb ||
attrValueCounts->Lower() != 1 || attrValueCounts->Length() != nb)
- Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
+ throw Standard_DimensionMismatch("IGESDefs_AttributeDef : Init");
if (FormNumber() >= 1)
if (attrValues->Lower() != 1 || attrValues->Length() != nb)
- Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
+ throw Standard_DimensionMismatch("IGESDefs_AttributeDef : Init");
if (FormNumber() == 2)
if (attrValuePointers->Lower() != 1 || attrValuePointers->Length() != nb)
- Standard_DimensionMismatch::Raise("IGESDefs_AttributeDef : Init");
+ throw Standard_DimensionMismatch("IGESDefs_AttributeDef : Init");
// Form 1 : attrValues defined Form = 2 : attrValuePointers defined
theName = aName;
(const Handle(TColStd_HArray2OfTransient)& attributes)
{
if (attributes->LowerCol() != 1 || attributes->LowerRow() != 1)
- Standard_DimensionMismatch::Raise("IGESDefs_AttributeTable : Init");
+ throw Standard_DimensionMismatch("IGESDefs_AttributeTable : Init");
theAttributes = attributes;
Standard_Integer fn = FormNumber();
if ( !allTypes.IsNull() && !allValues.IsNull() &&
(allValues->Lower() != 1 || allTypes->Lower() != 1 ||
allTypes->Length() != allValues->Length() ) )
- Standard_DimensionMismatch::Raise("IGESDefs_GenericData: Init");
+ throw Standard_DimensionMismatch("IGESDefs_GenericData: Init");
theNbPropertyValues = nbPropVal;
theName = aName;
theTypes = allTypes;
const Handle(TCollection_HAsciiString)& endMacro)
{
if (langStatements->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDefs_MacroDef : Init");
+ throw Standard_DimensionMismatch("IGESDefs_MacroDef : Init");
theMACRO = macro;
theEntityTypeID = entityTypeID;
theLangStatements = langStatements;
nbValuesInd->Lower() != 1 || nbValuesInd->Length() != num ||
valuesInd->Lower() != 1 || valuesInd->Length() != num ||
valuesDep->Lower() != 1 )
- Standard_DimensionMismatch::Raise("IGESDefs_TabularData : Init");
+ throw Standard_DimensionMismatch("IGESDefs_TabularData : Init");
theNbPropertyValues = nbProps;
thePropertyType = propType;
/* theNbDependents = nbDeps; */
if ( unitTypes->Lower() != 1 ||
(unitValues->Lower() != 1 || unitValues->Length() != length) ||
(unitScales->Lower() != 1 || unitScales->Length() != length) )
- Standard_DimensionMismatch::Raise("IGESDefs_UnitsData : Init");
+ throw Standard_DimensionMismatch("IGESDefs_UnitsData : Init");
theUnitTypes = unitTypes;
theUnitValues = unitValues;
theUnitScales = unitScales;
const Handle(TColgp_HArray1OfXY)& dataPnts)
{
if (dataPnts->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_CenterLine : Init");
+ throw Standard_DimensionMismatch("IGESDimen_CenterLine : Init");
theDatatype = aDataType;
theZDisplacement = aZdisp;
theDataPoints = dataPnts;
if (notes->Lower() != 1 ||
(startInd->Lower() != 1 || notes->Length() != startInd->Length()) ||
(endInd->Lower() != 1 || notes->Length() != endInd->Length()) )
- Standard_DimensionMismatch::Raise("IGESDimen_DimensionDisplayData : Init");
+ throw Standard_DimensionMismatch("IGESDimen_DimensionDisplayData : Init");
theNbPropertyValues = numProps;
theDimensionType = aDimType;
const Handle(IGESData_HArray1OfIGESEntity)& entities)
{
if (entities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_DimensionedGeometry : Init");
+ throw Standard_DimensionMismatch("IGESDimen_DimensionedGeometry : Init");
theNbDimensions = nbDims;
theDimension = aDimension;
theGeometryEntities = entities;
{
if (!someLeaders.IsNull())
if (someLeaders->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_FlagNote : Init");
+ throw Standard_DimensionMismatch("IGESDimen_FlagNote : Init");
theLowerLeftcorner = leftCorner;
theAngle = anAngle;
theNote = aNote;
const Handle(IGESDimen_HArray1OfLeaderArrow)& someLeaders)
{
if (someLeaders->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_GeneralLabel : Init");
+ throw Standard_DimensionMismatch("IGESDimen_GeneralLabel : Init");
theNote = aNote;
theLeaders = someLeaders;
InitTypeAndForm(210,0);
(rotFlags->Lower() != 1 || rotFlags->Length() != num) ||
(start->Lower() != 1 || start->Length() != num) ||
(texts->Lower() != 1 || texts->Length() != num) )
- Standard_DimensionMismatch::Raise("IGESDimen_GeneralNote : Init");
+ throw Standard_DimensionMismatch("IGESDimen_GeneralNote : Init");
theNbChars = nbChars;
theBoxWidths = widths;
void IGESDimen_GeneralNote::SetFormNumber (const Standard_Integer form)
{
if ((form < 0 || form > 8) && (form < 100 || form > 102) && form != 105)
- Standard_OutOfRange::Raise("IGESDimen_GeneralNote : SetFormNumber");
+ throw Standard_OutOfRange("IGESDimen_GeneralNote : SetFormNumber");
InitTypeAndForm(212,form);
}
const Handle(IGESDimen_HArray1OfLeaderArrow)& allLeaders)
{
if (!allGeoms.IsNull() && allGeoms->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_GeneralSymbol : Init");
+ throw Standard_DimensionMismatch("IGESDimen_GeneralSymbol : Init");
if (!allLeaders.IsNull())
- if (allLeaders->Lower() != 1) Standard_DimensionMismatch::Raise("$");
+ if (allLeaders->Lower() != 1) throw Standard_DimensionMismatch("$");
theNote = aNote;
theGeoms = allGeoms;
theLeaders = allLeaders;
void IGESDimen_GeneralSymbol::SetFormNumber (const Standard_Integer form)
{
- if ((form < 0 || form > 3) && form < 5000) Standard_OutOfRange::Raise
- ("IGESDimen_GeneralSymbol : SetFormNumber");
+ if ((form < 0 || form > 3) && form < 5000) throw Standard_OutOfRange("IGESDimen_GeneralSymbol : SetFormNumber");
InitTypeAndForm(228,form);
}
const Handle(TColgp_HArray1OfXY)& segments)
{
if (segments->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_LeaderArrow : Init");
+ throw Standard_DimensionMismatch("IGESDimen_LeaderArrow : Init");
theArrowHeadHeight = height;
theArrowHeadWidth = width;
theZDepth = depth ;
void IGESDimen_LeaderArrow::SetFormNumber (const Standard_Integer form)
{
- if (form < 1 || form > 12) Standard_OutOfRange::Raise
- ("IGESDimen_LeaderArrow : SetFormNumber");
+ if (form < 1 || form > 12) throw Standard_OutOfRange("IGESDimen_LeaderArrow : SetFormNumber");
InitTypeAndForm(214,form);
}
void IGESDimen_LinearDimension::SetFormNumber (const Standard_Integer fm)
{
- if (fm < 0 || fm > 2) Standard_OutOfRange::Raise
- ("IGESDimen_LinearDimension : SetFormNumber");
+ if (fm < 0 || fm > 2) throw Standard_OutOfRange("IGESDimen_LinearDimension : SetFormNumber");
InitTypeAndForm(216,fm);
}
if (allEntities->Lower() != 1 ||
allLocations->Lower() != 1 || allLocations->Length() != num ||
allPoints->Lower() != 1 || allPoints->Length() != num )
- Standard_DimensionMismatch::Raise
- ("IGESDimen_NewDimensionedGeometry: Init");
+ throw Standard_DimensionMismatch("IGESDimen_NewDimensionedGeometry: Init");
theNbDimensions = nbDimens;
theDimensionEntity = aDimen;
theDimensionOrientationFlag = anOrientation;
(rotateFlags->Lower() != 1 || rotateFlags->Length() != num) ||
(startPoints->Lower() != 1 || startPoints->Length() != num) ||
(texts->Lower() != 1 || texts->Length() != num))
- Standard_DimensionMismatch::Raise("IGESDimen_GeneralNote : Init");
+ throw Standard_DimensionMismatch("IGESDimen_GeneralNote : Init");
theWidth = width;
theHeight = height;
const Handle(TColgp_HArray1OfXY)& dataPoints)
{
if (dataPoints->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_Section : Init");
+ throw Standard_DimensionMismatch("IGESDimen_Section : Init");
theDatatype = dataType;
theZDisplacement = aDisp;
theDataPoints = dataPoints;
void IGESDimen_Section::SetFormNumber (const Standard_Integer form)
{
- if (form < 31 || form > 38) Standard_OutOfRange::Raise
- ("IGESDimen_Section : SetFormNumber");
+ if (form < 31 || form > 38) throw Standard_OutOfRange("IGESDimen_Section : SetFormNumber");
InitTypeAndForm(106,form);
}
{
if (!someIslands.IsNull())
if (someIslands->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_SectionedArea : Init");
+ throw Standard_DimensionMismatch("IGESDimen_SectionedArea : Init");
theExteriorCurve = aCurve;
thePattern = aPattern;
thePassingPoint = aPoint;
const Handle(TColgp_HArray1OfXY)& dataPoints)
{
if (dataPoints->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDimen_WitnessLine : Init");
+ throw Standard_DimensionMismatch("IGESDimen_WitnessLine : Init");
theDatatype = dataType;
theZDisplacement = aDisp;
theDataPoints = dataPoints;
{
if (!allNumPos.IsNull())
if (allNumPos->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_CircArraySubfigure : Init");
+ throw Standard_DimensionMismatch("IGESDraw_CircArraySubfigure : Init");
theBaseEntity = aBase;
theNbLocations = aNumLocs;
theCenter = aCenter;
Standard_Integer Len = allViews->Length();
Standard_Boolean Flag = ( allViewOrigins->Length() == Len );
if (!Flag || allViews->Lower() != 1 || allViewOrigins->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_Drawing : Init");
+ throw Standard_DimensionMismatch("IGESDraw_Drawing : Init");
}
if (!allAnnotations.IsNull())
- if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise
- ("IGESDraw_Drawing : Init");
+ if (allAnnotations->Lower() != 1) throw Standard_DimensionMismatch("IGESDraw_Drawing : Init");
theViews = allViews;
theViewOrigins = allViewOrigins;
if ( allViews->Lower() != 1 ||
(allViewOrigins->Lower() != 1 || allViewOrigins->Length() != Len) ||
(allOrientationAngles->Lower() != 1 || allOrientationAngles->Length() != Len) )
- Standard_DimensionMismatch::Raise
- ("IGESDraw_DrawingWithRotation : Init");
+ throw Standard_DimensionMismatch("IGESDraw_DrawingWithRotation : Init");
if (!allAnnotations.IsNull())
- if (allAnnotations->Lower() != 1) Standard_DimensionMismatch::Raise
- ("IGESDraw_DrawingWithRotation : Init");
+ if (allAnnotations->Lower() != 1) throw Standard_DimensionMismatch("IGESDraw_DrawingWithRotation : Init");
theViews = allViews;
theViewOrigins = allViewOrigins;
(allLeaderEntities->Lower() != 1 || allLeaderEntities->Length() != Ln) ||
(allLabelLevels->Lower() != 1 || allLabelLevels->Length() != Ln) ||
(allDisplayedEntities->Lower() != 1 || allDisplayedEntities->Length() != Ln))
- Standard_DimensionMismatch::Raise("IGESDraw_LabelDisplay : Init");
+ throw Standard_DimensionMismatch("IGESDraw_LabelDisplay : Init");
theViews = allViews;
theTextLocations = allTextLocations;
{
if (!allConnectPoints.IsNull())
if (allConnectPoints->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigure : Init");
+ throw Standard_DimensionMismatch("IGESDraw_NetworkSubfigure : Init");
theSubfigureDefinition = aDefinition;
theTranslation = aTranslation;
theScaleFactor = aScaleFactor;
{
if (!allPointEntities.IsNull())
if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigureDef : Init");
+ throw Standard_DimensionMismatch("IGESDraw_NetworkSubfigureDef : Init");
theDepth = aDepth;
theName = aName;
theEntities = allEntities;
{
if (!allEntities.IsNull())
if (allEntities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_Planar : Init");
+ throw Standard_DimensionMismatch("IGESDraw_Planar : Init");
theNbMatrices = nbMats;
theTransformationMatrix = aTransformationMatrix;
theEntities = allEntities;
{
if (!allNumPos.IsNull())
if (allNumPos->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_RectArraySubfigure : Init");
+ throw Standard_DimensionMismatch("IGESDraw_RectArraySubfigure : Init");
theBaseEntity = aBase;
theScaleFactor = aScale;
theLowerLeftCorner = aCorner;
(allLineFontValues->Lower() != 1 || allLineFontValues->Length() != Len) ||
(allLineFontDefinitions->Lower() != 1 || allLineFontDefinitions->Length() != Len) ||
(allLineWeights->Lower() != 1 || allLineWeights->Length() != Len) )
- Standard_DimensionMismatch::Raise("IGESDraw_SegmentedViewsVisible : Init");
+ throw Standard_DimensionMismatch("IGESDraw_SegmentedViewsVisible : Init");
theViews = allViews;
theBreakpointParameters = allBreakpointParameters;
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : Init");
+ throw Standard_DimensionMismatch("IGESDraw_ViewsVisible : Init");
if (!allViewEntities.IsNull())
if (allViewEntities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : Init");
+ throw Standard_DimensionMismatch("IGESDraw_ViewsVisible : Init");
theViewEntities = allViewEntities;
theDisplayEntity = allDisplayEntity;
InitTypeAndForm(402,3);
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisible : InitImplied");
+ throw Standard_DimensionMismatch("IGESDraw_ViewsVisible : InitImplied");
theDisplayEntity = allDisplayEntity;
}
(allLineWeights->Lower() != 1 || allLineWeights->Length() != Exp) ||
(allLineDefinitions->Lower() != 1 || allLineDefinitions->Length() != Exp) ||
(allColorDefinitions->Lower() != 1 || allColorDefinitions->Length() != Exp))
- Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisibleWithAttr : Init");
+ throw Standard_DimensionMismatch("IGESDraw_ViewsVisibleWithAttr : Init");
}
if (!allDisplayEntities.IsNull())
- if (allDisplayEntities->Lower() != 1) Standard_DimensionMismatch::Raise
- ("IGESDraw_ViewsVisibleWithAttr : Init");
+ if (allDisplayEntities->Lower() != 1) throw Standard_DimensionMismatch("IGESDraw_ViewsVisibleWithAttr : Init");
theViewEntities = allViewEntities;
theLineFonts = allLineFonts;
{
if (!allDisplayEntity.IsNull())
if (allDisplayEntity->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESDraw_ViewsVisibleWithAttr : InitImplied");
+ throw Standard_DimensionMismatch("IGESDraw_ViewsVisibleWithAttr : InitImplied");
theDisplayEntities = allDisplayEntity;
}
{
if (!allPoles.IsNull()) {
if (allPoles->Length() != allWeights->Length())
- Standard_DimensionMismatch::Raise("IGESGeom_BSplineCurve : Init");
+ throw Standard_DimensionMismatch("IGESGeom_BSplineCurve : Init");
if (allKnots->Lower() != -aDegree || allKnots->Upper() != anIndex+1 ||
allWeights->Upper() != anIndex ||
allWeights->Lower() != 0 || allPoles->Lower() != 0)
- Standard_DimensionMismatch::Raise("IGESGeom_BSplineCurve : Init");
+ throw Standard_DimensionMismatch("IGESGeom_BSplineCurve : Init");
}
theIndex = anIndex;
void IGESGeom_BSplineCurve::SetFormNumber (const Standard_Integer form)
{
- if (form < 0 || form > 5) Standard_OutOfRange::Raise
- ("IGESGeom_BSplineCurve : SetFormNumber");
+ if (form < 0 || form > 5) throw Standard_OutOfRange("IGESGeom_BSplineCurve : SetFormNumber");
InitTypeAndForm(126,form);
}
{
if (allWeights->RowLength() != allPoles->RowLength() ||
allWeights->ColLength() != allPoles->ColLength())
- Standard_DimensionMismatch::Raise("IGESGeom_BSplineSurface : Init");
+ throw Standard_DimensionMismatch("IGESGeom_BSplineSurface : Init");
if (allKnotsU->Lower() != -aDegU || allKnotsV->Lower() != -aDegV ||
allKnotsU->Upper() != anIndexU+1 || allKnotsV->Upper() != anIndexV+1 ||
allWeights->LowerRow() != 0 || allWeights->LowerCol() != 0 ||
allPoles->LowerRow() != 0 || allPoles->LowerCol() != 0 ||
allPoles->UpperRow() != anIndexU || allPoles->UpperCol() != anIndexV)
- Standard_DimensionMismatch::Raise("IGESGeom_BSplineSurface : Init");
+ throw Standard_DimensionMismatch("IGESGeom_BSplineSurface : Init");
theIndexU = anIndexU;
theIndexV = anIndexV;
void IGESGeom_BSplineSurface::SetFormNumber (const Standard_Integer form)
{
- if (form < 0 || form > 9) Standard_OutOfRange::Raise
- ("IGESGeom_BSplineSurface : SetFormNumber");
+ if (form < 0 || form > 9) throw Standard_OutOfRange("IGESGeom_BSplineSurface : SetFormNumber");
InitTypeAndForm(128,form);
}
if ( allSenses->Lower() != 1 ||
(allModelCurves->Lower() != 1 || allModelCurves->Length() != num1) ||
(allParameterCurves->Lower() != 1 || allParameterCurves->Length() != num1))
- Standard_DimensionMismatch::Raise("IGESGeom_Boundary: Init");
+ throw Standard_DimensionMismatch("IGESGeom_Boundary: Init");
theType = aType;
thePreference = aPreference;
const Handle(IGESGeom_HArray1OfBoundary)& aBoundary)
{
if (aBoundary->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESGeom_BoundedSurface : Init");
+ throw Standard_DimensionMismatch("IGESGeom_BoundedSurface : Init");
theType = aType;
theSurface = aSurface;
theBoundaries = aBoundary;
(const Handle(IGESData_HArray1OfIGESEntity)& allEntities)
{
if (!allEntities.IsNull() && allEntities->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESGeom_CompositeCurve : Init");
+ throw Standard_DimensionMismatch("IGESGeom_CompositeCurve : Init");
theEntities = allEntities;
InitTypeAndForm(102,0);
}
{
// PTV OCC386 crach application while reading So5771b.igs
if (allData.IsNull())
- Standard_NullObject::Raise("IGESGeom_CopiousData : Init with null data");
+ throw Standard_NullObject("IGESGeom_CopiousData : Init with null data");
- if (allData->Lower() != 1) Standard_DimensionMismatch::Raise("IGESGeom_CopiousData : Init");
+ if (allData->Lower() != 1) throw Standard_DimensionMismatch("IGESGeom_CopiousData : Init");
theDataType = aDataType;
theZPlane = aZPlane;
theData = allData;
void IGESGeom_Flash::SetFormNumber (const Standard_Integer form)
{
- if (form < 0 || form > 4) Standard_OutOfRange::Raise
- ("IGESGeom_Flash : SetFormNumber");
+ if (form < 0 || form > 4) throw Standard_OutOfRange("IGESGeom_Flash : SetFormNumber");
InitTypeAndForm(125,form);
}
Standard_Integer len = allXPolynomials->ColLength();
if ((len != allYPolynomials->ColLength()) ||
(len != allZPolynomials->ColLength()) )
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineCurve : Column Length of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineCurve : Column Length of HArray2s in Init");
if (allBreakPoints->Lower() != 1 || allXvalues->Lower() != 1 ||
allYvalues->Lower() != 1 || allZvalues->Lower() != 1 ||
allXPolynomials->LowerCol() != 1 || allXPolynomials->LowerRow() != 1 ||
allYPolynomials->LowerCol() != 1 || allYPolynomials->LowerRow() != 1 ||
allZPolynomials->LowerCol() != 1 || allZPolynomials->LowerRow() != 1)
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineCurve : Lower Indices of HArrays in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineCurve : Lower Indices of HArrays in Init");
len = allXPolynomials->RowLength();
if ((len != allYPolynomials->RowLength()) ||
(len != allZPolynomials->RowLength()) )
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineCurve : Row Length of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineCurve : Row Length of HArray2s in Init");
len = allXvalues->Length();
if ((len != allYvalues->Length()) || (len != allZvalues->Length()) )
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineCurve : Length of HArray1s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineCurve : Length of HArray1s in Init");
theType = aType;
theDegree = aDegree;
{
Standard_Integer i,j;
if (allUBreakPoints->Lower() != 1 || allVBreakPoints->Lower() != 1)
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineSurface: Lower Indices of BreakPoints in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineSurface: Lower Indices of BreakPoints in Init");
Standard_Integer nbUSegs = allUBreakPoints->Length() - 1;
Standard_Integer nbVSegs = allVBreakPoints->Length() - 1;
Standard_Integer len = allXCoeffs->RowLength();
if ((len != allYCoeffs->RowLength()) || (len != allZCoeffs->RowLength()))
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineSurface: Row Length of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineSurface: Row Length of HArray2s in Init");
if (allXCoeffs->LowerCol() != 1 || allXCoeffs->LowerRow() != 1 ||
allYCoeffs->LowerCol() != 1 || allYCoeffs->LowerRow() != 1 ||
allZCoeffs->LowerCol() != 1 || allZCoeffs->LowerRow() != 1 )
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineSurface: Lower Col-Row Indices of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineSurface: Lower Col-Row Indices of HArray2s in Init");
len = allXCoeffs->ColLength();
if ((len != allYCoeffs->ColLength()) || (len != allZCoeffs->ColLength()))
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineSurface: Column Length of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineSurface: Column Length of HArray2s in Init");
Handle(TColStd_HArray1OfReal) temp1;
Handle(TColStd_HArray1OfReal) temp2;
if ((temp1.IsNull() || temp1->Length() != 16) ||
(temp2.IsNull() || temp2->Length() != 16) ||
(temp3.IsNull() || temp3->Length() != 16))
- Standard_DimensionMismatch::Raise
- ("IGESGeom_SplineSurface: Lengths of elements of HArray2s in Init");
+ throw Standard_DimensionMismatch("IGESGeom_SplineSurface: Lengths of elements of HArray2s in Init");
}
}
if ((aMatrix->RowLength() != 4) || (aMatrix->ColLength() != 3))
- Standard_DimensionMismatch::Raise
- ("IGESGeom_TransformationMatrix : Init");
+ throw Standard_DimensionMismatch("IGESGeom_TransformationMatrix : Init");
{
if(theData.IsNull())
cout<<"Inavalid Transformation Data"<<endl;
- if ((fm < 0 || fm > 1) && (fm < 10 || fm > 12)) Standard_OutOfRange::Raise
- ("IGESGeom_TransformationMatrix : SetFormNumber");
+ if ((fm < 0 || fm > 1) && (fm < 10 || fm > 12)) throw Standard_OutOfRange("IGESGeom_TransformationMatrix : SetFormNumber");
InitTypeAndForm(124,fm);
}
{
if (!anInner.IsNull())
if (anInner->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESGeom_TrimmedSurface : Init");
+ throw Standard_DimensionMismatch("IGESGeom_TrimmedSurface : Init");
theSurface = aSurface;
theFlag = aFlag;
(const Handle(TColStd_HArray1OfInteger)& allLevelNumbers)
{
if (allLevelNumbers->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESGraph_DefinitionLevel : Init");
+ throw Standard_DimensionMismatch("IGESGraph_DefinitionLevel : Init");
theLevelNumbers = allLevelNumbers;
InitTypeAndForm(406,1);
}
const Handle(TCollection_HAsciiString)& aPattern)
{
if (allSegLength->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESGraph_LineFontDefPattern : Init");
+ throw Standard_DimensionMismatch("IGESGraph_LineFontDefPattern : Init");
theSegmentLengths = allSegLength;
theDisplayPattern = aPattern;
InitTypeAndForm(304,2);
(allPenFlags->Lower() != 1 || allPenFlags->Length() != Len) ||
(allMovePenToX->Lower() != 1 || allMovePenToX->Length() != Len) ||
(allMovePenToY->Lower() != 1 || allMovePenToY->Length() != Len) )
- Standard_DimensionMismatch::Raise("IGESGraph_TextFontDef : Init");
+ throw Standard_DimensionMismatch("IGESGraph_TextFontDef : Init");
theFontCode = aFontCode;
theFontName = aFontName;
{
if (operands->Lower() != 1 || operations->Lower() != 1 ||
operands->Length() != operations->Length())
- Standard_DimensionError::Raise("IGESSolid_BooleanTree : Init");
+ throw Standard_DimensionError("IGESSolid_BooleanTree : Init");
theOperations = operations;
theOperands = operands;
startVertexIndex->Lower() != 1 || startVertexIndex->Length() != nb ||
endVertexList->Lower() != 1 || endVertexList->Length() != nb ||
endVertexIndex->Lower() != 1 || endVertexIndex->Length() != nb )
- Standard_DimensionError::Raise("IGESSolid_EdgeList : Init");
+ throw Standard_DimensionError("IGESSolid_EdgeList : Init");
theCurves = Curves;
theStartVertexList = startVertexList;
const Handle(IGESSolid_HArray1OfLoop)& Loops)
{
if (Loops->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESSolid_Face : Init");
+ throw Standard_DimensionMismatch("IGESSolid_Face : Init");
theSurface = aSurface;
hasOuterLoop = OuterLoopFlag;
theLoops = Loops;
nbParameterCurves->Lower() != 1 || nb != nbParameterCurves->Length() ||
IsoparametricFlags->Lower() != 1 || nb != IsoparametricFlags->Length() ||
Curves->Lower() != 1 || nb != Curves->Length() )
- Standard_DimensionError::Raise("IGESSolid_Loop : Init");
+ throw Standard_DimensionError("IGESSolid_Loop : Init");
theTypes = Types;
theEdges = Edges;
if (!VoidShells.IsNull())
if (VoidShells->Lower() != 1 || VoidShellFlags->Lower() != 1 ||
VoidShells->Length() != VoidShellFlags->Length())
- Standard_DimensionError::Raise("IGESSolid_ManifoldSolid : Init");
+ throw Standard_DimensionError("IGESSolid_ManifoldSolid : Init");
theShell = aShell;
theOrientationFlag = Shellflag;
{
if (Faces->Lower() != 1 || Orient->Lower() != 1 ||
Faces->Length() != Orient->Length())
- Standard_DimensionError::Raise("IGESSolid_Shell : Init");
+ throw Standard_DimensionError("IGESSolid_Shell : Init");
theFaces = Faces;
theOrientation = Orient;
{
if (Items->Lower() != 1 || Matrices->Lower() != 1 ||
Items->Length() != Matrices->Length())
- Standard_DimensionError::Raise("IGESSolid_SolidAssembly : Init");
+ throw Standard_DimensionError("IGESSolid_SolidAssembly : Init");
theItems = Items;
theMatrices = Matrices;
{
if (curve.IsNull() || vstart <= 0 || vend <= 0 ||
vstart > thepoint->Length() || vend > thepoint->Length())
- Standard_DomainError::Raise ("IGESSolid_TopoBuilder : AddEdge");
+ throw Standard_DomainError("IGESSolid_TopoBuilder : AddEdge");
thecur3d->Append (curve);
thevstar->Append (vstart);
thevend->Append (vend);
const Standard_Integer orientation)
{
if (edge3d <= 0 || edge3d > thecur3d->Length())
- Standard_DomainError::Raise ("IGESSolid_TopoBuilder : MakeEdge");
+ throw Standard_DomainError("IGESSolid_TopoBuilder : MakeEdge");
theetype->Append (edgetype);
thee3d->Append (edge3d);
theeflag->Append (orientation);
(const Handle(IGESData_IGESEntity)& curve, const Standard_Integer iso)
{
if (curve.IsNull() || thee3d->IsEmpty())
- Standard_DomainError::Raise ("IGESSolid_TopoBuilder : AddCurveUV");
+ throw Standard_DomainError("IGESSolid_TopoBuilder : AddCurveUV");
thecuruv->Append(curve);
theisol->Append(iso);
}
(const Handle(IGESData_IGESEntity)& surface)
{
if (surface.IsNull())
- Standard_DomainError::Raise ("IGESSolid_TopoBuilder : MakeFace");
+ throw Standard_DomainError("IGESSolid_TopoBuilder : MakeFace");
thesurf = surface;
theouter = Standard_False;
theinner->Clear();
(const Handle(TColgp_HArray1OfXYZ)& Vertices)
{
if (Vertices.IsNull() || Vertices->Lower() != 1)
- Standard_DimensionMismatch::Raise("IGESSolid_VertexList : Init");
+ throw Standard_DimensionMismatch("IGESSolid_VertexList : Init");
theVertices = Vertices;
InitTypeAndForm(502,1);
}
result = Standard_False;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\n**IGESToBRep::TransferPCurve: Exception in SameRange : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
result = Standard_False;
}
}
}
} //:36
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\n** Exception in IGESToBRep_BasicCurve::TransferBasicCurve : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
if (res.IsNull()) {
// AddFail(start, "The IGESEntity cannot be transfered.");
return res;
}
} //:h8
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\n** Exception in IGESToBRep_BasicCurve::Transfer2dBasicCurve : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
return res;
}
else
BSplineRes = new Geom_BSplineCurve(Poles, Weight, Knot, Mult, Degree);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\n** Exception in IGESToBRep_BasicCurve::TransferBSplineCurve during creation of Geom_BSplineCurve : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
}
}
} //:36
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\n** Exception in IGESToBRep_BasicSurface::TransferBasicSurface : ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
#endif
+ (void)anException;
}
if (resurf.IsNull()) {
}//if ( !aResultSurf.IsNull())
}//if (extractCurve3d(generatrix, aBasisCurve))
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: IgesToBRep_TopoSurface::"
"TransferSurfaceOfRevolution(): exception by Geom: ";
- Standard_Failure::Caught()->Print ( cout ); cout << endl;
+ anException.Print ( cout ); cout << endl;
#endif
+ (void)anException;
}//catch (Standard_Failure)
}
}
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: IgesToBRep_TopoSurface::TransferTabulatedCylinder(): exception by Geom: ";
- Standard_Failure::Caught()->Print ( cout ); cout << endl;
+ anException.Print ( cout ); cout << endl;
#endif
+ (void)anException;
}
}
if (!IsEmpty()
&& SizePixelBytes (myImgFormat) != SizePixelBytes (thePixelFormat))
{
- Standard_ProgramError::Raise ("Image_PixMap::SetFormat() - incompatible pixel format");
+ throw Standard_ProgramError("Image_PixMap::SetFormat() - incompatible pixel format");
return;
}
}
}
else {
- Standard_DomainError::Raise("IntAna_Curve::Domain");
+ throw Standard_DomainError("IntAna_Curve::Domain");
}
}
//=======================================================================
((Theta>DomainSup*aRelTolp) && (!TwoCurves)) ||
(Theta>(DomainSup+DomainSup-DomainInf)*aRelTolp)) {
SigneSqrtDis = 0.;
- Standard_DomainError::Raise("IntAna_Curve::Domain");
+ throw Standard_DomainError("IntAna_Curve::Domain");
}
if(Theta>DomainSup) {
const Standard_Real DSup)
{
if(DInf>=DSup) {
- Standard_DomainError::Raise("IntAna_Curve::Domain");
+ throw Standard_DomainError("IntAna_Curve::Domain");
}
//
DomainInf=DInf;
inline Standard_Boolean IntAna_Int3Pln::IsEmpty () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return empt;
}
inline const gp_Pnt& IntAna_Int3Pln::Value () const {
- if (!done) {StdFail_NotDone::Raise();}
- if (empt) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (empt) {throw Standard_DomainError();}
return pnt;
}
inline Standard_Boolean IntAna_IntConicQuad::IsInQuadric() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return(inquadric);
}
inline Standard_Boolean IntAna_IntConicQuad::IsParallel() const {
- if(!done) {StdFail_NotDone::Raise();}
+ if(!done) {throw StdFail_NotDone();}
return(parallel);
}
inline Standard_Integer IntAna_IntConicQuad::NbPoints() const {
- if(!done) {StdFail_NotDone::Raise();}
- if (parallel || inquadric) {Standard_DomainError::Raise();}
+ if(!done) {throw StdFail_NotDone();}
+ if (parallel || inquadric) {throw Standard_DomainError();}
return(nbpts);
}
inline const gp_Pnt& IntAna_IntConicQuad::Point
(const Standard_Integer i) const {
- if(!done) {StdFail_NotDone::Raise();}
- if (parallel || inquadric) {Standard_DomainError::Raise();}
- if((i>nbpts)||(i<=0)) {Standard_OutOfRange::Raise();}
+ if(!done) {throw StdFail_NotDone();}
+ if (parallel || inquadric) {throw Standard_DomainError();}
+ if((i>nbpts)||(i<=0)) {throw Standard_OutOfRange();}
return(pnts[i-1]);
}
inline Standard_Real IntAna_IntConicQuad::ParamOnConic
(const Standard_Integer i) const {
- if(!done) {StdFail_NotDone::Raise();}
- if (parallel || inquadric) {Standard_DomainError::Raise();}
- if((i>nbpts)||(i<=0)) {Standard_OutOfRange::Raise();}
+ if(!done) {throw StdFail_NotDone();}
+ if (parallel || inquadric) {throw Standard_DomainError();}
+ if((i>nbpts)||(i<=0)) {throw Standard_OutOfRange();}
return(paramonc[i-1]);
}
}
inline Standard_Integer IntAna_IntLinTorus::NbPoints () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return nbpt;
}
inline const gp_Pnt& IntAna_IntLinTorus::Value
(const Standard_Integer Index) const {
- if (!done) {StdFail_NotDone::Raise();}
- if(Index<=0 || Index>nbpt) { Standard_OutOfRange::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if(Index<=0 || Index>nbpt) { throw Standard_OutOfRange();}
return thePoint[Index-1];
}
inline Standard_Real IntAna_IntLinTorus::ParamOnLine
(const Standard_Integer Index) const {
- if (!done) {StdFail_NotDone::Raise();}
- if(Index<=0 || Index>nbpt) { Standard_OutOfRange::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if(Index<=0 || Index>nbpt) { throw Standard_OutOfRange();}
return theParam[Index-1];
}
(const Standard_Integer Index,
Standard_Real& FI, Standard_Real& THETA) const {
- if (!done) {StdFail_NotDone::Raise();}
- if(Index<=0 || Index>nbpt) { Standard_OutOfRange::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if(Index<=0 || Index>nbpt) { throw Standard_OutOfRange();}
FI=theFi[Index-1];
THETA=theTheta[Index-1];
}
//NbSolutions
Standard_Integer NbSolutions() {
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return NbRoots;
}
//InfiniteRoots
Standard_Boolean InfiniteRoots() {
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return infinite_roots;
}
//Value
Standard_Real Value(const Standard_Integer n) {
if((!done)||(n>NbRoots)) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return Roots[n-1];
}
Standard_Boolean IntAna_IntQuadQuad::HasPreviousCurve(const Standard_Integer I) const
{
if(!done) {
- StdFail_NotDone::Raise("IntQuadQuad Not done");
+ throw StdFail_NotDone("IntQuadQuad Not done");
}
if (identical) {
- Standard_DomainError::Raise("IntQuadQuad identical");
+ throw Standard_DomainError("IntQuadQuad identical");
}
if((I>NbCurves)||(I<=0)) {
- Standard_OutOfRange::Raise("Incorrect Curve Number 'HasPrevious Curve'");
+ throw Standard_OutOfRange("Incorrect Curve Number 'HasPrevious Curve'");
}
if(previouscurve[I-1]) {
return Standard_True;
Standard_Boolean IntAna_IntQuadQuad::HasNextCurve(const Standard_Integer I) const
{
if(!done) {
- StdFail_NotDone::Raise("IntQuadQuad Not done");
+ throw StdFail_NotDone("IntQuadQuad Not done");
}
if (identical) {
- Standard_DomainError::Raise("IntQuadQuad identical");
+ throw Standard_DomainError("IntQuadQuad identical");
}
if((I>NbCurves)||(I<=0)) {
- Standard_OutOfRange::Raise("Incorrect Curve Number 'HasNextCurve'");
+ throw Standard_OutOfRange("Incorrect Curve Number 'HasNextCurve'");
}
if(nextcurve[I-1]) {
return Standard_True;
}
}
else {
- Standard_DomainError::Raise("Incorrect Curve Number 'PreviousCurve'"); return(0);
+ throw Standard_DomainError("Incorrect Curve Number 'PreviousCurve'");
}
}
//=======================================================================
}
}
else {
- Standard_DomainError::Raise("Incorrect Curve Number 'NextCurve'");
- return(0);
+ throw Standard_DomainError("Incorrect Curve Number 'NextCurve'");
}
}
//=======================================================================
const IntAna_Curve& IntAna_IntQuadQuad::Curve(const Standard_Integer i) const
{
if(!done) {
- StdFail_NotDone::Raise("IntQuadQuad Not done");
+ throw StdFail_NotDone("IntQuadQuad Not done");
}
if (identical) {
- Standard_DomainError::Raise("IntQuadQuad identical");
+ throw Standard_DomainError("IntQuadQuad identical");
}
if((i <= 0) || (i>NbCurves)) {
- Standard_OutOfRange::Raise("Incorrect Curve Number");
+ throw Standard_OutOfRange("Incorrect Curve Number");
}
return TheCurve[i-1];
}
const gp_Pnt& IntAna_IntQuadQuad::Point (const Standard_Integer i) const
{
if(!done) {
- StdFail_NotDone::Raise("IntQuadQuad Not done");
+ throw StdFail_NotDone("IntQuadQuad Not done");
}
if (identical) {
- Standard_DomainError::Raise("IntQuadQuad identical");
+ throw Standard_DomainError("IntQuadQuad identical");
}
if((i <= 0) || (i>Nbpoints)) {
- Standard_OutOfRange::Raise("Incorrect Point Number");
+ throw Standard_OutOfRange("Incorrect Point Number");
}
return Thepoints[i-1];
}
}
inline Standard_Boolean IntAna_IntQuadQuad::IdenticalElements () const {
- if(!done) {StdFail_NotDone::Raise("IntQuadQuad Not done");}
+ if(!done) {throw StdFail_NotDone("IntQuadQuad Not done");}
return(identical);
}
inline Standard_Integer IntAna_IntQuadQuad::NbCurve () const {
- if(!done) {StdFail_NotDone::Raise("IntQuadQuad Not done");}
- if (identical) {Standard_DomainError::Raise();}
+ if(!done) {throw StdFail_NotDone("IntQuadQuad Not done");}
+ if (identical) {throw Standard_DomainError();}
return(NbCurves);
}
inline Standard_Integer IntAna_IntQuadQuad::NbPnt () const
{
- if(!done) {StdFail_NotDone::Raise("IntQuadQuad Not done");}
- if (identical) {Standard_DomainError::Raise();}
+ if(!done) {throw StdFail_NotDone("IntQuadQuad Not done");}
+ if (identical) {throw Standard_DomainError();}
return(Nbpoints);
}
//=======================================================================
gp_Pnt IntAna_QuadQuadGeo::Point(const Standard_Integer n) const
{
- if(!done) { StdFail_NotDone::Raise(); }
- if(n>nbint || n<1) { Standard_DomainError::Raise(); }
+ if(!done) { throw StdFail_NotDone(); }
+ if(n>nbint || n<1) { throw Standard_DomainError(); }
if(typeres==IntAna_PointAndCircle) {
- if(n!=1) { Standard_DomainError::Raise(); }
+ if(n!=1) { throw Standard_DomainError(); }
if(param1==0.0) return(pt1);
return(pt2);
}
//=======================================================================
gp_Lin IntAna_QuadQuadGeo::Line(const Standard_Integer n) const
{
- if(!done) { StdFail_NotDone::Raise(); }
+ if(!done) { throw StdFail_NotDone(); }
if((n>nbint) || (n<1) || (typeres!=IntAna_Line)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if(n==1) { return(gp_Lin(pt1,dir1)); }
else { return(gp_Lin(pt2,dir2)); }
//=======================================================================
gp_Circ IntAna_QuadQuadGeo::Circle(const Standard_Integer n) const
{
- if(!done) { StdFail_NotDone::Raise(); }
+ if(!done) { throw StdFail_NotDone(); }
if(typeres==IntAna_PointAndCircle) {
- if(n!=1) { Standard_DomainError::Raise(); }
+ if(n!=1) { throw Standard_DomainError(); }
if(param2==0.0) return(gp_Circ(DirToAx2(pt1,dir1),param1));
return(gp_Circ(DirToAx2(pt2,dir2),param2));
}
else if((n>nbint) || (n<1) || (typeres!=IntAna_Circle)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if (n==1) { return(gp_Circ(DirToAx2(pt1,dir1),param1));}
else if (n==2) { return(gp_Circ(DirToAx2(pt2,dir2),param2));}
//=======================================================================
gp_Elips IntAna_QuadQuadGeo::Ellipse(const Standard_Integer n) const
{
- if(!done) { StdFail_NotDone::Raise(); }
+ if(!done) { throw StdFail_NotDone(); }
if((n>nbint) || (n<1) || (typeres!=IntAna_Ellipse)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if(n==1) {
gp_Parab IntAna_QuadQuadGeo::Parabola(const Standard_Integer n) const
{
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (typeres!=IntAna_Parabola) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if((n>nbint) || (n!=1)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return(gp_Parab(gp_Ax2( pt1
,dir1
gp_Hypr IntAna_QuadQuadGeo::Hyperbola(const Standard_Integer n) const
{
if(!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if((n>nbint) || (n<1) || (typeres!=IntAna_Hyperbola)) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if(n==1) {
return(gp_Hypr(gp_Ax2( pt1
inline IntAna_ResultType IntAna_QuadQuadGeo::TypeInter() const {
- if(!done) {StdFail_NotDone::Raise();}
+ if(!done) {throw StdFail_NotDone();}
return(typeres);
}
inline Standard_Integer IntAna_QuadQuadGeo::NbSolutions() const {
- if(!done) {StdFail_NotDone::Raise();}
+ if(!done) {throw StdFail_NotDone();}
return(nbint);
}
inline Standard_Boolean IntAna2d_AnaIntersection::IsEmpty () const {
if (!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return ((nbp==0)&&(!iden));
}
inline Standard_Boolean IntAna2d_AnaIntersection::IdenticalElements () const {
if (!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return iden ;
}
inline Standard_Boolean IntAna2d_AnaIntersection::ParallelElements () const {
if (!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return para ;
}
inline Standard_Integer IntAna2d_AnaIntersection::NbPoints () const {
if (!done) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return nbp ;
}
inline const IntAna2d_IntPoint& IntAna2d_AnaIntersection::Point (const Standard_Integer N) const {
if (!done) {
- StdFail_NotDone::Raise();
- return lpnt[0];
+ throw StdFail_NotDone();
}
else {
if ((N<=0)||(N>nbp)) {
- Standard_OutOfRange::Raise();
- return lpnt[0];
+ throw Standard_OutOfRange();
}
else {
return lpnt[N-1];
inline Standard_Real IntAna2d_IntPoint::ParamOnSecond () const {
if (myimplicit) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
return myu2;
}
,const Standard_Real TolConf,const Standard_Real Tol) {
//-- if(! CIRC_Domain.IsClosed()) {
-//-- Standard_ConstructionError::Raise("Domaine incorrect");
+//-- throw Standard_ConstructionError("Domaine incorrect");
//-- }
Standard_Boolean TheReversedParameters=ReversedParameters();
IntRes2d_Domain D(D1);
D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol);
- //-- Standard_ConstructionError::Raise("Domaine incorrect");
+ //-- throw Standard_ConstructionError("Domaine incorrect");
}
else {
Perform(IntCurve_IConicTool(C),D1,PCurve,D2,TolConf,Tol);
IntRes2d_Domain D(D1);
D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(E),D,PCurve,D2,TolConf,Tol);
- //-- Standard_ConstructionError::Raise("Domaine incorrect");
+ //-- throw Standard_ConstructionError("Domaine incorrect");
}
else {
Perform(IntCurve_IConicTool(E),D1,PCurve,D2,TolConf,Tol);
IntRes2d_Domain D(D1);
D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI);
Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol);
- //-- Standard_ConstructionError::Raise("Domaine incorrect");
+ //-- throw Standard_ConstructionError("Domaine incorrect");
}
else {
Perform(IntCurve_IConicTool(C),D1,PCurve,D2,TolConf,Tol);
theBegin = ThePnts(TheIndex(theIndex));
if (theIndex >= NbPntIn) {
if (!ClosedPolygon)
- Standard_OutOfRange::Raise("IntCurve_Polygon2dGen::Segment!");
+ throw Standard_OutOfRange("IntCurve_Polygon2dGen::Segment!");
ind = 0;
}
theEnd = ThePnts(TheIndex(ind+1));
Standard_Boolean IntCurveSurface_Intersection::IsDone() const { return(done); }
//================================================================================
Standard_Integer IntCurveSurface_Intersection::NbPoints() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lpnt.Length();
}
//================================================================================
Standard_Integer IntCurveSurface_Intersection::NbSegments() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lseg.Length();
}
//================================================================================
const IntCurveSurface_IntersectionPoint& IntCurveSurface_Intersection::Point( const Standard_Integer N) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lpnt.Value(N);
}
//================================================================================
const IntCurveSurface_IntersectionSegment& IntCurveSurface_Intersection::Segment( const Standard_Integer N) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lseg.Value(N);
}
//================================================================================
//Standard_IMPORT extern IntImp_ConstIsoparametric *ChoixRef;
-
-IntImp_Int2S::IntImp_Int2S() {
- Standard_ConstructionError::Raise(" Empty Constructor : IntImp_Int2S");
-}
-
-
IntImp_Int2S::IntImp_Int2S(const ThePSurface& surf1,
const ThePSurface& surf2,
const Standard_Real TolTangency ) :
inline Standard_Boolean IntImp_Int2S::IsEmpty() const
{
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::IsEmpty() ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::IsEmpty() ");
return empty;
}
inline const IntSurf_PntOn2S& IntImp_Int2S::Point() const
{
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::Point() ");
- if (empty) Standard_DomainError::Raise(" IntImp_Int2S::Point() ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::Point() ");
+ if (empty) throw Standard_DomainError(" IntImp_Int2S::Point() ");
return pint;
}
inline Standard_Boolean IntImp_Int2S::IsTangent () const {
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::IsTangent () ");
- if (empty) Standard_DomainError::Raise(" IntImp_Int2S::IsTangent () ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::IsTangent () ");
+ if (empty) throw Standard_DomainError(" IntImp_Int2S::IsTangent () ");
return tangent;
}
inline const gp_Dir& IntImp_Int2S::Direction () const {
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::Direction () ");
- if (empty) Standard_DomainError::Raise(" IntImp_Int2S::Direction () ");
- if (tangent) StdFail_UndefinedDerivative::Raise
- (" IntImp_Int2S::Direction () ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::Direction () ");
+ if (empty) throw Standard_DomainError(" IntImp_Int2S::Direction () ");
+ if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::Direction () ");
return d3d;
}
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS1 () const {
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::DirectionOnS1 () ");
- if (empty) Standard_DomainError::Raise(" IntImp_Int2S::DirectionOnS1 () ");
- if (tangent) StdFail_UndefinedDerivative::Raise
- (" IntImp_Int2S::DirectionOnS1 () ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS1 () ");
+ if (empty) throw Standard_DomainError(" IntImp_Int2S::DirectionOnS1 () ");
+ if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS1 () ");
return d2d1;
}
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS2 () const {
- if (!done) StdFail_NotDone::Raise(" IntImp_Int2S::DirectionOnS2 () ");
- if (empty) Standard_DomainError::Raise(" IntImp_Int2S::DirectionOnS2 () ");
- if (tangent) StdFail_UndefinedDerivative::Raise
- (" IntImp_Int2S::DirectionOnS2 () ");
+ if (!done) throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS2 () ");
+ if (empty) throw Standard_DomainError(" IntImp_Int2S::DirectionOnS2 () ");
+ if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS2 () ");
return d2d2;
}
Standard_Boolean IntImp_IntCS::IsDone() const { return done;}
Standard_Boolean IntImp_IntCS::IsEmpty()const {
- if (!done) StdFail_NotDone::Raise();
+ if (!done) throw StdFail_NotDone();
return empty;
}
const gp_Pnt& IntImp_IntCS::Point() const
{
- if (!done) StdFail_NotDone::Raise();
- if (empty) Standard_DomainError::Raise();
+ if (!done) throw StdFail_NotDone();
+ if (empty) throw Standard_DomainError();
return myFunction.Point();
}
void IntImp_IntCS::ParameterOnSurface(Standard_Real& U,
Standard_Real& V) const
{
- if (!done) StdFail_NotDone::Raise();
- if (empty) Standard_DomainError::Raise();
+ if (!done) throw StdFail_NotDone();
+ if (empty) throw Standard_DomainError();
U=u;
V=v;
}
Standard_Real IntImp_IntCS::ParameterOnCurve() const
{
- if (!done) StdFail_NotDone::Raise();
- if (empty) Standard_DomainError::Raise();
+ if (!done) throw StdFail_NotDone();
+ if (empty) throw Standard_DomainError();
return w;
}
inline const gp_Vec& IntImp_ZerImpFunc::Direction3d()
{
- if (IsTangent()) StdFail_UndefinedDerivative::Raise();
+ if (IsTangent()) throw StdFail_UndefinedDerivative();
return d3d;
}
inline const gp_Dir2d& IntImp_ZerImpFunc::Direction2d()
{
- if (IsTangent()) StdFail_UndefinedDerivative::Raise();
+ if (IsTangent()) throw StdFail_UndefinedDerivative();
return d2d;
}
#define SURF2 (*((ThePSurface *)(surf2)))
-IntImp_ZerParFunc::IntImp_ZerParFunc() {
- Standard_ConstructionError::Raise(" Empty Constructor : IntImp_ZerParFunc");
-}
-
IntImp_ZerParFunc::IntImp_ZerParFunc(const ThePSurface& S1 ,
const ThePSurface& S2) {
surf1 = (Standard_Address)(&S1);
}
inline gp_Dir IntImp_ZerParFunc::Direction() const {
- if (tangent ) StdFail_UndefinedDerivative::Raise();
+ if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir(tgduv[0]*dpuv[0].XYZ() + tgduv[1]*dpuv[1].XYZ());
}
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS1() const {
- if (tangent ) StdFail_UndefinedDerivative::Raise();
+ if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[0],tgduv[1]);
}
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS2() const {
- if (tangent ) StdFail_UndefinedDerivative::Raise();
+ if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[2],tgduv[3]);
}
if (!(TheParCurveDomain.HasFirstPoint() &&
TheParCurveDomain.HasLastPoint())) {
- Standard_ConstructionError::Raise("Domaine sur courbe incorrect");
+ throw Standard_ConstructionError("Domaine sur courbe incorrect");
}
Standard_Integer nb_echantillons = ParTool::NbSamples(TheParCurve,
inline const IntPatch_Point& IntPatch_ALine::FirstPoint () const
{
- if (!fipt) {Standard_DomainError::Raise();}
+ if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_ALine::LastPoint () const
{
- if (!lapt) {Standard_DomainError::Raise();}
+ if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
inline gp_Lin IntPatch_GLine::Line () const
{
- if (typ != IntPatch_Lin) {Standard_DomainError::Raise();}
+ if (typ != IntPatch_Lin) {throw Standard_DomainError();}
return gp_Lin(pos.Axis());
}
inline gp_Circ IntPatch_GLine::Circle () const
{
- if (typ != IntPatch_Circle) {Standard_DomainError::Raise();}
+ if (typ != IntPatch_Circle) {throw Standard_DomainError();}
return gp_Circ(pos,par1);
}
inline gp_Elips IntPatch_GLine::Ellipse () const
{
- if (typ != IntPatch_Ellipse) {Standard_DomainError::Raise();}
+ if (typ != IntPatch_Ellipse) {throw Standard_DomainError();}
return gp_Elips(pos,par1,par2);
}
inline gp_Parab IntPatch_GLine::Parabola () const
{
- if (typ != IntPatch_Parabola) {Standard_DomainError::Raise();}
+ if (typ != IntPatch_Parabola) {throw Standard_DomainError();}
return gp_Parab(pos,par1);
}
inline gp_Hypr IntPatch_GLine::Hyperbola () const
{
- if (typ != IntPatch_Hyperbola) {Standard_DomainError::Raise();}
+ if (typ != IntPatch_Hyperbola) {throw Standard_DomainError();}
return gp_Hypr(pos,par1,par2);
}
inline const IntPatch_Point& IntPatch_GLine::FirstPoint () const
{
- if (!fipt) {Standard_DomainError::Raise();}
+ if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_GLine::LastPoint () const
{
- if (!lapt) {Standard_DomainError::Raise();}
+ if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
Standard_Real&,
Standard_Real&)
{
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::IsVertex(const Handle(Adaptor2d_HCurve2d)&,
const Standard_Integer,
Handle(Adaptor3d_HVertex)&)
{
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Standard_Integer IntPatch_HInterTool::NbSegments(const Handle(Adaptor2d_HCurve2d)&)
const Standard_Integer,
Standard_Integer&)
{
- Standard_OutOfRange::Raise();
- return Standard_False;
+ throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::HasLastPoint (const Handle(Adaptor2d_HCurve2d)&,
const Standard_Integer,
Standard_Integer&)
{
- Standard_OutOfRange::Raise();
- return Standard_False;
+ throw Standard_OutOfRange();
}
Standard_Boolean IntPatch_HInterTool::IsAllSolution (const Handle(Adaptor2d_HCurve2d)&)
inline Standard_Boolean IntPatch_ImpImpIntersection::IsEmpty () const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return empt;
}
inline Standard_Boolean IntPatch_ImpImpIntersection::TangentFaces () const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return tgte;
}
inline Standard_Boolean IntPatch_ImpImpIntersection::OppositeFaces () const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
- if (!tgte) {Standard_DomainError::Raise();}
+ if (!IsDone ()) { throw StdFail_NotDone(); }
+ if (!tgte) {throw Standard_DomainError();}
return oppo;
}
inline Standard_Integer IntPatch_ImpImpIntersection::NbPnts () const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_ImpImpIntersection::Point (const Standard_Integer Index) const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return spnt(Index);
}
inline Standard_Integer IntPatch_ImpImpIntersection::NbLines () const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_ImpImpIntersection::Line (const Standard_Integer Index) const
{
- if (!IsDone ()) { StdFail_NotDone::Raise(); }
+ if (!IsDone ()) { throw StdFail_NotDone(); }
return slin(Index);
}
const Standard_Integer iT2 = SetQuad(S2, typs2, quad2);
//
if (!iT1 || !iT2) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
return;
}
//
}
//
default: {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
break;
}
}
// AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file).
if(Abs(aDetV1V2) < Precision::Angular())
{
- Standard_Failure::Raise("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
+ throw Standard_Failure("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
}
switch(aFoundCouple)
case IntAna_Parabola:
case IntAna_Hyperbola:
- Standard_Failure::Raise("IntCyCy(): Wrong intersection type!");
+ throw Standard_Failure("IntCyCy(): Wrong intersection type!");
case IntAna_Circle:
// Circle is useful when we will work with trimmed surfaces
isPlus = Standard_False;
break;
default:
- //Standard_Failure::Raise("Error. Range Error!!!!");
+ //throw Standard_Failure("Error. Range Error!!!!");
return Standard_False;
}
break;
default:
{
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
break;
}
}
inline Standard_Boolean IntPatch_ImpPrmIntersection::IsEmpty () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return empt;
}
inline Standard_Integer IntPatch_ImpPrmIntersection::NbPnts () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_ImpPrmIntersection::Point (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt(Index);
}
inline Standard_Integer IntPatch_ImpPrmIntersection::NbLines () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_ImpPrmIntersection::Line (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin(Index);
}
inline Standard_Boolean IntPatch_Intersection::IsEmpty () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return empt;
}
inline Standard_Boolean IntPatch_Intersection::TangentFaces () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return tgte;
}
inline Standard_Boolean IntPatch_Intersection::OppositeFaces () const
{
- if (!done) {StdFail_NotDone::Raise();}
- if (!tgte) {Standard_DomainError::Raise();}
+ if (!done) {throw StdFail_NotDone();}
+ if (!tgte) {throw Standard_DomainError();}
return oppo;
}
inline Standard_Integer IntPatch_Intersection::NbPnts () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt.Length();
}
inline const IntPatch_Point& IntPatch_Intersection::Point (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt(Index);
}
inline Standard_Integer IntPatch_Intersection::NbLines () const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin.Length();
}
inline const Handle(IntPatch_Line)& IntPatch_Intersection::Line (const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return slin(Index);
}
inline IntSurf_Situation IntPatch_Line::SituationS1 () const {
- if (tS1 != IntSurf_Touch) {Standard_DomainError::Raise();}
+ if (tS1 != IntSurf_Touch) {throw Standard_DomainError();}
return sit1;
}
inline IntSurf_Situation IntPatch_Line::SituationS2 () const {
- if (tS2 != IntSurf_Touch) {Standard_DomainError::Raise();}
+ if (tS2 != IntSurf_Touch) {throw Standard_DomainError();}
return sit2;
}
quad1.SetValue(myHS1->Surface().Torus());
break;
default:
- Standard_ConstructionError::Raise("IntPatch_IntSS::MakeCurve");
+ throw Standard_ConstructionError("IntPatch_IntSS::MakeCurve");
}
typs = myHS2->Surface().GetType();
quad2.SetValue(myHS2->Surface().Torus());
break;
default:
- Standard_ConstructionError::Raise("IntPatch_IntSS::MakeCurve");
+ throw Standard_ConstructionError("IntPatch_IntSS::MakeCurve");
}
quad1.Parameters(Ptref,U1,V1);
quad2.Parameters(Ptref,U2,V2);
break;
}
default: {
- Standard_ConstructionError::Raise("IntPatch_LineConstructor::AddLine");
+ throw Standard_ConstructionError("IntPatch_LineConstructor::AddLine");
}
break;
}
inline const Handle(Adaptor3d_HVertex)& IntPatch_Point::VertexOnS1 () const
{
- if (!vtxonS1) {Standard_DomainError::Raise();}
+ if (!vtxonS1) {throw Standard_DomainError();}
return vS1;
}
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_Point::ArcOnS1 () const
{
- if (!onS1) {Standard_DomainError::Raise();}
+ if (!onS1) {throw Standard_DomainError();}
return arcS1;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionLineArc1 () const
{
- if (!onS1) {Standard_DomainError::Raise();}
+ if (!onS1) {throw Standard_DomainError();}
return traline1;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionOnS1 () const
{
- if (!onS1) {Standard_DomainError::Raise();}
+ if (!onS1) {throw Standard_DomainError();}
return tra1;
}
inline Standard_Real IntPatch_Point::ParameterOnArc1 () const
{
- if (!onS1) {Standard_DomainError::Raise();}
+ if (!onS1) {throw Standard_DomainError();}
return prm1;
}
inline const Handle(Adaptor3d_HVertex)& IntPatch_Point::VertexOnS2 () const
{
- if (!vtxonS2) {Standard_DomainError::Raise();}
+ if (!vtxonS2) {throw Standard_DomainError();}
return vS2;
}
inline const Handle(Adaptor2d_HCurve2d)& IntPatch_Point::ArcOnS2 () const
{
- if (!onS2) {Standard_DomainError::Raise();}
+ if (!onS2) {throw Standard_DomainError();}
return arcS2;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionLineArc2 () const
{
- if (!onS2) {Standard_DomainError::Raise();}
+ if (!onS2) {throw Standard_DomainError();}
return traline2;
}
inline const IntSurf_Transition& IntPatch_Point::TransitionOnS2 () const
{
- if (!onS2) {Standard_DomainError::Raise();}
+ if (!onS2) {throw Standard_DomainError();}
return tra2;
}
inline Standard_Real IntPatch_Point::ParameterOnArc2 () const
{
- if (!onS2) {Standard_DomainError::Raise();}
+ if (!onS2) {throw Standard_DomainError();}
return prm2;
}
gp_Pnt2d p2d;
if (Pdeb == RealFirst() || Pfin == RealLast() || NbSample <= 1) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
//----------------------------------------------------------------------
//-- On veut eviter les cas ou le present polygone est beaucoup plus
{
Standard_Integer NbPnts = NbPntsToInsert + High - Low;
if(NumLine>NbLines() || NumLine<1 || Low>=High )
- Standard_OutOfRange::Raise(" IntPatch_PrmPrmIntersection NewLine ");
+ throw Standard_OutOfRange(" IntPatch_PrmPrmIntersection NewLine ");
//------------------------------------------------------------------
//-- Indice : Low Low+1 I I+1 High --
//-- --
//======================================================================
inline Standard_Integer IntPatch_PrmPrmIntersection::NbLines() const {
if(!done)
- StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
+ throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(SLin.Length());
}
inline const Handle(IntPatch_Line)& IntPatch_PrmPrmIntersection::Line
(const Standard_Integer n) const {
if(!done)
- StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
+ throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(SLin.Value(n));
}
//======================================================================
inline Standard_Boolean IntPatch_PrmPrmIntersection::IsEmpty() const {
if(!done)
- StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
+ throw StdFail_NotDone(" IntPatch_PrmPrmIntersection ");
return(empt);
}
inline const IntPatch_Point& IntPatch_RLine::FirstPoint () const
{
- if (!fipt) {Standard_DomainError::Raise();}
+ if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_RLine::LastPoint () const
{
- if (!lapt) {Standard_DomainError::Raise();}
+ if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
inline void IntPatch_RLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
- Standard_OutOfRange::Raise("Cannot delete not existing vertex");
+ throw Standard_OutOfRange("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}
inline Standard_Integer IntPatch_RLine::NbPnts () const
{
- if (curv.IsNull()) {Standard_DomainError::Raise();}
+ if (curv.IsNull()) {throw Standard_DomainError();}
return curv->NbPoints();
}
inline const IntSurf_PntOn2S& IntPatch_RLine::Point (const Standard_Integer Index) const
{
- if (curv.IsNull()) {Standard_DomainError::Raise();}
+ if (curv.IsNull()) {throw Standard_DomainError();}
return curv->Value(Index);
}
if (found) return Standard_True;
}
else {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
return Standard_False;
}
Nbptlin = rlin->NbPnts();
}
else {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
if (!Domain->Has3d())
// don't use computed deflection in the mode of pure geometric intersection
}
else
{
- Standard_TypeMismatch::Raise( "IntPatch_SpecialPoints::AddSingularPole(),"
+ throw Standard_TypeMismatch( "IntPatch_SpecialPoints::AddSingularPole(),"
"Unsupported quadric with Pole");
}
inline const IntPatch_Point& IntPatch_WLine::FirstPoint () const
{
- if (!fipt) {Standard_DomainError::Raise();}
+ if (!fipt) {throw Standard_DomainError();}
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_WLine::LastPoint () const
{
- if (!lapt) {Standard_DomainError::Raise();}
+ if (!lapt) {throw Standard_DomainError();}
return svtx(indl);
}
inline const IntPatch_Point& IntPatch_WLine::FirstPoint (Standard_Integer& Indfirst) const
{
- if (!fipt) {Standard_DomainError::Raise();}
+ if (!fipt) {throw Standard_DomainError();}
Indfirst = indf;
return svtx(indf);
}
inline const IntPatch_Point& IntPatch_WLine::LastPoint (Standard_Integer& Indlast) const
{
- if (!lapt) {Standard_DomainError::Raise();}
+ if (!lapt) {throw Standard_DomainError();}
Indlast = indl;
return svtx(indl);
}
inline void IntPatch_WLine::RemoveVertex(const Standard_Integer theIndex)
{
if((theIndex < 1) || (theIndex > NbVertex()))
- Standard_OutOfRange::Raise("Cannot delete not existing vertex");
+ throw Standard_OutOfRange("Cannot delete not existing vertex");
svtx.Remove(theIndex);
}
inline void IntRes2d_Domain::SetEquivalentParameters
(const Standard_Real p_first,
const Standard_Real p_last) {
- if((status&3)!=3) { Standard_DomainError::Raise(); }
+ if((status&3)!=3) { throw Standard_DomainError(); }
status|=4;
periodfirst=p_first;
periodlast=p_last;
}
inline Standard_Real IntRes2d_Domain::FirstParameter () const {
- if(!(status&1)) { Standard_DomainError::Raise(); }
+ if(!(status&1)) { throw Standard_DomainError(); }
return(first_param);
}
inline const gp_Pnt2d& IntRes2d_Domain::FirstPoint () const {
- if(!(status&1)) { Standard_DomainError::Raise(); }
+ if(!(status&1)) { throw Standard_DomainError(); }
return(first_point);
}
inline Standard_Real IntRes2d_Domain::FirstTolerance () const {
- if(!(status&1)) { Standard_DomainError::Raise(); }
+ if(!(status&1)) { throw Standard_DomainError(); }
return(first_tol);
}
}
inline Standard_Real IntRes2d_Domain::LastParameter () const {
- if(!(status&2)) { Standard_DomainError::Raise(); }
+ if(!(status&2)) { throw Standard_DomainError(); }
return(last_param);
}
inline const gp_Pnt2d& IntRes2d_Domain::LastPoint () const {
- if(!(status&2)) { Standard_DomainError::Raise(); }
+ if(!(status&2)) { throw Standard_DomainError(); }
return(last_point);
}
inline Standard_Real IntRes2d_Domain::LastTolerance () const {
- if(!(status&2)) { Standard_DomainError::Raise(); }
+ if(!(status&2)) { throw Standard_DomainError(); }
return(last_tol);
}
}
//----------------------------------------------------------------------
inline Standard_Boolean IntRes2d_Intersection::IsEmpty() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return ((lpnt.Length() == 0) && (lseg.Length() == 0));
}
//----------------------------------------------------------------------
inline Standard_Integer IntRes2d_Intersection::NbPoints() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lpnt.Length();
}
//----------------------------------------------------------------------
inline const IntRes2d_IntersectionPoint&
IntRes2d_Intersection::Point( const Standard_Integer N) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lpnt(N);
}
//----------------------------------------------------------------------
inline Standard_Integer IntRes2d_Intersection::NbSegments() const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lseg.Length();
}
//----------------------------------------------------------------------
inline const IntRes2d_IntersectionSegment&
IntRes2d_Intersection::Segment(const Standard_Integer N) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return lseg(N);
}
//----------------------------------------------------------------------
inline const IntRes2d_IntersectionPoint&
IntRes2d_IntersectionSegment::FirstPoint () const {
- if (!first) { Standard_DomainError::Raise(); }
+ if (!first) { throw Standard_DomainError(); }
return ptfirst;
}
inline const IntRes2d_IntersectionPoint&
IntRes2d_IntersectionSegment::LastPoint () const {
- if (!last) { Standard_DomainError::Raise();}
+ if (!last) { throw Standard_DomainError();}
return ptlast;
}
inline Standard_Boolean IntRes2d_Transition::IsTangent () const {
if (typetra==IntRes2d_Undecided) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
return tangent;
}
inline IntRes2d_Situation IntRes2d_Transition::Situation () const {
if (typetra!=IntRes2d_Touch) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
return situat;
}
inline Standard_Boolean IntRes2d_Transition::IsOpposite () const {
if (typetra!=IntRes2d_Touch) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
return oppos;
}
inline const TheVertex& IntStart_PathPoint::Vertex () const {
- if (isnew) {Standard_DomainError::Raise ();}
+ if (isnew) {throw Standard_DomainError();}
return vtx;
}
inline Standard_Integer IntStart_SearchInside::NbPoints () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return list.Length();
}
(const Standard_Integer Index) const
{
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return list.Value(Index);
}
math_FunctionAllRoots Sol(Func,Echant,EpsX,maxdist,maxdist); //-- TolBoundary,nTolTangency);
- if (!Sol.IsDone()) {Standard_Failure::Raise();}
+ if (!Sol.IsDone()) {throw Standard_Failure();}
Nbp=Sol.NbPoints();
//
Standard_Real theTol = 5.e-4;
math_FunctionAllRoots SolAgain(Func,Echant,EpsX,theTol,theTol); //-- TolBoundary,nTolTangency);
- if (!SolAgain.IsDone()) {Standard_Failure::Raise();}
+ if (!SolAgain.IsDone()) {throw Standard_Failure();}
Standard_Integer Nbi_again = SolAgain.NbIntervals();
inline Standard_Boolean IntStart_SearchOnBoundaries::AllArcSolution () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return all;
}
inline Standard_Integer IntStart_SearchOnBoundaries::NbPoints () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt.Length();
}
inline const IntStart_ThePathPoint& IntStart_SearchOnBoundaries::Point
(const Standard_Integer Index) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return spnt.Value(Index);
}
inline Standard_Integer IntStart_SearchOnBoundaries::NbSegments () const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return sseg.Length();
}
inline const IntStart_TheSegment& IntStart_SearchOnBoundaries::Segment
(const Standard_Integer Index) const {
- if (!done) {StdFail_NotDone::Raise();}
+ if (!done) {throw StdFail_NotDone();}
return sseg.Value(Index);
}
inline const ThePathPoint& IntStart_Segment::FirstPoint () const {
- if (!hasfp) { Standard_DomainError::Raise(); }
+ if (!hasfp) { throw Standard_DomainError(); }
return thefp;
}
inline const ThePathPoint& IntStart_Segment::LastPoint () const {
- if (!haslp) { Standard_DomainError::Raise(); }
+ if (!haslp) { throw Standard_DomainError(); }
return thelp;
}
inline const gp_Vec& IntSurf_PathPoint::Direction3d () const {
- if (istgt) {StdFail_UndefinedDerivative::Raise();}
+ if (istgt) {throw StdFail_UndefinedDerivative();}
return vectg;
}
inline const gp_Dir2d& IntSurf_PathPoint::Direction2d () const {
- if (istgt) {StdFail_UndefinedDerivative::Raise();}
+ if (istgt) {throw StdFail_UndefinedDerivative();}
return dirtg;
}
inline Standard_Boolean IntSurf_Transition::IsTangent () const {
- if (typetra == IntSurf_Undecided) {Standard_DomainError::Raise();}
+ if (typetra == IntSurf_Undecided) {throw Standard_DomainError();}
return tangent;
}
inline IntSurf_Situation IntSurf_Transition::Situation () const {
- if (typetra != IntSurf_Touch) {Standard_DomainError::Raise();}
+ if (typetra != IntSurf_Touch) {throw Standard_DomainError();}
return situat;
}
inline Standard_Boolean IntSurf_Transition::IsOpposite () const {
- if (typetra != IntSurf_Touch) {Standard_DomainError::Raise();}
+ if (typetra != IntSurf_Touch) {throw Standard_DomainError();}
return oppos;
}
if (theNewLength > 0) {
// default creator called for each item of the array
p = new Array1Item[theNewLength];
- if (!p) Standard_OutOfMemory::Raise("IntTools_CArray1 : Allocation failed.");
+ if (!p) throw Standard_OutOfMemory("IntTools_CArray1 : Allocation failed.");
myIsAllocated = Standard_True;
}
if (theNewLength > 0) {
// default creator called for each item of the array
p = new Array1Item[theNewLength];
- if (!p) Standard_OutOfMemory::Raise("IntTools_CArray1 : Allocation failed.");
+ if (!p) throw Standard_OutOfMemory("IntTools_CArray1 : Allocation failed.");
if (myLength!=0) {
Standard_Integer aBytesPerItem=sizeof(Array1Item);
const Array1Item& IntTools_CArray1::Value(const Standard_Integer Index) const
{
if (myLength <1 || Index < 0 || Index >= myLength)
- Standard_OutOfRange::Raise("IntTools_CArray1::Value");
+ throw Standard_OutOfRange("IntTools_CArray1::Value");
return ((Array1Item *)myStart)[Index];
}
Array1Item& IntTools_CArray1::ChangeValue(const Standard_Integer Index)
{
if (myLength < 1 || Index < 0 || Index >= myLength)
- Standard_OutOfRange::Raise("IntTools_CArray1::ChangeValue");
+ throw Standard_OutOfRange("IntTools_CArray1::ChangeValue");
return ((Array1Item *)myStart)[Index];
}
quad1.SetValue(HS1->Surface().Torus());
break;
default:
- Standard_ConstructionError::Raise("GeomInt_IntSS::MakeCurve");
+ throw Standard_ConstructionError("GeomInt_IntSS::MakeCurve");
}
typs = HS2->Surface().GetType();
quad2.SetValue(HS2->Surface().Torus());
break;
default:
- Standard_ConstructionError::Raise("GeomInt_IntSS::MakeCurve");
+ throw Standard_ConstructionError("GeomInt_IntSS::MakeCurve");
}
quad1.Parameters(Ptref,U1,V1);
// =====================================================================================
void IntTools_TopolTool::Initialize()
{
- Standard_NotImplemented::Raise("IntTools_TopolTool::Initialize ()");
+ throw Standard_NotImplemented("IntTools_TopolTool::Initialize ()");
}
// =====================================================================================
inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const
{
- if (!hasFirst) Standard_DomainError::Raise();
+ if (!hasFirst) throw Standard_DomainError();
return firstIndex;
}
inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const
{
- if (!hasFirst) Standard_DomainError::Raise();
+ if (!hasFirst) throw Standard_DomainError();
return theFirstPoint;
}
inline const TheStartPoint& IntWalk_IWLine::LastPoint() const
{
- if (!hasLast) Standard_DomainError::Raise();
+ if (!hasLast) throw Standard_DomainError();
return theLastPoint;
}
inline Standard_Integer IntWalk_IWLine::LastPointIndex() const
{
- if (!hasLast) Standard_DomainError::Raise();
+ if (!hasLast) throw Standard_DomainError();
return lastIndex;
}
inline Standard_Integer IntWalk_IWalking::NbLines() const
{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return lines.Length();
}
inline const Handle(IntWalk_TheIWLine)& IntWalk_IWalking::Value
(const Standard_Integer Index) const
{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return lines.Value(Index);
}
inline Standard_Integer IntWalk_IWalking::NbSinglePnts() const
{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return seqSingle.Length();
}
inline const ThePointOfPath& IntWalk_IWalking::SinglePnt
(const Standard_Integer Index) const
{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return seqSingle.Value(Index);
}
MakeWalkingPoint(Case - 10, U, V, sp, Psol);
}
else {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
inline Standard_Integer IntWalk_PWalking::NbPoints() const {
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return line->NbPoints();
}
inline const IntSurf_PntOn2S& IntWalk_PWalking::Value
(const Standard_Integer Index) const
{
- if (!done) StdFail_NotDone::Raise();
+ if (!done) throw StdFail_NotDone();
return line->Value(Index);
}
inline const Handle(IntSurf_LineOn2S)& IntWalk_PWalking::Line () const {
- if (!done) StdFail_NotDone::Raise();
+ if (!done) throw StdFail_NotDone();
return line;
}
inline Standard_Boolean IntWalk_PWalking::TangentAtFirst() const{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return tgfirst;
}
inline Standard_Boolean IntWalk_PWalking::TangentAtLast() const{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return tglast;
}
inline Standard_Boolean IntWalk_PWalking::IsClosed() const{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
return close;
}
inline const gp_Dir& IntWalk_PWalking::TangentAtLine
(Standard_Integer& Index) const
{
- if(!done) StdFail_NotDone::Raise();
+ if(!done) throw StdFail_NotDone();
Index = indextg;
return tgdir;
}
DEFINE_STANDARD_ALLOC
- //! Raises Construction Error
- Standard_EXPORT IntWalk_TheFunctionOfTheInt2S();
-
Standard_EXPORT IntWalk_TheFunctionOfTheInt2S(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2);
Standard_EXPORT Standard_Integer NbVariables() const;
public:
DEFINE_STANDARD_ALLOC
-
-
- //! Raises Construction Error
- Standard_EXPORT IntWalk_TheInt2S();
//! compute the solution point with the close point
Standard_EXPORT IntWalk_TheInt2S(const TColStd_Array1OfReal& Param, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency);
const Handle(TCollection_HAsciiString)& Interface_Check::Fail
(const Standard_Integer num, const Standard_Boolean final) const
{
- if (thefails.IsNull()) Standard_OutOfRange::Raise();
+ if (thefails.IsNull()) throw Standard_OutOfRange();
return (final ? thefails->Value(num) : thefailo->Value(num));
}
const Handle(TCollection_HAsciiString)& Interface_Check::Warning
(const Standard_Integer num, const Standard_Boolean final) const
{
- if (thewarns.IsNull()) Standard_OutOfRange::Raise();
+ if (thewarns.IsNull()) throw Standard_OutOfRange();
return (final ? thewarns->Value(num) : thewarno->Value(num));
}
const Handle(TCollection_HAsciiString)& Interface_Check::InfoMsg
(const Standard_Integer num, const Standard_Boolean final) const
{
- if (theinfos.IsNull()) Standard_OutOfRange::Raise();
+ if (theinfos.IsNull()) throw Standard_OutOfRange();
return (final ? theinfos->Value(num) : theinfoo->Value(num));
}
#if !defined No_Exception && !defined No_Interface_CheckFailure
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Interface_CheckFailure::Raise(MESSAGE);
+ if (CONDITION) throw Interface_CheckFailure(MESSAGE);
#else
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE)
#endif
const Handle(Interface_Check)& Interface_CheckIterator::Value () const
{
- if (thecurr->Value() > thelist->Length()) Standard_NoSuchObject::Raise
- ("Interface Check Iterator : Value");
+ if (thecurr->Value() > thelist->Length()) throw Standard_NoSuchObject("Interface Check Iterator : Value");
return thelist->Value(thecurr->Value());
}
Standard_Integer Interface_CheckIterator::Number () const
{
- if (thecurr->Value() > thenums->Length()) Standard_NoSuchObject::Raise
- ("Interface Check Iterator : Value");
+ if (thecurr->Value() > thenums->Length()) throw Standard_NoSuchObject("Interface Check Iterator : Value");
return thenums->Value(thecurr->Value());
}
static int errh = 1;
-static void raisecheck (Handle(Interface_Check)& ach)
+static void raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
{
- Handle(Standard_Failure) afail = Standard_Failure::Caught();
char mess[100];
sprintf (mess,"** Exception Raised during Check : %s **",
- afail->DynamicType()->Name());
+ theException.DynamicType()->Name());
ach->AddFail(mess);
#ifdef _WIN32
- if (afail->IsKind(STANDARD_TYPE(OSD_Exception)))
+ if (theException.IsKind(STANDARD_TYPE(OSD_Exception))) {
#else
- if (afail->IsKind(STANDARD_TYPE(OSD_Signal)))
+ if (theException.IsKind(STANDARD_TYPE(OSD_Signal))) {
#endif
- afail->Reraise("System Signal received, check interrupt");
+ theException.SetMessageString("System Signal received, check interrupt");
+ throw theException;
+ }
}
OCC_CATCH_SIGNALS
module->CheckCase(CN,ent,sh,ach);
}
- catch (Standard_Failure) {
- raisecheck(ach);
+ catch (Standard_Failure& anException) {
+ raisecheck(anException,ach);
}
}
else {
void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset)
{
if (reset) thestat = 0;
- if (thestat > 3) Interface_CheckFailure::Raise // deja teste avec erreur
+ if (thestat > 3) throw Interface_CheckFailure // deja teste avec erreur
("Interface Model : Global Check");
Handle(Interface_InterfaceModel) model = theshare.Model();
- if (model->GlobalCheck()->NbFails() > 0) Interface_CheckFailure::Raise
- ("Interface Model : Global Check");
+ if (model->GlobalCheck()->NbFails() > 0) throw Interface_CheckFailure("Interface Model : Global Check");
Handle(Interface_Check) modchk = new Interface_Check;
model->VerifyCheck(modchk);
if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),modchk);
- if (modchk->HasFailed()) Interface_CheckFailure::Raise
- ("Interface Model : Verify Check");
+ if (modchk->HasFailed()) throw Interface_CheckFailure("Interface Model : Verify Check");
if (thestat == 3) return; // tout teste et ca passe
errh = 0; // Pas de try/catch, car justement on raise
Standard_Integer nb = model->NbEntities();
for (Standard_Integer i = 1; i <= nb; i ++) {
- if (model->IsErrorEntity(i)) Interface_CheckFailure::Raise
- ("Interface Model : an Entity is recorded as Erroneous");
+ if (model->IsErrorEntity(i)) throw Interface_CheckFailure("Interface Model : an Entity is recorded as Erroneous");
Handle(Standard_Transient) ent = model->Value(i);
if (thestat & 1) {
if (!model->IsErrorEntity(i)) continue; // deja verify, reste analyse
Handle(Interface_Check) ach = new Interface_Check(ent);
FillCheck(ent,theshare,ach);
- if (ach->HasFailed()) Interface_CheckFailure::Raise
- ("Interface Model : Check on an Entity has Failed");
+ if (ach->HasFailed()) throw Interface_CheckFailure("Interface Model : Check on an Entity has Failed");
}
}
}
n0 = nb+1;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure& anException) {
n0 = i+1;
- raisecheck(ach);
+ raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}
}
n0 = nb+1;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure& anException) {
n0 = i+1;
- raisecheck(ach);
+ raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}
}
n0 = nb+1;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure& anException) {
n0 = i+1;
- raisecheck(ach);
+ raisecheck(anException,ach);
res.Add(ach,i); thestat |= 8;
}
}
}
n0 = nb+1;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure& anException) {
n0 = i+1;
- raisecheck(ach);
+ raisecheck(anException,ach);
res.Add(ach,i); thestat |= 4;
}
}
}
n0 = nb+1;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure& anException) {
n0 = i+1;
- raisecheck(ach);
+ raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}
const Handle(Standard_Transient)& res)
{
Standard_Integer num = themod->Number(ent);
- if (num == 0 || num > theres.Upper()) Interface_InterfaceError::Raise
- ("CopyMap : Bind, Starting Entity not issued from Starting Model");
- if (!theres.Value(num).IsNull()) Interface_InterfaceError::Raise
- ("CopyMap : Bind, Starting Entity already bound");
+ if (num == 0 || num > theres.Upper()) throw Interface_InterfaceError("CopyMap : Bind, Starting Entity not issued from Starting Model");
+ if (!theres.Value(num).IsNull()) throw Interface_InterfaceError("CopyMap : Bind, Starting Entity already bound");
theres.SetValue(num,res);
}
(const Handle(Interface_InterfaceModel)& amodel)
: thelib (Interface_Protocol::Active()) , thelst (amodel->NbEntities())
{
- if (Interface_Protocol::Active().IsNull()) Interface_InterfaceError::Raise
- ("Interface CopyTool : Create with Active Protocol undefined");
+ if (Interface_Protocol::Active().IsNull()) throw Interface_InterfaceError("Interface CopyTool : Create with Active Protocol undefined");
thelst.Init(Standard_False);
themod = amodel;
// <nument> == 0 -> Peut etre une sous-partie non partagee ...
// On accepte mais on se protege contre un bouclage
- if (nument == 0 && thelev > 100) Interface_InterfaceError::Raise
- ("CopyTool : Transferred, Entity is not contained in Starting Model");
+ if (nument == 0 && thelev > 100) throw Interface_InterfaceError("CopyTool : Transferred, Entity is not contained in Starting Model");
if (!themap->Search(ent,res)) { // deja transfere ? sinon, le faire
// On opere la Copie (enfin, on tente)
void Interface_EntityCluster::Append
(const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster Append");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster Append");
if (theents[0].IsNull()) theents[0] = ent;
else if (theents[1].IsNull()) theents[1] = ent;
else if (theents[2].IsNull()) theents[2] = ent;
Standard_Boolean Interface_EntityCluster::Remove
(const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster Remove");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster Remove");
Standard_Integer i;
// <ent> est-il ici ? si oui, on a son rang
if (ent == theents[0]) i = 1;
Standard_Boolean Interface_EntityCluster::Remove
(const Standard_Integer num)
{
- if (num < 1) Standard_OutOfRange::Raise("EntityCluster : Remove");
+ if (num < 1) throw Standard_OutOfRange("EntityCluster : Remove");
Standard_Integer n = NbLocal();
if (num > n) {
- if (thenext.IsNull()) Standard_OutOfRange::Raise("EntityCluster : Remove");
+ if (thenext.IsNull()) throw Standard_OutOfRange("EntityCluster : Remove");
Standard_Boolean res = thenext->Remove (num-n);
if (res) thenext = thenext->Next();
return Standard_False;
(const Standard_Integer num) const
{
Standard_Integer nb = NbLocal();
- if (num <= 0) Standard_OutOfRange::Raise("Interface EntityCluster : Value");
+ if (num <= 0) throw Standard_OutOfRange("Interface EntityCluster : Value");
if (num > nb) {
- if (thenext.IsNull()) Standard_OutOfRange::Raise
- ("Interface EntityCluster : Value");
+ if (thenext.IsNull()) throw Standard_OutOfRange("Interface EntityCluster : Value");
return thenext->Value(num-nb);
}
return theents[num-1]; // numerotation a partir de 0
void Interface_EntityCluster::SetValue
(const Standard_Integer num, const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster SetValue");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster SetValue");
Standard_Integer nb = NbLocal();
- if (num <= 0) Standard_OutOfRange::Raise("Interface EntityCluster : SetValue");
+ if (num <= 0) throw Standard_OutOfRange("Interface EntityCluster : SetValue");
if (num > nb) {
- if (thenext.IsNull()) Standard_OutOfRange::Raise
- ("Interface EntityCluster : SetValue");
+ if (thenext.IsNull()) throw Standard_OutOfRange("Interface EntityCluster : SetValue");
thenext->SetValue(num-nb,ent);
}
else theents[num-1] = ent; // numerotation a partir de 0
const Handle(Standard_Transient)& Interface_EntityIterator::Value () const
{
// NbEntity pas const (on ne sait pas comment il est implemente apres tout)
- if (thelist.IsNull()) Standard_NoSuchObject::Raise("Interface_EntityIterator");
+ if (thelist.IsNull()) throw Standard_NoSuchObject("Interface_EntityIterator");
if (thecurr->Value() < 1 || thecurr->Value() > thelist->Length())
- Standard_NoSuchObject::Raise("Interface_EntityIterator");
+ throw Standard_NoSuchObject("Interface_EntityIterator");
return thelist->Value(thecurr->Value());
}
void Interface_EntityList::Append
(const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Append");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Append");
if (theval.IsNull()) { theval = ent; return; }
Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
void Interface_EntityList::Add
(const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Add");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Add");
if (theval.IsNull()) { theval = ent; return; }
Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
void Interface_EntityList::Remove (const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Remove");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Remove");
if (theval.IsNull()) return;
if (theval == ent) {
theval.Nullify();
void Interface_EntityList::Remove (const Standard_Integer num)
{
- if (theval.IsNull()) Standard_OutOfRange::Raise("EntityList : Remove");
+ if (theval.IsNull()) throw Standard_OutOfRange("EntityList : Remove");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (ec.IsNull()) {
- if (num != 1) Standard_OutOfRange::Raise("EntityList : Remove");
+ if (num != 1) throw Standard_OutOfRange("EntityList : Remove");
theval.Nullify();
return;
}
const Handle(Standard_Transient)& Interface_EntityList::Value
(const Standard_Integer num) const
{
- if (theval.IsNull()) Standard_OutOfRange::Raise("Interface EntityList : Value");
+ if (theval.IsNull()) throw Standard_OutOfRange("Interface EntityList : Value");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) return ec->Value(num); // EntityCluster
- else if (num != 1) Standard_OutOfRange::Raise("Interface EntityList : Value");
+ else if (num != 1) throw Standard_OutOfRange("Interface EntityList : Value");
return theval;
}
void Interface_EntityList::SetValue
(const Standard_Integer num, const Handle(Standard_Transient)& ent)
{
- if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList SetValue");
- if (theval.IsNull()) Standard_OutOfRange::Raise("Interface EntityList : SetValue");
+ if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList SetValue");
+ if (theval.IsNull()) throw Standard_OutOfRange("Interface EntityList : SetValue");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) ec->SetValue(num,ent); // EntityCluster
- else if (num != 1) Standard_OutOfRange::Raise("Interface EntityList : SetValue");
+ else if (num != 1) throw Standard_OutOfRange("Interface EntityList : SetValue");
else theval = ent;
}
{
Standard_Integer res = 0;
Handle(Standard_Transient) entres;
- if (theval.IsNull()) Interface_InterfaceError::Raise
- ("Interface EntityList : TypedEntity , none found");
+ if (theval.IsNull()) throw Interface_InterfaceError("Interface EntityList : TypedEntity , none found");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) { // EntityCluster
for (Standard_Integer i = ec->NbLocal(); i > 0; i --) {
if (ec->Value(i)->IsKind(atype)) {
res ++;
- if (num == 0 && res > 1) Interface_InterfaceError::Raise
- ("Interface EntityList : TypedEntity , several found");
+ if (num == 0 && res > 1) throw Interface_InterfaceError("Interface EntityList : TypedEntity , several found");
entres = ec->Value(i);
if (res == num) return entres;
}
ec = ec->Next();
}
} else if (num > 1) {
- Interface_InterfaceError::Raise
- ("Interface EntityList : TypedEntity ,out of range");
+ throw Interface_InterfaceError("Interface EntityList : TypedEntity ,out of range");
} else { // InterfaceEntity
- if (!theval->IsKind(atype)) Interface_InterfaceError::Raise
- ("Interface EntityList : TypedEntity , none found");
+ if (!theval->IsKind(atype)) throw Interface_InterfaceError("Interface EntityList : TypedEntity , none found");
entres = theval;
}
return entres;
// En cas d erreur NON PREVUE par l analyse, recuperation par defaut
// Attention : la recuperation peut elle-meme planter ... (cf ierr)
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
// Au passage suivant, on attaquera le record suivant
num0 = thereader->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0);
- Handle(Standard_Failure) afail = Standard_Failure::Caught();
#ifdef _WIN32
- if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2;
+ if (anException.IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2;
#else
- if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2;
+ if (anException.IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2;
#endif
//:abv 03Apr00: anent is actually a previous one: if (anent.IsNull())
anent = thereader->BoundEntity(num);
void Interface_Graph::GetFromGraph (const Interface_Graph& agraph)
{
- if (Model() != agraph.Model()) Standard_DomainError::Raise
- ("Graph from Interface : GetFromGraph");
+ if (Model() != agraph.Model()) throw Standard_DomainError("Graph from Interface : GetFromGraph");
Standard_Integer nb = Size();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (agraph.IsPresent(i))
void Interface_Graph::GetFromGraph
(const Interface_Graph& agraph, const Standard_Integer stat)
{
- if (Model() != agraph.Model()) Standard_DomainError::Raise
- ("Graph from Interface : GetFromGraph");
+ if (Model() != agraph.Model()) throw Standard_DomainError("Graph from Interface : GetFromGraph");
Standard_Integer nb = Size();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (agraph.IsPresent(i) && agraph.Status(i) == stat)
if (themodel->IsRedefinedContent(num))
aCurEnt = themodel->ReportEntity(num)->Content();
- //if (num == 0) Standard_DomainError::Raise ("Interface : Shareds");
+ //if (num == 0) throw Standard_DomainError("Interface : Shareds");
Handle(Interface_GeneralModule) module;
Standard_Integer CN;
if (themodel->GTool()->Select(aCurEnt,module,CN))
#if !defined No_Exception && !defined No_Interface_InterfaceError
#define Interface_InterfaceError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Interface_InterfaceError::Raise(MESSAGE);
+ if (CONDITION) throw Interface_InterfaceError(MESSAGE);
#else
#define Interface_InterfaceError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Interface_InterfaceMismatch
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Interface_InterfaceMismatch::Raise(MESSAGE);
+ if (CONDITION) throw Interface_InterfaceMismatch(MESSAGE);
#else
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE)
#endif
Handle(Standard_Transient) ent;
if (num > 0) {
ent = Value(nm);
- if (! (ent == rep->Concerned()) ) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : SetReportEntity");
+ if (! (ent == rep->Concerned()) ) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
} else if (num < 0) {
nm = -num;
ent = Value(nm);
- if (! (ent == rep->Concerned()) ) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : SetReportEntity");
+ if (! (ent == rep->Concerned()) ) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
} else {
ent = rep->Concerned();
nm = Number (ent);
- if (nm == 0) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : SetReportEntity");
+ if (nm == 0) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
}
if (!thereports.IsBound(nm)) {
Standard_Integer maxrep = thereports.NbBuckets();
const Standard_Boolean listall)
{
Handle(Interface_Protocol) proto = Protocol();
- if (proto.IsNull()) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : AddWithRefs");
+ if (proto.IsNull()) throw Interface_InterfaceMismatch("InterfaceModel : AddWithRefs");
AddWithRefs (anent,proto,level,listall);
}
Standard_Integer minum = (oldnum > newnum ? newnum : oldnum);
Standard_Integer mxnum = (oldnum < newnum ? newnum : oldnum);
Standard_Integer kount = (oldnum > newnum ? cnt : -cnt);
- if (cnt <= 0 || cnt > mxnum - minum) Interface_InterfaceMismatch::Raise
- ("InterfaceModel : ChangeOrder, Overlap");
+ if (cnt <= 0 || cnt > mxnum - minum) throw Interface_InterfaceMismatch("InterfaceModel : ChangeOrder, Overlap");
for (i = 1; i < minum; i ++) ents.SetValue (i,theentities.FindKey(i));
for (i = mxnum+cnt; i <= nb; i ++) ents.SetValue (i,theentities.FindKey(i));
for (i = minum; i < mxnum; i ++)
void Interface_LineBuffer::SetMax (const Standard_Integer max)
{
- if (max > theline.Length()) Standard_OutOfRange::Raise
- ("Interface LineBuffer : SetMax");
+ if (max > theline.Length()) throw Standard_OutOfRange("Interface LineBuffer : SetMax");
if (max <= 0) themax = theline.Length();
else themax = max;
}
void Interface_LineBuffer::SetInitial (const Standard_Integer initial)
{
if (thefriz > 0) return;
- if (initial >= themax) Standard_OutOfRange::Raise
- ("Interface LineBuffer : SetInitial");
+ if (initial >= themax) throw Standard_OutOfRange("Interface LineBuffer : SetInitial");
if (initial <= 0) theinit = 0;
else theinit = initial;
}
} else
thelist.Bind(key, 1);
}
- if (theraise) Standard_DomainError::Raise ("Interface_MSG : Translate");
+ if (theraise) throw Standard_DomainError("Interface_MSG : Translate");
return key;
}
dup = new TCollection_HAsciiString(item);
thedup->Append(dup);
}
- if (theraise) Standard_DomainError::Raise ("Interface_MSG : Record");
+ if (theraise) throw Standard_DomainError("Interface_MSG : Record");
}
{
if (!theres.IsNull()) return theres;
if (hasnext) return thenext->Result();
- Standard_NoSuchObject::Raise ("Recognizer evaluation has failed");
- return theres; // pour calmer le compilateur
+ throw Standard_NoSuchObject("Recognizer evaluation has failed");
}
void Interface_Recognizer::Add (const Handle(Interface_Recognizer)& reco)
(const Handle(Standard_Transient)& ent) const
{
Standard_Integer num = themodel->Number(ent);
- if (num == 0 || num > themodel->NbEntities()) Standard_DomainError::Raise
- ("Interface ShareFlags : IsShared");
+ if (num == 0 || num > themodel->NbEntities()) throw Standard_DomainError("Interface ShareFlags : IsShared");
return theflags.Value(num);
}
if (entsh->IsKind(atype)) {
entresult = entsh;
result ++;
- if (result > 1) Interface_InterfaceError::Raise
- ("Interface ShareTool : TypedSharing, more than one found");
+ if (result > 1) throw Interface_InterfaceError("Interface ShareTool : TypedSharing, more than one found");
}
}
- if (result == 0) Interface_InterfaceError::Raise
- ("Interface ShareTool : TypedSharing, not found");
+ if (result == 0) throw Interface_InterfaceError("Interface ShareTool : TypedSharing, not found");
return entresult;
}
}
if (!Message_MsgFile::HasMsg ("XSTEP_1"))
{
- Standard_ProgramError::Raise ("Critical Error - message resources for Interface_Static are invalid or undefined!");
+ throw Standard_ProgramError("Critical Error - message resources for Interface_Static are invalid or undefined!");
}
}
}
Handle(Standard_Transient)& ent,
Handle(TCollection_HAsciiString)& val) const
{
- if (num < 1 || num > thenbparams) Standard_OutOfRange::Raise
- ("Interface UndefinedContent : ParamData");
+ if (num < 1 || num > thenbparams) throw Standard_OutOfRange("Interface UndefinedContent : ParamData");
Standard_Integer desc = theparams->Value(num);
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
ptype = Interface_ParamType (desc & Content_TypeField);
{
Standard_Integer desc = theparams->Value(num);
if (((desc >> Content_LocalShift) & Content_LocalField) != Content_LocalRef)
- Interface_InterfaceError::Raise
- ("UndefinedContent : Param is not Entity type");
+ throw Interface_InterfaceError("UndefinedContent : Param is not Entity type");
return theentities.Value (desc >> Content_NumberShift);
}
{
Standard_Integer desc = theparams->Value(num);
if (((desc >> Content_LocalShift) & Content_LocalField) != 0)
- Interface_InterfaceError::Raise
- ("UndefinedContent : Param is not literal");
+ throw Interface_InterfaceError("UndefinedContent : Param is not literal");
return thevalues->Value (desc >> Content_NumberShift);
}
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
Standard_Boolean c1ent = (local == Content_LocalRef);
- if (!c1ent) Interface_InterfaceError::Raise("UndefinedContent : SetEntity");
+ if (!c1ent) throw Interface_InterfaceError("UndefinedContent : SetEntity");
theentities.SetValue(rang,ent);
}
#if !defined No_Exception && !defined No_LProp_BadContinuity
#define LProp_BadContinuity_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) LProp_BadContinuity::Raise(MESSAGE);
+ if (CONDITION) throw LProp_BadContinuity(MESSAGE);
#else
#define LProp_BadContinuity_Raise_if(CONDITION, MESSAGE)
#endif
void LProp_CLProps::Tangent (Dir& D)
{
if(!IsTangentDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
if(mySignificantFirstDerivativeOrder == 1)
D = Dir(myDerivArr[0]);
Standard_Real c = Curvature();
if(c==RealLast() || Abs(c) <= myLinTol)
{
- LProp_NotDefined::Raise("LProp_CLProps::Normal(...):"
+ throw LProp_NotDefined("LProp_CLProps::Normal(...):"
"Curvature is null or infinity");
}
{
if(Abs(Curvature()) <= myLinTol)
{
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
}
// we used here the following vector relation
Standard_Real LProp_CurAndInf::Parameter(const Standard_Integer N) const
{
- if (N <1 || N > NbPoints ()) {Standard_OutOfRange::Raise();}
+ if (N <1 || N > NbPoints ()) {throw Standard_OutOfRange();}
return theParams.Value(N);
}
LProp_CIType LProp_CurAndInf::Type(const Standard_Integer N) const
{
- if (N <1 || N > NbPoints()) {Standard_OutOfRange::Raise();}
+ if (N <1 || N > NbPoints()) {throw Standard_OutOfRange();}
return theTypes.Value(N);
}
#if !defined No_Exception && !defined No_LProp_NotDefined
#define LProp_NotDefined_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) LProp_NotDefined::Raise(MESSAGE);
+ if (CONDITION) throw LProp_NotDefined(MESSAGE);
#else
#define LProp_NotDefined_Raise_if(CONDITION, MESSAGE)
#endif
void LProp_SLProps::TangentU (gp_Dir& D)
{
if(!IsTangentUDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
if(mySignificantFirstDerivativeOrderU == 1)
D = gp_Dir(myD1u);
void LProp_SLProps::TangentV (gp_Dir& D)
{
if(!IsTangentVDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
if(mySignificantFirstDerivativeOrderV == 1)
D = gp_Dir(myD1v);
{
if(!IsNormalDefined())
{
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
}
return myNormal;
Standard_Boolean LProp_SLProps::IsUmbilic ()
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
return Abs(myMaxCurv - myMinCurv) < Abs(Epsilon(myMaxCurv));
}
Standard_Real LProp_SLProps::MaxCurvature ()
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
return myMaxCurv;
}
Standard_Real LProp_SLProps::MinCurvature ()
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
return myMinCurv;
}
void LProp_SLProps::CurvatureDirections(gp_Dir& Max, gp_Dir& Min)
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
Max = myDirMaxCurv;
Min = myDirMinCurv;
Standard_Real LProp_SLProps::MeanCurvature ()
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
return myMeanCurv;
}
Standard_Real LProp_SLProps::GaussianCurvature ()
{
if(!IsCurvatureDefined())
- LProp_NotDefined::Raise();
+ throw LProp_NotDefined();
return myGausCurv;
}
}
inter.Perform();
if(!inter.IsDone())
- Standard_Failure::Raise
- ("Law::Reparametrize echec interpolation");
+ throw Standard_Failure("Law::Reparametrize echec interpolation");
Handle(Law_BSpline) bs = inter.Curve();
return bs;
}
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("Law_BSpFunc::NbIntervals");
+ throw Standard_DomainError("Law_BSpFunc::NbIntervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
switch ( S) {
case GeomAbs_G1:
case GeomAbs_G2:
- Standard_DomainError::Raise("Law_BSpFunc_Curve::Intervals");
+ throw Standard_DomainError("Law_BSpFunc_Curve::Intervals");
break;
case GeomAbs_C0:
myNbIntervals = 1;
const Standard_Boolean Periodic)
{
if (Degree < 1 || Degree > Law_BSpline::MaxDegree()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
- if (CPoles.Length() < 2) Standard_ConstructionError::Raise();
- if (CKnots.Length() != CMults.Length()) Standard_ConstructionError::Raise();
+ if (CPoles.Length() < 2) throw Standard_ConstructionError();
+ if (CKnots.Length() != CMults.Length()) throw Standard_ConstructionError();
for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) {
if (CKnots (I+1) - CKnots (I) <= Epsilon (Abs(CKnots (I)))) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (CPoles.Length() != BSplCLib::NbPoles(Degree,Periodic,CMults))
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Periodic);
if (Weights.Length() != Poles.Length())
- Standard_ConstructionError::Raise("Law_BSpline");
+ throw Standard_ConstructionError("Law_BSpline");
Standard_Integer i;
for (i = Weights.Lower(); i <= Weights.Upper(); i++) {
if (Weights(i) <= gp::Resolution())
- Standard_ConstructionError::Raise("Law_BSpline");
+ throw Standard_ConstructionError("Law_BSpline");
}
// check really rational
if (Degree == deg) return;
if (Degree < deg || Degree > Law_BSpline::MaxDegree()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Standard_Integer FromK1 = FirstUKnotIndex ();
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
- Standard_ConstructionError::Raise("Law_BSpline::InsertKnots");
+ throw Standard_ConstructionError("Law_BSpline::InsertKnots");
if (nbpoles == poles->Length()) return;
Standard_Integer I2 = LastUKnotIndex ();
if ( !periodic && (Index <= I1 || Index >= I2) ) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
else if ( periodic && (Index < I1 || Index > I2)) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
const TColStd_Array1OfReal & oldpoles = poles->Array1();
const Standard_Real& P,
const Standard_Real Weight)
{
- if (Index < 0 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 0 || Index > poles->Length()) throw Standard_OutOfRange();
- if (Weight <= gp::Resolution()) Standard_ConstructionError::Raise();
+ if (Weight <= gp::Resolution()) throw Standard_ConstructionError();
// find the spans which are modified with the inserting pole
void Law_BSpline::RemovePole
(const Standard_Integer Index)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
- if (poles->Length() <= 2) Standard_ConstructionError::Raise();
+ if (poles->Length() <= 2) throw Standard_ConstructionError();
if (knotSet == GeomAbs_NonUniform || knotSet == GeomAbs_PiecewiseBezier)
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
Standard_Integer i;
Handle(TColStd_HArray1OfReal) nknots =
(const Standard_Integer Index,
const Standard_Real K)
{
- if (Index < 1 || Index > knots->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange();
Standard_Real DK = Abs(Epsilon (K));
if (Index == 1) {
- if (K >= knots->Value(2) - DK) Standard_ConstructionError::Raise();
+ if (K >= knots->Value(2) - DK) throw Standard_ConstructionError();
}
else if (Index == knots->Length()) {
if (K <= knots->Value (knots->Length()-1) + DK) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
else {
if (K <= knots->Value(Index-1) + DK ||
K >= knots->Value(Index+1) - DK ) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
if (K != knots->Value (Index)) {
(const Standard_Integer Index,
const Standard_Real P)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
poles->SetValue (Index, P);
}
(const Standard_Integer Index,
const Standard_Real W)
{
- if (Index < 1 || Index > poles->Length()) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > poles->Length()) throw Standard_OutOfRange();
- if (W <= gp::Resolution ()) Standard_ConstructionError::Raise();
+ if (W <= gp::Resolution ()) throw Standard_ConstructionError();
Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution());
Law_BSplineKnotSplitting (const Handle(Law_BSpline)& BasisCurve,
const Standard_Integer ContinuityRange)
{
- if (ContinuityRange < 0) Standard_RangeError::Raise();
+ if (ContinuityRange < 0) throw Standard_RangeError();
Standard_Integer FirstIndex = BasisCurve->FirstUKnotIndex();
Standard_Integer LastIndex = BasisCurve->LastUKnotIndex();
//=======================================================================
GeomAbs_Shape Law_Composite::Continuity() const
{
- Standard_NotImplemented::Raise("Law_Composite::Continuity()");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("Law_Composite::Continuity()");
}
//=======================================================================
Standard_Real *point_array, *parameter_array, eval_result[2];
if ( PointsArray.Length() < 3) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (PointsArray.Length() == 3) {
degree = 2;
//Standard_Integer ii;
if (PeriodicFlag) {
if ((PointsPtr->Length()) + 1 != ParametersPtr->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
myTangents = new TColStd_HArray1OfReal(myPoints->Lower(),
myPoints->Upper());
Standard_Boolean result = CheckParameters(ParametersPtr->Array1());
if (!result) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myTangentFlags->Init(Standard_False);
}
myTangentFlags = TangentFlagsPtr;
if (Tangents.Length() != myPoints->Length() ||
TangentFlagsPtr->Length() != myPoints->Length()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myTangents = new TColStd_HArray1OfReal(Tangents.Lower(),Tangents.Upper());
for (ii = Tangents.Lower() ; ii <= Tangents.Upper() ; ii++ ) {
const Handle(Law_BSpline)& Law_Interpolate::Curve() const
{
if ( !myIsDone)
- StdFail_NotDone::Raise(" ");
+ throw StdFail_NotDone(" ");
return myCurve;
}
const Handle(TheModule)& LibCtl_Library::Module () const
{
- if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl");
+ if (thecurr.IsNull()) throw Standard_NoSuchObject("Library from LibCtl");
return thecurr->Module();
}
const Handle(TheProtocol)& LibCtl_Library::Protocol () const
{
- if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl");
+ if (thecurr.IsNull()) throw Standard_NoSuchObject("Library from LibCtl");
return thecurr->Protocol();
}
{
if (!mapI.Add(ind)) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopTools_ListIteratorOfListOfShape itl(mapEF(ind));
const TopoDS_Shape& edg = exp.Current();
Standard_Integer indedg = mapEF.FindIndex(edg);
if (indedg == 0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
if (!mapI.Contains(indedg)) {
Add(indedg,mapI,mapF,mapEF);
}
if (!anIterl.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
const TopoDS_Edge& theEdge = TopoDS::Edge(anIterl.Value());
TopoDS_Vertex Vf,Vl;
const TopTools_ListOfShape& LocOpe_BuildWires::Result () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
void LocOpe_CSIntersector::Perform(const LocOpe_SequenceOfLin& Slin)
{
if (myShape.IsNull() || Slin.Length() <= 0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myDone = Standard_False;
void LocOpe_CSIntersector::Perform(const LocOpe_SequenceOfCirc& Scir)
{
if (myShape.IsNull() || Scir.Length() <= 0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myDone = Standard_False;
void LocOpe_CSIntersector::Perform(const TColGeom_SequenceOfCurve& Scur)
{
if (myShape.IsNull() || Scur.Length() <= 0) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myDone = Standard_False;
Standard_Integer LocOpe_CSIntersector::NbPoints
(const Standard_Integer I) const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return ((LocOpe_SequenceOfPntFace *)myPoints)[I-1].Length();
}
Point(const Standard_Integer I,
const Standard_Integer Index) const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return ((LocOpe_SequenceOfPntFace *)myPoints)[I-1](Index);
}
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return LocAfter((((LocOpe_SequenceOfPntFace*)myPoints)[I-1]),
From,Tol,Or,IndFrom,IndTo);
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return LocBefore(((LocOpe_SequenceOfPntFace*)myPoints)[I-1],
From,Tol,Or,IndFrom,IndTo);
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return LocAfter(((LocOpe_SequenceOfPntFace*)myPoints)[I-1],
FromInd,Tol,Or,IndFrom,IndTo);
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (I <= 0 || I > myNbelem) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return LocBefore(((LocOpe_SequenceOfPntFace*)myPoints)[I-1],
FromInd,Tol,Or,IndFrom,IndTo);
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
Standard_Real Eps = Precision::Confusion();
Standard_Real param,FMEPS = From - Eps;
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
Standard_Real Eps = Precision::Confusion();
Standard_Real param,FPEPS = From + Eps;
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
Standard_Integer nbpoints = myPoints.Length();
if (FromInd >= nbpoints) {
Standard_Integer& IndTo) const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
Standard_Integer nbpoints = myPoints.Length();
if (FromInd <= 1) {
inline Standard_Integer LocOpe_CurveShapeIntersector::NbPoints() const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myPoints.Length();
}
inline const LocOpe_PntFace& LocOpe_CurveShapeIntersector::
Point(const Standard_Integer I) const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myPoints(I);
}
const TopoDS_Shape& LocOpe_DPrism::Shape () const
{
if (!myDPrism.IsDone()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
LocOpe_DPrism::Shapes (const TopoDS_Shape& S)const
{
if (!myDPrism.IsDone()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
if (myMap.IsBound(S)) {
return myMap(S);
Handle(Geom_Plane) PP = Handle(Geom_Plane)::DownCast(S);
if (PP.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
gp_Pln P = PP->Pln();
Handle(Geom_Plane) PP = Handle(Geom_Plane)::DownCast(S);
if (PP.IsNull()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
gp_Pln P = PP->Pln();
void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
{
if (myShape.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
myDone = Standard_False;
myRes.Nullify();
{
// TopTools_ListOfShape list;
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myModShapes(F);
}
inline const TopoDS_Shape& LocOpe_Generator::ResultingShape() const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myRes;
}
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myMap.Add(exp.Current()); // bonne orientation
}
}
// Est-ce un edge de connexite entre les faces collees
if (theMapEF.FindFromKey(edg).Extent() != 2) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
for (itl.Initialize(theMapEF.FindFromKey(edg)); itl.More(); itl.Next()) {
if (!myMap.Contains(itl.Value())) {
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopoDS_Shape aLocalFace = Fnew.Oriented(exp.Current().Orientation());
}
}
if (!exp.More()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
aLocalFace = Fbase.Oriented(exp.Current().Orientation());
const TopoDS_Edge& Ebase)
{
if (myMapEE.IsBound(Enew) && !myMapEE(Enew).IsSame(Ebase)) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
myMapEE.Bind(Enew,Ebase);
}
}
if (mySb.IsNull() || mySn.IsNull() ||
myMapEF.IsEmpty() || myOpe ==LocOpe_INVALID) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
Handle(LocOpe_WiresOnShape) theWOnS = new LocOpe_WiresOnShape(mySb);
const TopTools_ListOfShape& LocOpe_Gluer::DescendantFaces
(const TopoDS_Face& F) const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
if (myDescF.IsBound(F))
return myDescF(F);
static TopTools_ListOfShape nullList;
inline const TopoDS_Shape& LocOpe_Gluer::ResultingShape () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
const TopoDS_Shape& LocOpe_LinearForm::Shape () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
{
TopAbs_ShapeEnum typS = S.ShapeType();
if (typS != TopAbs_EDGE && typS != TopAbs_VERTEX) {
- Standard_DomainError::Raise();
+ throw Standard_DomainError();
}
// for (TopExp_Explorer exp(myPipe.Profile(),typS); exp.More(); exp.Next()) {
TopExp_Explorer exp(myPipe.Profile(),typS) ;
}
}
if (!exp.More()) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
myGShap.Clear();
return exp.Current().Orientation();
}
}
- Standard_NoSuchObject::Raise();
- return TopAbs_INTERNAL;
+ throw Standard_NoSuchObject();
}
const TopoDS_Shape& LocOpe_Prism::Shape () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
const TopoDS_Shape& LocOpe_Revol::Shape () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
const TopoDS_Shape& LocOpe_RevolutionForm::Shape () const
{
if (!myDone) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myRes;
}
myResult.Nullify();
myMap.Clear();
if (myShape.IsNull() || F.IsNull() || W.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
if (!ModLeft && !ModRight) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopAbs_Orientation OriF = TopAbs_FORWARD;
}
if (!FinS) {
- cout << "LocOpe_SplitDrafts:!Fins Standard_ConstructionError::Raise()" << endl;
- Standard_ConstructionError::Raise();
+ cout << "LocOpe_SplitDrafts:!Fins throw Standard_ConstructionError()" << endl;
+ throw Standard_ConstructionError();
}
gp_Pln NewPlg,NewPld;
thePipe.Init(theLinePipe,i2s.Line(1));
thePipe.Perform(Standard_True);
if (!thePipe.IsDone())
- Standard_ConstructionError::Raise ("GeomFill_Pipe : Cannot make a surface");
+ throw Standard_ConstructionError("GeomFill_Pipe : Cannot make a surface");
Handle(Geom_Surface) Spl = thePipe.Surface();
AS.Load(Spl);
thePipe.Init(theLinePipe,C);
thePipe.Perform(Standard_True);
if (!thePipe.IsDone())
- Standard_ConstructionError::Raise ("GeomFill_Pipe : Cannot make a surface");
+ throw Standard_ConstructionError("GeomFill_Pipe : Cannot make a surface");
Handle(Geom_Surface) thePS = thePipe.Surface();
if (thePS->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
const TopoDS_Shape& LocOpe_SplitDrafts::Shape () const
{
if (myResult.IsNull()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myResult;
}
(const TopoDS_Shape& S) const
{
if (myResult.IsNull()) {
- StdFail_NotDone::Raise();
+ throw StdFail_NotDone();
}
return myMap(S);
}
const TopoDS_Face& F)
{
if (myShape.IsNull()) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
TopExp_Explorer exp,expw,expf;
}
}
if (!exp.More()) {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
myLeft.Clear();
void LocOpe_Spliter::Perform(const Handle(LocOpe_WiresOnShape)& PW)
{
if (myShape.IsNull()) {
- Standard_NullObject::Raise();
+ throw Standard_NullObject();
}
myDone = Standard_False;
myMap.Clear();
const TopTools_ListOfShape& lsub = theSubs.Copy(itdesc.Key());
#ifdef OCCT_DEBUG
if (lsub.Extent() != 1) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
#endif
myMap(itdesc.Key()).Clear();
const TopTools_ListOfShape& lsub = theSubs.Copy(itl.Value());
#ifdef OCCT_DEBUG
if (lsub.Extent() != 1) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
#endif
newdesc.Append(lsub.First());
const TopTools_ListOfShape& LocOpe_Spliter::
DescendantShapes(const TopoDS_Shape& F)
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
if (myMap.IsBound(F))
return myMap(F);
else {
const TopTools_ListOfShape& LocOpe_Spliter::DirectLeft() const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myDLeft;
}
const TopTools_ListOfShape& LocOpe_Spliter::Left() const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myLeft;
}
LocOpe_BuildWires theBuild(ledge, PW);
// Modified by skv - Mon May 31 12:31:40 2004 OCC5865 End
if (!theBuild.IsDone()) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
ledge = theBuild.Result();
inline const TopoDS_Shape& LocOpe_Spliter::ResultingShape() const
{
- if (!myDone) {StdFail_NotDone::Raise();}
+ if (!myDone) {throw StdFail_NotDone();}
return myRes;
}
}
}
else {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
}
}
if (Lfaces.Extent() != 1 && Lfaces.Extent() !=2) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
// soit bord libre, soit connexite entre 2 faces, eventuellement edge closed
else {
const TopoDS_Face& Fac = TopoDS::Face(Lfaces.First());
if (!BRep_Tool::IsClosed(Eto,Fac)) {
- Standard_ConstructionError::Raise();
+ throw Standard_ConstructionError();
}
TopoDS_Shape aLocalE = Efrom.Oriented(TopAbs_FORWARD);
Standard_Boolean LocalAnalysis_CurveContinuity::IsC0() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if (myContC0 <= myepsC0 )
return Standard_True;
else return Standard_False;
Standard_Boolean LocalAnalysis_CurveContinuity::IsC1() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC0() && ( (myContC1 <= myepsC1)||(Abs(myContC1-M_PI)<=myepsC1)))
return Standard_True;
else return Standard_False;
Standard_Boolean LocalAnalysis_CurveContinuity::IsC2() const
{ Standard_Real epsil1, epsil2;
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC1())
{ if ((myContC2 <= myepsC2)||(Abs(myContC2-M_PI)<=myepsC2))
{ epsil1 = 0.5*myepsC1*myepsC1*myLambda1;
Standard_Boolean LocalAnalysis_CurveContinuity::IsG1() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC0() && (( myContG1 <= myepsG1||(Abs(myContG1-M_PI)<=myepsG1))))
return Standard_True;
else return Standard_False;
// -> 1 Crbure finie
// -> 2 Crbure infinie
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsG1 ())
{ CRBINF = 1/myepsC0;
CRBNUL = 8*myepsC0/(myMaxLon*myMaxLon);
Standard_Real LocalAnalysis_CurveContinuity::C0Value() const
{
- if (!myIsDone) {StdFail_NotDone::Raise();}
+ if (!myIsDone) {throw StdFail_NotDone();}
return ( myContC0 );
}
Standard_Real LocalAnalysis_CurveContinuity::C1Angle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC1 );
}
Standard_Real LocalAnalysis_CurveContinuity::C2Angle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC2 );
}
Standard_Real LocalAnalysis_CurveContinuity::G1Angle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContG1 );
}
/*********************************************************************************/
Standard_Real LocalAnalysis_CurveContinuity::G2Angle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContG2 );
}
Standard_Real LocalAnalysis_CurveContinuity::C1Ratio() const
{
- if (!myIsDone) {StdFail_NotDone::Raise();}
+ if (!myIsDone) {throw StdFail_NotDone();}
return ( myLambda1 );
}
Standard_Real LocalAnalysis_CurveContinuity::C2Ratio() const
{
- if (!myIsDone) {StdFail_NotDone::Raise();}
+ if (!myIsDone) {throw StdFail_NotDone();}
return ( myLambda2 );
}
/********************************************************************************/
Standard_Real LocalAnalysis_CurveContinuity::G2CurvatureVariation() const
{
- if (!myIsDone) {StdFail_NotDone::Raise();}
+ if (!myIsDone) {throw StdFail_NotDone();}
return ( myG2Variation);
}
/*************************************************************************/
GeomAbs_Shape LocalAnalysis_CurveContinuity::ContinuityStatus() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return (myTypeCont);
}
/*********************************************************************************/
/*********************************************************************************/
Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC0() const
-{ if (!myIsDone) { StdFail_NotDone::Raise();}
+{ if (!myIsDone) { throw StdFail_NotDone();}
if ( myContC0 <= myepsC0 )
return Standard_True;
else return Standard_False;
/*********************************************************************************/
Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC1() const
-{ if (!myIsDone) { StdFail_NotDone::Raise();}
+{ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC0 () && (myContC1U <= myepsC1) && (myContC1V <= myepsC1))
return Standard_True;
else return Standard_False;
Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC2() const
{ Standard_Real eps1u, eps1v, eps2u, eps2v;
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC1())
{ eps1u = 0.5*myepsC1*myepsC1*myLambda1U;
eps1v = 0.5*myepsC1*myepsC1*myLambda1V;
Standard_Boolean LocalAnalysis_SurfaceContinuity::IsG1() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
if ( IsC0 () &&( myContG1 <= myepsG1))
return Standard_True;
else return Standard_False;
{ Standard_Real EPSNL;
Standard_Integer itype;
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
itype =0;
EPSNL= 8*myepsC0/(mymaxlen*mymaxlen);
if ( IsG1())
GeomAbs_Shape LocalAnalysis_SurfaceContinuity::ContinuityStatus() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return (myTypeCont);
}
Standard_Real LocalAnalysis_SurfaceContinuity::C0Value() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC0 );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C1UAngle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC1U );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C1VAngle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC1V );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C2UAngle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC2U );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C2VAngle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContC2V );
}
Standard_Real LocalAnalysis_SurfaceContinuity::G1Angle() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myContG1 );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C1URatio() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myLambda1U );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C2URatio() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myLambda2U );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C1VRatio() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myLambda1V );
}
Standard_Real LocalAnalysis_SurfaceContinuity::C2VRatio() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myLambda2V );
}
Standard_Real LocalAnalysis_SurfaceContinuity::G2CurvatureGap() const
{
- if (!myIsDone) { StdFail_NotDone::Raise();}
+ if (!myIsDone) { throw StdFail_NotDone();}
return ( myGap );
}
else if (SecondNode() == aNode)
return FirstNode();
else {
- Standard_DomainError::Raise("MAT_Arc::TheOtherNode");
- return aNode;
+ throw Standard_DomainError("MAT_Arc::TheOtherNode");
}
}
// if (aNode == SecondNode()) return (!secondArcRight == NULL);
if (aNode == SecondNode()) return (secondArcRight != 0);
}
- Standard_DomainError::Raise("MAT_Arc::HasNeighbour");
- return Standard_False;
+ throw Standard_DomainError("MAT_Arc::HasNeighbour");
}
//========================================================================
if (aNode == FirstNode()) return (MAT_Arc*)firstArcRight;
if (aNode == SecondNode()) return (MAT_Arc*)secondArcRight;
}
- Standard_DomainError::Raise("MAT_Arc::Neighbour");
- return (MAT_Arc*)firstArcLeft;
+ throw Standard_DomainError("MAT_Arc::Neighbour");
}
//========================================================================
else if (aNode == SecondNode())
secondArcLeft = anArc.operator->();
else
- Standard_DomainError::Raise("MAT_Arc::SetNeighbour");
+ throw Standard_DomainError("MAT_Arc::SetNeighbour");
}
else {
if (aNode == FirstNode())
else if (aNode == SecondNode())
secondArcRight = anArc.operator->();
else
- Standard_DomainError::Raise("MAT_Arc::SetNeighbour");
+ throw Standard_DomainError("MAT_Arc::SetNeighbour");
}
}
Standard_Integer MAT2d_CutCurve::NbCurves() const
{
- if (UnModified()) {Standard_OutOfRange::Raise();}
+ if (UnModified()) {throw Standard_OutOfRange();}
return theCurves.Length();
}
const Standard_Integer Index)
const
{
- if (UnModified()) {Standard_OutOfRange::Raise();}
+ if (UnModified()) {throw Standard_OutOfRange();}
if ( Index < 1 || Index > theCurves.Length()) {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
return Handle(Geom2d_TrimmedCurve)::DownCast(theCurves.Value(Index));
}
void MAT2d_Tool2d::Dump(const Standard_Integer ,
const Standard_Integer ) const
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
#else
void MAT2d_Tool2d::Dump(const Standard_Integer bisector,
const Standard_Integer) const
}
return theNameStr;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
}
return theNameStr;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- return Standard_Failure::Caught()->GetMessageString();
+ return anException.GetMessageString();
}
}
thesubst = 0;
}
- void MoniTool_CaseData::AddRaised (const Standard_CString name)
- { AddData ( Standard_Failure::Caught(),1,name); }
+ void MoniTool_CaseData::AddRaised (const Handle(Standard_Failure)& theException, const Standard_CString name)
+ { AddData ( theException,1,name); }
void MoniTool_CaseData::AddShape
(const TopoDS_Shape& sh, const Standard_CString name)
Standard_EXPORT void AddData (const Handle(Standard_Transient)& val, const Standard_Integer kind, const Standard_CString name = "");
//! Adds the currently caught exception
- Standard_EXPORT void AddRaised (const Standard_CString name = "");
+ Standard_EXPORT void AddRaised (const Handle(Standard_Failure)& theException, const Standard_CString name = "");
//! Adds a Shape (recorded as a HShape)
Standard_EXPORT void AddShape (const TopoDS_Shape& sh, const Standard_CString name = "");
if (type != MoniTool_ValueInteger && type != MoniTool_ValueReal &&
type != MoniTool_ValueEnum && type != MoniTool_ValueText &&
type != MoniTool_ValueIdent)
- Standard_ConstructionError::Raise("MoniTool_TypedValue : Type not supported");
+ throw Standard_ConstructionError("MoniTool_TypedValue : Type not supported");
if (init[0] != '\0')
if (Satisfies(new TCollection_HAsciiString(init))) SetCStringValue (init);
void MoniTool_TypedValue::SetIntegerLimit
(const Standard_Boolean max, const Standard_Integer val)
{
- if (thetype != MoniTool_ValueInteger) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : SetIntegerLimit, not an Integer");
+ if (thetype != MoniTool_ValueInteger) throw Standard_ConstructionError("MoniTool_TypedValue : SetIntegerLimit, not an Integer");
if (max) { thelims |= 2; theintup = val; }
else { thelims |= 1; theintlow = val; }
void MoniTool_TypedValue::SetRealLimit
(const Standard_Boolean max, const Standard_Real val)
{
- if (thetype != MoniTool_ValueReal) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : SetRealLimit, not a Real");
+ if (thetype != MoniTool_ValueReal) throw Standard_ConstructionError("MoniTool_TypedValue : SetRealLimit, not a Real");
if (max) { thelims |= 2; therealup = val; }
else { thelims |= 1; therealow = val; }
void MoniTool_TypedValue::StartEnum
(const Standard_Integer start, const Standard_Boolean match)
{
- if (thetype != MoniTool_ValueEnum) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : StartEnum, Not an Enum");
+ if (thetype != MoniTool_ValueEnum) throw Standard_ConstructionError("MoniTool_TypedValue : StartEnum, Not an Enum");
thelims |= 4; if (!match) thelims -= 4;
theintlow = start; theintup = start -1;
const Standard_CString v7, const Standard_CString v8,
const Standard_CString v9, const Standard_CString v10)
{
- if (thetype != MoniTool_ValueEnum) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : AddEnum, Not an Enum");
+ if (thetype != MoniTool_ValueEnum) throw Standard_ConstructionError("MoniTool_TypedValue : AddEnum, Not an Enum");
if (theenums.IsNull()) theenums =
new TColStd_HArray1OfAsciiString(theintlow,theintlow+10);
else if (theenums->Upper() < theintup + 10) {
void MoniTool_TypedValue::AddEnumValue
(const Standard_CString val, const Standard_Integer num)
{
- if (thetype != MoniTool_ValueEnum) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : AddEnum, Not an Enum");
- if (num < theintlow) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : AddEnum, out of range");
+ if (thetype != MoniTool_ValueEnum) throw Standard_ConstructionError("MoniTool_TypedValue : AddEnum, Not an Enum");
+ if (num < theintlow) throw Standard_ConstructionError("MoniTool_TypedValue : AddEnum, out of range");
if (val[0] == '\0') return;
if (theenums.IsNull()) theenums =
new TColStd_HArray1OfAsciiString(theintlow,num+1);
void MoniTool_TypedValue::SetObjectType
(const Handle(Standard_Type)& typ)
{
- if (thetype != MoniTool_ValueIdent) Standard_ConstructionError::Raise
- ("MoniTool_TypedValue : AddEnum, Not an Entity/Object");
+ if (thetype != MoniTool_ValueIdent) throw Standard_ConstructionError("MoniTool_TypedValue : AddEnum, Not an Entity/Object");
theotyp = typ;
}
#if !defined No_Exception && !defined No_Standard_ProgramError
if (aBlock == 0L || aBlock->IsEmpty())
{
- Standard_ProgramError::Raise("NCollection_AccAllocator::Free: \
- Trying to free an invalid address");
+ throw Standard_ProgramError("NCollection_AccAllocator::Free: \
+ Trying to free an invalid address");
}
#endif
NCollection_BaseSequence& Other)
{
if (theIndex < 0 || theIndex > mySize)
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
if (Other.mySize != 0) {
if (theIndex == 0)
PPrepend (Other);
ListNode()
{
// Empty constructor is forbidden.
- Standard_NoSuchObject::Raise("NCollection_CellFilter::ListNode()");
+ throw Standard_NoSuchObject("NCollection_CellFilter::ListNode()");
}
Target Object;
{
DataMapNode* p = 0;
if (!lookup(theKey, p))
- Standard_NoSuchObject::Raise("NCollection_DataMap::Find");
+ throw Standard_NoSuchObject("NCollection_DataMap::Find");
return p->Value();
}
{
DataMapNode* p = 0;
if (!lookup(theKey, p))
- Standard_NoSuchObject::Raise("NCollection_DataMap::Find");
+ throw Standard_NoSuchObject("NCollection_DataMap::Find");
return p->ChangeValue();
}
Standard_NoSuchObject_Raise_if (!More(), "NCollection_DoubleMap::Iterator::Value");
return ((DoubleMapNode *) myNode)->Value();
}
- //! Value change access - denied
- TheKey2Type& ChangeValue(void) const
- {
- Standard_ImmutableObject::Raise("NCollection_DoubleMap::Iterator::ChangeValue");
- return * (TheKey2Type *) NULL; // For compiler
- }
};
public:
while (pNode)
{
if (Hasher1::IsEqual (pNode->Key1(), theKey1))
- Standard_MultiplyDefined::Raise("NCollection_DoubleMap:Bind");
+ throw Standard_MultiplyDefined("NCollection_DoubleMap:Bind");
pNode = (DoubleMapNode *) pNode->Next();
}
pNode = (DoubleMapNode *) myData2[iK2];
while (pNode)
{
if (Hasher2::IsEqual (pNode->Key2(), theKey2))
- Standard_MultiplyDefined::Raise("NCollection_DoubleMap:Bind");
+ throw Standard_MultiplyDefined("NCollection_DoubleMap:Bind");
pNode = (DoubleMapNode *) pNode->Next();
}
pNode = new (this->myAllocator) DoubleMapNode (theKey1, theKey2,
return pNode1->Key2();
pNode1 = (DoubleMapNode*) pNode1->Next();
}
- Standard_NoSuchObject::Raise("NCollection_DoubleMap::Find1");
- return pNode1->Key2(); // This for compiler
+ throw Standard_NoSuchObject("NCollection_DoubleMap::Find1");
}
//! Find2
return pNode2->Key1();
pNode2 = (DoubleMapNode*) pNode2->Next2();
}
- Standard_NoSuchObject::Raise("NCollection_DoubleMap::Find2");
- return pNode2->Key1(); // This for compiler
+ throw Standard_NoSuchObject("NCollection_DoubleMap::Find2");
}
//! Clear data. If doReleaseMemory is false then the table of
{
char aBuffer[96];
Sprintf (aBuffer, "Failed to allocate %" PRIuPTR " bytes in global dynamic heap", theSize);
- Standard_OutOfMemory::Raise (aBuffer);
+ throw Standard_OutOfMemory(aBuffer);
}
return aResult;
}
mySize = aSize - IMEM_SIZE(sizeof(IBlock));
myMemSize = aSize * sizeof(aligned_t);
if (aBlock == NULL)
- Standard_OutOfMemory::Raise("NCollection_IncAllocator: out of memory");
+ throw Standard_OutOfMemory("NCollection_IncAllocator: out of memory");
aBlock -> p_free_space = (aligned_t *) IMEM_ALIGN (&aBlock[1]);
aBlock -> p_end_block = ((aligned_t *) aBlock) + aSize;
aBlock -> p_next = NULL;
if (aResult)
myFirstBlock -> p_free_space = myFirstBlock -> p_end_block;
else
- Standard_OutOfMemory::Raise("NCollection_IncAllocator: out of memory");
+ throw Standard_OutOfMemory("NCollection_IncAllocator: out of memory");
} else
if (cSize <= IMEM_FREE(myFirstBlock)) {
/* If the requested size fits into the free space in the 1st block */
{
const size_t aDefault = IMEM_SIZE(DefaultBlockSize);
if (cSize > aDefault)
- Standard_OutOfMemory::Raise("NCollection_IncAllocator: out of memory");
+ throw Standard_OutOfMemory("NCollection_IncAllocator: out of memory");
else
{
aResult = (aligned_t *) allocateNewBlock (aDefault);
if (aResult)
myFirstBlock -> p_free_space = aResult + cSize;
else
- Standard_OutOfMemory::Raise("NCollection_IncAllocator: out of memory");
+ throw Standard_OutOfMemory("NCollection_IncAllocator: out of memory");
}
}
}
}
else
{
- Standard_OutOfMemory::Raise("NCollection_IncAllocator: out of memory");
+ throw Standard_OutOfMemory("NCollection_IncAllocator: out of memory");
}
return aResult;
}
{
if (p->Key2() != theIndex)
{
- Standard_DomainError::Raise ("NCollection_IndexedDataMap::Substitute : "
- "Attempt to substitute existing key");
+ throw Standard_DomainError ("NCollection_IndexedDataMap::Substitute : "
+ "Attempt to substitute existing key");
}
p->Key1() = theKey1;
p->ChangeValue() = theItem;
IndexedDataMapNode* aNode = nodeFromIndex (theKey2);
if (aNode == NULL)
{
- Standard_NoSuchObject::Raise ("NCollection_IndexedDataMap::FindKey");
+ throw Standard_NoSuchObject("NCollection_IndexedDataMap::FindKey");
}
return aNode->Key1();
}
IndexedDataMapNode* aNode = nodeFromIndex (theKey2);
if (aNode == NULL)
{
- Standard_NoSuchObject::Raise ("NCollection_IndexedDataMap::FindFromIndex");
+ throw Standard_NoSuchObject("NCollection_IndexedDataMap::FindFromIndex");
}
return aNode->Value();
}
IndexedDataMapNode* aNode = nodeFromIndex (theKey2);
if (aNode == NULL)
{
- Standard_NoSuchObject::Raise ("NCollection_IndexedDataMap::ChangeFromIndex");
+ throw Standard_NoSuchObject("NCollection_IndexedDataMap::ChangeFromIndex");
}
return aNode->ChangeValue();
}
return pNode1->Value();
pNode1 = (IndexedDataMapNode*) pNode1->Next();
}
- Standard_NoSuchObject::Raise("NCollection_IndexedDataMap::FindFromKey");
- return pNode1->Value();
+ throw Standard_NoSuchObject("NCollection_IndexedDataMap::FindFromKey");
}
//! ChangeFromKey
return pNode1->ChangeValue();
pNode1 = (IndexedDataMapNode*) pNode1->Next();
}
- Standard_NoSuchObject::Raise("NCollection_IndexedDataMap::ChangeFromKey");
- return pNode1->ChangeValue();
+ throw Standard_NoSuchObject("NCollection_IndexedDataMap::ChangeFromKey");
}
//! Seek returns pointer to Item by Key. Returns
#include <NCollection_TListNode.hxx>
#include <NCollection_StlIterator.hxx>
#include <Standard_NoSuchObject.hxx>
-#include <Standard_ImmutableObject.hxx>
#include <NCollection_DefaultHasher.hxx>
Standard_NoSuchObject_Raise_if(!More(), "NCollection_IndexedMap::Iterator::Value");
return myMap->FindKey(myIndex);
}
- //! Value change access denied - use Substitute
- TheKeyType& ChangeValue(void) const
- {
- Standard_ImmutableObject::Raise ("impossible to ChangeValue");
- return * (TheKeyType *) NULL; // This for compiler
- }
+
//! Performs comparison of two iterators.
Standard_Boolean IsEqual (const Iterator& theOther) const
{
{
if (p->Key2() != theIndex)
{
- Standard_DomainError::Raise ("NCollection_IndexedMap::Substitute : "
- "Attempt to substitute existing key");
+ throw Standard_DomainError ("NCollection_IndexedMap::Substitute : "
+ "Attempt to substitute existing key");
}
p->Key1() = theKey1;
return;
return pNode2->Key1();
pNode2 = (IndexedMapNode*) pNode2->Next2();
}
- Standard_NoSuchObject::Raise("NCollection_IndexedMap::FindKey");
- return pNode2->Key1(); // This for compiler
+ throw Standard_NoSuchObject("NCollection_IndexedMap::FindKey");
}
//! operator ()
#include <NCollection_StlIterator.hxx>
#include <NCollection_DefaultHasher.hxx>
-#include <Standard_ImmutableObject.hxx>
#include <Standard_NoSuchObject.hxx>
/**
Standard_NoSuchObject_Raise_if (!More(), "NCollection_Map::Iterator::Value");
return ((MapNode *) myNode)->Value();
}
- //! Value change access - denied
- TheKeyType& ChangeValue(void) const
- {
- Standard_ImmutableObject::Raise("NCollection_Map::Iterator::ChangeValue");
- return * (TheKeyType *) NULL; // For compiler
- }
+
//! Key
const TheKeyType& Key (void) const
{
{
char aBuf[128];
Sprintf (aBuf, "Failed to allocate %" PRIuPTR " bytes in local dynamic heap", theSize);
- Standard_OutOfMemory::Raise (aBuf);
+ throw Standard_OutOfMemory(aBuf);
}
return aResult;
}
//! across threads.
//!
//! Keep in mind that whether the C++ exception will really be thrown (i.e.
- //! ::throw() will be called) is regulated by the NO_CXX_EXCEPTIONS and
- //! OCC_CONVERT_SIGNALS macros used during compilation of Open CASCADE and
+ //! ::throw() will be called) is regulated by the
+ //! OCC_CONVERT_SIGNALS macro used during compilation of Open CASCADE and
//! user's code. Refer to Foundation Classes User's Guide for further details.
//!
Standard_EXPORT static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True);
if ( dirName.IsEmpty () )
- Standard_ProgramError :: Raise ( "OSD_Directory :: Build (): incorrect call - no directory name");
+ throw Standard_ProgramError ( "OSD_Directory :: Build (): incorrect call - no directory name");
Standard_Boolean isOK = Exists();
if (! isOK)
} else {
badPath:
- Standard_ProgramError :: Raise ( "OSD_Disk: bad disk name" );
+ throw Standard_ProgramError ( "OSD_Disk: bad disk name" );
} // end else
{
if (!Name.IsAscii() || Name.Search("$") != -1 )
- Standard_ConstructionError::Raise("OSD_Environment::OSD_Environment: bad argument");
+ throw Standard_ConstructionError("OSD_Environment::OSD_Environment: bad argument");
myName = Name;
}
if (!Name.IsAscii() || !Value.IsAscii() ||
// JPT : Dec-7-1992 Name.Search("$") != -1 || Value.Search("$") != -1)
Name.Search("$") != -1 )
- Standard_ConstructionError::Raise("OSD_Environment::OSD_Environment: bad argument");
+ throw Standard_ConstructionError("OSD_Environment::OSD_Environment: bad argument");
myName = Name;
myValue = Value;
{
myError.Reset();
if (!Name.IsAscii() || Name.Search("$") != -1 )
- Standard_ConstructionError::Raise("OSD_Environment::SetName: bad argument");
+ throw Standard_ConstructionError("OSD_Environment::SetName: bad argument");
myName = Name;
}
void OSD_Environment::SetValue (const TCollection_AsciiString& Value)
{
if (!Value.IsAscii() || Value.Search("$") != -1)
- Standard_ConstructionError::Raise("OSD_Environment::Change: bad argument");
+ throw Standard_ConstructionError("OSD_Environment::Change: bad argument");
myValue = Value;
}
}
}
buffer += ".\n\n";
- OSD_OSDError::Raise (buffer.ToCString());
+ throw OSD_OSDError(buffer.ToCString());
}
#else
#if !defined No_Exception && !defined No_OSD_Exception
#define OSD_Exception_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception(MESSAGE);
#else
#define OSD_Exception_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_ACCESS_VIOLATION
#define OSD_Exception_ACCESS_VIOLATION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_ACCESS_VIOLATION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_ACCESS_VIOLATION(MESSAGE);
#else
#define OSD_Exception_ACCESS_VIOLATION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_ARRAY_BOUNDS_EXCEEDED
#define OSD_Exception_ARRAY_BOUNDS_EXCEEDED_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_ARRAY_BOUNDS_EXCEEDED::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_ARRAY_BOUNDS_EXCEEDED(MESSAGE);
#else
#define OSD_Exception_ARRAY_BOUNDS_EXCEEDED_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_CTRL_BREAK
#define OSD_Exception_CTRL_BREAK_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_CTRL_BREAK::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_CTRL_BREAK(MESSAGE);
#else
#define OSD_Exception_CTRL_BREAK_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_DENORMAL_OPERAND
#define OSD_Exception_FLT_DENORMAL_OPERAND_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_DENORMAL_OPERAND::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_DENORMAL_OPERAND(MESSAGE);
#else
#define OSD_Exception_FLT_DENORMAL_OPERAND_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_DIVIDE_BY_ZERO
#define OSD_Exception_FLT_DIVIDE_BY_ZERO_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_DIVIDE_BY_ZERO::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_DIVIDE_BY_ZERO(MESSAGE);
#else
#define OSD_Exception_FLT_DIVIDE_BY_ZERO_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_INEXACT_RESULT
#define OSD_Exception_FLT_INEXACT_RESULT_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_INEXACT_RESULT::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_INEXACT_RESULT(MESSAGE);
#else
#define OSD_Exception_FLT_INEXACT_RESULT_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_INVALID_OPERATION
#define OSD_Exception_FLT_INVALID_OPERATION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_INVALID_OPERATION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_INVALID_OPERATION(MESSAGE);
#else
#define OSD_Exception_FLT_INVALID_OPERATION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_OVERFLOW
#define OSD_Exception_FLT_OVERFLOW_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_OVERFLOW::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_OVERFLOW(MESSAGE);
#else
#define OSD_Exception_FLT_OVERFLOW_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_STACK_CHECK
#define OSD_Exception_FLT_STACK_CHECK_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_STACK_CHECK::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_STACK_CHECK(MESSAGE);
#else
#define OSD_Exception_FLT_STACK_CHECK_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_FLT_UNDERFLOW
#define OSD_Exception_FLT_UNDERFLOW_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_FLT_UNDERFLOW::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_FLT_UNDERFLOW(MESSAGE);
#else
#define OSD_Exception_FLT_UNDERFLOW_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_ILLEGAL_INSTRUCTION
#define OSD_Exception_ILLEGAL_INSTRUCTION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_ILLEGAL_INSTRUCTION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_ILLEGAL_INSTRUCTION(MESSAGE);
#else
#define OSD_Exception_ILLEGAL_INSTRUCTION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_INT_DIVIDE_BY_ZERO
#define OSD_Exception_INT_DIVIDE_BY_ZERO_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_INT_DIVIDE_BY_ZERO::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_INT_DIVIDE_BY_ZERO(MESSAGE);
#else
#define OSD_Exception_INT_DIVIDE_BY_ZERO_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_INT_OVERFLOW
#define OSD_Exception_INT_OVERFLOW_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_INT_OVERFLOW::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_INT_OVERFLOW(MESSAGE);
#else
#define OSD_Exception_INT_OVERFLOW_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_INVALID_DISPOSITION
#define OSD_Exception_INVALID_DISPOSITION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_INVALID_DISPOSITION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_INVALID_DISPOSITION(MESSAGE);
#else
#define OSD_Exception_INVALID_DISPOSITION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_IN_PAGE_ERROR
#define OSD_Exception_IN_PAGE_ERROR_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_IN_PAGE_ERROR::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_IN_PAGE_ERROR(MESSAGE);
#else
#define OSD_Exception_IN_PAGE_ERROR_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_NONCONTINUABLE_EXCEPTION
#define OSD_Exception_NONCONTINUABLE_EXCEPTION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_NONCONTINUABLE_EXCEPTION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_NONCONTINUABLE_EXCEPTION(MESSAGE);
#else
#define OSD_Exception_NONCONTINUABLE_EXCEPTION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_PRIV_INSTRUCTION
#define OSD_Exception_PRIV_INSTRUCTION_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_PRIV_INSTRUCTION::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_PRIV_INSTRUCTION(MESSAGE);
#else
#define OSD_Exception_PRIV_INSTRUCTION_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_STACK_OVERFLOW
#define OSD_Exception_STACK_OVERFLOW_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_STACK_OVERFLOW::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_STACK_OVERFLOW(MESSAGE);
#else
#define OSD_Exception_STACK_OVERFLOW_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Exception_STATUS_NO_MEMORY
#define OSD_Exception_STATUS_NO_MEMORY_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Exception_STATUS_NO_MEMORY::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Exception_STATUS_NO_MEMORY(MESSAGE);
#else
#define OSD_Exception_STATUS_NO_MEMORY_Raise_if(CONDITION, MESSAGE)
#endif
TCollection_AsciiString aBuffer;
if (myPath.Name().Length()==0)
- Standard_ProgramError::Raise("OSD_File::Build : no name was given");
+ throw Standard_ProgramError("OSD_File::Build : no name was given");
if (myFileChannel != -1)
- Standard_ProgramError::Raise("OSD_File::Build : file is already open");
+ throw Standard_ProgramError("OSD_File::Build : file is already open");
myMode = Mode;
TCollection_AsciiString aBuffer;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Append : it is a directory");
+ throw Standard_ProgramError("OSD_File::Append : it is a directory");
}
if (myPath.Name().Length()==0)
- Standard_ProgramError::Raise("OSD_File::Append : no name was given");
+ throw Standard_ProgramError("OSD_File::Append : no name was given");
if (myFileChannel != -1)
- Standard_ProgramError::Raise("OSD_File::Append : file is already open");
+ throw Standard_ProgramError("OSD_File::Append : file is already open");
internal_prot = Protect.Internal();
myMode = Mode;
}
if (myPath.Name().Length()==0)
- Standard_ProgramError::Raise("OSD_File::Open : no name was given");
+ throw Standard_ProgramError("OSD_File::Open : no name was given");
if (myFileChannel != -1)
- Standard_ProgramError::Raise("OSD_File::Open : file is already open");
+ throw Standard_ProgramError("OSD_File::Open : file is already open");
internal_prot = Protect.Internal();
myMode = Mode;
int status;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Read : file is not open");
+ throw Standard_ProgramError("OSD_File::Read : file is not open");
if (Failed()) Perror();
if (myMode == OSD_WriteOnly)
- Standard_ProgramError::Raise("OSD_File::Read : file is Write only");
+ throw Standard_ProgramError("OSD_File::Read : file is Write only");
if (Nbyte <= 0)
- Standard_ProgramError::Raise("OSD_File::Read : Nbyte is null");
+ throw Standard_ProgramError("OSD_File::Read : Nbyte is null");
TCollection_AsciiString transfert(Nbyte,' ');
readbuf = (Standard_PCharacter)transfert.ToCString();
Standard_PCharacter readbuf, abuffer;
//
if (OSD_File::KindOfFile() == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
if (myFileChannel == -1){
- Standard_ProgramError::Raise("OSD_File::ReadLine : file is not open");
+ throw Standard_ProgramError("OSD_File::ReadLine : file is not open");
}
if (Failed()) {
Perror();
}
if (myMode == OSD_WriteOnly) {
- Standard_ProgramError::Raise("OSD_File::ReadLine : file is Write only");
+ throw Standard_ProgramError("OSD_File::ReadLine : file is Write only");
}
if (Nbyte <= 0){
- Standard_ProgramError::Raise("OSD_File::ReadLine : Nbyte is null");
+ throw Standard_ProgramError("OSD_File::ReadLine : Nbyte is null");
}
//
TCollection_AsciiString transfert(Nbyte,' ');
Readbyte = 0;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Read : file is not open");
+ throw Standard_ProgramError("OSD_File::Read : file is not open");
if (Failed()) Perror();
if (myMode == OSD_WriteOnly)
- Standard_ProgramError::Raise("OSD_File::Read : file is Write only");
+ throw Standard_ProgramError("OSD_File::Read : file is Write only");
if (Nbyte <= 0)
- Standard_ProgramError::Raise("OSD_File::Read : Nbyte is null");
+ throw Standard_ProgramError("OSD_File::Read : Nbyte is null");
if (Buffer == NULL)
- Standard_ProgramError::Raise("OSD_File::Read : Buffer is null");
+ throw Standard_ProgramError("OSD_File::Read : Buffer is null");
status = read (myFileChannel, (char*) Buffer, Nbyte);
int status;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Write : it is a directory");
+ throw Standard_ProgramError("OSD_File::Write : it is a directory");
}
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Write : file is not open");
+ throw Standard_ProgramError("OSD_File::Write : file is not open");
if (Failed()) Perror();
if (myMode == OSD_ReadOnly)
- Standard_ProgramError::Raise("OSD_File::Write : file is Read only");
+ throw Standard_ProgramError("OSD_File::Write : file is Read only");
if (Nbyte <= 0)
- Standard_ProgramError::Raise("OSD_File::Write : Nbyte is null");
+ throw Standard_ProgramError("OSD_File::Write : Nbyte is null");
writebuf = Buffer.ToCString();
int status;
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Write : file is not open");
+ throw Standard_ProgramError("OSD_File::Write : file is not open");
if (Failed()) Perror();
if (myMode == OSD_ReadOnly)
- Standard_ProgramError::Raise("OSD_File::Write : file is Read only");
+ throw Standard_ProgramError("OSD_File::Write : file is Read only");
if (Nbyte <= 0)
- Standard_ProgramError::Raise("OSD_File::Write : Nbyte is null");
+ throw Standard_ProgramError("OSD_File::Write : Nbyte is null");
status = write (myFileChannel, (const char *)Buffer, Nbyte);
int iwhere=0;
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Seek : file is not open");
+ throw Standard_ProgramError("OSD_File::Seek : file is not open");
if (Failed()) Perror();
int status;
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Close : file is not open");
+ throw Standard_ProgramError("OSD_File::Close : file is not open");
if (Failed()) Perror();
Standard_Boolean OSD_File::IsAtEnd(){
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::IsAtEnd : file is not open");
+ throw Standard_ProgramError("OSD_File::IsAtEnd : file is not open");
if (myIO == EOF) return (Standard_True);
return (Standard_False);
/*void OSD_File::Link(const TCollection_AsciiString& ToFile){
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::Link : file is not open");
+ throw Standard_ProgramError("OSD_File::Link : file is not open");
TCollection_AsciiString aBuffer;
myPath.SystemName ( aBuffer );
int status;
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::SetLock : file is not open");
+ throw Standard_ProgramError("OSD_File::SetLock : file is not open");
#ifdef POSIX
int status;
if (myFileChannel == -1)
- Standard_ProgramError::Raise("OSD_File::UnLock : file is not open");
+ throw Standard_ProgramError("OSD_File::UnLock : file is not open");
#ifdef POSIX
struct stat buf;
int status;
if (myPath.Name().Length()==0)
- Standard_ProgramError::Raise("OSD_File::Size : empty file name");
+ throw Standard_ProgramError("OSD_File::Size : empty file name");
TCollection_AsciiString aBuffer;
myPath.SystemName ( aBuffer );
#define ACE_HEADER_SIZE ( sizeof ( ACCESS_ALLOWED_ACE ) - sizeof ( DWORD ) )
-#define RAISE( arg ) Standard_ProgramError :: Raise ( ( arg ) )
+#define RAISE( arg ) throw Standard_ProgramError ( ( arg ) )
#define TEST_RAISE( arg ) _test_raise ( myFileHandle, ( arg ) )
#define OPEN_NEW 0
TCollection_AsciiString fName;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
if (myFileHandle != INVALID_HANDLE_VALUE)
cout << " OSD_File::Read : it is a directory " << endl;
#endif
return ;
-// Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+// throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
Standard_Integer NbyteRead;
LONG aSeekPos;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
TEST_RAISE( "ReadLine" );
DWORD dwBytesRead;
if ( OSD_File::KindOfFile ( ) == OSD_DIRECTORY ) {
- Standard_ProgramError::Raise("OSD_File::Read : it is a directory");
+ throw Standard_ProgramError("OSD_File::Read : it is a directory");
}
TEST_RAISE( "Read" );
buff += str;
buff += " (): wrong access";
- Standard_ProgramError::Raise(buff.ToCString());
+ throw Standard_ProgramError(buff.ToCString());
} // end if
} // end _test_raise
// if (myPath.Name().Length()==0) A directory can have a null name field (ex: root)
-// OSD_OSDError::Raise("OSD_FileNode::Exists : no name was given"); (LD)
+// throw OSD_OSDError("OSD_FileNode::Exists : no name was given"); (LD)
// if (Failed()) Perror();
void OSD_FileNode::Remove(){
// if (myPath.Name().Length()==0) A directory can have a null name field (ex: root)
-// OSD_OSDError::Raise("OSD_FileNode::Remove : no name was given"); (LD)
+// throw OSD_OSDError("OSD_FileNode::Remove : no name was given"); (LD)
// if (Failed()) Perror();
TCollection_AsciiString thisPath;
// if (myPath.Name().Length()==0)
-// OSD_OSDError::Raise("OSD_FileNode::Move : no name was given");
+// throw OSD_OSDError("OSD_FileNode::Move : no name was given");
// if (Failed()) Perror();
TCollection_AsciiString second_name;
// if (myPath.Name().Length()==0) Copy .login would raise !!
-// OSD_OSDError::Raise("OSD_FileNode::Copy : no name was given");
+// throw OSD_OSDError("OSD_FileNode::Copy : no name was given");
// if (Failed()) Perror();
ToPath.SystemName (second_name);
int s,u,g,w;
// if (myPath.Name().Length()==0)
-// OSD_OSDError::Raise("OSD_FileNode::Protection : no name was given");
+// throw OSD_OSDError("OSD_FileNode::Protection : no name was given");
// if (Failed()) Perror();
int status;
// if (myPath.Name().Length()==0)
-// OSD_OSDError::Raise("OSD_FileNode::SetProtection : no name was given");
+// throw OSD_OSDError("OSD_FileNode::SetProtection : no name was given");
// if (Failed()) Perror();
struct stat buffer;
// if (myPath.Name().Length()==0)
-// OSD_OSDError::Raise("OSD_FileNode::CreationMoment : no name was given");
+// throw OSD_OSDError("OSD_FileNode::CreationMoment : no name was given");
// if (Failed()) Perror();
struct stat buffer;
// if (myPath.Name().Length()==0)
-// OSD_OSDError::Raise("OSD_FileNode::AccessMoment : no name was given");
+// throw OSD_OSDError("OSD_FileNode::AccessMoment : no name was given");
// if (Failed()) Perror();
#include <Strsafe.h>
#define TEST_RAISE( arg ) _test_raise ( fName, ( arg ) )
-#define RAISE( arg ) Standard_ProgramError :: Raise ( ( arg ) )
+#define RAISE( arg ) throw Standard_ProgramError ( ( arg ) )
#ifndef OCCT_UWP
// None of the existing security APIs are supported in a UWP applications
buff += str;
buff += " (): wrong access";
- Standard_ProgramError::Raise(buff.ToCString());
+ throw Standard_ProgramError(buff.ToCString());
} // end if
} // end _test_raise
#if !defined No_Exception && !defined No_OSD_OSDError
#define OSD_OSDError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_OSDError::Raise(MESSAGE);
+ if (CONDITION) throw OSD_OSDError(MESSAGE);
#else
#define OSD_OSDError_Raise_if(CONDITION, MESSAGE)
#endif
}
catch ( tbb::captured_exception& anException )
{
- Standard_NotImplemented::Raise(anException.what());
+ throw Standard_NotImplemented(anException.what());
}
}
#else
}
catch ( tbb::captured_exception& anException )
{
- Standard_NotImplemented::Raise(anException.what());
+ throw Standard_NotImplemented(anException.what());
}
}
#else
Standard_Integer length=TrekLength();
if (length <= 0 || thewhere > length)
- Standard_NumericError::Raise("OSD_Path::RemoveATrek : where has an invalid value");
+ throw Standard_NumericError("OSD_Path::RemoveATrek : where has an invalid value");
Standard_Integer posit,aHowmany;
TCollection_AsciiString tok;
TCollection_AsciiString result=myTrek.Token("|",thewhere);
if (result == "")
- Standard_NumericError::Raise("OSD_Path::TrekValue : where is invalid");
+ throw Standard_NumericError("OSD_Path::TrekValue : where is invalid");
return(result);
}
Standard_Integer length=TrekLength();
if (thewhere <= 0 || thewhere > length)
- Standard_NumericError::Raise("OSD_Path::InsertATrek : where has an invalid value");
+ throw Standard_NumericError("OSD_Path::InsertATrek : where has an invalid value");
TCollection_AsciiString tok=myTrek.Token("|",thewhere);
Standard_Integer wwhere = myTrek.Search(tok);
strcat ( buff, str );
strcat ( buff, " (): unknown system type" );
- Standard_ProgramError :: Raise ( buff );
+ throw Standard_ProgramError ( buff );
} // end if
#if !defined No_Exception && !defined No_OSD_SIGBUS
#define OSD_SIGBUS_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGBUS::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGBUS(MESSAGE);
#else
#define OSD_SIGBUS_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGHUP
#define OSD_SIGHUP_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGHUP::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGHUP(MESSAGE);
#else
#define OSD_SIGHUP_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGILL
#define OSD_SIGILL_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGILL::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGILL(MESSAGE);
#else
#define OSD_SIGILL_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGINT
#define OSD_SIGINT_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGINT::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGINT(MESSAGE);
#else
#define OSD_SIGINT_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGKILL
#define OSD_SIGKILL_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGKILL::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGKILL(MESSAGE);
#else
#define OSD_SIGKILL_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGQUIT
#define OSD_SIGQUIT_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGQUIT::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGQUIT(MESSAGE);
#else
#define OSD_SIGQUIT_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGSEGV
#define OSD_SIGSEGV_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGSEGV::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGSEGV(MESSAGE);
#else
#define OSD_SIGSEGV_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_SIGSYS
#define OSD_SIGSYS_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_SIGSYS::Raise(MESSAGE);
+ if (CONDITION) throw OSD_SIGSYS(MESSAGE);
#else
#define OSD_SIGSYS_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_OSD_Signal
#define OSD_Signal_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) OSD_Signal::Raise(MESSAGE);
+ if (CONDITION) throw OSD_Signal(MESSAGE);
#else
#define OSD_Signal_Raise_if(CONDITION, MESSAGE)
#endif
break ;
case STATUS_NO_MEMORY:
// cout << "CallHandler : STATUS_NO_MEMORY:" << endl ;
- OSD_Exception_STATUS_NO_MEMORY ::
- Raise ( "MEMORY ALLOCATION ERROR ( no room in the process heap )" );
+ throw OSD_Exception_STATUS_NO_MEMORY ( "MEMORY ALLOCATION ERROR ( no room in the process heap )" );
case EXCEPTION_ACCESS_VIOLATION:
// cout << "CallHandler : EXCEPTION_ACCESS_VIOLATION:" << endl ;
StringCchPrintfW (buffer, _countof(buffer), L"%s%s%s0x%.8p%s%s%s", L"ACCESS VIOLATION",
CallHandler( EXCEPTION_FLT_INEXACT_RESULT ,0,0) ;
break ;
default:
- cout << "SIGWntHandler(default) -> Standard_NumericError::Raise(\"Floating Point Error\");" << endl;
- Standard_NumericError::Raise("Floating Point Error");
+ cout << "SIGWntHandler(default) -> throw Standard_NumericError(\"Floating Point Error\");" << endl;
+ throw Standard_NumericError("Floating Point Error");
break ;
}
break ;
void OSD::ControlBreak () {
if ( fCtrlBrk ) {
fCtrlBrk = Standard_False;
- OSD_Exception_CTRL_BREAK :: Raise ( "*** INTERRUPT ***" );
+ throw OSD_Exception_CTRL_BREAK ( "*** INTERRUPT ***" );
}
} // end OSD :: ControlBreak
#if !defined(__MINGW32__) && !defined(__CYGWIN32__)
switch (dwCode)
{
case EXCEPTION_ACCESS_VIOLATION:
- OSD_Exception_ACCESS_VIOLATION::Raise (msg);
+ throw OSD_Exception_ACCESS_VIOLATION(msg);
break;
case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
- OSD_Exception_ARRAY_BOUNDS_EXCEEDED::Raise (msg);
+ throw OSD_Exception_ARRAY_BOUNDS_EXCEEDED(msg);
break;
case EXCEPTION_DATATYPE_MISALIGNMENT:
- Standard_ProgramError::Raise (msg);
+ throw Standard_ProgramError(msg);
break;
case EXCEPTION_ILLEGAL_INSTRUCTION:
- OSD_Exception_ILLEGAL_INSTRUCTION::Raise (msg);
+ throw OSD_Exception_ILLEGAL_INSTRUCTION(msg);
break;
case EXCEPTION_IN_PAGE_ERROR:
- OSD_Exception_IN_PAGE_ERROR::Raise (msg);
+ throw OSD_Exception_IN_PAGE_ERROR(msg);
break;
case EXCEPTION_INT_DIVIDE_BY_ZERO:
- Standard_DivideByZero::Raise (msg);
+ throw Standard_DivideByZero(msg);
break;
case EXCEPTION_INT_OVERFLOW:
- OSD_Exception_INT_OVERFLOW::Raise (msg);
+ throw OSD_Exception_INT_OVERFLOW(msg);
break;
case EXCEPTION_INVALID_DISPOSITION:
- OSD_Exception_INVALID_DISPOSITION::Raise (msg);
+ throw OSD_Exception_INVALID_DISPOSITION(msg);
break;
case EXCEPTION_NONCONTINUABLE_EXCEPTION:
- OSD_Exception_NONCONTINUABLE_EXCEPTION::Raise (msg);
+ throw OSD_Exception_NONCONTINUABLE_EXCEPTION(msg);
break;
case EXCEPTION_PRIV_INSTRUCTION:
- OSD_Exception_PRIV_INSTRUCTION::Raise (msg);
+ throw OSD_Exception_PRIV_INSTRUCTION(msg);
break;
case EXCEPTION_STACK_OVERFLOW:
- OSD_Exception_STACK_OVERFLOW::Raise (msg);
+ throw OSD_Exception_STACK_OVERFLOW(msg);
break;
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
- Standard_DivideByZero::Raise (msg);
+ throw Standard_DivideByZero(msg);
break;
case EXCEPTION_FLT_STACK_CHECK:
case EXCEPTION_FLT_OVERFLOW:
- Standard_Overflow::Raise (msg);
+ throw Standard_Overflow(msg);
break;
case EXCEPTION_FLT_UNDERFLOW:
- Standard_Underflow::Raise (msg);
+ throw Standard_Underflow(msg);
break;
case EXCEPTION_FLT_INVALID_OPERATION:
case EXCEPTION_FLT_DENORMAL_OPERAND:
case EXCEPTION_FLT_INEXACT_RESULT:
case STATUS_FLOAT_MULTIPLE_TRAPS:
case STATUS_FLOAT_MULTIPLE_FAULTS:
- Standard_NumericError::Raise (msg);
+ throw Standard_NumericError(msg);
break;
default:
break;
#include <sys/signal.h>
#endif
-#if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
-//============================================================================
-//==== GetOldSigAction
-//==== get previous
-//============================================================================
-
-static struct sigaction *GetOldSigAction()
-{
- static struct sigaction oldSignals[NSIG];
- return oldSignals;
-}
-
-#ifdef SOLARIS
-static sigfpe_handler_type *GetOldFPE()
-{
- static sigfpe_handler_type aIEEEHandler[5] = { NULL, NULL, NULL, NULL, NULL } ;
- return aIEEEHandler;
-}
-#endif
-#endif
-
//============================================================================
//==== Handler
//==== Catche the differents signals:
//==== SIGSEGV is handled by "SegvHandler()"
//============================================================================
#ifdef SA_SIGINFO
- #if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
-static void Handler (const int theSignal, siginfo_t *theSigInfo, const Standard_Address theContext)
- #else
static void Handler (const int theSignal, siginfo_t */*theSigInfo*/, const Standard_Address /*theContext*/)
- #endif
#else
static void Handler (const int theSignal)
#endif
perror ("sigaction");
}
-#if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
- if (pthread_self() != getOCCThread() || !Standard_ErrorHandler::IsInTryBlock()) {
- // use the previous signal handler
- // cout << "OSD::Handler: signal " << (int) theSignal << " occured outside a try block " << endl ;
- struct sigaction *oldSignals = GetOldSigAction();
- struct sigaction asigacthandler = oldSignals[theSignal >= 0 && theSignal < NSIG ? theSignal : 0];
-
- if (asigacthandler.sa_flags & SA_SIGINFO) {
- void (*aCurInfoHandle)(int, siginfo_t *, void *) = asigacthandler.sa_sigaction;
-
- siginfo_t * aSigInfo = NULL;
-#ifdef SA_SIGINFO
- aSigInfo = theSigInfo;
-#endif
-
- if (aSigInfo) {
- switch (aSigInfo->si_signo) {
- case SIGFPE:
- {
-#ifdef SOLARIS
- sigfpe_handler_type *aIEEEHandlerTab = GetOldFPE();
- sigfpe_handler_type aIEEEHandler = NULL;
- switch (aSigInfo->si_code) {
- case FPE_INTDIV_TRAP :
- case FPE_FLTDIV_TRAP :
- aIEEEHandler = aIEEEHandlerTab[1];
- break;
- case FPE_INTOVF_TRAP :
- case FPE_FLTOVF_TRAP :
- aIEEEHandler = aIEEEHandlerTab[2];
- break;
- case FPE_FLTUND_TRAP :
- aIEEEHandler = aIEEEHandlerTab[4];
- break;
- case FPE_FLTRES_TRAP :
- aIEEEHandler = aIEEEHandlerTab[3];
- break;
- case FPE_FLTINV_TRAP :
- aIEEEHandler = aIEEEHandlerTab[0];
- break;
- case FPE_FLTSUB_TRAP :
- default:
- break;
- }
- if (aIEEEHandler) {
- // cout << "OSD::Handler: calling previous IEEE signal handler with info" << endl ;
- (*aIEEEHandler) (theSignal, aSigInfo, theContext);
- return;
- }
-#endif
- break;
- }
- default:
- break;
- }
- }
- if (aCurInfoHandle) {
- // cout << "OSD::Handler: calling previous signal handler with info " << aCurInfoHandle << endl ;
- (*aCurInfoHandle) (theSignal, aSigInfo, theContext);
-#ifdef OCCT_DEBUG
- cerr << " previous signal handler return" << endl ;
-#endif
- return;
- }
- else {
- // cout << "OSD::Handler: no handler with info for the signal" << endl;
- }
- }
- else {
- // no siginfo needed for the signal
- void (*aCurHandler) (int) = asigacthandler.sa_handler;
- if(aCurHandler) {
- // cout << "OSD::Handler: calling previous signal handler" << endl ;
- (*aCurHandler) (theSignal);
-#ifdef OCCT_DEBUG
- cerr << " previous signal handler return" << endl ;
-#endif
- return;
- }
- }
- // cout << " Signal occured outside a try block, but no handler for it" <<endl;
- return;
- }
-#endif
-
// cout << "OSD::Handler: signal " << (int) theSignal << " occured inside a try block " << endl ;
if ( ADR_ACT_SIGIO_HANDLER != NULL )
(*ADR_ACT_SIGIO_HANDLER)() ;
siginfo_t *ip,
const Standard_Address theContext)
{
-#ifdef NO_CXX_EXCEPTION
- if (!Standard_ErrorHandler::IsInTryBlock()) {
- Handler(theSignal, ip, theContext);
- return;
- }
-#else
(void)theSignal; // silence GCC warnings
(void)theContext;
-#endif
+
#ifdef __linux__
if (fFltExceptions)
feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
{
if ( fCtrlBrk ) {
fCtrlBrk = Standard_False;
- OSD_Exception_CTRL_BREAK::Raise ("*** INTERRUPT ***");
+ throw OSD_Exception_CTRL_BREAK("*** INTERRUPT ***");
}
}
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
{
- //Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!");
+ //throw Aspect_GraphicDeviceDefinitionError("OpenGl_GraphicDriver: cannot connect to X server!");
return;
}
if (theToInitialize
&& !InitContext())
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: default context can not be initialized!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_GraphicDriver: default context can not be initialized!");
}
// default layers are always presented in display layer sequence it can not be removed
for (NCollection_Map<Handle(OpenGl_View)>::Iterator aViewIter (myMapOfView);
aViewIter.More(); aViewIter.Next())
{
- const Handle(OpenGl_View)& aView = aViewIter.ChangeValue();
+ const Handle(OpenGl_View)& aView = aViewIter.Value();
const Handle(OpenGl_Window)& aWindow = aView->GlWindow();
if (aWindow.IsNull())
{
for (NCollection_Map<Handle(OpenGl_View)>::Iterator aViewIter (myMapOfView);
aViewIter.More(); aViewIter.Next())
{
- const Handle(OpenGl_View)& aView = aViewIter.ChangeValue();
+ const Handle(OpenGl_View)& aView = aViewIter.Value();
aView->ReleaseGlResources (aCtxShared);
}
for (NCollection_Map<Handle(OpenGl_View)>::Iterator aViewIter (myMapOfView);
aViewIter.More(); aViewIter.Next())
{
- const Handle(OpenGl_View)& aView = aViewIter.ChangeValue();
+ const Handle(OpenGl_View)& aView = aViewIter.Value();
const Handle(OpenGl_Window)& aWindow = aView->GlWindow();
if (aWindow.IsNull())
{
Handle(OpenGl_Structure) aStruct = Handle(OpenGl_Structure)::DownCast (myStructure->CStructure());
if (aStruct.IsNull())
{
- Graphic3d_GroupDefinitionError::Raise ("OpenGl_Group should be created by OpenGl_Structure!");
+ throw Graphic3d_GroupDefinitionError("OpenGl_Group should be created by OpenGl_Structure!");
}
}
// =======================================================================
void OpenGl_StructureShadow::Connect (Graphic3d_CStructure& )
{
- Standard_ProgramError::Raise ("Error! OpenGl_StructureShadow::Connect() should not be called!");
+ throw Standard_ProgramError("Error! OpenGl_StructureShadow::Connect() should not be called!");
}
// =======================================================================
// =======================================================================
void OpenGl_StructureShadow::Disconnect (Graphic3d_CStructure& )
{
- Standard_ProgramError::Raise ("Error! OpenGl_StructureShadow::Disconnect() should not be called!");
+ throw Standard_ProgramError("Error! OpenGl_StructureShadow::Disconnect() should not be called!");
}
|| anEglContext == EGL_NO_CONTEXT
|| anEglConfig == NULL)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL does not provide compatible configurations!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window, EGL does not provide compatible configurations!");
return;
}
NULL);
if (anEglSurf == EGL_NO_SURFACE)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is unable to create surface for window!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window, EGL is unable to create surface for window!");
return;
}
}
else if (theGContext != anEglContext)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is used in unsupported combination!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window, EGL is used in unsupported combination!");
return;
}
else
anEglSurf = eglGetCurrentSurface(EGL_DRAW);
if (anEglSurf == EGL_NO_SURFACE)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window, EGL is unable to retrieve current surface!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window, EGL is unable to retrieve current surface!");
return;
}
}
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: ChoosePixelFormat failed. Error code: ");
aMsg += (int )GetLastError();
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
TCollection_AsciiString aMsg("OpenGl_Window::CreateWindow: SetPixelFormat failed. Error code: ");
aMsg += (int )GetLastError();
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: wglCreateContext failed. Error code: ");
aMsg += (int )GetLastError();
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
}
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: wglShareLists failed. Error code: ");
aMsg += (int )GetLastError();
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
int isGl = 0;
if (aVis == NULL)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window::CreateWindow: XGetVisualInfo is unable to choose needed configuration in existing OpenGL context. ");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window::CreateWindow: XGetVisualInfo is unable to choose needed configuration in existing OpenGL context. ");
return;
}
else if (glXGetConfig (aDisp, aVis, GLX_USE_GL, &isGl) != 0 || !isGl)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window::CreateWindow: window Visual does not support GL rendering!");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window::CreateWindow: window Visual does not support GL rendering!");
return;
}
aGContext = glXCreateContext (aDisp, aVis, aSlaveCtx, GL_TRUE);
if (aGContext == NULL)
{
- Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_Window::CreateWindow: glXCreateContext failed.");
+ throw Aspect_GraphicDeviceDefinitionError("OpenGl_Window::CreateWindow: glXCreateContext failed.");
return;
}
}
|| ![EAGLContext setCurrentContext: aGLContext])
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: EAGLContext creation failed");
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
if (![EAGLContext setCurrentContext: aGLContext])
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: EAGLContext can not be assigned");
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
if (aGLContext == NULL)
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: NSOpenGLContext creation failed");
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
if (!aDefFbo->InitWithRB (myGlContext, myWidth, myHeight, GL_RGBA8, GL_DEPTH24_STENCIL8, aWinRBColor))
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: default FBO creation failed");
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
}
if (!aDefFbo->InitWrapper (myGlContext))
{
TCollection_AsciiString aMsg ("OpenGl_Window::CreateWindow: default FBO wrapper creation failed");
- Aspect_GraphicDeviceDefinitionError::Raise (aMsg.ToCString());
+ throw Aspect_GraphicDeviceDefinitionError(aMsg.ToCString());
return;
}
#if !defined No_Exception && !defined No_PCDM_DriverError
#define PCDM_DriverError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) PCDM_DriverError::Raise(MESSAGE);
+ if (CONDITION) throw PCDM_DriverError(MESSAGE);
#else
#define PCDM_DriverError_Raise_if(CONDITION, MESSAGE)
#endif
break;
}
aMsg << (char)0;
- Standard_Failure::Raise(aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
}
PCDM_SequenceOfDocument thePersistentDocuments;
{
try { OCC_CATCH_SIGNALS Make(aDocument,thePersistentDocuments);}
- catch (Standard_Failure) {
- aMsg << Standard_Failure::Caught()<<(char)0;
+ catch (Standard_Failure const& anException) {
+ aMsg << anException<<(char)0;
Failure=Standard_True;
}
}
- if(Failure) PCDM_DriverError::Raise(aMsg);
+ if(Failure) throw PCDM_DriverError(aMsg.str().c_str());
if(thePersistentDocuments.IsEmpty()) {
aMsg << "the storage driver: " << DynamicType()->Name() << "returned no documents to store" << (char) 0;
- PCDM_DriverError::Raise(aMsg);
+ throw PCDM_DriverError(aMsg.str().c_str());
}
Standard_Integer i=1;
theFile.Close();
if ( theData->ErrorStatus() != Storage_VSOk )
- PCDM_DriverError::Raise(theData->ErrorStatusExtension().ToCString());
+ throw PCDM_DriverError(theData->ErrorStatusExtension().ToCString());
}
Handle(PCDM_Document) voidDocument;
Standard_SStream aMsg;
aMsg << "No Make method were implemented in this Driver" << DynamicType()->Name() << (char) 0;
- Standard_NotImplemented::Raise(aMsg);
- return voidDocument;
+ throw Standard_NotImplemented(aMsg.str().c_str());
}
void PCDM_StorageDriver::Make(const Handle(CDM_Document)& aDocument, PCDM_SequenceOfDocument& Documents) {
if (rat) {
if(len != WCoefs->Length())
- Standard_Failure::Raise("PLib::Trimming : nbcoefs/dim != nbweights !!!");
+ throw Standard_Failure("PLib::Trimming : nbcoefs/dim != nbweights !!!");
upw = WCoefs->Upper();
}
len --;
case GeomAbs_C1: NivConstr = 1; break;
case GeomAbs_C2: NivConstr = 2; break;
default:
- Standard_ConstructionError::Raise("Invalid ConstraintOrder");
+ throw Standard_ConstructionError("Invalid ConstraintOrder");
}
if (MaxDegree < 2*NivConstr+1)
- Standard_ConstructionError::Raise("Invalid MaxDegree");
+ throw Standard_ConstructionError("Invalid MaxDegree");
if (Code >= 1)
WorkDegree = MaxDegree + 9;
else if (WorkDegree < NDEG61)
IPMIN=NDEG61;
else
- Standard_ConstructionError::Raise("Invalid MaxDegree");
+ throw Standard_ConstructionError("Invalid MaxDegree");
// ---> Nbre de points voulus.
Standard_Integer IWANT=0;
switch (Code) {
case 3: IWANT=NDEG50; break;
case 4: IWANT=NDEG61; break;
default:
- Standard_ConstructionError::Raise("Invalid Code");
+ throw Standard_ConstructionError("Invalid Code");
}
//--> NbGaussPoints est le nombre de points de discretisation de la fonction,
// il ne peut prendre que les valeurs 8,10,15,20,25,30,40,50 ou 61.
case GeomAbs_C1: NivConstr = 1; break;
case GeomAbs_C2: NivConstr = 2; break;
default:
- Standard_ConstructionError::Raise("Invalid ConstraintOrder");
+ throw Standard_ConstructionError("Invalid ConstraintOrder");
}
return NivConstr;
}
case 1: ConstraintOrder = GeomAbs_C1; break;
case 2: ConstraintOrder = GeomAbs_C2; break;
default:
- Standard_ConstructionError::Raise("Invalid NivConstr");
+ throw Standard_ConstructionError("Invalid NivConstr");
}
return ConstraintOrder;
}
case GeomAbs_C1: myNivConstr = 1; break;
case GeomAbs_C2: myNivConstr = 2; break;
default:
- Standard_ConstructionError::Raise("Invalid ConstraintOrder");
+ throw Standard_ConstructionError("Invalid ConstraintOrder");
}
myDegree = myWorkDegree - 2*(myNivConstr+1);
if (myDegree > 30)
- Standard_ConstructionError::Raise("Invalid Degree");
+ throw Standard_ConstructionError("Invalid Degree");
}
//=======================================================================
NbGaussPoints != NDEG40 && NbGaussPoints != NDEG50 &&
NbGaussPoints != NDEG61) ||
NbGaussPoints <= myDegree)
- Standard_ConstructionError::Raise("Invalid NbGaussPoints");
+ throw Standard_ConstructionError("Invalid NbGaussPoints");
math_Vector DecreasingPoints(1,NbGaussPoints);
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array1OfXYZ& theCoeff)
{
- if(theCoeff.Length()!= thePPC.Length()) Standard_DimensionMismatch::Raise();
+ if(theCoeff.Length()!= thePPC.Length()) throw Standard_DimensionMismatch();
myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
myCoef = new TColgp_HArray2OfXYZ(1,1,1, theCoeff.Length());
Plate_LinearScalarConstraint::Plate_LinearScalarConstraint
(const Plate_Array1OfPinpointConstraint& thePPC,const TColgp_Array2OfXYZ& theCoeff)
{
- if(theCoeff.RowLength()!= thePPC.Length()) Standard_DimensionMismatch::Raise();
+ if(theCoeff.RowLength()!= thePPC.Length()) throw Standard_DimensionMismatch();
myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
myCoef = new TColgp_HArray2OfXYZ(1, theCoeff.ColLength(),1, theCoeff.RowLength());
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColStd_Array1OfReal& theCoeff)
{
- if(theCoeff.Length()!= thePPC.Length()) Standard_DimensionMismatch::Raise();
+ if(theCoeff.Length()!= thePPC.Length()) throw Standard_DimensionMismatch();
myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
myCoef = new TColStd_HArray2OfReal(1,1,1, theCoeff.Length());
Plate_LinearXYZConstraint::Plate_LinearXYZConstraint(const Plate_Array1OfPinpointConstraint& thePPC,const TColStd_Array2OfReal& theCoeff)
{
- if(theCoeff.RowLength()!= thePPC.Length()) Standard_DimensionMismatch::Raise();
+ if(theCoeff.RowLength()!= thePPC.Length()) throw Standard_DimensionMismatch();
myPPC = new Plate_HArray1OfPinpointConstraint(1, thePPC.Length());
myCoef = new TColStd_HArray2OfReal(1, theCoeff.ColLength(),1, theCoeff.RowLength());
{
Standard_Integer m = SOPPC.Length();
- if (n > m) Standard_DimensionMismatch::Raise();
+ if (n > m) throw Standard_DimensionMismatch();
for(Standard_Integer index =1; index <= m;index++)
myLXYZC.SetPPC(index,SOPPC(index));
aMsg << theResource.ToCString() << endl;
if (theVerbose)
cout << "could not find the resource:" << theResource.ToCString() << endl;
- Plugin_Failure::Raise(aMsg);
+ throw Plugin_Failure(aMsg.str().c_str());
}
TCollection_AsciiString thePluginLibrary("");
aMsg << error.ToCString();
if (theVerbose)
cout << "could not open: " << PluginResource->Value(theResource.ToCString())<< " ; reason: "<< error.ToCString() << endl;
- Plugin_Failure::Raise(aMsg);
+ throw Plugin_Failure(aMsg.str().c_str());
}
f = theSharedLibrary.DlSymb("PLUGINFACTORY");
if( f == NULL ) {
Standard_SStream aMsg; aMsg << "could not find the factory in:";
aMsg << PluginResource->Value(theResource.ToCString());
aMsg << error.ToCString();
- Plugin_Failure::Raise(aMsg);
+ throw Plugin_Failure(aMsg.str().c_str());
}
theMapOfFunctions.Bind(pid,f);
}
#if !defined No_Exception && !defined No_Plugin_Failure
#define Plugin_Failure_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Plugin_Failure::Raise(MESSAGE);
+ if (CONDITION) throw Plugin_Failure(MESSAGE);
#else
#define Plugin_Failure_Raise_if(CONDITION, MESSAGE)
#endif
else if (pConnectedTri->mypConnected[2] == this)
iConn1 = 2;
else
- Standard_ProgramError::Raise("Poly_CoherentTriangle::RemoveConnection: "
- "wrong connection between triangles");
+ throw Standard_ProgramError("Poly_CoherentTriangle::RemoveConnection: "
+ "wrong connection between triangles");
}
pConnectedTri->mypConnected[iConn1] = 0L;
pConnectedTri->myNodesOnConnected[iConn1] = -1;
else if (iNode == pTri[i]->Node(2))
const_cast<Poly_CoherentTriangle *>(pTri[i])->mypLink[2] = 0L;
else
- Standard_ProgramError::Raise("Poly_CoherentTriangulation::RemoveLink: "
- " wrong connectivity between triangles");
+ throw Standard_ProgramError("Poly_CoherentTriangulation::RemoveLink: "
+ " wrong connectivity between triangles");
}
}
}
else if (pTriOpp->Node(2) == theTri.GetConnectedNode(theConn))
const_cast<Poly_CoherentTriangle *>(pTriOpp)->mypLink[2] = pLink;
else
- Standard_ProgramError::Raise("Poly_CoherentTriangulation::AddLink: "
- "Bad connectivity of triangles");
+ throw Standard_ProgramError("Poly_CoherentTriangulation::AddLink: "
+ "Bad connectivity of triangles");
}
}
return pLink;
else if (aTri.Node(1) == theLink.Node(1))
pTri[1] = &aTri;
} else
- Standard_ProgramError::Raise("Poly_CoherentTriangulation::FindTriangle : "
- " Data incoherence detected");
+ throw Standard_ProgramError("Poly_CoherentTriangulation::FindTriangle : "
+ " Data incoherence detected");
if (pTri[0] && pTri[1])
break;
}
{
if (theIndex < 1 || theIndex > myNodes.Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::Node : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::Node : index out of range");
}
return myNodes.Value (theIndex);
}
{
if (theIndex < 1 || theIndex > myNodes.Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::ChangeNode : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::ChangeNode : index out of range");
}
return myNodes.ChangeValue (theIndex);
}
{
if (myUVNodes.IsNull() || theIndex < 1 || theIndex > myUVNodes->Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::UVNode : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::UVNode : index out of range");
}
return myUVNodes->Value (theIndex);
}
{
if (myUVNodes.IsNull() || theIndex < 1 || theIndex > myUVNodes->Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::ChangeUVNode : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::ChangeUVNode : index out of range");
}
return myUVNodes->ChangeValue (theIndex);
}
{
if (theIndex < 1 || theIndex > myTriangles.Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::Triangle : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::Triangle : index out of range");
}
return myTriangles.Value (theIndex);
}
{
if (theIndex < 1 || theIndex > myTriangles.Size())
{
- Standard_OutOfRange::Raise ("Poly_Triangulation::ChangeTriangle : index out of range");
+ throw Standard_OutOfRange ("Poly_Triangulation::ChangeTriangle : index out of range");
}
return myTriangles.ChangeValue (theIndex);
}
{
if(theNormals.IsNull() || theNormals->Length() != 3*myNbNodes) {
- Standard_DomainError::Raise("Poly_Triangulation::SetNormals : wrong length");
+ throw Standard_DomainError("Poly_Triangulation::SetNormals : wrong length");
}
myNormals = theNormals;
{
if(myNormals.IsNull() || myNormals->Length() != 3*myNbNodes) {
- Standard_NullObject::Raise("Poly_Triangulation::Normals : "
- "wrong length or null array");
+ throw Standard_NullObject("Poly_Triangulation::Normals : "
+ "wrong length or null array");
}
return myNormals->Array1();
{
if(myNormals.IsNull() || myNormals->Length() != 3*myNbNodes) {
- Standard_NullObject::Raise("Poly_Triangulation::ChangeNormals : "
- "wrong length or null array");
+ throw Standard_NullObject("Poly_Triangulation::ChangeNormals : "
+ "wrong length or null array");
}
return myNormals->ChangeArray1();
{
if (myNormals.IsNull() || theIndex < 1 || theIndex > myNodes.Size())
{
- Standard_NullObject::Raise("Poly_Triangulation::SetNormal : empty array or index out of range");
+ throw Standard_NullObject ("Poly_Triangulation::SetNormal : empty array or index out of range");
}
myNormals->ChangeValue (theIndex * 3 - 2) = (Standard_ShortReal) theNormal.X();
{
if (myNormals.IsNull() || theIndex < 1 || theIndex > myNodes.Size())
{
- Standard_NullObject::Raise("Poly_Triangulation::Normal : empty array or index out of range");
+ throw Standard_NullObject ("Poly_Triangulation::Normal : empty array or index out of range");
}
gp_Dir N;
DS1_v*DS1_v + Ort*DS2_v);
Standard_Real det = dE_du.X()*dE_dv.Y() - dE_du.Y()*dE_dv.X();
- if (fabs(det) < gp::Resolution()) Standard_ConstructionError::Raise();
+ if (fabs(det) < gp::Resolution()) throw Standard_ConstructionError();
gp_Mat2d M(gp_XY(dE_dv.Y()/det, -dE_du.Y()/det),
gp_XY(-dE_dv.X()/det, dE_du.X()/det));
DS1_v*DS1_v + Ort*DS2_v);
Standard_Real det = dE_du.X()*dE_dv.Y() - dE_du.Y()*dE_dv.X();
- if (fabs(det) < gp::Resolution()) Standard_ConstructionError::Raise();
+ if (fabs(det) < gp::Resolution()) throw Standard_ConstructionError();
gp_Mat2d M(gp_XY(dE_dv.Y()/det, -dE_du.Y()/det),
gp_XY(-dE_dv.X()/det, dE_du.X()/det));
DS1_v*DS1_v + Ort*DS2_v);
Standard_Real det = dE_du.X()*dE_dv.Y() - dE_du.Y()*dE_dv.X();
- if (fabs(det) < gp::Resolution()) Standard_ConstructionError::Raise();
+ if (fabs(det) < gp::Resolution()) throw Standard_ConstructionError();
gp_Mat2d M(gp_XY(dE_dv.Y()/det, -dE_du.Y()/det),
gp_XY(-dE_dv.X()/det, dE_du.X()/det));
DS1_v*DS1_v + Ort*DS2_v);
Standard_Real det = dE_du.X()*dE_dv.Y() - dE_du.Y()*dE_dv.X();
- if (fabs(det) < gp::Resolution()) Standard_ConstructionError::Raise();
+ if (fabs(det) < gp::Resolution()) throw Standard_ConstructionError();
gp_Mat2d M(gp_XY(dE_dv.Y()/det, -dE_du.Y()/det),
gp_XY(-dE_dv.X()/det, dE_du.X()/det));
Standard_Real& Udeb,
Standard_Real& Ufin) const
{
- if(Index < 1 || Index > myNbCurves) Standard_NoSuchObject::Raise();
+ if(Index < 1 || Index > myNbCurves) throw Standard_NoSuchObject();
Udeb = mySequence->Value(Index)->Value(1).X();
Ufin = mySequence->Value(Index)->Value(mySequence->Value(Index)->Length()).X();
}
Standard_Boolean ProjLib_CompProjectedCurve::IsSinglePnt(const Standard_Integer Index, gp_Pnt2d& P) const
{
- if(Index < 1 || Index > myNbCurves) Standard_NoSuchObject::Raise();
+ if(Index < 1 || Index > myNbCurves) throw Standard_NoSuchObject();
P = gp_Pnt2d(mySequence->Value(Index)->Value(1).Y(), mySequence->Value(Index)->Value(1).Z());
return mySnglPnts->Value(Index);
}
Standard_Boolean ProjLib_CompProjectedCurve::IsUIso(const Standard_Integer Index, Standard_Real& U) const
{
- if(Index < 1 || Index > myNbCurves) Standard_NoSuchObject::Raise();
+ if(Index < 1 || Index > myNbCurves) throw Standard_NoSuchObject();
U = mySequence->Value(Index)->Value(1).Y();
return myUIso->Value(Index);
}
Standard_Boolean ProjLib_CompProjectedCurve::IsVIso(const Standard_Integer Index, Standard_Real& V) const
{
- if(Index < 1 || Index > myNbCurves) Standard_NoSuchObject::Raise();
+ if(Index < 1 || Index > myNbCurves) throw Standard_NoSuchObject();
V = mySequence->Value(Index)->Value(1).Z();
return myVIso->Value(Index);
}
break;
}
}
- if (!found) Standard_DomainError::Raise("ProjLib_CompProjectedCurve::D0");
+ if (!found) throw Standard_DomainError("ProjLib_CompProjectedCurve::D0");
Standard_Real U0, V0;
gp_Vec2d ProjLib_CompProjectedCurve::DN(const Standard_Real t,
const Standard_Integer N) const
{
- if (N < 1 ) Standard_OutOfRange::Raise("ProjLib_CompProjectedCurve : N must be greater than 0");
+ if (N < 1 ) throw Standard_OutOfRange("ProjLib_CompProjectedCurve : N must be greater than 0");
else if (N ==1)
{
gp_Pnt2d P;
return V2;
}
else if (N > 2 )
- Standard_NotImplemented::Raise("ProjLib_CompProjectedCurve::DN");
+ throw Standard_NotImplemented("ProjLib_CompProjectedCurve::DN");
return gp_Vec2d();
}
Standard_Real ProjLib_CompProjectedCurve::MaxDistance(const Standard_Integer Index) const
{
- if(Index < 1 || Index > myNbCurves) Standard_NoSuchObject::Raise();
+ if(Index < 1 || Index > myNbCurves) throw Standard_NoSuchObject();
return myMaxDistance->Value(Index);
}
SforS = GeomAbs_CN;
break;
default:
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
Standard_Integer i, j, k;
Standard_Integer NbIntCur = myCurve->NbIntervals(S);
break;
}
default:
- Standard_NoSuchObject::Raise("ProjLib_ComputeApprox::Value");
+ throw Standard_NoSuchObject("ProjLib_ComputeApprox::Value");
}
if ( UCouture) {
break;
}
default:
- Standard_NoSuchObject::Raise("ProjLib_ComputeApprox::Value");
+ throw Standard_NoSuchObject("ProjLib_ComputeApprox::Value");
}
Standard_Boolean ToMirror = Standard_False;
Standard_Real du = 0., dv = 0.;
break;
}
default:
- Standard_NoSuchObject::Raise("ProjLib_ComputeApproxOnPolarSurface::Value");
+ throw Standard_NoSuchObject("ProjLib_ComputeApproxOnPolarSurface::Value");
}
return gp_Pnt2d(S, T);
}
}
else
{
- Standard_NoSuchObject::Raise("");
+ throw Standard_NoSuchObject("");
}
// Try to run simple search with initial point (U0, V0).
break;
}
default:
- Standard_NoSuchObject::Raise("ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d");
+ throw Standard_NoSuchObject("ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d");
}
}
else {
case 1: myt = FixVal; break;
case 2: myU = FixVal; break;
case 3: myV = FixVal; break;
- default: Standard_ConstructionError::Raise();
+ default: throw Standard_ConstructionError();
}
}
ProjLib_PrjResolve::ProjLib_PrjResolve(const Adaptor3d_Curve& C,const Adaptor3d_Surface& S,const Standard_Integer Fix) : myFix(Fix)
{
- if (myFix > 3 || myFix < 1) Standard_ConstructionError::Raise();
+ if (myFix > 3 || myFix < 1) throw Standard_ConstructionError();
mySolution = gp_Pnt2d(0.,0.);
myCurve = (Adaptor3d_CurvePtr)&C;
mySurface = (Adaptor3d_SurfacePtr)&S;
gp_Pnt2d ProjLib_PrjResolve::Solution() const
{
- if (!IsDone()) StdFail_NotDone::Raise();
+ if (!IsDone()) throw StdFail_NotDone();
return mySolution;
}
myIsApprox (Standard_False)
{
// if ( Abs(D * Pl.Direction()) < Precision::Confusion()) {
-// Standard_ConstructionError::Raise
+// throw Standard_ConstructionError
// ("ProjLib_ProjectOnPlane: The Direction and the Plane are parallel");
// }
}
return myResult->Trim(First,Last,Tolerance) ;
}
else {
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
-
- // portage WNT
- Handle(Adaptor3d_HCurve) dummy;
- return dummy;
}
Standard_Real ProjLib_ProjectOnPlane::Period() const
{
if ( !IsPeriodic()) {
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane::Period");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane::Period");
}
if ( myIsApprox)
gp_Lin ProjLib_ProjectOnPlane::Line() const
{
if (myType != GeomAbs_Line)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Line");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Line");
return myResult->Line();
}
gp_Circ ProjLib_ProjectOnPlane::Circle() const
{
if (myType != GeomAbs_Circle)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Circle");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Circle");
return myResult->Circle();
}
gp_Elips ProjLib_ProjectOnPlane::Ellipse() const
{
if (myType != GeomAbs_Ellipse)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Ellipse");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Ellipse");
return myResult->Ellipse();
}
gp_Hypr ProjLib_ProjectOnPlane::Hyperbola() const
{
if (myType != GeomAbs_Hyperbola)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Hyperbola");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Hyperbola");
return myResult->Hyperbola() ;
}
gp_Parab ProjLib_ProjectOnPlane::Parabola() const
{
if (myType != GeomAbs_Parabola)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Parabola");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Parabola");
return myResult->Parabola() ;
}
{
if ((GetType() != GeomAbs_BSplineCurve) &&
(GetType() != GeomAbs_BezierCurve))
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Degree");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Degree");
if ( myIsApprox)
return myResult->Degree();
{
if ((GetType() != GeomAbs_BSplineCurve) &&
(GetType() != GeomAbs_BezierCurve))
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:IsRational");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:IsRational");
if ( myIsApprox)
return myResult->IsRational();
{
if ((GetType() != GeomAbs_BSplineCurve) &&
(GetType() != GeomAbs_BezierCurve))
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:NbPoles");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:NbPoles");
if ( myIsApprox)
return myResult->NbPoles();
Standard_Integer ProjLib_ProjectOnPlane::NbKnots() const
{
if ( GetType() != GeomAbs_BSplineCurve)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:NbKnots");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:NbKnots");
if ( myIsApprox)
return myResult->NbKnots();
Handle(Geom_BezierCurve) ProjLib_ProjectOnPlane::Bezier() const
{
if (myType != GeomAbs_BezierCurve)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:Bezier");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:Bezier");
return myResult->Bezier() ;
}
Handle(Geom_BSplineCurve) ProjLib_ProjectOnPlane::BSpline() const
{
if (myType != GeomAbs_BSplineCurve)
- Standard_NoSuchObject::Raise("ProjLib_ProjectOnPlane:BSpline");
+ throw Standard_NoSuchObject("ProjLib_ProjectOnPlane:BSpline");
return myResult->BSpline() ;
}
case GeomAbs_OtherCurve: // try the approximation
break;
default:
- Standard_NoSuchObject::Raise(" ");
+ throw Standard_NoSuchObject(" ");
}
}
GeomAbs_Shape ProjLib_ProjectedCurve::Continuity() const
{
- Standard_NotImplemented::Raise("");
- return GeomAbs_C0;
+ throw Standard_NotImplemented("");
}
Standard_Integer ProjLib_ProjectedCurve::NbIntervals(const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("");
- return 0;
+ throw Standard_NotImplemented("");
}
void ProjLib_ProjectedCurve::Intervals(TColStd_Array1OfReal& ,
const GeomAbs_Shape ) const
{
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
Standard_Boolean ProjLib_ProjectedCurve::IsClosed() const
{
- Standard_NotImplemented::Raise("");
- return Standard_True;
+ throw Standard_NotImplemented("");
}
Standard_Real ProjLib_ProjectedCurve::Period() const
{
- Standard_NotImplemented::Raise("");
- return 0.;
+ throw Standard_NotImplemented("");
}
gp_Pnt2d ProjLib_ProjectedCurve::Value(const Standard_Real ) const
{
- Standard_NotImplemented::Raise("");
- return gp_Pnt2d(0.,0.);
+ throw Standard_NotImplemented("");
}
void ProjLib_ProjectedCurve::D0(const Standard_Real , gp_Pnt2d& ) const
{
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
gp_Pnt2d& ,
gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
gp_Vec2d& ,
gp_Vec2d& ) const
{
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
gp_Vec2d&,
gp_Vec2d&) const
{
- Standard_NotImplemented::Raise("");
+ throw Standard_NotImplemented("");
}
gp_Vec2d ProjLib_ProjectedCurve::DN(const Standard_Real,
const Standard_Integer) const
{
- Standard_NotImplemented::Raise("");
- return gp_Vec2d(0.,0.);
+ throw Standard_NotImplemented("");
}
Standard_Real ProjLib_ProjectedCurve::Resolution(const Standard_Real) const
{
- Standard_NotImplemented::Raise("");
- return 0.;
+ throw Standard_NotImplemented("");
}
const Standard_Real ,
const Standard_Real ) const
{
- Standard_NotImplemented::Raise("");
- return NULL ;
+ throw Standard_NotImplemented("");
}
const gp_Lin2d& ProjLib_Projector::Line()const
{
if (myType != GeomAbs_Line)
- Standard_NoSuchObject::Raise("ProjLib_Projector::Line");
+ throw Standard_NoSuchObject("ProjLib_Projector::Line");
return myLin;
}
const gp_Circ2d& ProjLib_Projector::Circle()const
{
if (myType != GeomAbs_Circle)
- Standard_NoSuchObject::Raise("ProjLib_Projector::Circle");
+ throw Standard_NoSuchObject("ProjLib_Projector::Circle");
return myCirc;
}
const gp_Elips2d& ProjLib_Projector::Ellipse()const
{
if (myType != GeomAbs_Ellipse)
- Standard_NoSuchObject::Raise("ProjLib_Projector::Ellipse");
+ throw Standard_NoSuchObject("ProjLib_Projector::Ellipse");
return myElips;
}
const gp_Hypr2d& ProjLib_Projector::Hyperbola()const
{
if (myType != GeomAbs_Hyperbola)
- Standard_NoSuchObject::Raise("ProjLib_Projector::Hyperbola");
+ throw Standard_NoSuchObject("ProjLib_Projector::Hyperbola");
return myHypr;
}
const gp_Parab2d& ProjLib_Projector::Parabola()const
{
if (myType != GeomAbs_Parabola)
- Standard_NoSuchObject::Raise("ProjLib_Projector::Parabola");
+ throw Standard_NoSuchObject("ProjLib_Projector::Parabola");
return myParab;
}
#if !defined No_Exception && !defined No_Prs3d_InvalidAngle
#define Prs3d_InvalidAngle_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Prs3d_InvalidAngle::Raise(MESSAGE);
+ if (CONDITION) throw Prs3d_InvalidAngle(MESSAGE);
#else
#define Prs3d_InvalidAngle_Raise_if(CONDITION, MESSAGE)
#endif
const Handle(Prs3d_Presentation)& /*aPresentation*/,
const Standard_Integer /*aMode*/)
{
- Standard_NotImplemented::Raise("cannot compute in a 3d visualizer");
+ throw Standard_NotImplemented("cannot compute in a 3d visualizer");
}
//=======================================================================
void PrsMgr_PresentableObject::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
- Standard_NotImplemented::Raise("cannot compute under a specific projector");
+ throw Standard_NotImplemented("cannot compute under a specific projector");
}
//=======================================================================
const Handle(Geom_Transformation)& /*aTrsf*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
- Standard_NotImplemented::Raise("cannot compute under a specific projector");
+ throw Standard_NotImplemented("cannot compute under a specific projector");
}
//=======================================================================
// check that exception initialized without message string can be safely handled and printed
try {
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
std::cout << "Caught successfully: ";
- Standard_Failure::Caught()->Print (std::cout);
- std::cout << endl;
+ std::cout << anException << endl;
}
return 0;
}
{
di << "Caught, OK\n";
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
-#ifndef NO_CXX_EXCEPTION
// this case tests if (...) supersedes (Standard_*),
// the normal behaviour is not
catch(...) {
di<<" unknown exception... (But) Ok\n";
}
-#endif
}
{//==== Test Divide ByZero (Real) ===========================================
{
di << "Caught, OK\n";
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
catch(Standard_Overflow) {
di << "Caught, OK\n";
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
{
di << "Caught, OK\n";
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
di << "Exception caught, KO\n";
Succes = Standard_False;
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
catch(Standard_NumericError) {
di << "Caught, OK\n";
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
#endif
{
di << "Caught, OK\n";
- } catch(Standard_Failure) {
+ } catch(Standard_Failure const& anException) {
//cout << " Caught (" << Standard_Failure::Caught() << ")... KO" << endl;
di << " Caught (";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di << ")... KO\n";
Succes = Standard_False;
}
catch(OSD_Exception_STACK_OVERFLOW) {
di << "Failed : STACK OVERFLOW\n\n";
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
di << "Failed :\n\n";
//cout << Standard_Failure::Caught() << endl;
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
}
di << argv[0] << " : Finish\n";
OCC_CATCH_SIGNALS
myExpr->Process( aString );
}
- catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- di << "Exception : " << aFail->GetMessageString() << "\n";
+ catch(Standard_Failure const& anException) {
+ di << "Exception : " << anException.GetMessageString() << "\n";
}
return 0;
return 0;
}
-#include <OSD_Parallel.hxx>
-
-namespace {
- struct ExceptionRaiser
- {
- void operator () (int i) const
- {
- try
- {
- f (i);
- }
- catch (Standard_ProgramError)
- {
- strlen (Standard_Failure::Caught()->GetMessageString());
- }
- }
-
- void f(int i) const;
- };
-
- void ExceptionRaiser::f (int i) const
- {
- const char str[] = "0123456789";
- Standard_ProgramError::Raise (str + i % 10);
- }
-};
-
-static Standard_Integer OCC28217(Draw_Interpretor& theDI,
- Standard_Integer /*theNArg*/,
- const char ** /*theArgVal*/)
-{
- NCollection_Array1<int> aVec (1, 10000);
- for (int i=1; i < aVec.Length(); i++)
- aVec(i) = i;
-
- ExceptionRaiser aProc;
- OSD_Parallel::For (1, aVec.Length(), aProc);
-
- theDI << "OCC28217: OK";
- return 0;
-}
#include <TDF_Tool.hxx>
#include <XCAFDoc_View.hxx>
theCommands.Add("OCC26270", "OCC26270 shape result", __FILE__, OCC26270, group);
theCommands.Add ("OCC27552", "OCC27552", __FILE__, OCC27552, group);
theCommands.Add("OCC27875", "OCC27875 curve", __FILE__, OCC27875, group);
- theCommands.Add("OCC28217", "OCC28217", __FILE__, OCC28217, group);
theCommands.Add("OCC28389", "OCC28389", __FILE__, OCC28389, group);
return;
void QANewBRepNaming_BooleanOperation::Init(const TDF_Label& Label)
{
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_BooleanOperation::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_BooleanOperation::Init The Result label is Null ...");
myResultLabel = Label;
}
void QANewBRepNaming_BooleanOperationFeat::Init(const TDF_Label& ResultLabel) {
if(ResultLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_BooleanOperationFeat::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_BooleanOperationFeat::Init The Result label is Null ...");
myResultLabel = ResultLabel;
}
void QANewBRepNaming_Box::Init(const TDF_Label& Label) {
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Box::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Box::Init The Result label is Null ...");
myResultLabel = Label;
}
void QANewBRepNaming_Chamfer::Init(const TDF_Label& ResultLabel)
{
if(ResultLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Chamfer::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Chamfer::Init The Result label is Null ...");
myResultLabel = ResultLabel;
}
void QANewBRepNaming_Cylinder::Init(const TDF_Label& ResultLabel) {
if(ResultLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Cylinder::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Cylinder::Init The Result label is Null ...");
myResultLabel = ResultLabel;
}
void QANewBRepNaming_Fillet::Init(const TDF_Label& theLabel)
{
if(theLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Fillet::Init: The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Fillet::Init: The Result label is Null ...");
myResultLabel = theLabel;
}
void QANewBRepNaming_Gluing::Init(const TDF_Label& ResultLabel) {
if(ResultLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Gluing::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Gluing::Init The Result label is Null ...");
myResultLabel = ResultLabel;
}
void QANewBRepNaming_ImportShape::Init(const TDF_Label& Label) {
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_ImportShape::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_ImportShape::Init The Result label is Null ...");
myResultLabel = Label;
}
void QANewBRepNaming_Prism::Init(const TDF_Label& Label) {
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Prism::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Prism::Init The Result label is Null ...");
myResultLabel = Label;
}
void QANewBRepNaming_Revol::Init(const TDF_Label& Label)
{
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Revol::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Revol::Init The Result label is Null ...");
myResultLabel = Label;
}
void QANewBRepNaming_Sphere::Init(const TDF_Label& ResultLabel) {
if(ResultLabel.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_Sphere::Init The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_Sphere::Init The Result label is Null ...");
myResultLabel = ResultLabel;
}
QANewBRepNaming_TopNaming::QANewBRepNaming_TopNaming(const TDF_Label& Label)
{
if(Label.IsNull())
- Standard_NullObject::Raise("QANewBRepNaming_TopNaming:: The Result label is Null ...");
+ throw Standard_NullObject("QANewBRepNaming_TopNaming:: The Result label is Null ...");
myResultLabel = Label;
}
}
else {
- Standard_ConstructionError::Raise("QANewModTopOpe_Limitation : wrong mode");
+ throw Standard_ConstructionError("QANewModTopOpe_Limitation : wrong mode");
}
if ( R1 < 0. || R1 > 1. ||
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
MyRed = Standard_ShortReal (R1);
MyGreen = Standard_ShortReal (R2);
MyBlue = Standard_ShortReal (R3);
|| (R1 > 360.) ||
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
Quantity_Color::hlsrgb
(Standard_ShortReal (R1),
Standard_ShortReal (R2),
|| theRgb.g() < 0.0f || theRgb.g() > 1.0f
|| theRgb.b() < 0.0f || theRgb.b() > 1.0f)
{
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
}
}
if ( R1 < 0. || R1 > 1. ||
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
else {
MyRed = Standard_ShortReal (R1);
MyGreen = Standard_ShortReal (R2);
if ( R1 < 0. || R1 > 360. ||
R2 < 0. || R2 > 1. ||
R3 < 0. || R3 > 1. )
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
else {
Quantity_Color::hlsrgb
(Standard_ShortReal (R1),
if ( R < 0. || R > 1. ||
G < 0. || G > 1. ||
B < 0. || B > 1. )
- Standard_OutOfRange::Raise ("Color out");
+ throw Standard_OutOfRange("Color out");
Quantity_Color AColor (R, G, B, Quantity_TOC_RGB); // Couleur definie en RGB.
RR = R1 = (float ) 0.603922; RG = R2 = (float ) 0.803922; RB = R3 = (float ) 0.196078;
break;
default :
- Standard_OutOfRange::Raise ("Bad name");
+ throw Standard_OutOfRange("Bad name");
break;
}
if (AType == Quantity_TOC_HLS)
break;
default :
TheName = "UNDEFINED";
- Standard_OutOfRange::Raise ("Bad name");
+ throw Standard_OutOfRange("Bad name");
break;
}
return (TheName);
TestOfColor ();
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) E = Standard_Failure::Caught();
- cout << E << endl;
+ catch (Standard_Failure const& anException) {
+ cout << anException << endl;
}
}
#if !defined No_Exception && !defined No_Quantity_ColorDefinitionError
#define Quantity_ColorDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Quantity_ColorDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Quantity_ColorDefinitionError(MESSAGE);
#else
#define Quantity_ColorDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
Standard_Integer i;
if ( ! Quantity_Date::IsValid (mm,dd,yy,hh,mn,ss,mis,mics))
- Quantity_DateDefinitionError::Raise(
- "Quantity_Date::Quantity_Date invalid parameters");
-
+ throw Quantity_DateDefinitionError("Quantity_Date::Quantity_Date invalid parameters");
if ( Quantity_Date::IsLeap (yy) ) month_table[1] = 29;
else month_table[1] = 28;
if ( result.mySec <0 )
- Quantity_DateDefinitionError::Raise(
+ throw Quantity_DateDefinitionError(
"Quantity_Date::Subtract : The result date is anterior to Jan,1 1979");
return (result);
#if !defined No_Exception && !defined No_Quantity_DateDefinitionError
#define Quantity_DateDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Quantity_DateDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Quantity_DateDefinitionError(MESSAGE);
#else
#define Quantity_DateDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
const Standard_Integer mics) {
if ( ! Quantity_Period::IsValid(ss,mics) )
- Quantity_PeriodDefinitionError::Raise(
- "Quantity_Period::SetValues invalid parameters");
+ throw Quantity_PeriodDefinitionError("Quantity_Period::SetValues invalid parameters");
mySec = ss;
myUSec = mics;
#if !defined No_Exception && !defined No_Quantity_PeriodDefinitionError
#define Quantity_PeriodDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Quantity_PeriodDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw Quantity_PeriodDefinitionError(MESSAGE);
#else
#define Quantity_PeriodDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
Standard_Integer NBFACET = (Standard_Integer)((filesize - HEADER_SIZE) / SIZEOF_STL_FACET);
if (NBFACET < 1)
{
- Standard_NoMoreObject::Raise("RWStl::ReadBinary (wrong file size)");
+ throw Standard_NoMoreObject("RWStl::ReadBinary (wrong file size)");
}
theFile.Seek (80, OSD_FromBeginning);
TCollection_AsciiString n("Value of resource `");
n+= aResourceName;
n+= "` is not an integer";
- Standard_TypeMismatch::Raise(n.ToCString());
+ throw Standard_TypeMismatch(n.ToCString());
}
return Result.IntegerValue();
}
TCollection_AsciiString n("Value of resource `");
n+= aResourceName;
n+= "` is not a real";
- Standard_TypeMismatch::Raise(n.ToCString());
+ throw Standard_TypeMismatch(n.ToCString());
}
return Result.RealValue();
}
return myUserMap(Resource).ToCString();
if (myRefMap.IsBound(Resource))
return myRefMap(Resource).ToCString();
- Resource_NoSuchResource::Raise(aResource);
- return ("");
+ throw Resource_NoSuchResource(aResource);
}
//=======================================================================
#if !defined No_Exception && !defined No_Resource_NoSuchResource
#define Resource_NoSuchResource_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Resource_NoSuchResource::Raise(MESSAGE);
+ if (CONDITION) throw Resource_NoSuchResource(MESSAGE);
#else
#define Resource_NoSuchResource_Raise_if(CONDITION, MESSAGE)
#endif
: mynbpoints(theNbPoints)
{
if (theNbPoints <= 0)
- Standard_ConstructionError::Raise("Select3D_PointData");
+ throw Standard_ConstructionError("Select3D_PointData");
mypolyg3d = new Select3D_Pnt[mynbpoints];
}
const Select3D_Pnt& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
- Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
+ throw Standard_OutOfRange("Select3D_PointData::SetPnt");
mypolyg3d[theIndex] = theValue;
}
const gp_Pnt& theValue)
{
if (theIndex < 0 || theIndex >= mynbpoints)
- Standard_OutOfRange::Raise("Select3D_PointData::SetPnt");
+ throw Standard_OutOfRange("Select3D_PointData::SetPnt");
mypolyg3d[theIndex] = theValue;
}
Select3D_Pnt Pnt (const Standard_Integer theIndex) const
{
if (theIndex < 0 || theIndex >= mynbpoints)
- Standard_OutOfRange::Raise("Select3D_PointData::Pnt");
+ throw Standard_OutOfRange("Select3D_PointData::Pnt");
return mypolyg3d[theIndex];
}
gp_Pnt Pnt3d (const Standard_Integer theIndex) const
{
if (theIndex < 0 || theIndex >= mynbpoints)
- Standard_OutOfRange::Raise("Select3D_PointData::Pnt");
+ throw Standard_OutOfRange("Select3D_PointData::Pnt");
return mypolyg3d[theIndex];
}
( const Handle(PrsMgr_PresentationManager3d)&,
const SelectMgr_SequenceOfOwner&)
{
- Standard_NotImplemented::Raise ("SelectMgr_SelectableObject::HilightSelected");
+ throw Standard_NotImplemented("SelectMgr_SelectableObject::HilightSelected");
}
//=======================================================================
const Handle(Prs3d_Drawer)&,
const Handle(SelectMgr_EntityOwner)&)
{
- Standard_NotImplemented::Raise ("SelectMgr_SelectableObject::HilightOwnerWithColor");
+ throw Standard_NotImplemented("SelectMgr_SelectableObject::HilightOwnerWithColor");
}
//=======================================================================
{
if (myActiveSelectionType != Point)
{
- Standard_ProgramError::Raise ("SelectMgr_SelectingVolumeManager::DetectedPoint() should be called only for Point selection type");
+ throw Standard_ProgramError("SelectMgr_SelectingVolumeManager::DetectedPoint() should be called only for Point selection type");
}
return mySelectingVolumes[Frustum]->DetectedPoint (theDepth);
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;
}
}
}
- 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
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;
}
} // 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
- S = (Precision::IsInfinite(uf))? 0 : (uf+ul) / 2.;
- T = (Precision::IsInfinite(vf))? 0 : (vf+vl) / 2.;
-#ifdef OCCT_DEBUG //:s5
+//szv#4:S4163:12Mar99 optimized
+//:s5
cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ S = (Precision::IsInfinite(uf))? 0 : (uf+ul) / 2.;
+ T = (Precision::IsInfinite(vf))? 0 : (vf+vl) / 2.;
}
} //: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);
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;
}
{
//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);
}
{
//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.);
return Standard_True;
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\nWarning: ShapeBuild_Edge: Exception in BuildCurve3d: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return Standard_False;
}
else
aBSpline = GeomConvert::CurveToBSplineCurve(C3D,Convert_QuasiAngular);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxSurface Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
aBSpline = GeomConvert::CurveToBSplineCurve(C3D,Convert_QuasiAngular);
}
}
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
if(cnt > 0) cnt--;
continue;
}
B.SameParameter(theEdge,Standard_False);
return (i <= edges->Length());
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"Error: ShapeConstruct::JoinPCurves Exception in GeomConvert_CompCurveToBSplineCurve: ";
- Standard_Failure::Caught()->Print(cout); cout<<endl;
+ anException.Print(cout); cout<<endl;
#endif
+ (void)anException;
}
return Standard_False;
}
OCC_CATCH_SIGNALS
bspl = GeomConvert::CurveToBSplineCurve(tc);
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in GeomConvert: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
bspl->Segment ( fbsp, lbsp );
return bspl;
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
if ( Conv.IsDone() || Conv.HasResult() )
bspl = Conv.Curve();
}
- catch ( Standard_Failure ) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return bspl;
}
OCC_CATCH_SIGNALS
bspl = Geom2dConvert::CurveToBSplineCurve(tc);
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Geom2dConvert: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
bspl->Segment ( fbsp, lbsp );
return bspl;
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Segment: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
if ( Conv.IsDone() || Conv.HasResult() )
bspl = Conv.Curve();
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_Curve::ConvertToBSpline(): Exception in Approx_Curve3d: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return bspl;
}
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL3);
c2d.Nullify();
}
C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic());
return C2d;
}
- catch(Standard_Failure) {
-#ifdef OCCT_DEBUG //:s5
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+ //:s5
// debug ...
Standard_Integer nbp = params->Length();
Standard_Integer nb2 = points2d->Length();
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(): Exception: ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<"Pb Geom2dAPI_Approximate, tol2d="<<theTolerance2d<<" NbParams="<<nbp<<" NbPnts="<<nb2<<endl;
// if (nb2 > nbp) nb2 = nbp;
// Standard_Real rbp,rb2; rbp = nbp; rb2 = nb2;
// dbl.AddXYZ (quoi);
// }
#endif
+ (void)anException;
C2d.Nullify();
}
return C2d;
myInterPol2d.Perform();
if (myInterPol2d.IsDone()) C2d = myInterPol2d.Curve();
}
- catch(Standard_Failure) {
-#ifdef OCCT_DEBUG //:s5
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+//:s5
// // debug ...
Standard_Integer nbp = params->Length();
Standard_Integer nb2 = points2d->Length();
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolatePCurve(): Exception: ";
- Standard_Failure::Caught()->Print(cout);
+ anException.Print(cout);
cout<<"Pb Geom2dAPI_Interpolate, tol2d="<<theTolerance2d<<" NbParams="<<nbp<<" NbPnts="<<nb2<<endl;
// if (nb2 > nbp) nb2 = nbp;
// Standard_Real rbp,rb2; rbp = nbp; rb2 = nb2;
// dbl.AddXYZ (quoi);
// }
#endif
+ (void)anException;
C2d.Nullify();
}
return C2d;
myInterPol.Perform();
if (myInterPol.IsDone()) C3d = myInterPol.Curve();
}
- catch(Standard_Failure) {
- C3d.Nullify();
-#ifdef OCCT_DEBUG //:s5
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+ //:s5
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::InterpolateCurve3d(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ C3d.Nullify();
}
return C3d;
}
} */
return isoParam;
} // RAJOUT
- catch(Standard_Failure) {
-// pb : on affiche ce qu on peut
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
+// pb : on affiche ce qu on peut
for (Standard_Integer numpnt = 1; numpnt <= nbrPnt; numpnt ++) {
cout<<"["<<numpnt<<"]param="<<params(numpnt)<<" point=("<<
points(numpnt).X()<<" "<<points(numpnt).Y()<<" "<<points(numpnt).Z()<<")"<<endl;
}
-#endif
-#ifdef OCCT_DEBUG //:s5
cout << "Warning: ShapeConstruct_ProjectCurveOnSurface::IsAnIsoparametric(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return Standard_False;
}
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxSurface Exception: try to decrease continuity ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
//szv: protection against loop
if(aCU == 0 && aCV == 0) break;
if(aCU > 0) aCU--;
return Standard_True;
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: GeomConvert_ApproxCurve Exception: Wrong Coefficient : Decrease continuity ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
continue;
}
}
return Standard_True;
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: Geom2dConvert_ApproxCurve Exception: Wrong Cofficient :Decrease Continuity ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
continue;
}
}
}
if (!Message_MsgFile::HasMsg ("ShapeFix.FixSmallSolid.MSG0"))
{
- Standard_ProgramError::Raise ("Critical Error - message resources for ShapeExtend are invalid or undefined!");
+ throw Standard_ProgramError("Critical Error - message resources for ShapeExtend are invalid or undefined!");
}
}
}
B.Range(edge, G3dCFirst, G3dCLast, Standard_True);
}
} // end try
- catch(Standard_Failure) {
- myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
-#ifdef OCCT_DEBUG //:s5
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+//:s5
cout << "Warning: ShapeFix_Edge::FixAddPCurve(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
}
myStatus |= ShapeExtend::EncodeStatus (ShapeExtend_DONE1);
return Standard_True;
if ( ! SP ) myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
}
}
- catch(Standard_Failure)
- {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\nWarning: ShapeFix_Edge: Exception in SameParameter: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
}
}
}
else return Standard_False;
} // end try
- catch(Standard_Failure) {
-#ifdef OCCT_DEBUG //:s5
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
+//:s5
cout << "Warning: ShapeFix_EdgeProjAux, FindParameterWithExt(): Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return Standard_False;
}
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
continue;
}
}
bsc3d.PerformInfinitePoint(Precision::Confusion());
infinstatus = bsc3d.State();
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
ShellSolid.Add(aShell,aSolid);
continue;
}
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 );
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Solid::SolidFromShell: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return solid;
}
return solid;
else tc = new Geom_TrimmedCurve(c,first,last);
bsp = GeomConvert::CurveToBSplineCurve(tc);
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Wire_1::FixGap3d: Exception in TrimmedCurve" <<first<<" " <<last<<endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
}
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Wire_1::FixGap3d: Exception in TrimmedCurve :"<<endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
c = new Geom2d_TrimmedCurve(pc,first,last);
bsp = Geom2dConvert::CurveToBSplineCurve(c);
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Wire_1::FixGap2d: Exception in TrimmedCurve2d" <<first<<" " <<last<<endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
}
}
- catch (Standard_Failure)
- {
-
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeFix_Wire_1::FixGap2d: Exception in TrimmedCurve2d :"<<endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
E3 = newedge;
return ReplaceFirst;
}
- catch ( Standard_Failure )
- {
+ catch ( Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout<<"Error: ShapeFix_Wireframe::FixSmallEdges: JoinEdges: Exception in GeomConvert_CompCurveToBSplineCurve: ";
- Standard_Failure::Caught()->Print(cout); cout<<endl;
+ anException.Print(cout); cout<<endl;
#endif
+ (void)anException;
return ReplaceFirst;
}
}
if ( op->Perform(context) )
isDone = Standard_True;
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
Message_Msg SMSG2 ("SP.Sequence.Error.Except"); //Operator %s failed with exception %s
- SMSG2 << oper << Standard_Failure::Caught()->GetMessageString();
+ SMSG2 << oper << anException.GetMessageString();
context->Messenger()->Send (SMSG2, Message_Alarm);
}
context->UnSetScope();
val = myRC->Integer (MakeName (myScope, param)->ToCString()) != 0;
return Standard_True;
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeProcess_Context::GetInteger(): " << param << ": ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return Standard_False;
}
OCC_CATCH_SIGNALS
return myRC->Value ( MakeName ( myScope, param )->ToCString() );
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeProcess_Context::GetInteger(): " << param << ": ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return def;
}
}
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return Standard_False;
}
}
Curve2d = theSegments2d->Value(1);
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return Standard_False;
}
}
Curve2dR = theSegments2d->Value(1);
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_FixSmallBezierCurve::Approx(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
return Standard_False;
}
}
}
}
}
- catch (Standard_Failure) {
- myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "\nError: Exception in ShapeUpgrade_FaceDivide::Perform(): ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_FAIL2 );
}
}
}
else if (myCurve->IsKind (STANDARD_TYPE (Geom2d_BezierCurve)))
Handle(Geom2d_BezierCurve)::DownCast(theNewCurve)->Segment (First, Last);
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_Split2dCurve::Build(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
theNewCurve = new Geom2d_TrimmedCurve(Handle(Geom2d_Curve)::DownCast(myCurve->Copy()),First,Last);
}
myResultingCurves->SetValue (1, theNewCurve);
Handle(Geom2d_BezierCurve)::DownCast(theNewCurve)->Segment (Firstt, Lastt);
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_Split2dCurve::Build(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
theNewCurve = new Geom2d_TrimmedCurve(Handle(Geom2d_Curve)::DownCast(myCurve->Copy()),Firstt,Lastt);
}
}
Handle(Geom_BezierCurve)::DownCast(theNewCurve)->Segment (Firstt, Lastt);
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_Split3dCurve::Build(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
theNewCurve = new Geom_TrimmedCurve(Handle(Geom_Curve)::DownCast(myCurve->Copy()),Firstt,Lastt);
}
}
}
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE3 );
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: ShapeUpgrade_SplitSurface::Build(): Exception in Segment :";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
Handle(Geom_Surface) theNewSurf = theNew;
theNew = new Geom_RectangularTrimmedSurface(theNewSurf,U1,U2,V1,V2);
}
#if !defined No_Exception && !defined No_Standard_AbortiveTransaction
#define Standard_AbortiveTransaction_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_AbortiveTransaction::Raise(MESSAGE);
+ if (CONDITION) throw Standard_AbortiveTransaction(MESSAGE);
#else
#define Standard_AbortiveTransaction_Raise_if(CONDITION, MESSAGE)
#endif
//! Raise exception (Standard_ProgramError) with the provided message
#define Standard_ASSERT_RAISE(theExpr, theDesc) \
- Standard_ASSERT(theExpr, theDesc, Standard_ProgramError::Raise( \
+ Standard_ASSERT(theExpr, theDesc, throw Standard_ProgramError( \
"*** ERROR: ASSERT in file '" __FILE__ "': \n" theDesc " (" #theExpr ")" ) )
//! Return from the current function with specified value (empty
#if !defined No_Exception && !defined No_Standard_ConstructionError
#define Standard_ConstructionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_ConstructionError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_ConstructionError(MESSAGE);
#else
#define Standard_ConstructionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_DimensionError
#define Standard_DimensionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_DimensionError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_DimensionError(MESSAGE);
#else
#define Standard_DimensionError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_DimensionMismatch
#define Standard_DimensionMismatch_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_DimensionMismatch::Raise(MESSAGE);
+ if (CONDITION) throw Standard_DimensionMismatch(MESSAGE);
#else
#define Standard_DimensionMismatch_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_DivideByZero
#define Standard_DivideByZero_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_DivideByZero::Raise(MESSAGE);
+ if (CONDITION) throw Standard_DivideByZero(MESSAGE);
#else
#define Standard_DivideByZero_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_DomainError
#define Standard_DomainError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_DomainError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_DomainError(MESSAGE);
#else
#define Standard_DomainError_Raise_if(CONDITION, MESSAGE)
#endif
return anActive;
}
-#if defined(NO_CXX_EXCEPTION) || defined(OCC_CONVERT_SIGNALS)
+#if defined(OCC_CONVERT_SIGNALS)
Standard_ErrorHandler::Callback::Callback ()
: myHandler(0), myPrev(0), myNext(0)
//!
//! The implementation is based on C long jumps.
//!
-//! If macro NO_CXX_EXCEPTION is defined, "try" and "catch" are defined as
-//! macros that use jumps to implement exception handling.
-//! See Standard_Failure::Reraise() for exception throwing code.
-//! Note that this option is obsolete and useless for modern platforms.
-//!
//! If macro OCC_CONVERT_SIGNALS is defined, this enables macro OCC_CATCH_SIGNALS
//! that can be used in the code (often inside try {} blocks) to convert C-style
//! signals to standard C++ exceptions. This works only when OSD::SetSignal()
//! signal handler, this OCC_CONVERT_SIGNALS is not needed. Note however that
//! this requires that compiler option /EHa is used.
-#ifdef NO_CXX_EXCEPTION
-
- // No CXX Exceeptions, only jumps in all the cases.
- //
- // Note: In the current version setjmp is used. The alternative solution is to
- // use sigsetjmp that stores the signal mask (to be checked)
- // In the original implementation sigsetjmp is tried to use for SUN and IRIX
- // in the following way:
- // #ifdef SOLARIS
- // #define DoesNotAbort(aHandler) !sigsetjmp(aHandler.Label(),1)
- // #endif
-
- #define try Standard_ErrorHandler _Function; \
- if(!setjmp(_Function.Label()))
- #define catch(Error) else if(_Function.Catches(STANDARD_TYPE(Error)))
- #define OCC_CATCH_SIGNALS
-
- // Suppress GCC warning "variable ... might be clobbered by 'longjmp' or 'vfork'"
- #if defined(__GNUC__) && ! defined(__INTEL_COMPILER) && ! defined(__clang__)
- #pragma GCC diagnostic ignored "-Wclobbered"
- #endif
-
-#elif defined(OCC_CONVERT_SIGNALS)
+#if defined(OCC_CONVERT_SIGNALS)
// Exceptions are raied as usual, signal cause jumps in the nearest
// OCC_CATCH_SIGNALS and then thrown as exceptions.
//! so as to be correctly destroyed when error handler is activated.
//!
//! Note that this is needed only when Open CASCADE is compiled with
- //! NO_CXX_EXCEPTION or OCC_CONVERT_SIGNALS options (i.e. on UNIX/Linux).
+ //! OCC_CONVERT_SIGNALS options (i.e. on UNIX/Linux).
//! In that case, raising OCC exception and/or signal will not cause
//! C++ stack unwinding and destruction of objects created in the stack.
//!
friend class Standard_Failure;
};
-// If neither NO_CXX_EXCEPTION nor OCC_CONVERT_SIGNALS is defined,
+// If OCC_CONVERT_SIGNALS is not defined,
// provide empty inline implementation
-#if ! defined(NO_CXX_EXCEPTION) && ! defined(OCC_CONVERT_SIGNALS)
+#if ! defined(OCC_CONVERT_SIGNALS)
inline Standard_ErrorHandler::Callback::Callback ()
: myHandler(0), myPrev(0), myNext(0)
{
// ******************************************************************
// Standard_Failure *
// ******************************************************************
-#ifndef NO_CXX_EXCEPTION
static Standard_THREADLOCAL Handle(Standard_Failure) RaisedError;
-#endif
+
// ------------------------------------------------------------------
//
// ------------------------------------------------------------------
// ------------------------------------------------------------------
Handle(Standard_Failure) Standard_Failure::Caught()
{
-#ifdef NO_CXX_EXCEPTION
- return Standard_ErrorHandler::LastCaughtError();
-#else
return RaisedError ;
-#endif
}
// ------------------------------------------------------------------
void Standard_Failure::Reraise ()
{
-#ifdef NO_CXX_EXCEPTION
- Standard_ErrorHandler::Error (this);
- Standard_ErrorHandler::Abort (this);
-#else
RaisedError = this;
Throw();
-#endif
}
void Standard_Failure::Jump()
{
-#if defined (NO_CXX_EXCEPTION) || defined (OCC_CONVERT_SIGNALS)
+#if defined (OCC_CONVERT_SIGNALS)
Standard_ErrorHandler::Error (this);
Standard_ErrorHandler::Abort (this);
#else
// ------------------------------------------------------------------
void Standard_Failure::Throw() const
{
-#ifndef NO_CXX_EXCEPTION
throw *this;
-#endif
}
// ------------------------------------------------------------------
//! Returns the last caught exception.
//! Needed when exceptions are emulated by C longjumps,
//! in other cases is also provided for compatibility.
+ Standard_DEPRECATED("This method is deprecated (not thread-safe), use standard C++ mechanism instead")
Standard_EXPORT static Handle(Standard_Failure) Caught();
return AStream;
}
+inline Standard_OStream& operator << (Standard_OStream& AStream,
+ const Standard_Failure& AFailure)
+{
+ AFailure.Print(AStream);
+ return AStream;
+}
+
#endif // _Standard_Failure_HeaderFile
{
char* tmpBuffer =(char*) aGuid;
- if(!CheckGUIDFormat(tmpBuffer)) Standard_RangeError::Raise("Invalid format of GUID");
+ if(!CheckGUIDFormat(tmpBuffer)) throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b2)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b1);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b2);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
tmpBuffer[i] = '\0';
- if(!CheckGUIDFormat(tmpBuffer)) Standard_RangeError::Raise("Invalid format of GUID");
+ if(!CheckGUIDFormat(tmpBuffer)) throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue32(tmpBuffer,my32b)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b1)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b2)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
if((tmpBuffer = Standard_GUID_GetValue16(tmpBuffer,my16b3)) == NULL)
- Standard_RangeError::Raise("Invalid format of GUID");
+ throw Standard_RangeError("Invalid format of GUID");
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b1);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b2);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
Standard_Integer Standard_GUID::Hash(const Standard_Integer Upper) const
{
if (Upper < 1){
- Standard_RangeError::
- Raise("Standard_GUID::Hash: Try to apply HashCode method with negative or null argument.");
+ throw Standard_RangeError("Standard_GUID::Hash: Try to apply HashCode method with negative or null argument.");
}
char sguid[Standard_GUID_SIZE_ALLOC];
#if !defined No_Exception && !defined No_Standard_ImmutableObject
#define Standard_ImmutableObject_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_ImmutableObject::Raise(MESSAGE);
+ if (CONDITION) throw Standard_ImmutableObject(MESSAGE);
#else
#define Standard_ImmutableObject_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_LicenseError
#define Standard_LicenseError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_LicenseError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_LicenseError(MESSAGE);
#else
#define Standard_LicenseError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_LicenseNotFound
#define Standard_LicenseNotFound_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_LicenseNotFound::Raise(MESSAGE);
+ if (CONDITION) throw Standard_LicenseNotFound(MESSAGE);
#else
#define Standard_LicenseNotFound_Raise_if(CONDITION, MESSAGE)
#endif
aBlock = (Standard_Size*)calloc(RoundSizeN+BLOCK_SHIFT, sizeof(Standard_Size));
// if still not succeeded, raise exception
if ( ! aBlock )
- Standard_OutOfMemory::Raise ("Standard_MMgrOpt::Allocate(): malloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrOpt::Allocate(): malloc failed");
}
// initialize new block header by its size
if ( Purge(Standard_False) )
goto retry;
// if nothing helps, raise exception
- Standard_OutOfMemory::Raise (strerror(errcode));
+ throw Standard_OutOfMemory(strerror(errcode));
}
// save actually allocated size into argument
char messageA[BUFSIZE];
WideCharToMultiByte(CP_UTF8, 0, message, -1, messageA, sizeof(messageA), NULL, NULL);
- Standard_OutOfMemory::Raise(messageA);
+ throw Standard_OutOfMemory(messageA);
}
// record map handle in the beginning
if ( Purge(Standard_False) )
goto retry;
// if nothing helps, raise exception
- Standard_OutOfMemory::Raise ("Standard_MMgrOpt::Allocate(): malloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrOpt::Allocate(): malloc failed");
}
}
// clear whole block if clearing option is set
Standard_Address aPtr = ( myClear ? calloc(aRoundSize, sizeof(char)) :
malloc(aRoundSize) );
if ( ! aPtr )
- Standard_OutOfMemory::Raise("Standard_MMgrRaw::Allocate(): malloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrRaw::Allocate(): malloc failed");
return aPtr;
}
const Standard_Size aRoundSize = (theSize + 3) & ~0x3;
Standard_Address newStorage = (Standard_Address)realloc(theStorage, aRoundSize);
if ( ! newStorage )
- Standard_OutOfMemory::Raise("Standard_MMgrRaw::Reallocate(): realloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrRaw::Reallocate(): realloc failed");
// Note that it is not possible to ensure that additional memory
// allocated by realloc will be cleared (so as to satisfy myClear mode);
// in order to do that we would need using memset...
Standard_Address aPtr = ( myClear ? scalable_calloc(aRoundSize, sizeof(char)) :
scalable_malloc(aRoundSize) );
if ( ! aPtr )
- Standard_OutOfMemory::Raise("Standard_MMgrTBBalloc::Allocate(): malloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrTBBalloc::Allocate(): malloc failed");
return aPtr;
}
const Standard_Size aRoundSize = (theSize + 3) & ~0x3;
Standard_Address newStorage = (Standard_Address)scalable_realloc(theStorage, aRoundSize);
if ( ! newStorage )
- Standard_OutOfMemory::Raise("Standard_MMgrTBBalloc::Reallocate(): realloc failed");
+ throw Standard_OutOfMemory("Standard_MMgrTBBalloc::Reallocate(): realloc failed");
// Note that it is not possible to ensure that additional memory
// allocated by realloc will be cleared (so as to satisfy myClear mode);
// in order to do that we would need using memset...
#if !defined No_Exception && !defined No_Standard_MultiplyDefined
#define Standard_MultiplyDefined_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_MultiplyDefined::Raise(MESSAGE);
+ if (CONDITION) throw Standard_MultiplyDefined(MESSAGE);
#else
#define Standard_MultiplyDefined_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NegativeValue
#define Standard_NegativeValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NegativeValue::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NegativeValue(MESSAGE);
#else
#define Standard_NegativeValue_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NoMoreObject
#define Standard_NoMoreObject_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NoMoreObject::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NoMoreObject(MESSAGE);
#else
#define Standard_NoMoreObject_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NoSuchObject
#define Standard_NoSuchObject_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NoSuchObject::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NoSuchObject(MESSAGE);
#else
#define Standard_NoSuchObject_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NotImplemented
#define Standard_NotImplemented_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NotImplemented::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NotImplemented(MESSAGE);
#else
#define Standard_NotImplemented_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NullObject
#define Standard_NullObject_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NullObject::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NullObject(MESSAGE);
#else
#define Standard_NullObject_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NullValue
#define Standard_NullValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NullValue::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NullValue(MESSAGE);
#else
#define Standard_NullValue_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_NumericError
#define Standard_NumericError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_NumericError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_NumericError(MESSAGE);
#else
#define Standard_NumericError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_OutOfMemory
#define Standard_OutOfMemory_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_OutOfMemory::Raise(MESSAGE);
+ if (CONDITION) throw Standard_OutOfMemory(MESSAGE);
#else
#define Standard_OutOfMemory_Raise_if(CONDITION, MESSAGE)
#endif
class Standard_OutOfMemory : public Standard_ProgramError
{
- void Throw () const Standard_OVERRIDE;
+ Standard_EXPORT void Throw () const Standard_OVERRIDE;
public:
#if !defined No_Exception && !defined No_Standard_OutOfRange
#define Standard_OutOfRange_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_OutOfRange::Raise(MESSAGE);
+ if (CONDITION) throw Standard_OutOfRange(MESSAGE);
#else
#define Standard_OutOfRange_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_Overflow
#define Standard_Overflow_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_Overflow::Raise(MESSAGE);
+ if (CONDITION) throw Standard_Overflow(MESSAGE);
#else
#define Standard_Overflow_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_ProgramError
#define Standard_ProgramError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_ProgramError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_ProgramError(MESSAGE);
#else
#define Standard_ProgramError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_RangeError
#define Standard_RangeError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_RangeError::Raise(MESSAGE);
+ if (CONDITION) throw Standard_RangeError(MESSAGE);
#else
#define Standard_RangeError_Raise_if(CONDITION, MESSAGE)
#endif
Standard_Integer HashCode(const Standard_Real me, const Standard_Integer Upper)
{
if (Upper < 1){
- Standard_RangeError::
- Raise("Try to apply HashCode method with negative or null argument.");
+ throw Standard_RangeError("Try to apply HashCode method with negative or null argument.");
}
union
{
Standard_Real ACos (const Standard_Real Value)
{
if ( (Value < -1.) || (Value > 1.) ){
- Standard_RangeError::Raise();
+ throw Standard_RangeError();
}
return acos(Value);
}
Standard_Real ASin (const Standard_Real Value)
{
if ( Value < -1 || Value > 1 ){
- Standard_RangeError::Raise();
+ throw Standard_RangeError();
}
return asin(Value);
}
Standard_Real ATan2 (const Standard_Real Value, const Standard_Real Other)
{
if ( Value == 0. && Other == 0. ){
- Standard_NullValue::Raise();
+ throw Standard_NullValue();
}
return atan2(Value,Other);
}
Standard_Real ATanh(const Standard_Real Value)
{
if ( (Value <= -1.) || (Value >= 1.) ){
- Standard_NumericError::Raise("Illegal agument in ATanh");
#ifdef OCCT_DEBUG
cout << "Illegal agument in ATanh" << endl ;
#endif
+ throw Standard_NumericError("Illegal agument in ATanh");
}
#if __QNX__
return std::atanh(Value);
Standard_Real ACosh (const Standard_Real Value)
{
if ( Value < 1. ){
- Standard_NumericError::Raise("Illegal agument in ACosh");
#ifdef OCCT_DEBUG
cout << "Illegal agument in ACosh" << endl ;
#endif
+ throw Standard_NumericError("Illegal agument in ACosh");
}
#if __QNX__
return std::acosh(Value);
Standard_Real Cosh (const Standard_Real Value)
{
if ( Abs(Value) > 0.71047586007394394e+03 ){
- Standard_NumericError::Raise("Result of Cosh exceeds the maximum value Standard_Real");
#ifdef OCCT_DEBUG
cout << "Result of Cosh exceeds the maximum value Standard_Real" << endl ;
#endif
+ throw Standard_NumericError("Result of Cosh exceeds the maximum value Standard_Real");
}
return cosh(Value);
}
Standard_Real Sinh (const Standard_Real Value)
{
if ( Abs(Value) > 0.71047586007394394e+03 ){
- Standard_NumericError::Raise("Result of Sinh exceeds the maximum value Standard_Real");
#ifdef OCCT_DEBUG
cout << "Result of Sinh exceeds the maximum value Standard_Real" << endl ;
#endif
+ throw Standard_NumericError("Result of Sinh exceeds the maximum value Standard_Real");
}
return sinh(Value);
}
//-------------------------------------------------------------------
Standard_Real Log (const Standard_Real Value)
{ if ( Value <= 0. ){
- Standard_NumericError::Raise("Illegal agument in Log");
#ifdef OCCT_DEBUG
cout << "Illegal agument in Log" << endl ;
#endif
+ throw Standard_NumericError("Illegal agument in Log");
}
return log(Value);
}
Standard_Real Sqrt (const Standard_Real Value)
{
if ( Value < 0. ){
- Standard_NumericError::Raise("Illegal agument in Sqrt");
#ifdef OCCT_DEBUG
cout << "Illegal agument in Sqrt" << endl ;
#endif
+ throw Standard_NumericError("Illegal agument in Sqrt");
}
return sqrt(Value);
}
Standard_Integer HashCode(const Standard_ShortReal me, const Standard_Integer Upper)
{
if (Upper < 1){
- Standard_RangeError::
- Raise("Try to apply HashCode method with negative or null argument.");
+ throw Standard_RangeError("Try to apply HashCode method with negative or null argument.");
}
union
{
#if !defined No_Exception && !defined No_Standard_TooManyUsers
#define Standard_TooManyUsers_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_TooManyUsers::Raise(MESSAGE);
+ if (CONDITION) throw Standard_TooManyUsers(MESSAGE);
#else
#define Standard_TooManyUsers_Raise_if(CONDITION, MESSAGE)
#endif
Standard_Transient* Standard_Transient::This() const
{
if (GetRefCount() == 0)
- Standard_ProgramError::Raise ("Attempt to create handle to object created in stack, not yet constructed, or destroyed");
+ throw Standard_ProgramError("Attempt to create handle to object created in stack, not yet constructed, or destroyed");
return const_cast<Standard_Transient*> (this);
}
#if !defined No_Exception && !defined No_Standard_TypeMismatch
#define Standard_TypeMismatch_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_TypeMismatch::Raise(MESSAGE);
+ if (CONDITION) throw Standard_TypeMismatch(MESSAGE);
#else
#define Standard_TypeMismatch_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Standard_Underflow
#define Standard_Underflow_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Standard_Underflow::Raise(MESSAGE);
+ if (CONDITION) throw Standard_Underflow(MESSAGE);
#else
#define Standard_Underflow_Raise_if(CONDITION, MESSAGE)
#endif
return model_rd;
}
- Standard_Failure::Raise ("StdDrivers : unknown GUID");
- return NULL;
+ throw Standard_Failure("StdDrivers : unknown GUID");
}
//=======================================================================
#if !defined No_Exception && !defined No_StdFail_InfiniteSolutions
#define StdFail_InfiniteSolutions_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) StdFail_InfiniteSolutions::Raise(MESSAGE);
+ if (CONDITION) throw StdFail_InfiniteSolutions(MESSAGE);
#else
#define StdFail_InfiniteSolutions_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_StdFail_NotDone
#define StdFail_NotDone_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) StdFail_NotDone::Raise(MESSAGE);
+ if (CONDITION) throw StdFail_NotDone(MESSAGE);
#else
#define StdFail_NotDone_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_StdFail_Undefined
#define StdFail_Undefined_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) StdFail_Undefined::Raise(MESSAGE);
+ if (CONDITION) throw StdFail_Undefined(MESSAGE);
#else
#define StdFail_Undefined_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_StdFail_UndefinedDerivative
#define StdFail_UndefinedDerivative_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) StdFail_UndefinedDerivative::Raise(MESSAGE);
+ if (CONDITION) throw StdFail_UndefinedDerivative(MESSAGE);
#else
#define StdFail_UndefinedDerivative_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_StdFail_UndefinedValue
#define StdFail_UndefinedValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) StdFail_UndefinedValue::Raise(MESSAGE);
+ if (CONDITION) throw StdFail_UndefinedValue(MESSAGE);
#else
#define StdFail_UndefinedValue_Raise_if(CONDITION, MESSAGE)
#endif
return model_rd;
}
- Standard_Failure::Raise ("StdLDrivers : unknown GUID");
- return NULL;
+ throw Standard_Failure("StdLDrivers : unknown GUID");
}
//=======================================================================
PCDM_ReadWriter::Open (*aFileDriver, theFileName, Storage_VSRead);
myReaderStatus = PCDM_RS_OK;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
myReaderStatus = PCDM_RS_OpenError;
Standard_SStream aMsg;
- aMsg << Standard_Failure::Caught() << endl;
- Standard_Failure::Raise (aMsg);
+ aMsg << anException << endl;
+ throw Standard_Failure(aMsg.str().c_str());
}
// Read header section
Standard_SStream aMsg;
aMsg << "could not find any document in this file" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
// Select instantiators for the used types
else aMsg << endl;
}
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
}
const Handle(CDM_Document)& /*theDoc*/,
const Handle(CDM_Application)& /*theApplication*/)
{
- Standard_NotImplemented::Raise ("Reading from stream is not supported by StdLDrivers_DocumentRetrievalDriver");
+ throw Standard_NotImplemented("Reading from stream is not supported by StdLDrivers_DocumentRetrievalDriver");
}
//=======================================================================
case Storage_VSAlreadyOpen:
myReaderStatus = PCDM_RS_OpenError;
aMsg << "Stream Open Error" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
case Storage_VSModeError:
myReaderStatus = PCDM_RS_WrongStreamMode;
aMsg << "Stream is opened with a wrong mode for operation" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
case Storage_VSSectionNotFound:
myReaderStatus = PCDM_RS_FormatFailure;
aMsg << "Section is not found" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
case Storage_VSFormatError:
myReaderStatus = PCDM_RS_FormatFailure;
aMsg << "Wrong format error" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
case Storage_VSUnknownType:
myReaderStatus = PCDM_RS_TypeFailure;
aMsg << "Try to read an unknown type" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
case Storage_VSTypeMismatch:
myReaderStatus = PCDM_RS_TypeFailure;
aMsg << "Try to read a wrong primitive type" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
default:
myReaderStatus = PCDM_RS_DriverFailure;
aMsg << "Retrieval Driver Failure" << endl;
- Standard_Failure::Raise (aMsg);
+ throw Standard_Failure(aMsg.str().c_str());
}
}
{
if (theImage.IsEmpty())
{
- Standard_ProgramError::Raise ("StdSelect_ViewerSelector3d::ToPixMap() has been called with empty image");
- return Standard_False;
+ throw Standard_ProgramError("StdSelect_ViewerSelector3d::ToPixMap() has been called with empty image");
}
Handle(BaseFiller) aFiller;
const StepData_Field& StepData_FieldList::Field (const Standard_Integer) const
{
- Standard_OutOfRange::Raise("StepData_FieldList : Field");
- return nulfild;
+ throw Standard_OutOfRange("StepData_FieldList : Field");
}
StepData_Field& StepData_FieldList::CField (const Standard_Integer)
{
- Standard_OutOfRange::Raise("StepData_FieldList : CField");
- return nulfild;
+ throw Standard_OutOfRange("StepData_FieldList : CField");
}
const StepData_Field& StepData_FieldList1::Field (const Standard_Integer num) const
{
- if (num != 1) Standard_OutOfRange::Raise("StepData_FieldList1 : Field");
+ if (num != 1) throw Standard_OutOfRange("StepData_FieldList1 : Field");
return thefield;
}
StepData_Field& StepData_FieldList1::CField (const Standard_Integer num)
{
- if (num != 1) Standard_OutOfRange::Raise("StepData_FieldList1 : CField");
+ if (num != 1) throw Standard_OutOfRange("StepData_FieldList1 : CField");
return thefield;
}
const StepData_Field& StepData_FieldListD::Field (const Standard_Integer num) const
{
- if (thefields.IsNull()) Standard_OutOfRange::Raise("StepData_FieldListD::Field");
+ if (thefields.IsNull()) throw Standard_OutOfRange("StepData_FieldListD::Field");
return thefields->Value(num);
}
StepData_Field& StepData_FieldListD::CField (const Standard_Integer num)
{
- if (thefields.IsNull()) Standard_OutOfRange::Raise("StepData_FieldListD::Field");
+ if (thefields.IsNull()) throw Standard_OutOfRange("StepData_FieldListD::Field");
return thefields->ChangeValue(num);
}
ent = Member(i);
if (ent->HasField (name)) return ent->Field (name);
}
- Interface_InterfaceMismatch::Raise("StepData_Plex : Field");
- return bid; // pour faire plaisir au compilo
+ throw Interface_InterfaceMismatch("StepData_Plex : Field");
}
ent = Member(i);
if (ent->HasField (name)) return ent->CField (name);
}
- Interface_InterfaceMismatch::Raise("StepData_Plex : Field");
- return bid; // pour faire plaisir au compilo
+ throw Interface_InterfaceMismatch("StepData_Plex : Field");
}
{
if (ent.IsNull()) thevalue.Nullify();
else if (!Matches(ent))
- Standard_TypeMismatch::Raise ("StepData : SelectType, SetValue");
+ throw Standard_TypeMismatch("StepData : SelectType, SetValue");
else thevalue = ent;
}
void StepData_SelectType::SetInt (const Standard_Integer val)
{
DeclareAndCast(StepData_SelectMember,sm,thevalue);
- if (sm.IsNull()) Standard_TypeMismatch::Raise ("StepData : SelectType, SetInt");
+ if (sm.IsNull()) throw Standard_TypeMismatch("StepData : SelectType, SetInt");
sm->SetInt (val);
}
DeclareAndCast(StepData_SelectMember,sm,thevalue);
if (!sm.IsNull()) {
if (name && name[0] != '\0')
- if (!sm->SetName(name)) Standard_TypeMismatch::Raise ("StepData : SelectType, SetInteger");
+ if (!sm->SetName(name)) throw Standard_TypeMismatch("StepData : SelectType, SetInteger");
}
else if (name && name[0] != '\0') {
Handle(StepData_SelectNamed) sn = new StepData_SelectNamed;
{
Handle(StepData_SelectMember) sm = SelectVal (thevalue,name,0);
sm->SetInteger (val);
- if (CaseMem (sm) == 0) Standard_TypeMismatch::Raise ("StepData : SelectType, SetInteger");
+ if (CaseMem (sm) == 0) throw Standard_TypeMismatch("StepData : SelectType, SetInteger");
thevalue = sm;
}
{
Handle(StepData_SelectMember) sm = SelectVal (thevalue,name,0);
sm->SetBoolean (val);
- if (CaseMem (sm) == 0) Standard_TypeMismatch::Raise ("StepData : SelectType, SetBoolean");
+ if (CaseMem (sm) == 0) throw Standard_TypeMismatch("StepData : SelectType, SetBoolean");
thevalue = sm;
}
{
Handle(StepData_SelectMember) sm = SelectVal (thevalue,name,0);
sm->SetLogical (val);
- if (CaseMem (sm) == 0) Standard_TypeMismatch::Raise ("StepData : SelectType, SetLogical");
+ if (CaseMem (sm) == 0) throw Standard_TypeMismatch("StepData : SelectType, SetLogical");
thevalue = sm;
}
{
Handle(StepData_SelectMember) sm = SelectVal (thevalue,name,1);
sm->SetReal (val);
- if (CaseMem (sm) == 0) Standard_TypeMismatch::Raise ("StepData : SelectType, SetReal");
+ if (CaseMem (sm) == 0) throw Standard_TypeMismatch("StepData : SelectType, SetReal");
thevalue = sm;
}
const StepData_Field& StepData_Simple::Field (const Standard_CString name) const
{
Standard_Integer num = ESDescr()->Rank (name);
- if (num == 0) Interface_InterfaceMismatch::Raise("StepData_Simple : Field");
+ if (num == 0) throw Interface_InterfaceMismatch("StepData_Simple : Field");
return FieldNum (num);
}
StepData_Field& StepData_Simple::CField (const Standard_CString name)
{
Standard_Integer num = ESDescr()->Rank (name);
- if (num == 0) Interface_InterfaceMismatch::Raise("StepData_Simple : Field");
+ if (num == 0) throw Interface_InterfaceMismatch("StepData_Simple : Field");
return CFieldNum (num);
}
stepdat->SetEntityNumbers(optim);
SetEntities();
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Handle(Message_Messenger) sout = Message::DefaultMessenger();
sout << " Exception Raised during Preparation :\n";
- sout << Standard_Failure::Caught()->GetMessageString();
+ sout << anException.GetMessageString();
sout << "\n Now, trying to continue, but with presomption of failure\n";
}
}
{
Standard_Integer nb = themodel->NbEntities();
if (numscope <= 0 || numscope > nb || numin <= 0 || numin > nb)
- Interface_InterfaceMismatch::Raise("StepWriter : SetScope, out of range");
+ throw Interface_InterfaceMismatch("StepWriter : SetScope, out of range");
if (thescopenext.IsNull()) {
thescopebeg = new TColStd_HArray1OfInteger (1,nb); thescopebeg->Init(0);
thescopeend = new TColStd_HArray1OfInteger (1,nb); thescopeend->Init(0);
cout << "StepWriter : SetScope (scope : " << numscope << " entity : "
<< numin << "), Entity already in a Scope"<<endl;
#endif
- Interface_InterfaceMismatch::Raise("StepWriter : SetScope, already set");
+ throw Interface_InterfaceMismatch("StepWriter : SetScope, already set");
}
thescopenext->SetValue(numin,-1); // nouvelle fin de scope
if (thescopebeg->Value(numscope) == 0) thescopebeg->SetValue(numscope,numin);
void StepData_StepWriter::SendData ()
{
- if (thesect) Interface_InterfaceMismatch::Raise("StepWriter : Data section");
+ if (thesect) throw Interface_InterfaceMismatch("StepWriter : Data section");
NewLine(Standard_False);
thefile->Append (new TCollection_HAsciiString("DATA;"));
thesect = Standard_True;
void StepData_StepWriter::EndFile ()
{
- if (thesect) Interface_InterfaceMismatch::Raise("StepWriter : EndFile");
+ if (thesect) throw Interface_InterfaceMismatch("StepWriter : EndFile");
NewLine(Standard_False);
thefile->Append (new TCollection_HAsciiString("END-ISO-10303-21;"));
thesect = Standard_False;
void StepData_StepWriter::SendComment(const Handle(TCollection_HAsciiString)& text)
{
- if (!thecomm) Interface_InterfaceMismatch::Raise("StepWriter : Comment");
+ if (!thecomm) throw Interface_InterfaceMismatch("StepWriter : Comment");
AddString(text->ToCString(),text->Length());
}
void StepData_StepWriter::SendComment (const Standard_CString text)
{
- if (!thecomm) Interface_InterfaceMismatch::Raise("StepWriter : Comment");
+ if (!thecomm) throw Interface_InterfaceMismatch("StepWriter : Comment");
AddString(text,(Standard_Integer) strlen(text));
}
{
if (atype.Length() == 0) return;
if (themult) {
- if (thelevel != 1) Interface_InterfaceMismatch::Raise
- ("StepWriter : StartEntity"); // decompte de parentheses mauvais ...
+ if (thelevel != 1) throw Interface_InterfaceMismatch("StepWriter : StartEntity"); // decompte de parentheses mauvais ...
AddString(textendlist);
AddString(" ",1); //skl 29.01.2003
}
char lident[20];
// Undefined ?
if (val.IsNull()) {
-// Interface_InterfaceMismatch::Raise("StepWriter : Sending Null Reference");
+// throw Interface_InterfaceMismatch("StepWriter : Sending Null Reference");
thechecks.CCheck(thenum)->AddFail("Null Reference");
SendUndef();
Comment(Standard_True);
Comment(Standard_True);
SendComment(" UNKNOWN REF ");
Comment(Standard_False);
-// Interface_InterfaceMismatch::Raise("StepWriter : Sending Unknown Reference");
+// throw Interface_InterfaceMismatch("StepWriter : Sending Unknown Reference");
}
}
// Cas normal : une bonne Entite, on envoie son Ident.
void StepData_StepWriter::EndEntity ()
{
- if (thelevel != 1) Interface_InterfaceMismatch::Raise
- ("StepWriter : EndEntity"); // decompte de parentheses mauvais ...
+ if (thelevel != 1) throw Interface_InterfaceMismatch("StepWriter : EndEntity"); // decompte de parentheses mauvais ...
AddString(textendent);
thelevel = 0; // on garde theindval : sera traite au prochain NewLine
Standard_Boolean indent = theindent; theindent = Standard_False;
void StepFile_CallFailure(char * const message)
{
- Standard_Failure::Raise(message);
+ throw Standard_Failure(message);
}
OCC_CATCH_SIGNALS
if (stepread () != 0) { lir_file_fin(3); stepread_endinput (newin,ficnom); return 1; }
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
sout << " ... Exception Raised while reading Step File : " << ficnom << ":\n" << endl;
- sout << Standard_Failure::Caught()->GetMessageString();
+ sout << anException.GetMessageString();
sout << " ..." << endl;
#endif
+ (void)anException;
lir_file_fin(3);
stepread_endinput (newin,ficnom);
return 1;
(const Handle(Interface_Protocol)& proto)
{
DeclareAndCast(StepData_Protocol,newproto,proto);
- if (newproto.IsNull()) Interface_InterfaceError::Raise("StepSelect_StepType");
+ if (newproto.IsNull()) throw Interface_InterfaceError("StepSelect_StepType");
theproto = newproto;
thelib.Clear();
thelib.AddProtocol (theproto);
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
+#ifdef OCCT_DEBUG
// ShapeTool_DB ?
-#ifdef OCCT_DEBUG //:s5
+//:s5
cout<<"Warning: MakeSurface: Exception:";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
return 0;
}
OCC_CATCH_SIGNALS
aGeomCrv = StepToGeom::MakeCurve (aCrv);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
Handle(Message_Messenger) sout = TP->Messenger();
sout<<"StepToTopoDS, GeometricSet, elem "<<i<<" of "<<nbElem<<": exception ";
- sout<<Standard_Failure::Caught()->GetMessageString() << endl;
+ sout<<anException.GetMessageString() << endl;
}
if ( ! aGeomCrv.IsNull() ) {
BRepBuilderAPI_MakeEdge anEdge(aGeomCrv, aGeomCrv->FirstParameter(), aGeomCrv->LastParameter());
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: StepToTopoDS_TranslateCompositeCurve: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
}
}
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Warning: StepToTopoDS_TranslateCompositeCurve: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
}
}
TP->AddWarning(C,"Could not convert a curve. Curve definition is incorrect");
}
}
- catch (Standard_Failure)
- {
- TP->AddFail(C,"Exeption was raised. Curve geometry definition is incorrect");
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- cout << "Warning: StepToTopoDS_TranslateEdgeLoop: Exception: ";
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ cout << "Warning: StepToTopoDS_TranslateEdgeLoop: Exception: ";
+ anException.Print(cout); cout << endl;
#endif
+ (void)anException;
+ TP->AddFail(C,"Exeption was raised. Curve geometry definition is incorrect");
}
}
myObjects.ChangeFind(aName)->SetObject(aPers);
}
else {
- Standard_NoSuchObject::Raise();
+ throw Standard_NoSuchObject();
}
}
#if !defined No_Exception && !defined No_Storage_StreamExtCharParityError
#define Storage_StreamExtCharParityError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamExtCharParityError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamExtCharParityError(MESSAGE);
#else
#define Storage_StreamExtCharParityError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamFormatError
#define Storage_StreamFormatError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamFormatError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamFormatError(MESSAGE);
#else
#define Storage_StreamFormatError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamModeError
#define Storage_StreamModeError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamModeError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamModeError(MESSAGE);
#else
#define Storage_StreamModeError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamReadError
#define Storage_StreamReadError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamReadError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamReadError(MESSAGE);
#else
#define Storage_StreamReadError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamTypeMismatchError
#define Storage_StreamTypeMismatchError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamTypeMismatchError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamTypeMismatchError(MESSAGE);
#else
#define Storage_StreamTypeMismatchError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamUnknownTypeError
#define Storage_StreamUnknownTypeError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamUnknownTypeError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamUnknownTypeError(MESSAGE);
#else
#define Storage_StreamUnknownTypeError_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Storage_StreamWriteError
#define Storage_StreamWriteError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Storage_StreamWriteError::Raise(MESSAGE);
+ if (CONDITION) throw Storage_StreamWriteError(MESSAGE);
#else
#define Storage_StreamWriteError_Raise_if(CONDITION, MESSAGE)
#endif
r = myPt.FindKey(aTypeNum);
}
else {
- Standard_NoSuchObject::Raise("Storage_TypeData::Type - aTypeNum not in range");
+ throw Standard_NoSuchObject("Storage_TypeData::Type - aTypeNum not in range");
}
return r;
r = myPt.FindFromKey(aTypeName);
}
else {
- Standard_NoSuchObject::Raise("Storage_TypeData::Type - aTypeName not found");
+ throw Standard_NoSuchObject("Storage_TypeData::Type - aTypeName not found");
}
return r;
myNumShape.Closed(),Standard_False,
Standard_False);
}
- else Standard_ConstructionError::Raise("inifinite Shape");
+ else throw Standard_ConstructionError("inifinite Shape");
}
return myNumShape;
}
myNumShape.Closed(),Standard_False,
Standard_False);
}
- else Standard_ConstructionError::Raise("inifinite Shape");
+ else throw Standard_ConstructionError("inifinite Shape");
}
return myNumShape;
}
// Modified by Sergey KHROMOV - Mon Feb 10 11:46:15 2003 End
myData = new Array2Item [Size];
- if (!myData) Standard_OutOfMemory::Raise("Array2 : Allocation failed");
+ if (!myData) throw Standard_OutOfMemory("Array2 : Allocation failed");
}
// allocation of the indirection table (pointers on rows)
mystring[mylength] = '\0';
}
else {
- Standard_NullObject::Raise("TCollection_AsciiString : parameter 'astring'");
+ throw Standard_NullObject("TCollection_AsciiString : parameter 'astring'");
}
}
mystring [ mylength ] = '\0' ;
}
else {
- Standard_NullObject::Raise("TCollection_AsciiString : parameter 'astring'");
+ throw Standard_NullObject("TCollection_AsciiString : parameter 'astring'");
}
}
}
}
else {
- Standard_NullObject::Raise("TCollection_AsciiString::Operator += parameter other");
+ throw Standard_NullObject("TCollection_AsciiString::Operator += parameter other");
}
}
RightJustify(Width,Filler);
}
else if (Width < 0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
}
if (mystring[i] == Set.mystring[j]) return i+1;
return 0;
}
- Standard_OutOfRange::Raise();
- return 0;
+ throw Standard_OutOfRange();
}
// ----------------------------------------------------------------------------
}
return 0;
}
- Standard_OutOfRange::Raise();
- return 0;
+ throw Standard_OutOfRange();
}
//----------------------------------------------------------------------------
void TCollection_AsciiString::Insert(const Standard_Integer where,
const Standard_Character what)
{
- if (where > mylength + 1 ) Standard_OutOfRange::Raise
- ("TCollection_AsciiString::Insert : Parameter where is too big");
- if (where < 1) Standard_OutOfRange::Raise
- ("TCollection_AsciiString::Insert : Parameter where is too small");
+ if (where > mylength + 1 ) throw Standard_OutOfRange("TCollection_AsciiString::Insert : Parameter where is too big");
+ if (where < 1) throw Standard_OutOfRange("TCollection_AsciiString::Insert : Parameter where is too small");
mystring = Reallocate (mystring, mylength + 2);
if (where != mylength +1) {
}
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::Insert : "
- "Parameter where is invalid");
+ throw Standard_OutOfRange("TCollection_AsciiString::Insert : "
+ "Parameter where is invalid");
}
}
}
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::Insert : "
- "Parameter where is too big");
+ throw Standard_OutOfRange("TCollection_AsciiString::Insert : "
+ "Parameter where is too big");
}
}
void TCollection_AsciiString::InsertAfter(const Standard_Integer Index,
const TCollection_AsciiString& what)
{
- if (Index < 0 || Index > mylength) Standard_OutOfRange::Raise();
+ if (Index < 0 || Index > mylength) throw Standard_OutOfRange();
Insert(Index+1,what);
}
void TCollection_AsciiString::InsertBefore(const Standard_Integer Index,
const TCollection_AsciiString& what)
{
- if (Index < 1 || Index > mylength) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > mylength) throw Standard_OutOfRange();
Insert(Index,what);
}
if (other) {
return ( strncmp( other, mystring, mylength+1 ) == 0 );
}
- Standard_NullObject::Raise("TCollection_AsciiString::Operator == "
+ throw Standard_NullObject("TCollection_AsciiString::Operator == "
"Parameter 'other'");
- return Standard_False;
}
// ----------------------------------------------------------------------------
if (other) {
return ( strncmp( other, mystring, mylength+1 ) != 0 );
}
- Standard_NullObject::Raise("TCollection_AsciiString::Operator != "
+ throw Standard_NullObject("TCollection_AsciiString::Operator != "
"Parameter 'other'");
- return Standard_False;
}
// ----------------------------------------------------------------------------
if (other) {
return ( strncmp( mystring, other, mylength+1 ) < 0 );
}
- Standard_NullObject::Raise("TCollection_AsciiString::Operator < "
- "Parameter 'other'");
- return Standard_False;
+ throw Standard_NullObject("TCollection_AsciiString::Operator < "
+ "Parameter 'other'");
}
// ----------------------------------------------------------------------------
if (other) {
return ( strncmp( mystring, other, mylength+1 ) > 0 );
}
- Standard_NullObject::Raise("TCollection_AsciiString::Operator > "
- "Parameter 'other'");
- return Standard_False;
+ throw Standard_NullObject("TCollection_AsciiString::Operator > "
+ "Parameter 'other'");
}
// ----------------------------------------------------------------------------
Standard_Integer value = (Standard_Integer)strtol(mystring,&ptr,10);
if (ptr != mystring) return value;
- Standard_NumericError::Raise("TCollection_AsciiString::IntegerValue");
- return 0;
+ throw Standard_NumericError("TCollection_AsciiString::IntegerValue");
}
// ----------------------------------------------------------------------------
mystring[mylength] = '\0';
}
else if (Width < 0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
}
}
return 0 ;
}
- Standard_OutOfRange::Raise();
- return 0 ;
+ throw Standard_OutOfRange();
}
//------------------------------------------------------------------------
if (Find) return l+2;
else return 0;
}
- Standard_OutOfRange::Raise();
- return 0;
+ throw Standard_OutOfRange();
}
// ----------------------------------------------------------------------------
Standard_Real value = Strtod(mystring,&ptr);
if (ptr != mystring) return value;
- Standard_NumericError::Raise("TCollection_AsciiString::RealValue");
- return value;
+ throw Standard_NumericError("TCollection_AsciiString::RealValue");
}
// ----------------------------------------------------------------------------
mystring[mylength] = '\0';
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::Remove: "
- "Too many characters to erase or invalid "
- "starting value.");
+ throw Standard_OutOfRange("TCollection_AsciiString::Remove: "
+ "Too many characters to erase or invalid "
+ "starting value.");
}
}
mystring[mylength] = '\0';
}
else if (Width < 0) {
- Standard_NegativeValue::Raise();
+ throw Standard_NegativeValue();
}
}
mystring[where-1] = what;
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
- "parameter where");
+ throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
+ "parameter where");
}
}
mystring[mylength] = '\0';
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
- "parameter where");
+ throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
+ "parameter where");
}
}
mystring[mylength] = '\0';
}
else {
- Standard_OutOfRange::Raise("TCollection_AsciiString::SetValue : "
- "parameter where");
+ throw Standard_OutOfRange("TCollection_AsciiString::SetValue : "
+ "parameter where");
}
}
Trunc(where);
return ;
}
- Standard_OutOfRange::Raise("TCollection_AsciiString::Split index");
+ throw Standard_OutOfRange("TCollection_AsciiString::Split index");
return ;
}
Trunc(where);
return res;
}
- Standard_OutOfRange::Raise("TCollection_AsciiString::Split index");
- TCollection_AsciiString res;
- return res;
+ throw Standard_OutOfRange("TCollection_AsciiString::Split index");
}
// ----------------------------------------------------------------------------
{
if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex )
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
Standard_Integer newlength = ToIndex-FromIndex+1;
res.mystring =Reallocate (res.mystring, newlength + 1);
strncpy( res.mystring, mystring + FromIndex - 1, newlength );
const Standard_Integer whichone) const
{
if (!separators)
- Standard_NullObject::Raise("TCollection_AsciiString::Token : "
- "parameter 'separators'");
+ throw Standard_NullObject("TCollection_AsciiString::Token : "
+ "parameter 'separators'");
Standard_Integer theOne ;
Standard_Integer StringIndex = 0 ;
void TCollection_AsciiString::Trunc(const Standard_Integer ahowmany)
{
if (ahowmany < 0 || ahowmany > mylength)
- Standard_OutOfRange::Raise("TCollection_AsciiString::Trunc : "
- "parameter 'ahowmany'");
+ throw Standard_OutOfRange("TCollection_AsciiString::Trunc : "
+ "parameter 'ahowmany'");
mylength = ahowmany;
mystring[mylength] = '\0';
}
if (where > 0 && where <= mylength) {
return mystring[where-1];
}
- Standard_OutOfRange::Raise("TCollection_AsciiString::Value : parameter where");
- return '\0';
+ throw Standard_OutOfRange("TCollection_AsciiString::Value : parameter where");
}
const Standard_Integer ToIndex) const
{
- if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex ) Standard_OutOfRange::Raise();
+ if (ToIndex > mylength || FromIndex <= 0 || FromIndex > ToIndex ) throw Standard_OutOfRange();
return TCollection_AsciiString( &mystring [ FromIndex - 1 ] ,
ToIndex - FromIndex + 1 ) ;
void TCollection_BaseSequence::PInsertAfter(const Standard_Integer Index, TCollection_BaseSequence& Other)
{
- if (Index < 0 || Index > Size) Standard_OutOfRange::Raise();
+ if (Index < 0 || Index > Size) throw Standard_OutOfRange();
if (Other.Size == 0) return;
if (Index == 0)
PPrepend( Other );
TCollection_BasicMap(Other.NbBuckets(),Standard_True)
{
if (!Other.IsEmpty())
- Standard_DomainError::Raise("TCollection:Copy of DataMap");
+ throw Standard_DomainError("TCollection:Copy of DataMap");
}
//=======================================================================
}
p = (TCollection_DataMapNode*) p->Next();
}
- Standard_NoSuchObject::Raise("TCollection_DataMap::Find");
- return p->Value();
+ throw Standard_NoSuchObject("TCollection_DataMap::Find");
}
//=======================================================================
//function : ChangeFind
}
p = (TCollection_DataMapNode*) p->Next();
}
- Standard_NoSuchObject::Raise("TCollection_DataMap::ChangeFind");
- return p->Value();
+ throw Standard_NoSuchObject("TCollection_DataMap::ChangeFind");
}
//modified by NIZNHY-PKV Tue Jul 05 09:54:14 2011f
//=======================================================================
TCollection_BasicMap(Other.NbBuckets(),Standard_False)
{
if (Other.Extent() != 0)
- Standard_DomainError::Raise("TCollection:Copy of DoubleMap");
+ throw Standard_DomainError("TCollection:Copy of DoubleMap");
}
//=======================================================================
p = data1[k1];
while (p) {
if (Hasher1::IsEqual(p->Key1(),K1))
- Standard_MultiplyDefined::Raise("DoubleMap:Bind");
+ throw Standard_MultiplyDefined("DoubleMap:Bind");
p = (TCollection_DoubleMapNode*) p->Next();
}
p = data2[k2];
while (p) {
if (Hasher2::IsEqual(p->Key2(),K2))
- Standard_MultiplyDefined::Raise("DoubleMap:Bind");
+ throw Standard_MultiplyDefined("DoubleMap:Bind");
p = (TCollection_DoubleMapNode*)p->Next2();
}
p = new TCollection_DoubleMapNode(K1,K2,data1[k1],data2[k2]);
if (Hasher1::IsEqual(p1->Key1(),K1)) return p1->Key2();
p1 = (TCollection_DoubleMapNode*) p1->Next();
}
- Standard_NoSuchObject::Raise("TCollection_DoubleMap::Find1");
+ throw Standard_NoSuchObject("TCollection_DoubleMap::Find1");
return p1->Key2();
}
if (Hasher2::IsEqual(p2->Key2(),K2)) return p2->Key1();
p2 = (TCollection_DoubleMapNode*)p2->Next2();
}
- Standard_NoSuchObject::Raise("TCollection_DoubleMap::Find2");
+ throw Standard_NoSuchObject("TCollection_DoubleMap::Find2");
return p2->Key1();
}
{
if (theString == NULL)
{
- Standard_NullObject::Raise ("TCollection_ExtendedString : null parameter ");
+ throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
if (isMultiByte)
{
if (theString == NULL)
{
- Standard_NullObject::Raise("TCollection_ExtendedString : null parameter ");
+ throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
for (mylength = 0; theString[mylength] != '\0'; ++mylength) {}
{
if (theStringUtf == NULL)
{
- Standard_NullObject::Raise ("TCollection_ExtendedString : null parameter ");
+ throw Standard_NullObject("TCollection_ExtendedString : null parameter ");
}
mystring = fromWideString<sizeof(Standard_WideChar)> (theStringUtf, mylength);
const Standard_ExtCharacter what)
{
if (where > mylength + 1 )
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
- "Parameter where is too big");
+ throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
+ "Parameter where is too big");
if (where < 0)
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
- "Parameter where is negative");
+ throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
+ "Parameter where is negative");
if (mystring != NULL)
{
}
}
else {
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Insert : "
- "Parameter where is too big");
+ throw Standard_OutOfRange("TCollection_ExtendedString::Insert : "
+ "Parameter where is too big");
}
}
mystring[mylength] = '\0';
}
else
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Remove: "
- "Too many characters to erase or "
- "invalid starting value.");
+ throw Standard_OutOfRange("TCollection_ExtendedString::Remove: "
+ "Too many characters to erase or "
+ "invalid starting value.");
}
// ----------------------------------------------------------------------------
mystring[where-1] = what;
}
else {
- Standard_OutOfRange::Raise("TCollection_ExtendedString::SetValue : parameter where");
+ throw Standard_OutOfRange("TCollection_ExtendedString::SetValue : parameter where");
}
}
mystring[mylength] = '\0';
}
else
- Standard_OutOfRange::Raise("TCollection_ExtendedString::SetValue : "
- "parameter where");
+ throw Standard_OutOfRange("TCollection_ExtendedString::SetValue : "
+ "parameter where");
}
// ----------------------------------------------------------------------------
Trunc(where);
return res;
}
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Split index");
- TCollection_ExtendedString res;
- return res;
+ throw Standard_OutOfRange("TCollection_ExtendedString::Split index");
}
// ----------------------------------------------------------------------------
{
TCollection_ExtendedString res;
if (!separators)
- Standard_NullObject::Raise("TCollection_ExtendedString::Token : "
- "parameter 'separators'");
+ throw Standard_NullObject("TCollection_ExtendedString::Token : "
+ "parameter 'separators'");
int i,j,k,l;
Standard_PExtCharacter buftmp = allocateExtChars (mylength);
void TCollection_ExtendedString::Trunc(const Standard_Integer ahowmany)
{
if (ahowmany < 0 || ahowmany > mylength)
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Trunc : "
- "parameter 'ahowmany'");
+ throw Standard_OutOfRange("TCollection_ExtendedString::Trunc : "
+ "parameter 'ahowmany'");
mylength = ahowmany;
mystring[mylength] = '\0';
}
if(mystring) return mystring[where-1];
else return 0;
}
- Standard_OutOfRange::Raise("TCollection_ExtendedString::Value : "
- "parameter where");
- return 0;
+ throw Standard_OutOfRange("TCollection_ExtendedString::Value : "
+ "parameter where");
}
(const Standard_Integer Width ,
const Standard_Character Filler)
{
- if (Width < 0) Standard_NegativeValue::Raise();
+ if (Width < 0) throw Standard_NegativeValue();
myString.Center(Width,Filler);
}
{
if (Length() == 0 || Set->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return (myString.FirstLocationInSet(Set->String(),FromIndex,ToIndex));
}
{
if (Length() == 0 || Set->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return (myString.FirstLocationNotInSet(Set->String(),FromIndex,ToIndex));
}
{
Standard_Integer size1 = Length();
#ifndef NOBOUNDCHECK
- if (Index < 0 || Index > size1) Standard_OutOfRange::Raise();
+ if (Index < 0 || Index > size1) throw Standard_OutOfRange();
#endif
myString.InsertAfter(Index,S->String());
}
{
Standard_Integer size1 = Length();
#ifndef NOBOUNDCHECK
- if (Index < 1 || Index > size1) Standard_OutOfRange::Raise();
+ if (Index < 1 || Index > size1) throw Standard_OutOfRange();
#endif
myString.InsertBefore(Index,S->String());
}
Standard_Boolean TCollection_HAsciiString::IsDifferent
(const Handle(TCollection_HAsciiString)& S) const
{
- if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsDifferent");
+ if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsDifferent");
if(S->Length() != myString.Length() ) return Standard_True;
return ( strncmp( myString.ToCString(), S->ToCString(), myString.Length() ) != 0 );
}
Standard_Boolean TCollection_HAsciiString::IsSameString
(const Handle(TCollection_HAsciiString)& S) const
{
- if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsSameString");
+ if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsSameString");
if ( myString.Length() == S->Length() )
return ( strncmp( myString.ToCString(), S->ToCString(), myString.Length() ) == 0 );
else
(const Handle(TCollection_HAsciiString)& S ,
const Standard_Boolean CaseSensitive) const
{
- if(S.IsNull()) Standard_NullObject::Raise("TCollection_HAsciiString::IsSameString");
+ if(S.IsNull()) throw Standard_NullObject("TCollection_HAsciiString::IsSameString");
return TCollection_AsciiString::IsSameString (myString, S->myString, CaseSensitive);
}
void TCollection_HAsciiString::LeftJustify
(const Standard_Integer Width, const Standard_Character Filler)
{
- if (Width < 0) Standard_NegativeValue::Raise();
+ if (Width < 0) throw Standard_NegativeValue();
myString.LeftJustify(Width,Filler);
}
const Standard_Integer FromIndex, const Standard_Integer ToIndex) const
{
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return myString.Location(N,C,FromIndex,ToIndex);
}
{
if (Length() == 0 || S->Length() == 0) return 0;
if (ToIndex > Length() || FromIndex <= 0 || FromIndex > ToIndex )
- Standard_OutOfRange::Raise();
+ throw Standard_OutOfRange();
return myString.Location(S->String(),FromIndex,ToIndex);
}
void TCollection_HAsciiString::RightJustify
(const Standard_Integer Width, const Standard_Character Filler)
{
- if (Width < 0) Standard_NegativeValue::Raise();
+ if (Width < 0) throw Standard_NegativeValue();
myString.RightJustify(Width,Filler);
}
TCollection_BasicMap(Other.NbBuckets(),Standard_False)
{
if (Other.Extent() != 0)
- Standard_DomainError::Raise("TCollection:Copy of non empty IndexedDataMap");
+ throw Standard_DomainError("TCollection:Copy of non empty IndexedDataMap");
}
//=======================================================================
while (p) {
if (Hasher::IsEqual(p->Key1(),K1)) {
if (p->Key2() != I)
- Standard_DomainError::Raise("IndexedDataMap::Substitute : "
- "Attempt to substitute existing key");
+ throw Standard_DomainError("IndexedDataMap::Substitute : "
+ "Attempt to substitute existing key");
p->Key1() = K1;
p->Value() = T;
return;
if (p2->Key2() == K2) return p2->Key1();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
- Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
+ throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Key1();
}
if (p2->Key2() == K2) return p2->Value();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
- Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
+ throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Value();
}
if (p2->Key2() == K2) return p2->Value();
p2 = (TCollection_IndexedDataMapNode*)p2->Next2();
}
- Standard_OutOfRange::Raise("IndexedDataMap : missing index !!!");
+ throw Standard_OutOfRange("IndexedDataMap : missing index !!!");
return p2->Value();
}
if (Hasher::IsEqual(p1->Key1(),K1)) return p1->Value();
p1 = (TCollection_IndexedDataMapNode*) p1->Next();
}
- Standard_OutOfRange::Raise("TCollection_IndexedDataMap::FindFromKey");
+ throw Standard_OutOfRange("TCollection_IndexedDataMap::FindFromKey");
return p1->Value();
}
//=======================================================================
if (Hasher::IsEqual(p1->Key1(),K1)) return p1->Value();
p1 = (TCollection_IndexedDataMapNode*)p1->Next();
}
- Standard_OutOfRange::Raise("TCollection_IndexedDataMap::ChangeFromKey");
+ throw Standard_OutOfRange("TCollection_IndexedDataMap::ChangeFromKey");
return p1->Value();
}
//modified by NIZNHY-PKV Tue Jul 05 08:37:03 2011f
while (p) {
if (Hasher::IsEqual(p->Key1(),K1)) {
if (p->Key2() != I)
- Standard_DomainError::Raise("IndexedMap::Substitute : "
- "Attempt to substitute existing key");
+ throw Standard_DomainError("IndexedMap::Substitute : "
+ "Attempt to substitute existing key");
p->Key1() = K1;
return;
}
if (p2->Key2() == K2) return p2->Key1();
p2 = (TCollection_IndexedMapNode*)p2->Next2();
}
- Standard_OutOfRange::Raise("IndexedMap : missing index !!!");
+ throw Standard_OutOfRange("IndexedMap : missing index !!!");
return p2->Key1();
}
if (IsForgotten()) return myTransaction;
else if (IsBackuped()) return myNext->myTransaction - 1;
else if (IsValid()) return myLabelNode->Data()->Transaction();
- Standard_DomainError::Raise("The attribute structure is wrong.");
- return 0;
+ throw Standard_DomainError("The attribute structure is wrong.");
}
aMess = "Attribute \"";
aMess += DynamicType()->Name();
aMess += "\" is changed outside transaction";
- Standard_ImmutableObject::Raise(aMess.ToCString());
+ throw Standard_ImmutableObject(aMess.ToCString());
}
const Standard_Integer currentTransaction =
{
#ifdef OCCT_DEBUG
if (myBackup.IsNull())
- Standard_DomainError::Raise("Impossible to remove a nonexistent backup.");
+ throw Standard_DomainError("Impossible to remove a nonexistent backup.");
#endif
myBackup->BeforeRemoval();
myBackup->myLabelNode = NULL; // Absolutly necessary!
if (tAtt->IsInstance(sAtt->DynamicType()))
aAttMap.Bind(sAtt,tAtt);
else
- Standard_TypeMismatch::Raise
- ("TDF_CopyTool: Cannot paste to a different type attribute.");
+ throw Standard_TypeMismatch("TDF_CopyTool: Cannot paste to a different type attribute.");
}
}
}
cout<<"AttributeDelta type = "<<itr.Value()->DynamicType()->Name();
cout<<" Attribute type = "<<itr.Value()->Attribute()->DynamicType()->Name()<<endl;;
if (before)
- Standard_ConstructionError::Raise("BeforeUndo(): dead lock.");
+ cout<<"BeforeUndo(): dead lock."<<endl;
else
- Standard_ConstructionError::Raise("AfterUndo(): dead lock.");
+ cout<<"AfterUndo(): dead lock."<<endl;
}
#endif
for (itr.Initialize(ADlist); itr.More(); itr.Next()) {
//=======================================================================
void TDF_Label::Imported(const Standard_Boolean aStatus) const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no status.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no status.");
if (myLabelNode->IsImported() != aStatus) {
myLabelNode->Imported(aStatus);
for (TDF_ChildIterator itr(*this, Standard_True);
(const Standard_GUID& anID,
Handle(TDF_Attribute)& anAttribute) const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no attribute.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no attribute.");
TDF_AttributeIterator itr (myLabelNode); // Without removed attributes.
for ( ; itr.More(); itr.Next()) {
if (itr.Value()->ID() == anID) {
Standard_Integer TDF_Label::Depth() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no depth.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no depth.");
return myLabelNode->Depth();
}
TDF_LabelNode* lp2 = myLabelNode;
#ifdef OCCT_DEBUG
if ((lp1 == NULL) || (lp2 == NULL))
- Standard_NullObject::Raise("A null label has no ancestor nor descendant.");
+ throw Standard_NullObject("A null label has no ancestor nor descendant.");
#endif
if ((lp1 != NULL) && (lp2 != NULL)) {
const Standard_Integer d1 = lp1->Depth();
const TDF_Label TDF_Label::Root() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no root.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no root.");
return myLabelNode->RootNode();
}
Standard_Integer TDF_Label::NbChildren() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no children.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no children.");
Standard_Integer n = 0;
if (myLabelNode->FirstChild() != NULL)
for (TDF_ChildIterator itr(*this); itr.More(); itr.Next()) ++n;
const Standard_Boolean create) const
{
if (IsNull())
- Standard_NullObject::Raise("A null Label has no child.");
+ throw Standard_NullObject("A null Label has no child.");
if (create && ((Depth()+1) & TDF_LabelNodeFlagsMsk))
- Standard_OutOfRange::Raise("Depth value out of range");
+ throw Standard_OutOfRange("Depth value out of range");
return FindOrAddChild(aTag,create);
}
Standard_Boolean TDF_Label::HasAttribute() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no attribute.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no attribute.");
if (!myLabelNode->FirstAttribute().IsNull()) {
TDF_AttributeIterator itr (myLabelNode); // Without removed attributes.
Standard_Integer TDF_Label::NbAttributes() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no attribute.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no attribute.");
Standard_Integer n = 0;
if (!myLabelNode->FirstAttribute().IsNull())
for (TDF_AttributeIterator itr (myLabelNode); itr.More(); itr.Next()) ++n;
Standard_Integer TDF_Label::Transaction() const
{
- if (IsNull()) Standard_NullObject::Raise("A null Label has no transaction.");
+ if (IsNull()) throw Standard_NullObject("A null Label has no transaction.");
return myLabelNode->Data()->Transaction();
}
aMess = "Attribute \"";
aMess += anAttribute->DynamicType()->Name();
aMess += "\" is added to label outside transaction";
- Standard_ImmutableObject::Raise(aMess.ToCString());
+ throw Standard_ImmutableObject(aMess.ToCString());
}
if (!anAttribute->Label().IsNull())
- Standard_DomainError::Raise("Attribute to add is already attached to a label.");
+ throw Standard_DomainError("Attribute to add is already attached to a label.");
Handle(TDF_Attribute) dummyAtt;
//if (Find(anAttribute->ID(),dummyAtt))
if (FindAttribute(anAttribute->ID(),dummyAtt))
- Standard_DomainError::Raise("This label has already such an attribute.");
+ throw Standard_DomainError("This label has already such an attribute.");
anAttribute->myTransaction = toNode->Data()->Transaction(); /// myData->Transaction();
anAttribute->mySavedTransaction = 0;
aMess = "Attribute \"";
aMess += anAttribute->DynamicType()->Name();
aMess += "\" is removed from label outside transaction";
- Standard_ImmutableObject::Raise(aMess.ToCString());
+ throw Standard_ImmutableObject(aMess.ToCString());
}
if (fromNode != anAttribute->Label().myLabelNode)
- Standard_DomainError::Raise
- ("Attribute to forget not attached to my label.");
+ throw Standard_DomainError("Attribute to forget not attached to my label.");
Standard_Integer curTrans = fromNode->Data()->Transaction();
if (!anAttribute->IsForgotten()) {
const Handle(TDF_Attribute)& anAttribute) const
{
if (anAttribute.IsNull())
- Standard_NullObject::Raise("The attribute is a null handle.");
+ throw Standard_NullObject("The attribute is a null handle.");
if (!anAttribute->Label().IsNull())
- Standard_NullObject::Raise
- ("Cannot resume an attribute already attached to a label.");
+ throw Standard_NullObject("Cannot resume an attribute already attached to a label.");
if (!anAttribute->IsForgotten())
- Standard_DomainError::Raise
- ("Cannot resume an unforgotten attribute.");
+ throw Standard_DomainError("Cannot resume an unforgotten attribute.");
AddToNode(toNode, anAttribute); // vro
anAttribute->Resume();
cout<<"Transaction "<<myName<<" opens #"<<myDF->Transaction()+1<<endl;
#endif
if (IsOpen())
- Standard_DomainError::Raise("This transaction is already open.");
+ throw Standard_DomainError("This transaction is already open.");
if (myDF.IsNull())
- Standard_NullObject::Raise("Null TDF_Data.");
+ throw Standard_NullObject("Null TDF_Data.");
return myUntilTransaction = myDF->OpenTransaction();
}
// TDF_Label current;
Handle(TDataStd_Current) A;
if (!access.Data()->Root().FindAttribute (TDataStd_Current::GetID(), A)) {
- Standard_DomainError::Raise("TDataStd_Current::Get : not setted");
+ throw Standard_DomainError("TDataStd_Current::Get : not setted");
}
return A->GetLabel();
}
Handle(TDataStd_Directory) TDataStd_Directory::New (const TDF_Label& L)
{
if (L.HasAttribute()) {
- Standard_DomainError::Raise("TDataStd_Directory::New : not an empty label");
+ throw Standard_DomainError("TDataStd_Directory::New : not an empty label");
}
Handle(TDataStd_Directory) A = new TDataStd_Directory ();
L.AddAttribute(A);
Handle(TDataStd_NoteBook) TDataStd_NoteBook::New (const TDF_Label& label)
{
if (label.HasAttribute()) {
- Standard_DomainError::Raise("TDataStd_NoteBook::New : not an empty label");
+ throw Standard_DomainError("TDataStd_NoteBook::New : not an empty label");
}
Handle(TDataStd_NoteBook) NB = new TDataStd_NoteBook ();
label.AddAttribute(NB);
Standard_Boolean TDataStd_TreeNode::Append (const Handle(TDataStd_TreeNode)& TN)
{
if (!(TN->ID() == myTreeID) )
- Standard_DomainError::Raise("TDataStd_TreeNode::Append : uncompatible GUID");
+ throw Standard_DomainError("TDataStd_TreeNode::Append : uncompatible GUID");
Handle(TDataStd_TreeNode) bid;
TN->SetNext(bid); // Deconnects from next.
Standard_Boolean TDataStd_TreeNode::Prepend (const Handle(TDataStd_TreeNode)& TN)
{
if (!(TN->ID() == myTreeID) )
- Standard_DomainError::Raise("TDataStd_TreeNode::Prepend : uncompatible GUID");
+ throw Standard_DomainError("TDataStd_TreeNode::Prepend : uncompatible GUID");
Handle(TDataStd_TreeNode) bid;
TN->SetPrevious(bid);
Standard_Boolean TDataStd_TreeNode::InsertBefore (const Handle(TDataStd_TreeNode)& TN)
{
if (!(TN->ID() == myTreeID) )
- Standard_DomainError::Raise("TDataStd_TreeNode::InsertBefore : uncompatible GUID");
+ throw Standard_DomainError("TDataStd_TreeNode::InsertBefore : uncompatible GUID");
TN->SetFather(Father());
TN->SetPrevious(Previous());
Standard_Boolean TDataStd_TreeNode::InsertAfter (const Handle(TDataStd_TreeNode)& TN)
{
if (!(TN->ID() == myTreeID) )
- Standard_DomainError::Raise("TDataStd_TreeNode::InsertAfter : uncompatible GUID");
+ throw Standard_DomainError("TDataStd_TreeNode::InsertAfter : uncompatible GUID");
if (HasFather() && !HasNext())
Father()->SetLast(TN);
{
Handle(TDataStd_Name) N;
if (!Label().FindAttribute(TDataStd_Name::GetID(),N)) {
- Standard_DomainError::Raise("TDataStd_Variable::Name : invalid model");
+ throw Standard_DomainError("TDataStd_Variable::Name : invalid model");
}
return N->Get();
}
{
Handle(TDataStd_Real) R;
if (!Label().FindAttribute(TDataStd_Real::GetID(),R)) {
- Standard_DomainError::Raise("TDataStd_Variable::Real : invalid model");
+ throw Standard_DomainError("TDataStd_Variable::Real : invalid model");
}
return R;
}
{
Handle(TDataStd_Real) R;
if (!Label().FindAttribute(TDataStd_Real::GetID(),R)) {
- Standard_DomainError::Raise("TDataStd_Variable::Get : invalid model");
+ throw Standard_DomainError("TDataStd_Variable::Get : invalid model");
}
return R->Get();
}
{
Handle(TDataStd_Expression) E;
if (!Label().FindAttribute(TDataStd_Expression::GetID(),E)) {
- Standard_DomainError::Raise("TDataStd_Variable::Deassign");
+ throw Standard_DomainError("TDataStd_Variable::Deassign");
}
Label().ForgetAttribute(E);
}
{
Handle(TDataStd_Expression) E;
if (!Label().FindAttribute(TDataStd_Expression::GetID(),E)) {
- Standard_DomainError::Raise("TDataStd_Variable::GetExpression");
+ throw Standard_DomainError("TDataStd_Variable::GetExpression");
}
return E;
}
}
#ifdef OCCT_DEBUG
else {
- Standard_Failure::Raise("curve Null dans TDataXtd_Geometry");
+ throw Standard_Failure("curve Null dans TDataXtd_Geometry");
}
#endif
}
}
#ifdef OCCT_DEBUG
else {
- Standard_Failure::Raise("surface Null dans TDataXtd_Geometry");
+ throw Standard_Failure("surface Null dans TDataXtd_Geometry");
}
#endif
break;
Handle(TDataXtd_Shape) TDataXtd_Shape::New (const TDF_Label& label)
{
if (label.HasAttribute()) {
- Standard_DomainError::Raise("TDataXtd_Shape::New : not an empty label");
+ throw Standard_DomainError("TDataXtd_Shape::New : not an empty label");
}
Handle(TDataXtd_Shape) A = new TDataXtd_Shape ();
label.AddAttribute(A);
Standard_Integer TDocStd_Application::NbDocuments() const
{
if (!CDF_Session::Exists())
- Standard_DomainError::Raise("TDocStd_Application::NbDocuments");
+ throw Standard_DomainError("TDocStd_Application::NbDocuments");
Handle(CDF_Session) S = CDF_Session::CurrentSession();
return S->Directory()->Length();
}
void TDocStd_Application::GetDocument(const Standard_Integer index,Handle(TDocStd_Document)& aDoc) const
{
if (!CDF_Session::Exists())
- Standard_DomainError::Raise("TDocStd_Application::NbDocuments");
+ throw Standard_DomainError("TDocStd_Application::NbDocuments");
Handle(CDF_Session) S = CDF_Session::CurrentSession();
CDF_DirectoryIterator it (S->Directory());
Standard_Integer current = 0;
CDF_Application::Open(D);
aDoc = D;
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
// status = GetRetrieveStatus();
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
+ if (!MessageDriver().IsNull()) {
// Standard_SStream aMsg;
// aMsg << Standard_Failure::Caught() << endl;
// cout << "TDocStd_Application::Open(): " << aMsg.rdbuf()->str() << endl;
- TCollection_ExtendedString aString (F->GetMessageString());
+ TCollection_ExtendedString aString (anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
theDoc = D;
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
- if (!aFailure.IsNull() && !MessageDriver().IsNull())
+ if (!MessageDriver().IsNull())
{
- TCollection_ExtendedString aFailureMessage (aFailure->GetMessageString());
+ TCollection_ExtendedString aFailureMessage (anException.GetMessageString());
MessageDriver()->Write (aFailureMessage.ToExtString());
}
}
OCC_CATCH_SIGNALS
storer.Realize();
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
+ catch (Standard_Failure const& anException) {
+ if (!MessageDriver().IsNull()) {
+ TCollection_ExtendedString aString (anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
return aDocStorageDriver->GetStoreStatus();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
- if (!aFailure.IsNull() && !MessageDriver().IsNull())
+ if (!MessageDriver().IsNull())
{
- TCollection_ExtendedString aString(aFailure->GetMessageString());
+ TCollection_ExtendedString aString(anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
OCC_CATCH_SIGNALS
storer.Realize();
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
+ catch (Standard_Failure const& anException) {
+ if (!MessageDriver().IsNull()) {
+ TCollection_ExtendedString aString (anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
OCC_CATCH_SIGNALS
storer.Realize();
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
+ catch (Standard_Failure const& anException) {
+ if (!MessageDriver().IsNull()) {
+ TCollection_ExtendedString aString (anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
return aDocStorageDriver->GetStoreStatus();
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
- if (!aFailure.IsNull() && !MessageDriver().IsNull())
+ if (!MessageDriver().IsNull())
{
- TCollection_ExtendedString aString(aFailure->GetMessageString());
+ TCollection_ExtendedString aString(anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
OCC_CATCH_SIGNALS
storer.Realize();
}
- catch (Standard_Failure) {
- Handle(Standard_Failure) F = Standard_Failure::Caught();
- if (!F.IsNull() && !MessageDriver().IsNull()) {
- TCollection_ExtendedString aString (F->GetMessageString());
+ catch (Standard_Failure const& anException) {
+ if (!MessageDriver().IsNull()) {
+ TCollection_ExtendedString aString (anException.GetMessageString());
MessageDriver()->Write(aString.ToExtString());
}
}
{
#ifdef OCCT_DEBUG_TRANS
if (myUndoTransaction.IsOpen() && myData->Transaction() > 1) {
- Standard_DomainError::Raise ("NewCommand : many open transactions");
+ throw Standard_DomainError("NewCommand : many open transactions");
}
#endif
void TDocStd_Document::OpenCommand ()
{
if (!myIsNestedTransactionMode && myUndoTransaction.IsOpen()) {
- Standard_DomainError::Raise("TDocStd_Document::OpenCommand : already open");
+ throw Standard_DomainError("TDocStd_Document::OpenCommand : already open");
}
OpenTransaction();
// if (myUndoLimit != 0) myUndoTransaction.Open();
{
Handle(TDocStd_Modified) MDF;
if (!access.Root().FindAttribute (TDocStd_Modified::GetID(), MDF)) {
- Standard_DomainError::Raise("TDocStd_Modified::Get : IsEmpty");
+ throw Standard_DomainError("TDocStd_Modified::Get : IsEmpty");
}
return MDF->Get();
}
"Can't start new application transaction while a "
"previous one is not commited or aborted" << endl;
#endif
- Standard_Failure::Raise("Can't start new application transaction"
+ throw Standard_Failure("Can't start new application transaction"
"while a previous one is not commited or aborted");
}
myOpenTransaction = Standard_True;
indata->Root().AddAttribute(A);
}
else {
- Standard_DomainError::Raise("TDocStd_Owner::SetDocument : already called");
+ throw Standard_DomainError("TDocStd_Owner::SetDocument : already called");
}
}
{
Handle(TDocStd_Owner) A;
if (!ofdata->Root().FindAttribute (TDocStd_Owner::GetID(), A)) {
- Standard_DomainError::Raise("TDocStd_Owner::GetDocument : document not found");
+ throw Standard_DomainError("TDocStd_Owner::GetDocument : document not found");
}
return A->GetDocument();
}
void TDocStd_XLinkIterator::Next()
{
- if (myValue == NULL) Standard_NoMoreObject::Raise("");
+ if (myValue == NULL) throw Standard_NoMoreObject("");
else myValue = myValue->Next();
}
SOURCE = TDocStd_Document::Get(source);
if (TARGET != SOURCE) {
if (!TDF_Tool::IsSelfContained(source)) {
- Standard_DomainError::Raise("TDocStd_XLinkTool::Copy : not self-contained");
+ throw Standard_DomainError("TDocStd_XLinkTool::Copy : not self-contained");
}
}
{
Handle(TDF_Reference) REF;
if (target.FindAttribute(TDF_Reference::GetID(),REF)) {
- Standard_DomainError::Raise(" TDocStd_CopyWithLink : already a ref");
+ throw Standard_DomainError(" TDocStd_CopyWithLink : already a ref");
}
Copy(target,source);
if (isDone) {
{
Handle(TDF_Reference) REF;
if (!label.FindAttribute(TDF_Reference::GetID(),REF)) {
- Standard_DomainError::Raise(" TDocStd_XLinkTool::UpdateLink : not ref registred");
+ throw Standard_DomainError(" TDocStd_XLinkTool::UpdateLink : not ref registred");
}
TDocStd_XLinkTool XLinkTool;
Copy (label,REF->Get());
Handle(TFunction_Driver) driver;
Handle(TFunction_Function) func;
if (!myLabel.FindAttribute(TFunction_Function::GetID(), func))
- Standard_NoSuchObject::Raise("TFunction_IFunction::GetDriver(): A Function is not found attached to this label");
+ throw Standard_NoSuchObject("TFunction_IFunction::GetDriver(): A Function is not found attached to this label");
if (!TFunction_DriverTable::Get()->FindDriver(func->GetDriverGUID(), driver, thread))
- Standard_NoSuchObject::Raise("TFunction_IFunction::GetDriver(): A driver is not found for this ID");
+ throw Standard_NoSuchObject("TFunction_IFunction::GetDriver(): A driver is not found for this ID");
driver->Init(myLabel);
return driver;
}
{
Handle(TFunction_GraphNode) graphNode;
if (!myLabel.FindAttribute(TFunction_GraphNode::GetID(), graphNode))
- Standard_NoSuchObject::Raise("TFunction_IFunction::GetStatus(): A graph node is not found attached to this label");
+ throw Standard_NoSuchObject("TFunction_IFunction::GetStatus(): A graph node is not found attached to this label");
return graphNode;
}
const TNaming_ListOfNamedShape& Args)
{
if (Args.Extent() < 2) {
- Standard_ConstructionError::Raise("TNaming_Name::Solve: => Generated");
+ throw Standard_ConstructionError("TNaming_Name::Solve: => Generated");
}
// First argument : label of generation
// Next arguments : generators.
const TopAbs_ShapeEnum ShapeType)
{
if (Args.Extent() > 2) {
- Standard_ConstructionError::Raise("TNaming_Name::Solve");
+ throw Standard_ConstructionError("TNaming_Name::Solve");
}
if(!ValidArgs(Args)) return Standard_False;
const Handle(TNaming_NamedShape)& A = Args.First();
TopTools_IndexedMapOfShape aMapOfSh;
TDF_LabelMap aForbiden;
if (Args.Extent() < 1 )
- Standard_ConstructionError::Raise("TNaming_Name::Solve");
+ throw Standard_ConstructionError("TNaming_Name::Solve");
const Handle(TNaming_NamedShape)& A = Args.First();
TNaming_NamingTool::CurrentShape (Valid,aForbiden,A, aMapOfSh);
if (aMapOfSh.Extent() != 1) return aResult;
TopTools_IndexedMapOfShape aMapOfSh;
TDF_LabelMap aForbiden;
if (Args.Extent() < 1 )
- Standard_ConstructionError::Raise("TNaming_Name::Solve");
+ throw Standard_ConstructionError("TNaming_Name::Solve");
const Handle(TNaming_NamedShape)& A = Args.First();
TNaming_NamingTool::CurrentShape (Valid,aForbiden,A, aMapOfSh);
if (aMapOfSh.Extent() != 1) return aResult;
case TNaming_ORIENTATION : return "ORIENTATION";
case TNaming_WIREIN : return "WIREIN";
default :
- Standard_DomainError::Raise("TNaming_NameType; enum term unknown ");
+ throw Standard_DomainError("TNaming_NameType; enum term unknown ");
}
- return "";
}
#endif
//=======================================================================
}
case TNaming_SUBSTRACTION:
{
- Standard_NotImplemented::Raise();
+ throw Standard_NotImplemented();
// Done = Substraction (aLab,Valid,myArgs);
break;
}
{
TDF_Label Lab = into->Label();
if (Lab.IsNull()) {
- Standard_NullObject::Raise("TNaming_NamedShape::Paste");
+ throw Standard_NullObject("TNaming_NamedShape::Paste");
}
TNaming_Builder B(Lab);
ldn = cdn;
cdn = cdn->NextSameShape(prs);
if (ldn == cdn) {
- Standard_ConstructionError::Raise("UpdateFirstUseOrNextSameShape");
+ throw Standard_ConstructionError("UpdateFirstUseOrNextSameShape");
break;
}
}
if (myAtt->myNode == 0L) myAtt->myEvolution = TNaming_PRIMITIVE;
else {
if (myAtt->myEvolution != TNaming_PRIMITIVE)
- Standard_ConstructionError::Raise("TNaming_Builder : not same evolution");
+ throw Standard_ConstructionError("TNaming_Builder : not same evolution");
}
TNaming_RefShape* pos = 0L;
#endif
pns = myShapes->myMap.ChangeFind(newShape);
if (pns->FirstUse()->myAtt == myAtt.operator->()) {
- Standard_ConstructionError::Raise("TNaming_Builder::Generate");
+ throw Standard_ConstructionError("TNaming_Builder::Generate");
}
TNaming_Node* pdn = new TNaming_Node(pos,pns);
myAtt->Add(pdn);
if (myAtt->myNode == 0L) myAtt->myEvolution = TNaming_DELETE;
else {
if (myAtt->myEvolution != TNaming_DELETE)
- Standard_ConstructionError::Raise("TNaming_Builder : not same evolution");
+ throw Standard_ConstructionError("TNaming_Builder : not same evolution");
}
TNaming_RefShape* pns = 0L;
if (myAtt->myNode == 0L) myAtt->myEvolution = TNaming_GENERATED;
else {
if (myAtt->myEvolution != TNaming_GENERATED)
- Standard_ConstructionError::Raise("TNaming_Builder : not same evolution");
+ throw Standard_ConstructionError("TNaming_Builder : not same evolution");
}
if (oldShape.IsSame(newShape)) {
if (myAtt->myNode == 0L) myAtt->myEvolution = TNaming_MODIFY;
else {
if (myAtt->myEvolution != TNaming_MODIFY)
- Standard_ConstructionError::Raise("TNaming_Builder : not same evolution");
+ throw Standard_ConstructionError("TNaming_Builder : not same evolution");
}
if (oldShape.IsSame(newShape)) {
if (myAtt->myNode == 0L) myAtt->myEvolution = TNaming_SELECTED;
else {
if (myAtt->myEvolution != TNaming_SELECTED)
- Standard_ConstructionError::Raise("TNaming_Builder : not same evolution");
+ throw Standard_ConstructionError("TNaming_Builder : not same evolution");
}
TNaming_RefShape* pos;
TDF_Label TNaming_OldShapeIterator::Label() const
{
- if (myNode == 0L) Standard_NoSuchObject::Raise("TNaming_OldShapeIterator::Label");
+ if (myNode == 0L) throw Standard_NoSuchObject("TNaming_OldShapeIterator::Label");
return myNode->Label();
}
Handle(TNaming_NamedShape) TNaming_OldShapeIterator::NamedShape() const
{
- if (myNode == 0L) Standard_NoSuchObject::Raise("TNaming_OldShapeIterator::Label");
+ if (myNode == 0L) throw Standard_NoSuchObject("TNaming_OldShapeIterator::Label");
return myNode->myAtt;
}
//=======================================================================
const TopoDS_Shape& TNaming_OldShapeIterator::Shape() const
{
- if(myNode == 0L) Standard_NoSuchObject::Raise("TNaming_OldShapeIterator::Shape");
+ if(myNode == 0L) throw Standard_NoSuchObject("TNaming_OldShapeIterator::Shape");
return myNode->myOld->Shape();
}
Message_MsgFile::LoadFromString (TObj_TObj_msg, sizeof(TObj_TObj_msg) - 1);
if (!Message_MsgFile::HasMsg ("TObj_Appl_SUnknownFailure"))
{
- Standard_ProgramError::Raise ("Critical Error - message resources for TObj_Application are invalid or undefined!");
+ throw Standard_ProgramError("Critical Error - message resources for TObj_Application are invalid or undefined!");
}
}
{
aStatus = Open (theSourceFile, theTargetDoc);
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
ErrorMessage (Message_Msg("TObj_Appl_Exception") <<
- Standard_Failure::Caught()->GetMessageString());
+ anException.GetMessageString());
#endif
+ (void)anException;
}
}
myIsError = aStatus != PCDM_RS_OK;
{
isInitOk = initNewModel(isFileEmpty);
}
- catch (Standard_Failure)
- {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
- Handle(Standard_Failure) anExc = Standard_Failure::Caught();
- TCollection_ExtendedString aString(anExc->DynamicType()->Name());
- aString = aString + ": " + anExc->GetMessageString();
+ TCollection_ExtendedString aString(anException.DynamicType()->Name());
+ aString = aString + ": " + anException.GetMessageString();
Messenger()->Send(Message_Msg("TObj_Appl_Exception") << aString);
#endif
+ (void)anException;
Messenger()->Send(Message_Msg("TObj_M_WrongFile") << theFile,
Message_Alarm);
}
{
// check that modification is allowed
if ( !Label().Data()->IsModificationAllowed() )
- Standard_ImmutableObject::Raise
- ("Attribute TObj_TIntSparseArray is changed outside transaction");
+ throw Standard_ImmutableObject("Attribute TObj_TIntSparseArray is changed outside transaction");
if (theId < 1 || theValue < 1)
- Standard_OutOfRange::Raise ("TObj_TIntSparseArray::SetValue");
+ throw Standard_OutOfRange("TObj_TIntSparseArray::SetValue");
Standard_Integer anOld = AbsentValue;
Standard_Boolean isOld = myVector.HasValue(theId);
{
// check that modification is allowed
if ( !Label().Data()->IsModificationAllowed() )
- Standard_ImmutableObject::Raise
- ("Attribute TObj_TIntSparseArray is changed outside transaction");
+ throw Standard_ImmutableObject("Attribute TObj_TIntSparseArray is changed outside transaction");
if (theId < 1)
- Standard_OutOfRange::Raise ("TObj_TIntSparseArray::UnsetValue");
+ throw Standard_OutOfRange("TObj_TIntSparseArray::UnsetValue");
Standard_Integer anOld = AbsentValue;
Standard_Boolean isOld = myVector.HasValue(theId);
// create associated data (unless already there)
Handle(TDataXtd_Presentation) aData = TDataXtd_Presentation::Set (theLabel, theDriver);
if(aData.IsNull())
- Standard_NoMoreObject::Raise (NO_MORE_OBJECT);
+ throw Standard_NoMoreObject(NO_MORE_OBJECT);
if ( !theLabel.FindAttribute(TPrsStd_AISPresentation::GetID(), aPresentation) )
{
aPresentation = new TPrsStd_AISPresentation();
{
Handle(TDataXtd_Presentation) aData;
if (!Label().FindAttribute(TDataXtd_Presentation::GetID(), aData))
- Standard_NoMoreObject::Raise (NO_MORE_OBJECT);
+ throw Standard_NoMoreObject(NO_MORE_OBJECT);
return aData;
}
{
Handle(TPrsStd_AISViewer) V;
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
- Standard_DomainError::Raise("already done");
+ throw Standard_DomainError("already done");
}
V = new TPrsStd_AISViewer();
V->SetInteractiveContext (new AIS_InteractiveContext(viewer));
{
Handle(TPrsStd_AISViewer) V;
if (acces.Root().FindAttribute(TPrsStd_AISViewer::GetID(),V)) {
- Standard_DomainError::Raise("already done");
+ throw Standard_DomainError("already done");
}
V = new TPrsStd_AISViewer();
V->SetInteractiveContext (IC);
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2) {
- Standard_ProgramError::Raise ("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
+ throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
}
if (!aConst->IsPlanar()) {
#ifdef OCCT_DEBUG
{
Standard_Integer nbgeom = aConst->NbGeometries();
if (nbgeom < 2)
- Standard_ProgramError::Raise
- ("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
+ throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
TopoDS_Shape shape1,shape2 ;
GetTwoShapes(aConst,shape1,shape2);
gp_Pnt tsee_entity0::Pnt() const
{
- if (!Is0()) Standard_Failure::Raise("not 0d");
+ if (!Is0()) throw Standard_Failure("not 0d");
gp_Pnt P;
if (IsP()) P = myEPDS->Point(myEindex).Point();
else if (IsV()) P = BRep_Tool::Pnt(TopoDS::Vertex(myEPDS->Shape(myEindex)));
TopOpeBRep_Bipoint::TopOpeBRep_Bipoint
(const Standard_Integer I1,const Standard_Integer I2):myI1(I1),myI2(I2){}
Standard_Integer TopOpeBRep_Bipoint::I1() const {
-if(myI1<=0)Standard_ProgramError::Raise("TopOpeBRep_Bipoint I1=0");
+if(myI1<=0)throw Standard_ProgramError("TopOpeBRep_Bipoint I1=0");
return myI1;
}
Standard_Integer TopOpeBRep_Bipoint::I2() const {
-if(myI2<=0)Standard_ProgramError::Raise("TopOpeBRep_Bipoint I2=0");
+if(myI2<=0)throw Standard_ProgramError("TopOpeBRep_Bipoint I2=0");
return myI2;
}
{
if (ISI == 1) myF1 = TopoDS::Face(F);
else if (ISI == 2) myF2 = TopoDS::Face(F);
- else Standard_Failure::Raise("Face(i,f) : ISI incorrect");
+ else throw Standard_Failure("Face(i,f) : ISI incorrect");
}
//=======================================================================
{
if (ISI == 1) return myF1;
else if (ISI == 2) return myF2;
- else Standard_Failure::Raise("Face(i) : ISI incorrect");
- return myF1;
+ else throw Standard_Failure("Face(i) : ISI incorrect");
}
//=======================================================================
//modified by NIZNHY-PKV Thu Nov 4 15:44:13 1999 to
if (PC1.IsNull())
- Standard_Failure::Raise("EdgesIntersector::Perform : no 2d curve");
+ throw Standard_Failure("EdgesIntersector::Perform : no 2d curve");
myCurve1.Load(PC1);
BRep_Tool::UVPoints(myEdge1,myFace1,pfirst,plast);
{
if ( Index == 1 ) return myEdge1;
else if ( Index == 2 ) return myEdge2;
- else Standard_Failure::Raise("TopOpeBRep_EdgesIntersector::Edge");
-
- return myEdge1;
+ else throw Standard_Failure("TopOpeBRep_EdgesIntersector::Edge");
}
//=======================================================================
{
if ( Index == 1 ) return myCurve1;
else if ( Index == 2 ) return myCurve2;
- else Standard_Failure::Raise("TopOpeBRep_EdgesIntersector::Curve");
-
- return myCurve1;
+ else throw Standard_Failure("TopOpeBRep_EdgesIntersector::Curve");
}
//=======================================================================
{
if ( Index == 1 ) return myFace1;
else if ( Index == 2 ) return myFace2;
- else Standard_Failure::Raise("TopOpeBRep_EdgesIntersector::Face");
-
- return myFace1;
+ else throw Standard_Failure("TopOpeBRep_EdgesIntersector::Face");
}
//=======================================================================
{
if ( Index == 1 ) return mySurface1->ChangeSurface();
else if ( Index == 2 ) return mySurface2->ChangeSurface();
- else Standard_Failure::Raise("TopOpeBRep_EdgesIntersector::Surface");
-
- return mySurface1->ChangeSurface();
+ else throw Standard_Failure("TopOpeBRep_EdgesIntersector::Surface");
}
//=======================================================================
//=======================================================================
const TopOpeBRep_Point2d& TopOpeBRep_EdgesIntersector::Point(const Standard_Integer I) const
{
- if (I<1 || I>mysp2d.Length()) Standard_Failure::Raise("TopOpeBRep_EdgesIntersector::Point(I)");
+ if (I<1 || I>mysp2d.Length()) throw Standard_Failure("TopOpeBRep_EdgesIntersector::Point(I)");
return mysp2d(I);
}
const IntRes2d_IntersectionSegment& TopOpeBRep_EdgesIntersector::Segment1() const
{
if ( ! IsPointOfSegment1() )
- Standard_Failure::Raise("TopOpeBRep_EdgesIntersector : Not a segment point");
+ throw Standard_Failure("TopOpeBRep_EdgesIntersector : Not a segment point");
Standard_Integer iseg = 1 + (myPointIndex - myNbPoints - 1) / 2;
return mylseg.Value(iseg);
}
staA = staINON;
}
else // Middle/Middle is impossible
- Standard_Failure::Raise("TopOpeBRep_EdgesIntersector : Situation Unknown MM");
+ throw Standard_Failure("TopOpeBRep_EdgesIntersector : Situation Unknown MM");
}
else { // posother = Head or End
Standard_Boolean opposite = IsOpposite1();
staA = staINON;
}
else { // Middle is impossible
- Standard_Failure::Raise("TopOpeBRep_EdgesIntersector : Situation Unknown M");
+ throw Standard_Failure("TopOpeBRep_EdgesIntersector : Situation Unknown M");
}
} // point is not a segment point
break;
case IntRes2d_Undecided :
- Standard_Failure::Raise("TopOpeBRep_EdgesIntersector : TransitionType Undecided");
+ throw Standard_Failure("TopOpeBRep_EdgesIntersector : TransitionType Undecided");
break;
} // switch TransitionType()
const TopoDS_Shape& TopOpeBRep_EdgesIntersector::Vertex1(const Standard_Integer Index)
{
if ( ! IsVertex1(Index) )
- Standard_Failure::Raise("TopOpeBRep_EdgesIntersector : Vertex1");
+ throw Standard_Failure("TopOpeBRep_EdgesIntersector : Vertex1");
return myIsVertexVertex;
}
{
if ( Index == 1 ) return myFace;
else if ( Index == 2 ) return myEdge;
- else Standard_ProgramError::Raise("TopOpeBRep_FaceEdgeIntersector::Shape");
-
- return myNullShape;
+ else throw Standard_ProgramError("TopOpeBRep_FaceEdgeIntersector::Shape");
}
//=======================================================================
return TR;
}
- else Standard_ProgramError::Raise("FEINT Transition Index");
-
-// return(TopOpeBRepDS_Transition());
- TopOpeBRepDS_Transition aValRet ;
- return (aValRet);
+ else throw Standard_ProgramError("FEINT Transition Index");
}
//=======================================================================
VP.EdgeON(E,paramC,Esi);
}
else {
-// Standard_ProgramError::Raise("VP_Position projection failed on E");
+// throw Standard_ProgramError("VP_Position projection failed on E");
VP.ChangeKeep(Standard_False); // xpu051198
}
}
VP.EdgeON(OOE,paramC,OOEsi);
}
else {
-// Standard_ProgramError::Raise("VP_Position projection failed on OOE");
+// throw Standard_ProgramError("VP_Position projection failed on OOE");
VP.ChangeKeep(Standard_False); // xpu051198
}
}
{
if (I == 1) return myF1;
else if (I == 2) return myF2;
- Standard_ProgramError::Raise("FacesFiller::Face");
- return myF1;
+ throw Standard_ProgramError("FacesFiller::Face");
}
//=======================================================================
Standard_Boolean TopOpeBRep_FacesIntersector::SameDomain () const
{
if (!myIntersectionDone)
- Standard_ProgramError::Raise("FacesIntersector : bad SameDomain");
+ throw Standard_ProgramError("FacesIntersector : bad SameDomain");
Standard_Boolean sd = myIntersector.TangentFaces();
{
if ( Index == 1 ) return myFace1;
else if ( Index == 2 ) return myFace2;
- else Standard_ProgramError::Raise("TopOpeBRep_FacesIntersector::Face");
-
- return myNullShape;
+ else throw Standard_ProgramError("TopOpeBRep_FacesIntersector::Face");
}
if ( SameDomain() ) {
return mySurfacesSameOriented;
}
- Standard_ProgramError::Raise("FacesIntersector : bad SurfacesSameOriented");
- return Standard_False;
+ throw Standard_ProgramError("FacesIntersector : bad SurfacesSameOriented");
}
//=======================================================================
case TopOpeBRep_RESTRICTION :
case TopOpeBRep_OTHERTYPE :
default :
- Standard_ProgramError::Raise("TopOpeBRep_GeomTool::MakePrivateCurves");
+ throw Standard_ProgramError("TopOpeBRep_GeomTool::MakePrivateCurves");
break;
}
case TopOpeBRep_RESTRICTION :
case TopOpeBRep_OTHERTYPE :
default :
- Standard_ProgramError::Raise("TopOpeBRep_GeomTool::MakePrivateCurves");
+ throw Standard_ProgramError("TopOpeBRep_GeomTool::MakePrivateCurves");
break;
}
}
Handle(Geom2d_Curve) PC1;
PC1 = FC2D_CurveOnSurface(myEdge1,F1,first,last,tolpc);
- if (PC1.IsNull()) Standard_Failure::Raise("TopOpeBRep_Hctxee2d::SetEdges : no 2d curve");
+ if (PC1.IsNull()) throw Standard_Failure("TopOpeBRep_Hctxee2d::SetEdges : no 2d curve");
myCurve1.Load(PC1);
BRep_Tool::UVPoints(myEdge1,F1,pfirst,plast);
tole = BRep_Tool::Tolerance(myEdge1);
{
if ( Index == 1 ) return myEdge1;
else if ( Index == 2 ) return myEdge2;
- else Standard_Failure::Raise("TopOpeBRep_Hctxee2d::Edge");
-
- return myEdge1;
+ else throw Standard_Failure("TopOpeBRep_Hctxee2d::Edge");
}
//=======================================================================
{
if ( Index == 1 ) return myCurve1;
else if ( Index == 2 ) return myCurve2;
- else Standard_Failure::Raise("TopOpeBRep_Hctxee2d::Curve");
-
- return myCurve1;
+ else throw Standard_Failure("TopOpeBRep_Hctxee2d::Curve");
}
//=======================================================================
{
if ( Index == 1 ) return myDomain1;
else if ( Index == 2 ) return myDomain2;
- else Standard_Failure::Raise("TopOpeBRep_Hctxee2d::Domain");
-
- return myDomain1;
+ else throw Standard_Failure("TopOpeBRep_Hctxee2d::Domain");
}
{
if ( Index == 1 ) return myFace1;
else if ( Index == 2 ) return myFace2;
- else Standard_Failure::Raise("TopOpeBRep_Hctxff2d::Face");
-
- return myFace1;
+ else throw Standard_Failure("TopOpeBRep_Hctxff2d::Face");
}
//=======================================================================
{
if ( Index == 1 ) return mySurface1;
else if ( Index == 2 ) return mySurface2;
- else Standard_Failure::Raise("TopOpeBRep_Hctxff2d::HSurface");
-
- return mySurface1;
+ else throw Standard_Failure("TopOpeBRep_Hctxff2d::HSurface");
}
//=======================================================================
{
if ( Index == 1 ) return myf1surf1F_sameoriented;
else if ( Index == 2 ) return myf2surf1F_sameoriented;
- else Standard_Failure::Raise("TopOpeBRep_Hctxff2d::FSO");
-
- return Standard_True;
+ else throw Standard_Failure("TopOpeBRep_Hctxff2d::FSO");
}
Standard_Boolean TopOpeBRep_LineInter::HasFirstPoint() const
{
if (myILG.IsNull())
- Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasFirstPoint sur line != GLine");
+ throw Standard_ProgramError("TopOpeBRep_LineInter::HasFirstPoint sur line != GLine");
return myILG->HasFirstPoint();
}
Standard_Boolean TopOpeBRep_LineInter::HasLastPoint() const
{
if (myILG.IsNull())
- Standard_ProgramError::Raise("TopOpeBRep_LineInter::HasLastPoint sur line != GLine");
+ throw Standard_ProgramError("TopOpeBRep_LineInter::HasLastPoint sur line != GLine");
return myILG->HasLastPoint();
}
{
if (I == 1) return myLineTonF1;
if (I == 2) return myLineTonF2;
- Standard_ProgramError::Raise("TopOpeBRep_LineInter::FaceFaceTransition");
- return myLineTonF1;
+ throw Standard_ProgramError("TopOpeBRep_LineInter::FaceFaceTransition");
}
//=======================================================================
//=======================================================================
const TopoDS_Vertex& TopOpeBRep_Point2d::Vertex(const Standard_Integer Index) const
{
- if (!IsVertex(Index)) Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
+ if (!IsVertex(Index)) throw Standard_Failure("TopOpeBRep_Point2d::Vertex");
if (Index == 1) return myvertex1;
else if (Index == 2) return myvertex2;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
- return myvertex1;
+ else throw Standard_Failure("TopOpeBRep_Point2d::Vertex");
}
//=======================================================================
{
if (Index == 1) return mytransition1;
else if (Index == 2) return mytransition2;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::Transition");
- return mytransition1;
+ else throw Standard_Failure("TopOpeBRep_Point2d::Transition");
}
//=======================================================================
{
if (Index == 1) return mytransition1;
else if (Index == 2) return mytransition2;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::ChangeTransition");
- return mytransition1;
+ else throw Standard_Failure("TopOpeBRep_Point2d::ChangeTransition");
}
//=======================================================================
//=======================================================================
inline const IntRes2d_IntersectionPoint& TopOpeBRep_Point2d::Pint() const
{
- if (!HasPint()) Standard_Failure::Raise("TopOpeBRep_Point2d::Pint");
+ if (!HasPint()) throw Standard_Failure("TopOpeBRep_Point2d::Pint");
return mypint;
}
{
if (Index == 1) myisvertex1 = B;
else if (Index == 2) myisvertex2 = B;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::SetIsVertex");
+ else throw Standard_Failure("TopOpeBRep_Point2d::SetIsVertex");
}
//=======================================================================
{
if (Index == 1) return myisvertex1;
else if (Index == 2) return myisvertex2;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::IsVertex");
- return myisvertex1;
+ else throw Standard_Failure("TopOpeBRep_Point2d::IsVertex");
}
//=======================================================================
{
if (Index == 1) {myvertex1 = V; myisvertex1 = Standard_True;}
else if (Index == 2) {myvertex2 = V; myisvertex2 = Standard_True;}
- else Standard_Failure::Raise("TopOpeBRep_Point2d::SetVertex");
+ else throw Standard_Failure("TopOpeBRep_Point2d::SetVertex");
}
//=======================================================================
{
if (Index == 1) mytransition1 = T;
else if (Index == 2) mytransition2 = T;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::SetTransition");
+ else throw Standard_Failure("TopOpeBRep_Point2d::SetTransition");
}
//=======================================================================
{
if (Index == 1) myparameter1 = P;
else if (Index == 2) myparameter2 = P;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::SetParameter");
+ else throw Standard_Failure("TopOpeBRep_Point2d::SetParameter");
}
//=======================================================================
{
if (Index == 1) return myparameter1;
else if (Index == 2) return myparameter2;
- else Standard_Failure::Raise("TopOpeBRep_Point2d::Parameter");
- return myparameter1;
+ else throw Standard_Failure("TopOpeBRep_Point2d::Parameter");
}
//=======================================================================
if (Lrest.ArcIsEdge(2)) IArc = 2;
if (IArc == 0) {
#ifdef OCCT_DEBUG
- Standard_Failure::Raise("StBipVPonF");
-#endif
+ throw Standard_Failure("StBipVPonF");
+#else
return TopAbs_UNKNOWN;
+#endif
}
Standard_Integer ISI = (IArc == 1) ? 2 : 1;
Standard_Integer sif = vpf.ShapeIndex();
tolee = tolee * 1.e2; //xpu290998 : PRO15369
Standard_Real param, dist; Standard_Boolean projok = FUN_tool_projPonE(vp.Value(),tolee,E,param,dist);
if (!projok) {
- Standard_ProgramError::Raise("TopOpeBRep_FacesFiller::VPParamOnER");
+ throw Standard_ProgramError("TopOpeBRep_FacesFiller::VPParamOnER");
}
return param;
}
}
}
- Standard_Failure::Raise("CurrentGeomShape : no intersection");
- TopoDS_Shape* bid = new TopoDS_Shape();
- return *bid;
+ throw Standard_Failure("CurrentGeomShape : no intersection");
}
//modified by NIZNHY-PKV Fri Sep 24 11:02:59 1999 from
//=======================================================================
if ( Index == 1 ) return myShape1;
else if ( Index == 2 ) return myShape2;
- Standard_Failure::Raise("ShapeIntersector : no shape");
- TopoDS_Shape* bid = new TopoDS_Shape();
- return *bid;
+ throw Standard_Failure("ShapeIntersector : no shape");
}
}
}
- Standard_ProgramError::Raise("CurrentGeomShape : no intersection 2d");
- TopoDS_Shape* bid = new TopoDS_Shape();
- return *bid;
+ throw Standard_ProgramError("CurrentGeomShape : no intersection 2d");
}
if ( Index == 1 ) return myShape1;
else if ( Index == 2 ) return myShape2;
- Standard_ProgramError::Raise("ShapeIntersector : no shape");
- TopoDS_Shape* bid = new TopoDS_Shape();
- return *bid;
+ throw Standard_ProgramError("ShapeIntersector : no shape");
}
//=======================================================================
const TopoDS_Shape& TopOpeBRep_VPointInter::VertexOnS1() const
{
if ( !myPPOI->IsVertexOnS1() )
- Standard_DomainError::Raise("TopOpeBRep_VPointInter::VertexOnS1");
+ throw Standard_DomainError("TopOpeBRep_VPointInter::VertexOnS1");
const Handle(BRepTopAdaptor_HVertex)* HBRTAHV = (Handle(BRepTopAdaptor_HVertex)*)&(myPPOI->VertexOnS1());
return (*HBRTAHV)->Vertex();
const TopoDS_Shape& TopOpeBRep_VPointInter::VertexOnS2() const
{
if ( !myPPOI->IsVertexOnS2() )
- Standard_DomainError::Raise("TopOpeBRep_VPointInter::VertexOnS2");
+ throw Standard_DomainError("TopOpeBRep_VPointInter::VertexOnS2");
const Handle(BRepTopAdaptor_HVertex)* HBRTAHV = (Handle(BRepTopAdaptor_HVertex)*)&(myPPOI->VertexOnS2());
return (*HBRTAHV)->Vertex();
{
if (I == 1) myState1 = S;
else if (I == 2) myState2 = S;
- else Standard_DomainError::Raise("TopOpeBRep_VPointInter::State");
+ else throw Standard_DomainError("TopOpeBRep_VPointInter::State");
UpdateKeep();
}
{
if (I == 1) return myState1;
else if (I == 2) return myState2;
- else { Standard_DomainError::Raise("TopOpeBRep_VPointInter::State"); return TopAbs_UNKNOWN; }
+ else { throw Standard_DomainError("TopOpeBRep_VPointInter::State");}
}
//=======================================================================
{
if (I == 1) return myEdgeON1;
else if (I == 2) return myEdgeON2;
- else Standard_DomainError::Raise("TopOpeBRep_VPointInter::EdgeON");
- return myNullShape;
+ else throw Standard_DomainError("TopOpeBRep_VPointInter::EdgeON");
}
//=======================================================================
{
if (I == 1) return myEdgeONPar1;
else if (I == 2) return myEdgeONPar2;
- else Standard_DomainError::Raise("TopOpeBRep_VPointInter::EdgeONParameter");
- return 0.;
+ else throw Standard_DomainError("TopOpeBRep_VPointInter::EdgeONParameter");
}
//=======================================================================
}
break;
}
- default : Standard_ProgramError::Raise("VPointClassifier : wrong Index");
+ default : throw Standard_ProgramError("VPointClassifier : wrong Index");
}
if (myState == TopAbs_ON) {
const TopOpeBRep_VPointInter& TopOpeBRep_VPointInterIterator::CurrentVP()
{
if (!More())
- Standard_ProgramError::Raise("TopOpeBRep_VPointInterIterator::CurrentVP");
+ throw Standard_ProgramError("TopOpeBRep_VPointInterIterator::CurrentVP");
const TopOpeBRep_VPointInter& VP = myLineInter->VPoint(myVPointIndex);
return VP;
}
TopOpeBRep_VPointInter& TopOpeBRep_VPointInterIterator::ChangeCurrentVP()
{
if (!More())
- Standard_ProgramError::Raise("TopOpeBRep_VPointInterIterator::ChangeCurrentVP");
+ throw Standard_ProgramError("TopOpeBRep_VPointInterIterator::ChangeCurrentVP");
TopOpeBRep_VPointInter& VP = myLineInter->ChangeVPoint(myVPointIndex);
return VP;
}
Standard_Integer TopOpeBRep_VPointInterIterator::CurrentVPIndex()const
{
if (!More())
- Standard_ProgramError::Raise("TopOpeBRep_VPointInterIterator::CurrentVPIndex");
+ throw Standard_ProgramError("TopOpeBRep_VPointInterIterator::CurrentVPIndex");
return myVPointIndex;
}
const TopOpeBRep_WPointInter& TopOpeBRep_WPointInterIterator::CurrentWP()
{
if (!More())
- Standard_ProgramError::Raise("TopOpeBRep_WPointInterIterator::Current");
+ throw Standard_ProgramError("TopOpeBRep_WPointInterIterator::Current");
const TopOpeBRep_WPointInter& WP = myLineInter->WPoint(myWPointIndex);
return WP;
}
parline = f;
}
else {
- Standard_ProgramError::Raise("FUNBREP_Periodize");
+ throw Standard_ProgramError("FUNBREP_Periodize");
}
} // onfl
else {
//----------------------------------------------------------------------
{
if (L.TypeLineCurve() != TopOpeBRep_WALKING) {
- Standard_ProgramError::Raise("FUNBREP_topowalki_new : line is not a walking");
- return Standard_False;
+ throw Standard_ProgramError("FUNBREP_topowalki_new : line is not a walking");
}
Standard_Boolean CPIfound = !Ifound.IsNull();
//----------------------------------------------------------------------
{
if (L.TypeLineCurve() != TopOpeBRep_WALKING) {
- Standard_ProgramError::Raise("FUNBREP_topowalki : line is not a walking");
- return Standard_False;
+ throw Standard_ProgramError("FUNBREP_topowalki : line is not a walking");
}
#ifdef OCCT_DEBUG
//----------------------------------------------------------------------
{
if (L.TypeLineCurve() == TopOpeBRep_WALKING) {
- Standard_ProgramError::Raise("FUNBREP_topogline_new : line is not a GLine");
- return Standard_False;
+ throw Standard_ProgramError("FUNBREP_topogline_new : line is not a GLine");
}
Standard_Integer iVP = VP.Index();
//----------------------------------------------------------------------
{
if (L.TypeLineCurve() == TopOpeBRep_WALKING) {
- Standard_ProgramError::Raise("FUNBREP_topogline : line is not a GLine");
- return Standard_False;
+ throw Standard_ProgramError("FUNBREP_topogline : line is not a GLine");
}
#ifdef OCCT_DEBUG
Standard_Integer vpsind = VP.ShapeIndex();
Standard_Boolean on2edges = (vpsind == 3);
Standard_Boolean isvalid = on2edges || (vpsind == ShapeIndex);
- if (!isvalid) Standard_Failure::Raise("TopOpeBRep_FacesFiller::GetEdgeTrans");
+ if (!isvalid) throw Standard_Failure("TopOpeBRep_FacesFiller::GetEdgeTrans");
const TopoDS_Edge& edge = TopoDS::Edge(VP.Edge(ShapeIndex));
Standard_Real paredge = VP.EdgeParameter(ShapeIndex);
(const TopOpeBRepBuild_BlockIterator& BI) const
{
Standard_Boolean isbound = BI.More();
- if (!isbound) Standard_Failure::Raise("OutOfRange");
+ if (!isbound) throw Standard_Failure("OutOfRange");
Standard_Integer index = BI.Value();
const TopoDS_Shape& E = myOrientedShapeMap(index);
(const Standard_Integer index) const
{
Standard_Boolean isbound = myOrientedShapeMapIsValid.IsBound(index);
- if (!isbound) Standard_Failure::Raise("OutOfRange");
+ if (!isbound) throw Standard_Failure("OutOfRange");
const TopoDS_Shape& E = myOrientedShapeMap(index);
return E;
(const TopoDS_Shape& E) const
{
Standard_Boolean isbound = myOrientedShapeMap.Contains(E);
- if (!isbound) Standard_Failure::Raise("OutOfRange");
+ if (!isbound) throw Standard_Failure("OutOfRange");
Standard_Integer I = myOrientedShapeMap.FindIndex(E);
return I;
#ifdef OCCT_DEBUG
Standard_EXPORT void FUN_RaiseON()
-{Standard_Failure::Raise("BuilderON");}
+{throw Standard_Failure("BuilderON");}
static void FUN_cout(const TopoDS_Shape& eON)
{
TopAbs_Orientation oE = eON.Orientation();
Handle(Geom2d_Curve) C2D;
if (!pcf) {
C2D = FC2D_CurveOnSurface(E,F,f,l,tolpc);
- if (C2D.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::End 1");
+ if (C2D.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::End 1");
Standard_Real tolE = BRep_Tool::Tolerance(E);
Standard_Real tol = Max(tolE,tolpc);
B.UpdateEdge(E,C2D,F,tol);
{
const Handle(TopOpeBRepBuild_Loop)& L = myFaceAreaBuilder.Loop();
if ( L->IsShape() )
- Standard_DomainError::Raise("TopOpeBRepBuild_FaceBuilder:InitEdge");
+ throw Standard_DomainError("TopOpeBRepBuild_FaceBuilder:InitEdge");
else {
myBlockIterator = L->BlockIterator();
myBlockIterator.Initialize();
//=======================================================================
const TopoDS_Shape& TopOpeBRepBuild_FaceBuilder::Edge() const
{
- if (!myBlockIterator.More()) Standard_Failure::Raise("OutOfRange");
+ if (!myBlockIterator.More()) throw Standard_Failure("OutOfRange");
const Standard_Integer i = myBlockIterator.Value();
Standard_Boolean isvalid = myBlockBuilder.ElementIsValid(i);
- if (!isvalid) Standard_Failure::Raise("Edge not Valid");
+ if (!isvalid) throw Standard_Failure("Edge not Valid");
const TopoDS_Shape& E = myBlockBuilder.Element(i);
return E;
Standard_Integer TopOpeBRepBuild_FaceBuilder::EdgeConnexity(const TopoDS_Shape& /*E*/) const
{
#ifdef OCCT_DEBUG
- Standard_ProgramError::Raise("FaceBuilder::EdgeConnexity management disactivated");
-#endif
+ throw Standard_ProgramError("FaceBuilder::EdgeConnexity management disactivated");
+#else
return 0;
+#endif
// Standard_Boolean inmosi = myMOSI.IsBound(E);
// Standard_Integer nmosi = (inmosi) ? myMOSI.Find(E) : 0;
// return nmosi;
if (s == TopAbs_IN ) return 0;
else if (s == TopAbs_ON ) return 1;
else if (s == TopAbs_OUT) return 2;
- else Standard_ProgramError::Raise("GIndex : bad input");
- return 0;
+ else throw Standard_ProgramError("GIndex : bad input");
}
//=======================================================================
if (i == 0) return TopAbs_IN;
else if (i == 1) return TopAbs_ON;
else if (i == 2) return TopAbs_OUT;
- else Standard_ProgramError::Raise("GState : bad input");
- return TopAbs_UNKNOWN;
+ else throw Standard_ProgramError("GState : bad input");
}
//=======================================================================
else if ( Value(TopAbs_OUT,TopAbs_ON)) s2 = TopAbs_OUT;
if ( s1 == TopAbs_UNKNOWN || s2 == TopAbs_UNKNOWN ) {
- Standard_ProgramError::Raise("Gtopo : StatesON incorrect");
+ throw Standard_ProgramError("Gtopo : StatesON incorrect");
}
}
else IsToRev = (s1 == TopAbs_IN);
return IsToRev;
}
-// Standard_ProgramError::Raise("GTopo::IsToReverse1");
+// throw Standard_ProgramError("GTopo::IsToReverse1");
// return Standard_False; // dummy
}
Standard_Boolean TopOpeBRepBuild_GTopo::Reverse() const
{
if (myReverseForce) return myReverseValue;
- Standard_ProgramError::Raise("GTopo::ReverseValue undefined");
- return Standard_False; // dummy
+ throw Standard_ProgramError("GTopo::ReverseValue undefined");
}
//=======================================================================
Standard_Real u,v; ElSLib::Parameters(pln,p3,u,v); gp_Pnt2d p2(u,v);
Standard_Real f,l,tolpc; Handle(Geom2d_Curve) C2D;
C2D = FC2D_CurveOnSurface(myEdgeReference,myFaceReference,f,l,tolpc);
- if (C2D.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::GParamOnReference");
+ if (C2D.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::GParamOnReference");
// Standard_Real U;
Geom2dAdaptor_Curve AC(C2D);
Handle(Geom2d_Curve) PC = FC2D_CurveOnSurface(EG,FS,pf,pl,tol);
if (PC.IsNull()) {
TopoDS_Edge EEG = EG; Standard_Boolean ok = FUN_tool_pcurveonF(FS,EEG);
- if (!ok) Standard_ProgramError::Raise("_Builder::SplitONVisolineonCyl");
+ if (!ok) throw Standard_ProgramError("_Builder::SplitONVisolineonCyl");
Standard_Real f,l; PC = FC2D_CurveOnSurface(EEG,FS,f,l,tol);
}
TopoDS_Shape FF = FOR; FF.Orientation(TopAbs_FORWARD);
Standard_Boolean ok = FUN_SplitEvisoONperiodicF(myDataStructure,FF);
- if (!ok) Standard_ProgramError::Raise("_Builder::SplitONVisolineonCyl");
+ if (!ok) throw Standard_ProgramError("_Builder::SplitONVisolineonCyl");
} // i
}
const TopoDS_Shape& TopOpeBRepBuild_HBuilder::CurrentSection() const
{
- if (PITLE == NULL) Standard_ProgramError::Raise("no more CurrentSection");
- if (!PITLE->More()) Standard_ProgramError::Raise("no more CurrentSection");
+ if (PITLE == NULL) throw Standard_ProgramError("no more CurrentSection");
+ if (!PITLE->More()) throw Standard_ProgramError("no more CurrentSection");
return PITLE->Value();
}
static void FUN_Raise() {
#ifdef OCCT_DEBUG
cout<<"******************************ERROR"<<endl;
- Standard_ProgramError::Raise("KPart.cxx");
+ throw Standard_ProgramError("KPart.cxx");
#endif
}
EinEE = FUN_PinE(P,EE);
if (sta == TopAbs_IN) return EinEE;
else if (sta == TopAbs_OUT) return !EinEE;
- else Standard_ProgramError::Raise("TopOpeBRepBuild FUN_EstaEE on invalid state");
- return EinEE;
+ else throw Standard_ProgramError("TopOpeBRepBuild FUN_EstaEE on invalid state");
}
//=======================================================================
// Standard_Real tolpc; MGhc2 PC = FC2D_CurveOnSurface(eon,F,esdF,f,l,tolpc);
Standard_Real tolpc; MGhc2 PC = FC2D_CurveOnSurface(eon,F,esdF,f,l,tolpc,Standard_True);//xpu051198 :PRO15049
hasPC = (!PC.IsNull());
- if (!hasPC) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::SSE null PC on F");
+ if (!hasPC) throw Standard_ProgramError("TopOpeBRepBuild_Builder::SSE null PC on F");
Standard_Real tol = Max(tolE,tolpc);
BB.UpdateEdge(eon,PC,F,tol);
}
#endif
Standard_Boolean haspc = FC2D_HasCurveOnSurface(EG,FS); if (haspc) continue;
Standard_Boolean hasc3d = FC2D_HasC3D(EG);
- if (!hasc3d) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::SSE EG without C3D");
+ if (!hasc3d) throw Standard_ProgramError("TopOpeBRepBuild_Builder::SSE EG without C3D");
Standard_Real pf,pl,tolpc; Handle(Geom2d_Curve) PC;
Standard_Boolean trim3d = Standard_True; PC = FC2D_CurveOnSurface(EG,FS,pf,pl,tolpc,trim3d);
- if (PC.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::SSE EG without PC on FS");
+ if (PC.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::SSE EG without PC on FS");
}
} //5
Standard_Boolean isouon,isovon; gp_Pnt2d o2don; gp_Dir2d d2don;
Standard_Boolean ISOon = TopOpeBRepTool_TOOL::UVISO(PCon,isouon,isovon,d2don,o2don);
Standard_Boolean PCko = !ISOon || ((isoU && !isouon) || (isoV && !isovon));
- if (PCko) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::splitON");
+ if (PCko) throw Standard_ProgramError("TopOpeBRepBuild_Builder::splitON");
Standard_Boolean test = (FFuper && isoU) || (FFvper && isoV);
if (!test) { newlON.Append(eon); continue;}
{
if (SubShapeType == TopAbs_EDGE) myShapeType = TopAbs_FACE;
else if (SubShapeType == TopAbs_VERTEX) myShapeType = TopAbs_EDGE;
- else Standard_ProgramError::Raise("ShapeSet : bad ShapeType");
+ else throw Standard_ProgramError("ShapeSet : bad ShapeType");
myDEBNumber = 0;
myCheckShape = Standard_False; // temporary NYI
{
const Handle(TopOpeBRepBuild_Loop)& L = mySolidAreaBuilder.Loop();
if ( L->IsShape() )
- Standard_DomainError::Raise("TopOpeBRepBuild_SolidBuilder:InitFace");
+ throw Standard_DomainError("TopOpeBRepBuild_SolidBuilder:InitFace");
else {
myBlockIterator = L->BlockIterator();
myBlockIterator.Initialize();
add = (state == ToBuild1);
}
else {
- Standard_ProgramError::Raise("SplitShapes no 3D curve on edge");
+ throw Standard_ProgramError("SplitShapes no 3D curve on edge");
// NYI pas de courbe 3d : prendre un point sur (courbe 2d,face)
}
}
} //jyl980406+
C2D = FC2D_CurveOnSurface(E,F,f2,l2,tolpc);
- if (C2D.IsNull()) Standard_ProgramError::Raise("WEC : ResetElement");
+ if (C2D.IsNull()) throw Standard_ProgramError("WEC : ResetElement");
Standard_Real t = 0.397891143689; Standard_Real par = ((1-t)*f2 + t*l2);
myPoint2d = C2D->Value(par);
Standard_Real fE,lE,tolpc;Handle(Geom2d_Curve) PC;
Standard_Boolean trim3d = Standard_True;
PC = FC2D_CurveOnSurface(E,F,fE,lE,tolpc,trim3d);
- if (PC.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_WireEdgeSet::IsUVISO");
+ if (PC.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_WireEdgeSet::IsUVISO");
Handle(Standard_Type) TheType = PC->DynamicType();
if (TheType == STANDARD_TYPE(Geom2d_Line)) {
// Standard_Real tolE = BRep_Tool::Tolerance(E);
Standard_Real f2,l2,tolpc; Handle(Geom2d_Curve) C2D;
C2D = FC2D_CurveOnSurface(E,WESF,f2,l2,tolpc);
- if (C2D.IsNull()) Standard_ProgramError::Raise("GFillCurveTopologyWES");
+ if (C2D.IsNull()) throw Standard_ProgramError("GFillCurveTopologyWES");
#ifdef OCCT_DEBUG
// Standard_Real tol = Max(tolE,tolpc);
#endif
BU.GFindSamDomSODO(Fac1,LFSO,LFDO);
}
else {
- Standard_ProgramError::Raise("KPmakeface Stfac1 != OUT");
+ throw Standard_ProgramError("KPmakeface Stfac1 != OUT");
}
if (rankIN == 0) {
- Standard_ProgramError::Raise("KPmakeface rankIN = 0");
+ throw Standard_ProgramError("KPmakeface rankIN = 0");
}
TopTools_ListOfShape LFIN;
GFindSamDomSODO(Fac1,LFSO,LFDO);
}
else {
- Standard_ProgramError::Raise("KPmakeface Stfac1 != OUT");
- return myFaceReference; //Dummy
+ throw Standard_ProgramError("KPmakeface Stfac1 != OUT");
}
if (rankIN == 0) {
- Standard_ProgramError::Raise("KPmakeface rankIN = 0");
- return myFaceReference; //Dummy
+ throw Standard_ProgramError("KPmakeface rankIN = 0");
}
TopTools_ListOfShape LFIN;
const TopoDS_Face& FA = TopoDS::Face(FF);
Standard_Boolean puok = TopOpeBRepTool::PurgeClosingEdges(FA,LOF,MWisOld,MshNOK);
- if (!puok) Standard_Failure::Raise("TopOpeBRepBuild::GWESMakeFaces");
+ if (!puok) throw Standard_Failure("TopOpeBRepBuild::GWESMakeFaces");
topurge = !MshNOK.IsEmpty();
#ifdef OCCT_DEBUG
if (topurge) {
TopTools_ListOfShape LOFF;
Standard_Boolean puok = TopOpeBRepTool::MakeFaces(TopoDS::Face(FF),LOF,MshNOK,LOFF);
- if (!puok) Standard_Failure::Raise("TopOpeBRepBuild::GWESMakeFaces");
+ if (!puok) throw Standard_Failure("TopOpeBRepBuild::GWESMakeFaces");
LOF.Clear(); LOF.Assign(LOFF);
}
Standard_Real f2,l2,tolpc; Handle(Geom2d_Curve) C2D; // jyl980402+
//C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc); // jyl980402+
C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc, Standard_True); // xpu051198 (CTS21701)
- if(C2D.IsNull()) Standard_ProgramError::Raise("TopOpeBRepBuild_Builder::GFABUMakeFaces null PC"); // jyl980402+
+ if(C2D.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::GFABUMakeFaces null PC"); // jyl980402+
Standard_Real tol = Max(tolE,tolpc); // jyl980402+
BRep_Builder BB_PC; BB_PC.UpdateEdge(newEdge,C2D,newFace,tol); // jyl980402+
} // jyl980402+
case TopAbs_SOLID : res = TopOpeBRepDS_SOLID; break;
case TopAbs_COMPSOLID : res = TopOpeBRepDS_COMPSOLID; break;
case TopAbs_COMPOUND : res = TopOpeBRepDS_COMPOUND; break;
- default : Standard_ProgramError::Raise("TopOpeBRepDS::ShapeToKind");
+ default : throw Standard_ProgramError("TopOpeBRepDS::ShapeToKind");
}
return res;
}
case TopOpeBRepDS_SOLID : res = TopAbs_SOLID; break;
case TopOpeBRepDS_COMPSOLID : res = TopAbs_COMPSOLID; break;
case TopOpeBRepDS_COMPOUND : res = TopAbs_COMPOUND; break;
- default : Standard_ProgramError::Raise("TopOpeBRepDS::KindToShape");
+ default : throw Standard_ProgramError("TopOpeBRepDS::KindToShape");
}
return res;
}
const Standard_Boolean approx = Approximation();
const Handle(Geom_Curve)& C3D = C.Curve();
- if (comppc1 && C.Shape1().IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 2");
- if (comppc2 && C.Shape2().IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 3");
+ if (comppc1 && C.Shape1().IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 2");
+ if (comppc2 && C.Shape2().IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 3");
TopoDS_Vertex Vmin,Vmax; TopExp::Vertices(E,Vmin,Vmax);
- if ( Vmin.IsNull() ) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 4");
- if ( Vmax.IsNull() ) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 5");
+ if ( Vmin.IsNull() ) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 4");
+ if ( Vmax.IsNull() ) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 5");
if (iswalk && approx) {
- if (compc3d && C3D.IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
+ if (compc3d && C3D.IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
ApproxCurves(C, E, inewC, HDS);
TopOpeBRepDS_Curve& newC = HDS->ChangeCurve(inewC);
PutPCurves(newC, E, comppc1, comppc2);
inewC = HDS->MakeCurve(C,newC1);
TopOpeBRepDS_Curve& newC = HDS->ChangeCurve(inewC);
if(iswalk && !approx) {
- if (compc3d && C3D.IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
+ if (compc3d && C3D.IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
newC.Curve1(C.Curve1());
newC.Curve2(C.Curve2());
}
Standard_Boolean comppc2 = GT.CompPC2();
const Handle(Geom_Curve)& C3D = C1.Curve();
- if (compc3d && C3D.IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
- if (comppc1 && C2.Shape1().IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 2");
- if (comppc2 && C2.Shape2().IsNull()) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 3");
+ if (compc3d && C3D.IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 1");
+ if (comppc1 && C2.Shape1().IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 2");
+ if (comppc2 && C2.Shape2().IsNull()) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 3");
TopoDS_Vertex Vmin,Vmax; TopExp::Vertices(TopoDS::Edge(E),Vmin,Vmax);
- if ( Vmin.IsNull() ) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 4");
- if ( Vmax.IsNull() ) Standard_ProgramError::Raise
- ("TopOpeBRepDS_BuildTool::RecomputeCurve 5");
+ if ( Vmin.IsNull() ) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 4");
+ if ( Vmax.IsNull() ) throw Standard_ProgramError("TopOpeBRepDS_BuildTool::RecomputeCurve 5");
Standard_Boolean kbspl1 = Standard_False;
Handle(Geom_BSplineCurve) BS = Handle(Geom_BSplineCurve)::DownCast(C3D);
}
else if ( typec3d == TopOpeBRepTool_APPROX ) {
- if (!comppc1 || !comppc2) Standard_NotImplemented::Raise("DSBuildToolAPPROX");
+ if (!comppc1 || !comppc2) throw Standard_NotImplemented("DSBuildToolAPPROX");
myCurveTool.MakeCurves(parmin,parmax,
C3D,PC1,PC2,F1,F2,
C3Dnew,PC1new,PC2new,
}
else if ( typec3d == TopOpeBRepTool_INTERPOL ) {
- Standard_NotImplemented::Raise("DSBuildToolINTERPOL");
+ throw Standard_NotImplemented("DSBuildToolINTERPOL");
}
Standard_Real newtol,newparmin,newparmax;
else if ( r1 != iS1 && r2 == iS2 ) r = r1;
else if ( r1 != iS1 && r2 != iS2 ) {
if (r1 != r2) {
- // Standard_ProgramError::Raise("FacesFiller::Insert SD 1");
+ // throw Standard_ProgramError("FacesFiller::Insert SD 1");
}
r = (refFirst? r1 : r2);
}
if (r == 0) {
- Standard_ProgramError::Raise("FacesFiller::Insert SD 2");
+ throw Standard_ProgramError("FacesFiller::Insert SD 2");
}
TopoDS_Shape Sr = Shape(r);
const TopOpeBRepDS_Point& TopOpeBRepDS_DataStructure::Point(const Standard_Integer I)const
{
if ( I < 1 || I > myNbPoints ) {
- Standard_ProgramError::Raise("TopOpeBRepDS_DataStructure::Point");
+ throw Standard_ProgramError("TopOpeBRepDS_DataStructure::Point");
}
if ( myPoints.IsBound(I) )
TopOpeBRepDS_Point& TopOpeBRepDS_DataStructure::ChangePoint(const Standard_Integer I)
{
if ( I < 1 || I > myNbPoints ) {
- Standard_ProgramError::Raise("TopOpeBRepDS_DataStructure::Point");
+ throw Standard_ProgramError("TopOpeBRepDS_DataStructure::Point");
}
if ( myPoints.IsBound(I) )
else if ( I->IsKind(STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) )
p = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I)->Parameter();
else {
- Standard_Failure::Raise("FDS_Parameter");
+ throw Standard_Failure("FDS_Parameter");
}
return p;
}
static void FUN_Raise()
{
- Standard_ProgramError::Raise("Edge3dInterferenceTool");
+ throw Standard_ProgramError("Edge3dInterferenceTool");
}
#define POINT (0)
else if ( I->IsKind(STANDARD_TYPE(TopOpeBRepDS_CurvePointInterference)) )
p = Handle(TopOpeBRepDS_CurvePointInterference)::DownCast(I)->Parameter();
else {
- Standard_ProgramError::Raise("TopOpeBRepDS_EdgeInterferenceTool1");
+ throw Standard_ProgramError("TopOpeBRepDS_EdgeInterferenceTool1");
}
return p;
}
#define M_REVERSED(ori) (ori == TopAbs_REVERSED)
//------------------------------------------------------
-static void FUN_RaiseError(){Standard_ProgramError::Raise("TopOpeBRepDS_FaceInterferenceTool");}
+static void FUN_RaiseError(){throw Standard_ProgramError("TopOpeBRepDS_FaceInterferenceTool");}
//------------------------------------------------------
Standard_EXPORT Standard_Boolean FUN_Parameters
// Getting the principle directions,the normal and the curvatures
BRepLProp_SLProps props(surf,uu,vv,2,Precision::Confusion());
Standard_Boolean curdef = props.IsCurvatureDefined();
- if (!curdef) Standard_ProgramError::Raise("TopOpeBRepDS_FaceInterferenceTool::Init");
+ if (!curdef) throw Standard_ProgramError("TopOpeBRepDS_FaceInterferenceTool::Init");
Standard_Boolean umbilic = props.IsUmbilic();
if (umbilic) {
Cur1 = Cur2 = props.MeanCurvature();
// describes "direct" geometry
}
else
- Standard_Failure::Raise("FUN_ComputeGeomData");
+ throw Standard_Failure("FUN_ComputeGeomData");
D1 = Norm; Standard_Real x = D1.X(),y = D1.Y(),z = D1.Z(),tol = Precision::Confusion();
Standard_Boolean nullx = (Abs(x)<tol),nully = (Abs(y)<tol),nullz = (Abs(z)<tol);
//=======================================================================
void TopOpeBRepDS_FaceInterferenceTool::GetEdgePntPar(gp_Pnt& P,Standard_Real& p) const
{
- if (!myOnEdDef) Standard_ProgramError::Raise("GetEdgePntPar");
+ if (!myOnEdDef) throw Standard_ProgramError("GetEdgePntPar");
P = myPntOnEd;
p = myParOnEd;
}
{
Standard_Boolean h = myDS.HasShape(S);
if ( !h ) {
- Standard_ProgramError::Raise("StoreInterference on shape out of DS");
+ throw Standard_ProgramError("StoreInterference on shape out of DS");
return;
}
StoreInterference(I,myDS.ChangeShapeInterferences(S));
{
Standard_Integer n = myDS.NbShapes();
if ( IS < 1 || IS > n ) {
- Standard_ProgramError::Raise("StoreInterference on index out of DS");
+ throw Standard_ProgramError("StoreInterference on index out of DS");
return;
}
return Handle(TopOpeBRepDS_EdgeVertexInterference)::DownCast (I)->Parameter();
}
else {
- Standard_ProgramError::Raise("TopOpeBRepDS_PointIterator::Parameter()");
- return 0.; // windowsNT
+ throw Standard_ProgramError("TopOpeBRepDS_PointIterator::Parameter()");
}
-// return 0.; // windowsNT
}
//=======================================================================
->Config() == TopOpeBRepDS_DIFFORIENTED;
}
else {
- Standard_ProgramError::Raise("TopOpeBRepDS_PointIterator::DiffOriented()");
- return Standard_False; // windowsNT
+ throw Standard_ProgramError("TopOpeBRepDS_PointIterator::DiffOriented()");
}
-// return Standard_False; // windowsNT
}
//=======================================================================
->Config() == TopOpeBRepDS_SAMEORIENTED;
}
else {
- Standard_ProgramError::Raise("TopOpeBRepDS_PointIterator::SameOriented()");
- return Standard_False; // windowsNT
+ throw Standard_ProgramError("TopOpeBRepDS_PointIterator::SameOriented()");
}
}
Standard_Integer ip = (Standard_Integer)TopOpeBRepDS_POINT;
Standard_Integer is = (Standard_Integer)TopOpeBRepDS_SOLID;
if (ip > is ) {
- Standard_ProgramError::Raise("TopOpeBRepDS_TKI : enumeration badly ordered");
+ throw Standard_ProgramError("TopOpeBRepDS_TKI : enumeration badly ordered");
return;
}
Standard_Integer f = 1; // first index of table
{
Standard_Boolean ok = IsValidKG(K,G);
if (!ok) {
- Standard_ProgramError::Raise("TopOpeBRepDS_TKI : Add K G");
+ throw Standard_ProgramError("TopOpeBRepDS_TKI : Add K G");
return;
}
void TopOpeBRepDS_TKI::Add(const TopOpeBRepDS_Kind K,const Standard_Integer G,const Handle(TopOpeBRepDS_Interference)& HI)
{
Standard_Boolean ok = IsValidKG(K,G);
- if (!ok) Standard_ProgramError::Raise("TopOpeBRepDS_TKI : Add K G HI");
+ if (!ok) throw Standard_ProgramError("TopOpeBRepDS_TKI : Add K G HI");
Add(K,G);
ChangeInterferences(K,G).Append(HI);
Standard_Integer TopOpeBRepDS_Transition::Index() const
{
if ( myIndexAfter != myIndexBefore )
- Standard_Failure::Raise("Transition::Index() on different shapes");
+ throw Standard_Failure("Transition::Index() on different shapes");
return myIndexBefore;
}
TopOpeBRepDS_Point PDS; TopoDS_Shape VDS;
if (ispoint) PDS = BDS.Point(G1);
else if (isvertex) VDS = BDS.Shape(G1);
- else Standard_Failure::Raise("TopOpeBRepDS FDS_repvg2 1");
+ else throw Standard_Failure("TopOpeBRepDS FDS_repvg2 1");
Standard_Boolean isEd1 = BRep_Tool::Degenerated(E1); if (isEd1) {it1.Next(); continue;}
TopOpeBRepDS_ListIteratorOfListOfInterference it2(it1); if (it2.More()) it2.Next(); else {it1.Next(); continue; }
Standard_Integer iu = myHAI->Upper();
Standard_Boolean b = (I >= 1 && I <= iu);
if (!b) {
- Standard_ProgramError::Raise("BS::Box3");
+ throw Standard_ProgramError("BS::Box3");
}
Standard_Integer im = myHAI->Value(I);
const TopoDS_Shape& S = myHBT->Shape(im);
case GeomAbs_Hyperbola : C2D = new Geom2d_Hyperbola(PC.Hyperbola()); break;
case GeomAbs_BSplineCurve : C2D = PC.BSpline(); break;
default :
- Standard_NotImplemented::Raise("CurveTool::MakePCurve");
+ throw Standard_NotImplemented("CurveTool::MakePCurve");
break;
}
return C2D;
myResultEdgesDone(Standard_False),myNbConnexEdge(0)
{
// if (theShape.ShapeType() != TopAbs_SHELL && theShape.ShapeType() != TopAbs_SOLID)
-// Standard_ConstructionError::Raise("FuseEdges");
+// throw Standard_ConstructionError("FuseEdges");
Standard_NullObject_Raise_if(theShape.IsNull(),"FuseEdges");
myMapFaces.Clear();
ME.Init(ExtC,VF,VL);
if (!ME.IsDone())
- Standard_ConstructionError::Raise("FuseEdges : Fusion failed");
+ throw Standard_ConstructionError("FuseEdges : Fusion failed");
}
else
- Standard_ConstructionError::Raise("FuseEdges : Fusion failed");
+ throw Standard_ConstructionError("FuseEdges : Fusion failed");
}
NewEdge = ME.Edge();
//modified by NIZHNY-MZV Wed Apr 5 10:05:53 2000
else if ( t == TopAbs_VERTEX) BRepBndLib::Add(S,B);
else {
- Standard_ProgramError::Raise("HBT::ComputeBox : invalid type");
+ throw Standard_ProgramError("HBT::ComputeBox : invalid type");
}
}
{
Standard_Boolean hb = HasBox(S);
if (!hb) {
- Standard_ProgramError::Raise("HBT::Box1");
+ throw Standard_ProgramError("HBT::Box1");
}
const Bnd_Box& B = myIMS.FindFromKey(S);
Standard_Integer iu = Extent();
Standard_Integer hb = (I >= 1 && I <= iu);
if (!hb) {
- Standard_ProgramError::Raise("HBT::Box2");
+ throw Standard_ProgramError("HBT::Box2");
}
const Bnd_Box& B = myIMS.FindFromIndex(I);
return B;
Standard_Integer iu = Extent();
Standard_Integer hs = (I >= 1 && I <= iu);
if (!hs) {
- Standard_ProgramError::Raise("HBT::Box4");
+ throw Standard_ProgramError("HBT::Box4");
}
const TopoDS_Shape& S = myIMS.FindKey(I);
return S;
if (!uviso) return Standard_False;
Standard_Real pfEin,plEin,tolEin; Handle(Geom2d_Curve) PCEin = FUNTOOLC2D_CurveOnSurface(Ein,Fsp,pfEin,plEin,tolEin);
- if (PCEin.IsNull()) Standard_Failure::Raise(" FUN_correctDegeneratedE : no 2d curve Ein");
+ if (PCEin.IsNull()) throw Standard_Failure(" FUN_correctDegeneratedE : no 2d curve Ein");
Standard_Real pf1,pl1,tol1; Handle(Geom2d_Curve) PC1 = FUNTOOLC2D_CurveOnSurface(e1,Fsp,pf1,pl1,tol1);
- if (PC1.IsNull()) Standard_Failure::Raise(" FUN_correctDegeneratedE : no 2d curve e1");
+ if (PC1.IsNull()) throw Standard_Failure(" FUN_correctDegeneratedE : no 2d curve e1");
Standard_Real pf2,pl2,tol2; Handle(Geom2d_Curve) PC2 = FUNTOOLC2D_CurveOnSurface(e2,Fsp,pf2,pl2,tol2);
- if (PC2.IsNull()) Standard_Failure::Raise(" FUN_correctDegeneratedE : no 2d curve e2");
+ if (PC2.IsNull()) throw Standard_Failure(" FUN_correctDegeneratedE : no 2d curve e2");
Standard_Real parv1 = BRep_Tool::Parameter(v1,Ein,Fsp);
Standard_Real parv2 = BRep_Tool::Parameter(v2,Ein,Fsp);
TopOpeBRepTool_PurgeInternalEdges::TopOpeBRepTool_PurgeInternalEdges(const TopoDS_Shape& theShape,const Standard_Boolean PerformNow):myShape(theShape),myIsDone(Standard_False)
{
// if (theShape.ShapeType() != TopAbs_SHELL && theShape.ShapeType() != TopAbs_SOLID)
-// Standard_ConstructionError::Raise("PurgeInternalEdges");
+// throw Standard_ConstructionError("PurgeInternalEdges");
Standard_NullObject_Raise_if(theShape.IsNull(),"PurgeInternalEdges");
if (PerformNow) {
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUSO();
if (trc) cout<<"***** Failure in REGUS **********"<<endl;
-// Standard_Failure::Raise("REGUS");
+// throw Standard_Failure("REGUS");
#endif
}
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
if (trc) cout<<"*** Raise REGUW"<<endl;
-// Standard_Failure::Raise("REGUW");
+// throw Standard_Failure("REGUW");
#endif
}
void TopOpeBRepTool_REGUW::GetEsplits(TopTools_DataMapOfShapeListOfShape& Esplits) const
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Esplits = myEsplits;
}
void TopOpeBRepTool_REGUW::GetOwNw(TopTools_DataMapOfShapeListOfShape& OwNw) const
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
OwNw = myOwNw;
}
Standard_Boolean TopOpeBRepTool_REGUW::SplitEds()
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
if (trc) cout<<"** SPLITTING EDGES **"<<endl;
const TopoDS_Shape& TopOpeBRepTool_REGUW::S() const
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
return myS;
}
void TopOpeBRepTool_REGUW::InitStep(const TopoDS_Shape& S)
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
TopoDS_Shape null;myCORRISO.Init(null); myCORRISO.Init(S);
mymapvEds.Clear();
Standard_Boolean TopOpeBRepTool_REGUW::MapS()
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
if (trc) cout<<"** MAPPING **"<<endl;
Standard_Boolean TopOpeBRepTool_REGUW::InitBlock()
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
#endif
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
#endif
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
efound.Nullify();
Standard_Real fac = 0.45678;
Standard_Real tola = Precision::Angular();
Standard_Boolean TopOpeBRepTool_REGUW::NextinBlock()
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
if (trc) cout<<endl<<" vcur = v"<<FUN_adds(myv)<<" p2d = ("<<myp2d.X()<<" "<<myp2d.Y()<<")"<<endl;
#endif
TopTools_ListOfShape& Splits)
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
iStep = istep;
#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepTool_GettraceREGUFA();
Standard_Boolean TopOpeBRepTool_REGUW::REGU()
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
TopTools_ListOfShape null;
Standard_Boolean toregu = !myListVmultiple.IsEmpty();
Standard_Boolean TopOpeBRepTool_REGUW::GetSplits(TopTools_ListOfShape& Splits) const
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Standard_Boolean isb = myOwNw.IsBound(S());
if (!isb) return Standard_False;
Splits = myOwNw.Find(S());
Standard_Boolean TopOpeBRepTool_REGUW::Connexity(const TopoDS_Vertex& v, TopOpeBRepTool_connexity& co) const
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Standard_Boolean isb = mymapvEds.Contains(v);
if (!isb) return Standard_False;
co = mymapvEds.FindFromKey(v);
Standard_Boolean TopOpeBRepTool_REGUW::AddNewConnexity(const TopoDS_Vertex& v, const Standard_Integer OriKey,const TopoDS_Edge& e)
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Standard_Boolean isb = mymapvEds.Contains(v);
if (!isb) return Standard_False;
Standard_Boolean TopOpeBRepTool_REGUW::RemoveOldConnexity(const TopoDS_Vertex& v, const Standard_Integer OriKey,const TopoDS_Edge& e)
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Standard_Boolean isb = mymapvEds.Contains(v);
if (!isb) return Standard_False;
Standard_Boolean TopOpeBRepTool_REGUW::UpdateMultiple(const TopoDS_Vertex& v)
{
- if (!HasInit()) Standard_Failure::Raise("TopOpeBRepTool_REGUW : NO INIT");
+ if (!HasInit()) throw Standard_Failure("TopOpeBRepTool_REGUW : NO INIT");
Standard_Boolean isb = mymapvEds.Contains(v);
if (!isb) return Standard_False;
const TopOpeBRepTool_connexity& co = mymapvEds.FindFromKey(v);
}
else {
myState = TopAbs_UNKNOWN;
- Standard_ProgramError::Raise("TopOpeBRepTool_ShapeClassifier !P3Ddef");
+ throw Standard_ProgramError("TopOpeBRepTool_ShapeClassifier !P3Ddef");
}
}
}
}
}
else {
- Standard_ProgramError::Raise("StateShapeShape : bad operands");
+ throw Standard_ProgramError("StateShapeShape : bad operands");
}
// take orientation of reference shape in account
C2D = FC2D_CurveOnSurface(myEdge,F,f2d,l2d,tol2d,trimCurve);
if(C2D.IsNull())
- Standard_ProgramError::Raise("StateShapeShape : no 2d curve");
+ throw Standard_ProgramError("StateShapeShape : no 2d curve");
Standard_Real t = 0.127956477;
Standard_Real p = (1-t)*f2d + t*l2d;
C3D = BRep_Tool::Curve(myEdge,f3d,l3d);
if(C3D.IsNull())
- Standard_ProgramError::Raise("StateShapeShape : no 3d curve");
+ throw Standard_ProgramError("StateShapeShape : no 3d curve");
Standard_Real t = 0.127956477;
Standard_Real p = (1-t)*f3d + t*l3d;
C3D = BRep_Tool::Curve(myEdge,f3d,l3d);
if (C3D.IsNull())
- Standard_ProgramError::Raise("StateShapeShape : no 3d curve");
+ throw Standard_ProgramError("StateShapeShape : no 3d curve");
Standard_Real t = 0.127956477;
Standard_Real p = (1-t)*f3d + t*l3d;
}
}
else
- Standard_ProgramError::Raise("StateShapeShape : bad operands");
+ throw Standard_ProgramError("StateShapeShape : bad operands");
}
}
}
else {
- Standard_ProgramError::Raise("StateShapeShape : bad operands");
+ throw Standard_ProgramError("StateShapeShape : bad operands");
}
}
}
}
else {
- Standard_ProgramError::Raise("StateShapeShape : bad operands");
+ throw Standard_ProgramError("StateShapeShape : bad operands");
}
}
if (myP3Ddef) {
return myP3D;
}
- Standard_ProgramError::Raise("ShapeClassifier::P3D undefined");
- return myP3D;
+ throw Standard_ProgramError("ShapeClassifier::P3D undefined");
}
//=======================================================================
if (myP2Ddef) {
return myP2D;
}
- Standard_ProgramError::Raise("ShapeClassifier::P2D undefined");
- return myP2D;
+ throw Standard_ProgramError("ShapeClassifier::P2D undefined");
}
//=======================================================================
case TopAbs_FACE : tol = BRep_Tool::Tolerance(TopoDS::Face(S)); break;
case TopAbs_EDGE : tol = BRep_Tool::Tolerance(TopoDS::Edge(S)); break;
case TopAbs_VERTEX : tol = BRep_Tool::Tolerance(TopoDS::Vertex(S)); break;
- default : Standard_ProgramError::Raise
- ("TopOpeBRepTool_ShapeTool : Shape has no tolerance"); break;
+ default : throw Standard_ProgramError("TopOpeBRepTool_ShapeTool : Shape has no tolerance"); break;
}
return tol;
}
gp_Pnt TopOpeBRepTool_ShapeTool::Pnt(const TopoDS_Shape& S)
{
if ( S.ShapeType() != TopAbs_VERTEX ) {
- Standard_ProgramError::Raise("TopOpeBRepTool_ShapeTool::Pnt");
- return gp_Pnt();
+ throw Standard_ProgramError("TopOpeBRepTool_ShapeTool::Pnt");
}
return BRep_Tool::Pnt(TopoDS::Vertex(S));
}
Standard_Real first,last,tolpc;
const Handle(Geom2d_Curve) PC = FC2D_CurveOnSurface(E,F,first,last,tolpc);
- if (PC.IsNull()) Standard_ProgramError::Raise("ShapeTool::PeriodizeParameter : no 2d curve");
+ if (PC.IsNull()) throw Standard_ProgramError("ShapeTool::PeriodizeParameter : no 2d curve");
Handle(Standard_Type) TheType = PC->DynamicType();
if (TheType == STANDARD_TYPE(Geom2d_Line)) {
Standard_Boolean TopOpeBRepTool_face::Finite() const
{
- if (!IsDone()) Standard_Failure::Raise("TopOpeBRepTool_face NOT DONE");
+ if (!IsDone()) throw Standard_Failure("TopOpeBRepTool_face NOT DONE");
return myfinite;
}
const TopoDS_Face& TopOpeBRepTool_face::Ffinite() const
{
- if (!IsDone()) Standard_Failure::Raise("TopOpeBRepTool_face NOT DONE");
+ if (!IsDone()) throw Standard_Failure("TopOpeBRepTool_face NOT DONE");
return myFfinite;
}
aShape.TShape()->Modified(Standard_True);
}
else {
- TopoDS_UnCompatibleShapes::Raise("TopoDS_Builder::Add");
+ throw TopoDS_UnCompatibleShapes("TopoDS_Builder::Add");
}
}
else {
- TopoDS_FrozenShape::Raise("TopoDS_Buider::Add");
+ throw TopoDS_FrozenShape("TopoDS_Buider::Add");
}
}
#if !defined No_Exception && !defined No_TopoDS_FrozenShape
#define TopoDS_FrozenShape_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) TopoDS_FrozenShape::Raise(MESSAGE);
+ if (CONDITION) throw TopoDS_FrozenShape(MESSAGE);
#else
#define TopoDS_FrozenShape_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_TopoDS_LockedShape
#define TopoDS_LockedShape_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) TopoDS_LockedShape::Raise(MESSAGE);
+ if (CONDITION) throw TopoDS_LockedShape(MESSAGE);
#else
#define TopoDS_LockedShape_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_TopoDS_UnCompatibleShapes
#define TopoDS_UnCompatibleShapes_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) TopoDS_UnCompatibleShapes::Raise(MESSAGE);
+ if (CONDITION) throw TopoDS_UnCompatibleShapes(MESSAGE);
#else
#define TopoDS_UnCompatibleShapes_Raise_if(CONDITION, MESSAGE)
#endif
void Transfer_Binder::SetResultPresent ()
{
- if (thestatus == Transfer_StatusUsed) Transfer_TransferFailure::Raise
- ("Binder : SetResult, Result is Already Set and Used");
+ if (thestatus == Transfer_StatusUsed) throw Transfer_TransferFailure("Binder : SetResult, Result is Already Set and Used");
theexecst = Transfer_StatusDone;
thestatus = Transfer_StatusDefined;
}
void Transfer_Iterator::Add
(const Handle(Transfer_Binder)& binder)
{
- if (!thestarts.IsNull()) Standard_NoSuchObject::Raise
- ("Transfer_Iterator : Add, Starting Object required not provided");
+ if (!thestarts.IsNull()) throw Standard_NoSuchObject("Transfer_Iterator : Add, Starting Object required not provided");
AddItem(binder);
}
const TheStart& Transfer_Iterator::Starting () const
{
-// if (thecurr == 0 || thecurr > themaxi) Standard_NoSuchObject::Raise
+// if (thecurr == 0 || thecurr > themaxi) throw Standard_NoSuchObject
// ("TransferIterator : Starting");
-// if (theselect->Value(thecurr) == 0) Standard_NoSuchObject::Raise
+// if (theselect->Value(thecurr) == 0) throw Standard_NoSuchObject
// ("TransferIterator : Starting");
- if (thestarts.IsNull()) Standard_NoSuchObject::Raise
- ("TransferIterator : No Starting defined at all");
+ if (thestarts.IsNull()) throw Standard_NoSuchObject("TransferIterator : No Starting defined at all");
return thestarts->Value(thecurr);
}
#if !defined No_Exception && !defined No_Transfer_TransferDeadLoop
#define Transfer_TransferDeadLoop_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Transfer_TransferDeadLoop::Raise(MESSAGE);
+ if (CONDITION) throw Transfer_TransferDeadLoop(MESSAGE);
#else
#define Transfer_TransferDeadLoop_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Transfer_TransferFailure
#define Transfer_TransferFailure_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Transfer_TransferFailure::Raise(MESSAGE);
+ if (CONDITION) throw Transfer_TransferFailure(MESSAGE);
#else
#define Transfer_TransferFailure_Raise_if(CONDITION, MESSAGE)
#endif
for (Standard_Integer i = 1; i <= nbres; i ++)
iter.AddItem(mulres->Value(i));
}
- else Transfer_TransferFailure::Raise
- ("TransferInput : Entities, one of the Results is not Transient Handle");
+ else throw Transfer_TransferFailure("TransferInput : Entities, one of the Results is not Transient Handle");
}
return iter;
}
const Handle(Transfer_Binder)& Transfer_TransferIterator::Value () const
{
- if (thecurr == 0 || thecurr > themaxi) Standard_NoSuchObject::Raise
- ("TransferIterator : Value");
- if (theselect->Value(thecurr) == 0) Standard_NoSuchObject::Raise
- ("TransferIterator : Value");
+ if (thecurr == 0 || thecurr > themaxi) throw Standard_NoSuchObject("TransferIterator : Value");
+ if (theselect->Value(thecurr) == 0) throw Standard_NoSuchObject("TransferIterator : Value");
return theitems->Value(thecurr);
}
void Transfer_TransferOutput::Transfer (const Handle(Standard_Transient)& obj)
{
- if (themodel->Number(obj) == 0) Transfer_TransferFailure::Raise
- ("TransferOutput : Transfer, entities do not come from same initial model");
+ if (themodel->Number(obj) == 0) throw Transfer_TransferFailure("TransferOutput : Transfer, entities do not come from same initial model");
// Standard_Integer scope = 0;
// if (thescope) scope = theproc->NewScope (obj);
/* switch (theundef) {
case Transfer_UndefIgnore : return;
- case Transfer_UndefFailure : Transfer_TransferFailure::Raise
- ("TransferOutput : Transfer Undefined as Failure");
+ case Transfer_UndefFailure : throw Transfer_TransferFailure("TransferOutput : Transfer Undefined as Failure");
case Transfer_UndefContent : break; // on ne sait pas traiter ...
case Transfer_UndefUser : break; // idem
}
Handle(Transfer_Binder) binder = Find(start); //,categ); skl
if (binder.IsNull()) {
StartTrace (binder,start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : IsAlreadyUsed, transfer not done cannot be used...");
+ throw Transfer_TransferFailure("TransferProcess : IsAlreadyUsed, transfer not done cannot be used...");
}
return (binder->Status() == Transfer_StatusUsed);
}
}
else if (former->Status() == Transfer_StatusUsed) {
StartTrace (former,start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : Bind, already Bound");
+ throw Transfer_TransferFailure("TransferProcess : Bind, already Bound");
}
else {
if (thetrace > 2) StartTrace (former,start,thelevel,5);
if (!binder.IsNull()) {
if (!binder->IsKind(STANDARD_TYPE(Transfer_MultipleBinder))) {
StartTrace (thelastbnd,start,thelevel,4);
- Transfer_TransferFailure::Raise ("TransferProcess : BindMultiple");
+ throw Transfer_TransferFailure("TransferProcess : BindMultiple");
}
}
else Bind(start,new Transfer_MultipleBinder);//,categ);skl
Handle(Transfer_MultipleBinder)::DownCast(binder);
if (multr.IsNull()) {
StartTrace (binder,start,thelevel,4);
- if (binder.IsNull()) Transfer_TransferFailure::Raise
- ("TransferProcess : AddMultiple, nothing bound");
- else Transfer_TransferFailure::Raise
- ("TransferProcess : AddMultiple, Binder not a MultipleBinder");
+ if (binder.IsNull()) throw Transfer_TransferFailure("TransferProcess : AddMultiple, nothing bound");
+ else throw Transfer_TransferFailure("TransferProcess : AddMultiple, Binder not a MultipleBinder");
}
multr->AddResult(res);
}
Standard_Integer index = MapIndex(start);
if (index == 0) {
//StartTrace (thelastbnd,start,thelevel,4);
- //Transfer_TransferFailure::Raise("TransferProcess : SetRoot");
+ //throw Transfer_TransferFailure("TransferProcess : SetRoot");
return;
}
// (*themessenger->Out()) << flush;
}
else StartTrace (former, start,thelevel,4);
- Transfer_TransferFailure::Raise
- ("TransferProcess : Transfer in Error Status");
+ throw Transfer_TransferFailure("TransferProcess : Transfer in Error Status");
case Transfer_StatusLoop : // la boucle est bouclee ...
if (thetrace) {
themessenger << " *** Transfer Head of Dead Loop :" << endl;
// (*themessenger->Out()) << flush;
}
else StartTrace (former, start,thelevel,4);
- Transfer_TransferDeadLoop::Raise
- ("TransferProcess : Transfer at Head of a Dead Loop");
+ throw Transfer_TransferDeadLoop("TransferProcess : Transfer at Head of a Dead Loop");
}
#ifdef TRANSLOG
cout << "Transfer,level "<<thelevel<<Message_Flush;
StartTrace (binder, start, thelevel-1,0);
}
else StartTrace (binder, start,thelevel-1,4);
- Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop");
+ throw Transfer_TransferFailure("TransferProcess : Head of Dead Loop");
// Autrement dit, on change d exception (on est sorti de la boucle)
} else {
if (thetrace) {
binder->AddFail("Transfer in dead Loop");
thelevel = oldlev;
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
if (binder.IsNull()) {
themessenger << " *** Exception Raised with no Result" << endl;
binder = new Transfer_VoidBinder;
}
binder->AddFail("Transfer stopped by exception raising");
if (thetrace) {
- themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl;
+ themessenger << " *** Raised : " << anException.GetMessageString() << endl;
StartTrace (binder, start, thelevel-1,4);
}
thelevel = oldlev;
return qSeq->Value(i)->Dimensions();
}
}
- Standard_NoSuchObject::Raise("Units::Dimensions");
+ throw Standard_NoSuchObject("Units::Dimensions");
}
return Units_Dimensions::ALess();
}
#if !defined No_Exception && !defined No_Units_NoSuchType
#define Units_NoSuchType_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Units_NoSuchType::Raise(MESSAGE);
+ if (CONDITION) throw Units_NoSuchType(MESSAGE);
#else
#define Units_NoSuchType_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_Units_NoSuchUnit
#define Units_NoSuchUnit_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) Units_NoSuchUnit::Raise(MESSAGE);
+ if (CONDITION) throw Units_NoSuchUnit(MESSAGE);
#else
#define Units_NoSuchUnit_Raise_if(CONDITION, MESSAGE)
#endif
thesequenceoftokens = new Units_TokensSequence();
Handle(Units_TokensSequence) lstlexicon=alexicon->Sequence();
if(lstlexicon.IsNull())
- Units_NoSuchType::Raise("BAD LEXICON descriptor");
+ throw Units_NoSuchType("BAD LEXICON descriptor");
limchain=strlen(astring);
i=0;
}
}
- Units_NoSuchUnit::Raise(aunit);
+ throw Units_NoSuchUnit(aunit);
}
}
- Units_NoSuchType::Raise(aquantity);
+ throw Units_NoSuchType(aquantity);
}
return;
}
}
- Units_NoSuchUnit::Raise(aunit);
+ throw Units_NoSuchUnit(aunit);
}
}
- Units_NoSuchType::Raise(aquantity);
+ throw Units_NoSuchType(aquantity);
}
}
}
- Units_NoSuchType::Raise(aquantity);
- return TCollection_AsciiString() ;
+ throw Units_NoSuchType(aquantity);
}
#if !defined No_Exception && !defined No_V3d_BadValue
#define V3d_BadValue_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) V3d_BadValue::Raise(MESSAGE);
+ if (CONDITION) throw V3d_BadValue(MESSAGE);
#else
#define V3d_BadValue_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_V3d_UnMapped
#define V3d_UnMapped_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) V3d_UnMapped::Raise(MESSAGE);
+ if (CONDITION) throw V3d_UnMapped(MESSAGE);
#else
#define V3d_UnMapped_Raise_if(CONDITION, MESSAGE)
#endif
{
if (!myActiveLights.Contains (theLight))
{
- V3d_BadValue_Raise_if (myActiveLights.Extent() >= LightLimit(),
- "V3d_View::SetLightOn, "
- "too many lights");
+ if (myActiveLights.Extent() >= LightLimit())
+ throw V3d_BadValue("V3d_View::SetLightOn, too many lights");
myActiveLights.Append (theLight);
UpdateLights();
}
//=============================================================================
void V3d_View::SetLightOff (const Handle(V3d_Light)& theLight)
{
- Standard_TypeMismatch_Raise_if (MyViewer->IsGlobalLight (theLight),
- "V3d_View::SetLightOff, "
- "the light is global");
+ if (MyViewer->IsGlobalLight (theLight))
+ throw Standard_TypeMismatch("V3d_View::SetLightOff, the light is global");
myActiveLights.Remove (theLight);
UpdateLights();
}
gp_Dir anUp (aCamera->Up());
if (!ScreenAxis (aReferencePlane, anUp, myXscreenAxis, myYscreenAxis, myZscreenAxis))
{
- V3d_BadValue::Raise ("V3d_View::Translate, alignment of Eye,At,Up");
+ throw V3d_BadValue("V3d_View::Translate, alignment of Eye,At,Up");
}
}
gp_Dir anUp (aCamera->Up());
if (!ScreenAxis (aReferencePlane, anUp,
myXscreenAxis,myYscreenAxis,myZscreenAxis))
- V3d_BadValue::Raise ("V3d_View::Translate, alignment of Eye,At,Up");
+ throw V3d_BadValue("V3d_View::Translate, alignment of Eye,At,Up");
}
Standard_Real XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ;
void V3d_Viewer::SetDefaultViewSize (const Standard_Real theSize)
{
- V3d_BadValue_Raise_if (theSize <= 0.0, "V3d_Viewer::SetDefaultViewSize, bad size");
+ if (theSize <= 0.0)
+ throw V3d_BadValue("V3d_Viewer::SetDefaultViewSize, bad size");
myViewSize = theSize;
}
di << "Error: export of image to " << aFormatStr << " failed!\n";
}
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
di << "Error: export of image to " << aFormatStr << " failed";
- di << " (exception: " << Standard_Failure::Caught()->GetMessageString() << ")";
+ di << " (exception: " << anException.GetMessageString() << ")";
}
Standard_ENABLE_DEPRECATION_WARNINGS
return 0;
myOnOff = aOnOff;
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myIntensity = aIntensity;
myColor = aColor;
{
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myIntensity = aIntensity;
}
{
if (aShininess->Value(i) < 0. || aShininess->Value(i) > 1.)
{
- Standard_Failure::Raise("The value of aShininess is out of range (0 - 1)");
+ throw Standard_Failure("The value of aShininess is out of range (0 - 1)");
}
}
myShininess = aShininess;
{
if (aTransparency->Value(i) < 0. || aTransparency->Value(i) > 1.)
{
- Standard_Failure::Raise("The value of aTransparency is out of range (0 - 1)");
+ throw Standard_Failure("The value of aTransparency is out of range (0 - 1)");
}
}
myTransparency = aTransparency;
{
if (aShininess->Value(i) < 0. || aShininess->Value(i) > 1.)
{
- Standard_Failure::Raise("The value of aShininess is out of range (0 - 1)");
+ throw Standard_Failure("The value of aShininess is out of range (0 - 1)");
}
}
myShininess = aShininess;
{
if (aTransparency->Value(i) < 0. || aTransparency->Value(i) > 1.)
{
- Standard_Failure::Raise("The value of aTransparency is out of range (0 - 1)");
+ throw Standard_Failure("The value of aTransparency is out of range (0 - 1)");
}
}
myTransparency = aTransparency;
{
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myOnOff = aOnOff;
myIntensity = aIntensity;
{
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myIntensity = aIntensity;
}
Standard_Integer size = aWidth*aHeight;
if (anArray->Length() != size)
{
- Standard_Failure::Raise("The size of Array is no equal (aWidth*aHeight)");
+ throw Standard_Failure("The size of Array is no equal (aWidth*aHeight)");
}
myWidth = aWidth;
myHeight = aHeight;
Standard_Integer size = myWidth*myHeight;
if (anArray->Length() != size)
{
- Standard_Failure::Raise("The size of Array is no equal (aWidth*aHeight)");
+ throw Standard_Failure("The size of Array is no equal (aWidth*aHeight)");
}
myArray = anArray;
myArrayFlag = Standard_True;
myOnOff = aOnOff;
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myIntensity = aIntensity;
myColor = aColor;
{
if (aIntensity < 0. || aIntensity > 1.)
{
- Standard_Failure::Raise("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
+ throw Standard_Failure("Error : Light intensity must be in the range 0.0 to 1.0, inclusive.");
}
myIntensity = aIntensity;
}
if( Ypers.IsParallel(Zpers,Precision::Angular()) )
{
- Standard_Failure::Raise("Projection Vector is Parallel to High Point Direction");
+ throw Standard_Failure("Projection Vector is Parallel to High Point Direction");
}
gp_Dir Xpers = Ypers.Crossed(Zpers);
#if !defined No_Exception && !defined No_WNT_ClassDefinitionError
#define WNT_ClassDefinitionError_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) WNT_ClassDefinitionError::Raise(MESSAGE);
+ if (CONDITION) throw WNT_ClassDefinitionError(MESSAGE);
#else
#define WNT_ClassDefinitionError_Raise_if(CONDITION, MESSAGE)
#endif
if (!RegisterClassW (&aWinClass))
{
myClassName.Clear();
- WNT_ClassDefinitionError::Raise ("Unable to register window class");
+ throw WNT_ClassDefinitionError("Unable to register window class");
}
myWndProc = (Standard_Address )aWinClass.lpfnWndProc;
}
{
if (thePxWidth <= 0 || thePxHeight <= 0)
{
- Aspect_WindowDefinitionError::Raise ("Coordinate(s) out of range");
+ throw Aspect_WindowDefinitionError("Coordinate(s) out of range");
}
DWORD aStyle = theStyle;
theClientStruct);
if (!myHWindow)
{
- Aspect_WindowDefinitionError::Raise ("Unable to create window");
+ throw Aspect_WindowDefinitionError("Unable to create window");
}
myHParentWindow = theParent;
di << string8;
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
//printf ( "%40.40s", "exception" );
char string9[260];
Sprintf (string9, "%40.40s", "exception" );
#ifdef OCCT_DEBUG
//fflush ( stdout );
di << ": ";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di<<" ** Skip\n";
#endif
+ (void)anException;
}
}
else if ( wholeDoc ) {
context->SetResult ( S );
}
}
- catch (Standard_Failure) {
+ catch (Standard_Failure const& anException) {
#ifdef OCCT_DEBUG
cout << "Error: XSAlgo_AlgoContainer::ProcessShape(): Exception in ShapeFix::Shape" << endl;
- Standard_Failure::Caught()->Print(cout); cout << endl;
+ anException.Print(cout); cout << endl;
#endif
- }
+ (void)anException;
+ }
return context->Result();
}
// for writing, define default sequence of DirectFaces
if (newadapt->IsKind(thisadapt->DynamicType()))
return;
if (!(thisadapt->IsKind(newadapt->DynamicType())) && thisadapt != newadapt)
- Standard_DomainError::Raise("XSControl_Controller : Record");
+ throw Standard_DomainError("XSControl_Controller : Record");
}
listad.Bind(theName, this);
}
status = myController->TransferWriteTransient
(obj,myTransferWriter,model,myTransferMode);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<endl;
status = IFSelect_RetFail;
}
status = myController->TransferWriteShape
(shape,myTransferWriter,model,myTransferMode);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
- sout<<Standard_Failure::Caught()->GetMessageString();
+ sout<<anException.GetMessageString();
sout<<endl;
status = IFSelect_RetFail;
}
DeclareAndCast(TColStd_HSequenceOfTransient,seqt,seqval);
if (!seqt.IsNull())
{ if (num <= seqt->Length()) val = seqt->Value(num); return val; }
-// Standard_TypeMismatch::Raise("XSControl_Utils::SeqTraValue");
+// throw Standard_TypeMismatch("XSControl_Utils::SeqTraValue");
return val;
}
if (!seqh.IsNull()) return seqh->Length();
DeclareAndCast(TColStd_HSequenceOfInteger,seqi,seqval);
if (!seqi.IsNull()) return seqi->Length();
-// Standard_TypeMismatch::Raise("XSControl_Utils::SeqLength");
+// throw Standard_TypeMismatch("XSControl_Utils::SeqLength");
return 0;
}
for (i = 1; i <= lng; i ++) arrt->SetValue (i-first+1,seqt->Value(i));
return arrt;
}
- Standard_TypeMismatch::Raise("XSControl_Utils::SeqToArr");
- return val;
+ throw Standard_TypeMismatch("XSControl_Utils::SeqToArr");
}
for (i = first; i <= last; i ++) seqt->Append (arrt->Value(i));
return seqt;
}
- Standard_TypeMismatch::Raise("XSControl_Utils::ArrToSeq");
- return val;
+ throw Standard_TypeMismatch("XSControl_Utils::ArrToSeq");
}
OCC_CATCH_SIGNALS
DBRep::Set(fname,shape);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
di << "** Exception : ";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di<<" ** Skip\n";
di << "Saving shape in variable Draw : " << fname << "\n";
WriteShape (shape,1);
OCC_CATCH_SIGNALS
DBRep::Set(fname,shape);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
di << "** Exception : ";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di<<" ** Skip\n";
}
}
OCC_CATCH_SIGNALS
DBRep::Set(fname,shape);
}
- catch(Standard_Failure) {
+ catch(Standard_Failure const& anException) {
di << "** Exception : ";
- di << Standard_Failure::Caught()->GetMessageString();
+ di << anException.GetMessageString();
di<<" ** Skip\n";
di << "Saving shape in variable Draw : " << fname << "\n";
WriteShape (shape,1);
return model_rd;
}
- Standard_Failure::Raise ("XmlDrivers : unknown GUID");
- static Handle(Standard_Transient) aNullHandle;
- return aNullHandle;
+ throw Standard_Failure("XmlDrivers : unknown GUID");
}
//=======================================================================
return model_rd;
}
- Standard_Failure::Raise ("XmlLDrivers : unknown GUID");
- static Handle(Standard_Transient) aNullHandle;
- return aNullHandle;
+ throw Standard_Failure("XmlLDrivers : unknown GUID");
}
#define SLENGTH 80
theFileName + " cannot be opened for reading";
theApplication->MessageDriver()->Write (aMsg.ToExtString());
- Standard_Failure::Raise("File cannot be opened for reading");
+ throw Standard_Failure("File cannot be opened for reading");
}
}
else
myReaderStatus = PCDM_RS_OK;
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
- TCollection_ExtendedString anErrorString (Standard_Failure::Caught()->GetMessageString());
+ TCollection_ExtendedString anErrorString (anException.GetMessageString());
aMsgDriver -> Write (anErrorString.ToExtString());
}
theFileName + " cannot be opened for writing";
theDocument->Application()->MessageDriver()->Write (aMsg.ToExtString());
- Standard_Failure::Raise("File cannot be opened for writing");
+ throw Standard_Failure("File cannot be opened for writing");
}
}
" cannot be used for writing";
theDocument->Application()->MessageDriver()->Write (aMsg.ToExtString());
- Standard_Failure::Raise("File cannot be opened for writing");
+ throw Standard_Failure("File cannot be opened for writing");
}
::take_time (0, " +++++ Fin formatting to XML : ", aMessageDriver);
OCC_CATCH_SIGNALS
anObjNb = MakeDocument(theDocument, theElement);
}
- catch (Standard_Failure)
+ catch (Standard_Failure const& anException)
{
SetIsError (Standard_True);
SetStoreStatus(PCDM_SS_Failure);
- TCollection_ExtendedString anErrorString (Standard_Failure::Caught()->GetMessageString());
+ TCollection_ExtendedString anErrorString (anException.GetMessageString());
aMessageDriver -> Write (anErrorString.ToExtString());
}
}
else if (theString.equals (::ConOffsetString()))
aResult = TDataXtd_OFFSET;
else
- Standard_DomainError::Raise
- ("TDataXtd_ConstraintEnum; string value without enum term equivalence");
+ throw Standard_DomainError("TDataXtd_ConstraintEnum; string value without enum term equivalence");
}
return aResult;
}
case TDataXtd_OFFSET : return ::ConOffsetString();
default:
- Standard_DomainError::Raise("TDataXtd_ConstraintEnum; enum term unknown");
+ throw Standard_DomainError("TDataXtd_ConstraintEnum; enum term unknown");
}
- static XmlObjMgt_DOMString aNullString;
- return aNullString; // To avoid compilation error message.
}
case TDataXtd_ELLIPSE : return ::GeomEllipseString();
default:
- Standard_DomainError::Raise("TDataXtd_GeometryEnum; enum term unknown");
+ throw Standard_DomainError("TDataXtd_GeometryEnum; enum term unknown");
}
- static XmlObjMgt_DOMString aNullString;
- return aNullString; // To avoid compilation error message.
}
// aBld.Replace(anOldShape,aNewShape);
// break;
default:
- Standard_DomainError::Raise("TNaming_Evolution; enum term unknown");
+ throw Standard_DomainError("TNaming_Evolution; enum term unknown");
}
anOldShape.Nullify();
aNewShape.Nullify();
case TNaming_SELECTED : return ::EvolSelectedString();
case TNaming_REPLACE : return ::EvolModifyString(); // case TNaming_REPLACE : return ::EvolReplaceString(); for compatibility
default:
- Standard_DomainError::Raise("TNaming_Evolution; enum term unknown");
+ throw Standard_DomainError("TNaming_Evolution; enum term unknown");
}
- static XmlObjMgt_DOMString aNullString;
- return aNullString; // To avoid compilation error message.
}
//=======================================================================
else if (theString.equals (::EvolReplaceString()))
aResult = TNaming_MODIFY; // for compatibility //TNaming_REPLACE;
else
- Standard_DomainError::Raise
- ("TNaming_Evolution; string value without enum term equivalence");
+ throw Standard_DomainError("TNaming_Evolution; string value without enum term equivalence");
}
return aResult;
}
case TNaming_WIREIN : return ::NTWireInString();
case TNaming_SHELLIN : return ::NTShellInString();
default:
- Standard_DomainError::Raise("TNaming_NameType; enum term unknown ");
+ throw Standard_DomainError("TNaming_NameType; enum term unknown ");
}
- static XmlObjMgt_DOMString aNullString;
- return aNullString; // To avoid compilation error message.
}
//=======================================================================
else if (theString.equals (::ShVertexString()))
aResult = TopAbs_VERTEX;
else
- Standard_DomainError::Raise
- ("TopAbs_ShapeEnum; string value without enum term equivalence");
+ throw Standard_DomainError("TopAbs_ShapeEnum; string value without enum term equivalence");
}
return aResult;
}
else if (theString.equals (::NTShellInString()))
aResult = TNaming_SHELLIN;
else
- Standard_DomainError::Raise
- ("TNaming_NameType; string value without enum term equivalence");
+ throw Standard_DomainError("TNaming_NameType; string value without enum term equivalence");
}
return aResult;
}
case '-' : myOrientation = TopAbs_REVERSED; break;
case 'i' : myOrientation = TopAbs_INTERNAL; break;
case 'e' : myOrientation = TopAbs_EXTERNAL; break;
- default: Standard_DomainError::Raise
- ("XmlMNaming_Shape1; orientation value without enum term equivalence");
+ default: throw Standard_DomainError("XmlMNaming_Shape1; orientation value without enum term equivalence");
}
Standard_CString anIntPtr = (Standard_CString) &aPtr[1];
if (XmlObjMgt::GetInteger (anIntPtr, myTShapeID) == Standard_False)
- Standard_DomainError::Raise
- ("XmlMNaming_Shape1; tshape value cannot be initialised by integer");
+ throw Standard_DomainError("XmlMNaming_Shape1; tshape value cannot be initialised by integer");
}
}
int aDummy = 0;
if (thePxWidth <= 0 || thePxHeight <= 0)
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, Coordinate(s) out of range");
+ throw Aspect_WindowDefinitionError("Xw_Window, Coordinate(s) out of range");
}
else if (theXDisplay.IsNull())
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, X Display connection is undefined");
+ throw Aspect_WindowDefinitionError("Xw_Window, X Display connection is undefined");
return;
}
else if (!glXQueryExtension (myDisplay->GetDisplay(), &aDummy, &aDummy))
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, GLX extension is unavailable");
+ throw Aspect_WindowDefinitionError("Xw_Window, GLX extension is unavailable");
return;
}
}
if (aVisInfo == NULL)
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, couldn't find compatible Visual (RGBA, double-buffered)");
+ throw Aspect_WindowDefinitionError("Xw_Window, couldn't find compatible Visual (RGBA, double-buffered)");
return;
}
XFree (aVisInfo); aVisInfo = NULL;
if (myXWindow == 0)
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, Unable to create window");
+ throw Aspect_WindowDefinitionError("Xw_Window, Unable to create window");
return;
}
int aDummy = 0;
if (theXWin == 0)
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, given invalid X window");
+ throw Aspect_WindowDefinitionError("Xw_Window, given invalid X window");
return;
}
else if (theXDisplay.IsNull())
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, X Display connection is undefined");
+ throw Aspect_WindowDefinitionError("Xw_Window, X Display connection is undefined");
return;
}
else if (!glXQueryExtension (myDisplay->GetDisplay(), &aDummy, &aDummy))
{
myXWindow = 0;
- Aspect_WindowDefinitionError::Raise ("Xw_Window, GLX extension is unavailable");
+ throw Aspect_WindowDefinitionError("Xw_Window, GLX extension is unavailable");
return;
}
XVisualInfo* aVisInfo = XGetVisualInfo (aDisp, aVisInfoMask, &aVisInfoTmp, &aNbItems);
if (aVisInfo == NULL)
{
- Aspect_WindowDefinitionError::Raise ("Xw_Window, Visual is unavailable");
+ throw Aspect_WindowDefinitionError("Xw_Window, Visual is unavailable");
return;
}
XFree (aVisInfo);
Standard_Real s = M.Determinant();
if ( Abs(s) < gp::Resolution() )
- Standard_ConstructionError::Raise("gp_GTrsf::SetForm, null determinant");
+ throw Standard_ConstructionError("gp_GTrsf::SetForm, null determinant");
if (s > 0)
s = Pow(s,1./3.);
inline gp_Trsf gp_GTrsf::Trsf () const
{
if ( Form() == gp_Other )
- Standard_ConstructionError::Raise("gp_GTrsf::Trsf() - non-orthogonal GTrsf");
+ throw Standard_ConstructionError("gp_GTrsf::Trsf() - non-orthogonal GTrsf");
gp_Trsf T;
T.shape = shape;
const Standard_Real aTolerance2 = 2.0 * aTolerance;
if ( Form() == gp_Other )
- Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(0)");
+ throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(0)");
Standard_Real value = (matrix.Value(1, 1) * matrix.Value(1, 1)
+ matrix.Value(2, 1) * matrix.Value(2, 1));
if ( Abs(value - 1.) > aTolerance2 )
- Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(1)");
+ throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(1)");
value = (matrix.Value(1, 2) * matrix.Value(1, 2)
+ matrix.Value(2, 2) * matrix.Value(2, 2));
if ( Abs(value - 1.) > aTolerance2 )
- Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(2)");
+ throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(2)");
value = (matrix.Value(1, 1) * matrix.Value(1, 2)
+ matrix.Value(2, 1) * matrix.Value(2, 2));
if ( Abs(value) > aTolerance )
- Standard_ConstructionError::Raise("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(3)");
+ throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(3)");
gp_Trsf2d aTransformation;
const Standard_Real theNorm = Magnitude();
const Standard_Real theOtherNorm = Other.Magnitude();
if (theNorm <= gp::Resolution() || theOtherNorm <= gp::Resolution())
- gp_VectorWithNullMagnitude::Raise();
+ throw gp_VectorWithNullMagnitude();
const Standard_Real D = theNorm * theOtherNorm;
const Standard_Real Cosinus = coord.Dot (Other.coord) / D;
#if !defined No_Exception && !defined No_gp_VectorWithNullMagnitude
#define gp_VectorWithNullMagnitude_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) gp_VectorWithNullMagnitude::Raise(MESSAGE);
+ if (CONDITION) throw gp_VectorWithNullMagnitude(MESSAGE);
#else
#define gp_VectorWithNullMagnitude_Raise_if(CONDITION, MESSAGE)
#endif
Standard_Integer n = Diagonal.Length();
if (Subdiagonal.Length() != n)
- Standard_Failure::Raise("math_EigenValuesSearcher : dimension mismatch");
+ throw Standard_Failure("math_EigenValuesSearcher : dimension mismatch");
myDiagonal = new TColStd_HArray1OfReal(1, n);
myDiagonal->ChangeArray1() = Diagonal;
if ((Neq <= 0) ||
(StartingPoint.Length()!= Ninc) ||
(theInfBound.Length() != Ninc) ||
- (theSupBound.Length() != Ninc)) { Standard_DimensionError:: Raise(); }
+ (theSupBound.Length() != Ninc)) { throw Standard_DimensionError(); }
Standard_Integer i;
Standard_Boolean ChangeDirection = Standard_False, Sort = Standard_False, isNewSol = Standard_False;
StdFail_NotDone_Raise_if(!Done, " ");
if(X.Length() != LU.RowNumber()) {
- Standard_DimensionError::Raise();
+ throw Standard_DimensionError();
}
LU_Solve(LU,
Index,
Sol.Invert(*this);
}
else {
- math_SingularMatrix::Raise(); // SingularMatrix Exception;
+ throw math_SingularMatrix(); // SingularMatrix Exception;
}
}
#if !defined No_Exception && !defined No_math_NotSquare
#define math_NotSquare_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) math_NotSquare::Raise(MESSAGE);
+ if (CONDITION) throw math_NotSquare(MESSAGE);
#else
#define math_NotSquare_Raise_if(CONDITION, MESSAGE)
#endif
#if !defined No_Exception && !defined No_math_SingularMatrix
#define math_SingularMatrix_Raise_if(CONDITION, MESSAGE) \
- if (CONDITION) math_SingularMatrix::Raise(MESSAGE);
+ if (CONDITION) throw math_SingularMatrix(MESSAGE);
#else
#define math_SingularMatrix_Raise_if(CONDITION, MESSAGE)
#endif
+++ /dev/null
-puts "Testing intensive raising exceptions in parallel threads"
-puts "0028217: E r r o r handling is not thread safe and causing memory corruption and sporadic crashes"
-
-# this test will fail on vc10-13 and gcc less than 4.8
-set dver [dversion]
-if { ( [regexp {Compiler: MS Visual C[+][+] ([0-9]+)} $dver res ver] && $ver < 14 ) ||
- ( [regexp {Compiler: GCC ([0-9]+[.][0-9]+)} $dver res ver] && $ver < 4.8 ) } {
- puts "TODO OCC28217 ALL: TEST INCOMPLETE"
- puts "TODO OCC28217 Windows: An exception was caught"
- puts "TODO OCC28217 Windows: \\*\\* Exception \\*\\*"
- puts "TODO ?OCC28217 Linux: An exception was caught"
- puts "TODO ?OCC28217 Linux: \\*\\* Exception \\*\\*.*"
- puts "TODO ?OCC28217 Linux: \\*\\*\\* Abort"
- puts "TODO ?OCC28217 Linux: ... The exception is"
-}
-pload QAcommands
-OCC28217