mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0026937: Eliminate NO_CXX_EXCEPTION macro support
Macro NO_CXX_EXCEPTION was removed from code. Method Raise() was replaced by explicit throw statement. Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer. Method Standard_Failure::Caught() is deprecated now. Eliminated empty constructors. Updated samples. Eliminate empty method ChangeValue from NCollection_Map class. Removed not operable methods from NCollection classes.
This commit is contained in:
@@ -212,7 +212,7 @@ const TopoDS_Shape& TopOpeBRepBuild_BlockBuilder::Element
|
||||
(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);
|
||||
@@ -223,7 +223,7 @@ const TopoDS_Shape& TopOpeBRepBuild_BlockBuilder::Element
|
||||
(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;
|
||||
@@ -233,7 +233,7 @@ Standard_Integer TopOpeBRepBuild_BlockBuilder::Element
|
||||
(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;
|
||||
|
@@ -62,7 +62,7 @@ Standard_EXPORT Standard_Boolean DEBTEFOR(const TopOpeBRepBuild_Builder& B,const
|
||||
|
||||
#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();
|
||||
|
@@ -229,7 +229,7 @@ void TopOpeBRepBuild_Builder::End()
|
||||
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);
|
||||
|
@@ -556,7 +556,7 @@ Standard_Integer TopOpeBRepBuild_FaceBuilder::InitEdge()
|
||||
{
|
||||
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();
|
||||
@@ -592,11 +592,11 @@ void TopOpeBRepBuild_FaceBuilder::NextEdge()
|
||||
//=======================================================================
|
||||
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;
|
||||
@@ -609,9 +609,10 @@ const TopoDS_Shape& TopOpeBRepBuild_FaceBuilder::Edge() const
|
||||
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;
|
||||
|
@@ -213,8 +213,7 @@ Standard_Integer TopOpeBRepBuild_GTopo::GIndex(const TopAbs_State s) const
|
||||
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");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -227,8 +226,7 @@ TopAbs_State TopOpeBRepBuild_GTopo::GState(const Standard_Integer i) const
|
||||
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");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -341,7 +339,7 @@ void TopOpeBRepBuild_GTopo::StatesON(TopAbs_State& s1,
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +360,7 @@ Standard_Boolean TopOpeBRepBuild_GTopo::IsToReverse1() const
|
||||
else IsToRev = (s1 == TopAbs_IN);
|
||||
return IsToRev;
|
||||
}
|
||||
// Standard_ProgramError::Raise("GTopo::IsToReverse1");
|
||||
// throw Standard_ProgramError("GTopo::IsToReverse1");
|
||||
// return Standard_False; // dummy
|
||||
}
|
||||
|
||||
@@ -406,8 +404,7 @@ void TopOpeBRepBuild_GTopo::SetReverse(const Standard_Boolean rev)
|
||||
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");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -799,7 +799,7 @@ Standard_Boolean TopOpeBRepBuild_Builder::GParamOnReference(const TopoDS_Vertex&
|
||||
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);
|
||||
|
@@ -983,7 +983,7 @@ static Standard_Boolean FUN_SplitEvisoONperiodicF(const Handle(TopOpeBRepDS_HDat
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ void TopOpeBRepBuild_Builder::SplitEvisoONperiodicF()
|
||||
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
|
||||
}
|
||||
|
||||
|
@@ -314,8 +314,8 @@ void TopOpeBRepBuild_HBuilder::NextSection()
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
@@ -69,7 +69,7 @@ extern Standard_Boolean TopOpeBRepBuild_GettraceKPB();
|
||||
static void FUN_Raise() {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout<<"******************************ERROR"<<endl;
|
||||
Standard_ProgramError::Raise("KPart.cxx");
|
||||
throw Standard_ProgramError("KPart.cxx");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -196,8 +196,7 @@ static Standard_Boolean FUN_EstaEE(const TopoDS_Edge& E, const TopAbs_State sta,
|
||||
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");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -538,7 +537,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
|
||||
// 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);
|
||||
}
|
||||
@@ -581,10 +580,10 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
|
||||
#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
|
||||
|
||||
@@ -633,7 +632,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges()
|
||||
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;}
|
||||
|
@@ -50,7 +50,7 @@ TopOpeBRepBuild_ShapeSet::TopOpeBRepBuild_ShapeSet(const TopAbs_ShapeEnum SubSha
|
||||
{
|
||||
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
|
||||
|
@@ -155,7 +155,7 @@ Standard_Integer TopOpeBRepBuild_SolidBuilder::InitFace()
|
||||
{
|
||||
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();
|
||||
|
@@ -139,7 +139,7 @@ void TopOpeBRepBuild_Builder::SplitShapes(TopOpeBRepTool_ShapeExplorer& Ex,
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@@ -393,7 +393,7 @@ void TopOpeBRepBuild_WireEdgeClassifier::ResetElement(const TopoDS_Shape& EE)
|
||||
} //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);
|
||||
|
@@ -522,7 +522,7 @@ void TopOpeBRepBuild_WireEdgeSet::IsUVISO(const TopoDS_Edge& E,const TopoDS_Face
|
||||
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)) {
|
||||
|
@@ -202,7 +202,7 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter
|
||||
// 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
|
||||
|
@@ -624,11 +624,11 @@ Standard_EXPORT void FUNKP_KPmakefaces(const TopOpeBRepBuild_Builder& BU,
|
||||
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;
|
||||
@@ -712,13 +712,11 @@ TopoDS_Shape TopOpeBRepBuild_Builder::KPmakeface(const TopoDS_Shape& Fac1,
|
||||
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;
|
||||
|
@@ -207,7 +207,7 @@ void TopOpeBRepBuild_Builder::GWESMakeFaces
|
||||
|
||||
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
|
||||
@@ -218,7 +218,7 @@ void TopOpeBRepBuild_Builder::GWESMakeFaces
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBu
|
||||
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+
|
||||
|
Reference in New Issue
Block a user