New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that
next label (i.e. does not end with "break" or "return" etc.).
This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough.
The macro is inserted in places that currently generate such warning message and where fallthrough is intentional.
Doxygen comments are provided for this and other macros in Standard_Macro.hxx.
case 4 : if (uncar < '0' || uncar > '9') return Standard_False;
break;
case 5 : if (uncar != '-') return Standard_False;
+ Standard_FALLTHROUGH
case 6 : if (uncar != '0' && uncar != '1') return Standard_False;
break;
case 7 : if (uncar < '0' || uncar > '9') return Standard_False;
if (dizmois == '1' && (uncar < '0' || uncar > '2')) return Standard_False;
break;
case 8 : if (uncar != '-') return Standard_False;
+ Standard_FALLTHROUGH
case 9 : if (uncar < '0' || uncar > '3') return Standard_False;
break;
case 10 : if (uncar < '0' || uncar > '9') return Standard_False;
if (dizjour == '3' && (uncar != '0' && uncar != '1')) return Standard_False;
break;
case 11 : if (uncar != 'T') return Standard_False;
+ Standard_FALLTHROUGH
case 12 : if (uncar < '0' || uncar > '2') return Standard_False;
break;
case 13 : if (uncar < '0' || uncar > '9') return Standard_False;
if (dizheur == '2' && (uncar < '0' || uncar > '3')) return Standard_False;
break;
case 14 : if (uncar != ':') return Standard_False;
+ Standard_FALLTHROUGH
case 15 : if (uncar < '0' || uncar > '5') return Standard_False;
break;
case 16 : if (uncar < '0' || uncar > '9') return Standard_False;
break;
case 17 : if (uncar != ':') return Standard_False;
+ Standard_FALLTHROUGH
case 18 : if (uncar < '0' || uncar > '5') return Standard_False;
break;
case 19 : if (uncar < '0' || uncar > '9') return Standard_False;
myC2D2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetCurve();
mySurf2 = ((Adaptor3d_CurveOnSurface *)(&(HCurOnSur->Curve())))->GetSurface();
+ Standard_FALLTHROUGH
case 2:
CurOnSur.Load(myC2D1);
CurOnSur.Load(mySurf1);
case GeomAbs_Ellipse:
case GeomAbs_Hyperbola:
case GeomAbs_Parabola:
- if (c.GetType() == GeomAbs_Line)
- // Two points on straight segment
- iNbPoints=2;
- else
- // Four points on otheranalitical curves
- iNbPoints=4;
+ // Two points on straight segment, Four points on otheranalitical curves
+ iNbPoints = (c.GetType() == GeomAbs_Line ? 2 : 4);
+ Standard_FALLTHROUGH
default:
{
// Put some points on other curves
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
- { case 7 : epsG1 = Draw::Atof(a[6]);
- case 6 : epsC0 = Draw::Atof(a[5]);
- case 5 : epsnl = Draw::Atof(a[4]);
- case 4 : {} break;
- default : return 1;
- }
+ {
+ case 7 : epsG1 = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : epsC0 = Draw::Atof(a[5]);
+ Standard_FALLTHROUGH
+ case 5 : epsnl = Draw::Atof(a[4]);
+ Standard_FALLTHROUGH
+ case 4 : break;
+ default : return 1;
+ }
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
- { case 6 : epsC0 = Draw::Atof(a[5]);
- case 5 : epsnl = Draw::Atof(a[4]);
- case 4 : {} break;
- default : return 1;
- }
-
+ {
+ case 6 : epsC0 = Draw::Atof(a[5]);
+ Standard_FALLTHROUGH
+ case 5 : epsnl = Draw::Atof(a[4]);
+ Standard_FALLTHROUGH
+ case 4 : break;
+ default : return 1;
+ }
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
Standard_Boolean isconti = Standard_True;
nbeval = (Standard_Integer ) Draw::Atof( a[3]);
switch(n)
- {
- case 9 : maxlen = Draw::Atof(a[8]);
- case 8 : percent = Draw::Atof(a[7]);
- case 7 : epsG1 = Draw::Atof(a[6]);
- case 6 : epsC0 = Draw::Atof(a[5]);
- case 5 : epsnl = Draw::Atof(a[4]);
- case 4 : {} break;
- default : return 1;
- }
+ {
+ case 9 : maxlen = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : percent = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsG1 = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : epsC0 = Draw::Atof(a[5]);
+ Standard_FALLTHROUGH
+ case 5 : epsnl = Draw::Atof(a[4]);
+ Standard_FALLTHROUGH
+ case 4 : break;
+ default : return 1;
+ }
Standard_Real pard1, parf1, U, Uf, deltaU, nb = 0;
addPoint1;
if (aFin <= 1) break;
}
+ Standard_FALLTHROUGH
case 2:
{
addPoint2;
if (aFin <= 2) break;
}
+ Standard_FALLTHROUGH
case 3:
{
addPoint3;
if (aFin <= 3) break;
}
+ Standard_FALLTHROUGH
case 4:
{
addPoint4;
if (aFin <= 4) break;
}
+ Standard_FALLTHROUGH
case 5:
{
addPoint5;
if (aFin <= 5) break;
}
+ Standard_FALLTHROUGH
case 6:
{
addPoint6;
if (aFin <= 6) break;
}
+ Standard_FALLTHROUGH
case 7:
{
addPoint7;
if (aFin <= 7) break;
}
+ Standard_FALLTHROUGH
case 8:
{
addPoint0;
if (aFin <= 8) break;
}
+ Standard_FALLTHROUGH
case 9:
{
addPoint1;
if (aFin <= 9) break;
}
+ Standard_FALLTHROUGH
case 10:
{
addPoint2;
if (aFin <= 10) break;
}
+ Standard_FALLTHROUGH
case 11:
{
addPoint3;
if (aFin <= 11) break;
}
+ Standard_FALLTHROUGH
case 12:
{
addPoint4;
if (aFin <= 12) break;
}
+ Standard_FALLTHROUGH
case 13:
{
addPoint5;
if (aFin <= 13) break;
}
+ Standard_FALLTHROUGH
case 14:
{
addPoint6;
if (aFin <= 14) break;
}
+ Standard_FALLTHROUGH
case 15:
{
addPoint7;
addP0;
if (Fi2 <= 0) break;
}
+ Standard_FALLTHROUGH
case 1 :
{
addP1;
if (Fi2 <= 1) break;
}
+ Standard_FALLTHROUGH
case 2 :
{
addP2;
if (Fi2 <= 2) break;
}
+ Standard_FALLTHROUGH
case 3 :
{
addP3;
if (Fi2 <= 3) break;
}
+ Standard_FALLTHROUGH
case 4 :
{
addP4;
if (Fi2 <= 4) break;
}
+ Standard_FALLTHROUGH
case 5 :
{
addP5;
if (Fi2 <= 5) break;
}
+ Standard_FALLTHROUGH
case 6 :
{
addP6;
if (Fi2 <= 6) break;
}
+ Standard_FALLTHROUGH
case 7 :
{
addP7;
if (Fi2 <= 7) break;
}
+ Standard_FALLTHROUGH
case 8 :
default :
{
switch (Fi2) {
case 15 :
addP7;
+ Standard_FALLTHROUGH
case 14 :
addP6;
+ Standard_FALLTHROUGH
case 13 :
addP5;
+ Standard_FALLTHROUGH
case 12 :
addP4;
+ Standard_FALLTHROUGH
case 11 :
addP3;
+ Standard_FALLTHROUGH
case 10 :
addP2;
+ Standard_FALLTHROUGH
case 9 :
addP1;
+ Standard_FALLTHROUGH
case 8 :
break;
}
break;
}
}
+ Standard_FALLTHROUGH
default:
{
Standard_Integer Nu = NbUSamples(S);
case GeomAbs_Plane:
myExtElCS.Perform(C.Line(), myS->Plane());
if (myExtElCS.IsParallel()) break;
+ Standard_FALLTHROUGH
case GeomAbs_Torus:
case GeomAbs_Cone:
break;
}
}
+ Standard_FALLTHROUGH
case GeomAbs_Hyperbola:
{
if(myCtype == GeomAbs_Hyperbola && myStype == GeomAbs_Plane) {
break;
}
}
+ Standard_FALLTHROUGH
default:
{
Extrema_GenExtCS Ext;
return;
}
}
+ Standard_FALLTHROUGH
case GeomAbs_Cylinder:
{
if(Precision::IsInfinite(v1))
/*********************************************************************************/
static Standard_Integer surfaceCcontinuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, V1, V2, u1, u2, v1, v2;
+{
+ Standard_Real U1, U2, V1, V2, u1, u2, v1, v2;
GeomAbs_Shape TypeCont;
Standard_Integer ord;
Standard_Boolean b1, b2, b3, b4;
Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
if (surf2.IsNull()) return 1;
- U1 = Draw::Atof(a[3]);
- U2 = Draw::Atof(a[6]);
- V1 = Draw::Atof(a[4]);
- V2 = Draw::Atof(a[7]);
+ U1 = Draw::Atof(a[3]);
+ U2 = Draw::Atof(a[6]);
+ V1 = Draw::Atof(a[4]);
+ V2 = Draw::Atof(a[7]);
- ord = Draw::Atoi(a[1]);
+ ord = Draw::Atoi(a[1]);
- surf1->Bounds(u1, u2, v1, v2);
- b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
- b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
+ surf1->Bounds(u1, u2, v1, v2);
+ b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+ b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
- surf2->Bounds(u1, u2, v1, v2);
- b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
- b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-
- if (!((b1 && b2)&&(b3 && b4))) return 1;
+ surf2->Bounds(u1, u2, v1, v2);
+ b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+ b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-
- switch ( ord )
- { case 0 : { TypeCont=GeomAbs_C0;
- switch(n)
- { case 10 : epsC0= Draw::Atof(a[9]);
- case 9 : epsnl = Draw::Atof(a[8]);
- case 8 : {} break;
- default : return 1;
- }
- LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
- TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen);
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
- case 1 : { TypeCont=GeomAbs_C1;
- switch(n)
- { case 11 : epsC1=Draw::Atof(a[10]);
- case 10 : epsC0= Draw::Atof(a[9]);
- case 9 : epsnl = Draw::Atof(a[8]);
- case 8 : {} break;
- default : return 1;
- }
- LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
- TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
-
- }
- break;
- case 2 : { TypeCont=GeomAbs_C2;
- switch(n)
- {
- case 12 : epsC2= Draw::Atof(a[11]);
- case 11 : epsC1=Draw::Atof(a[10]);
- case 10 : epsC0= Draw::Atof(a[9]);
- case 9 : epsnl = Draw::Atof(a[8]);
- case 8 : {} break;
- default : return 1;
- }
- LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
- TypeCont, epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
-
-
- default : {}
- }
- return 0;
+ if (!((b1 && b2)&&(b3 && b4))) return 1;
+
+ switch ( ord )
+ {
+ case 0 :
+ {
+ TypeCont = GeomAbs_C0;
+ switch(n)
+ {
+ case 10: epsC0 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsnl = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 8 - 10 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+
+ case 1 :
+ {
+ TypeCont = GeomAbs_C1;
+ switch(n)
+ {
+ case 11 : epsC1 = Draw::Atof(a[10]);
+ Standard_FALLTHROUGH
+ case 10 : epsC0 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsnl = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 8 - 11 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+
+ case 2 :
+ {
+ TypeCont = GeomAbs_C2;
+ switch(n)
+ {
+ case 12 : epsC2 = Draw::Atof(a[11]);
+ Standard_FALLTHROUGH
+ case 11 : epsC1 = Draw::Atof(a[10]);
+ Standard_FALLTHROUGH
+ case 10 : epsC0 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsnl = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 8 - 12 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+ default:
+ std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 0, 1, or 2" << std::endl;
+ return 1;
+ }
+
+ LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
+ TypeCont, epsnl, epsC0, epsC1, epsC2, epsG1, perce, maxlen);
+ //LocalAnalysis::Dump(RES,cout);
+ Standard_SStream aSStream;
+ LocalAnalysis::Dump(RES,aSStream);
+ di << aSStream;
+ return 0;
}
/*********************************************************************************/
static Standard_Integer surfaceGcontinuity (Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, V1, V2,u1, u2, v1, v2;
+{
+ Standard_Real U1, U2, V1, V2,u1, u2, v1, v2;
GeomAbs_Shape TypeCont;
Standard_Integer ord;
Standard_Boolean b1, b2, b3, b4;
Handle(Geom_Surface) surf2 = DrawTrSurf::GetSurface(a[5]);
if (surf2.IsNull()) return 1;
- U1 = Draw::Atof(a[3]);
- U2 = Draw::Atof(a[6]);
- V1 = Draw::Atof(a[4]);
- V2 = Draw::Atof(a[7]);
+ U1 = Draw::Atof(a[3]);
+ U2 = Draw::Atof(a[6]);
+ V1 = Draw::Atof(a[4]);
+ V2 = Draw::Atof(a[7]);
- ord = Draw::Atoi(a[1]);
+ ord = Draw::Atoi(a[1]);
- surf1->Bounds(u1, u2, v1, v2);
- b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
- b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
+ surf1->Bounds(u1, u2, v1, v2);
+ b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+ b3 = ((((V1>=v1)&&(V1<=v2))||((V1<=v1)&&(V1>=v2))));
- surf2->Bounds(u1, u2, v1, v2);
- b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
- b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-
- if (!((b1 && b2)&&(b3 && b4))) return 1;
+ surf2->Bounds(u1, u2, v1, v2);
+ b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+ b4 = ((((V2>=v1)&&(V2<=v2))||((V2<=v1)&&(V2>=v2))));
-
- switch ( ord )
- {
- case 1 : { TypeCont=GeomAbs_G1;
- switch(n)
- { case 11 : epsG1=Draw::Atof(a[10]);
- case 10 : epsC0= Draw::Atof(a[9]);
- case 9 : epsnl = Draw::Atof(a[8]);
- case 8 : {} break;
- default : return 1;
- }
- LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
- TypeCont,epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
-
- }
- break;
- case 2 : { TypeCont=GeomAbs_G2;
- switch(n)
- { case 13 : maxlen =Draw::Atof (a[12]);
- case 12 : perce=Draw::Atof(a[11]);
- case 11 : epsG1=Draw::Atof(a[10]);
- case 10 : epsC0= Draw::Atof(a[9]);
- case 9 : epsnl = Draw::Atof(a[8]);
- case 8 : {} break;
- default : return 1;
- }
- LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
- TypeCont, epsnl,epsC0,epsC1,epsC2,epsG1,perce,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
-
-
- default : {}
- }
- return 0;
+ if (!((b1 && b2)&&(b3 && b4))) return 1;
+
+
+ switch ( ord )
+ {
+ case 1 :
+ {
+ TypeCont = GeomAbs_G1;
+ switch(n)
+ {
+ case 11 : epsG1 = Draw::Atof(a[10]);
+ Standard_FALLTHROUGH
+ case 10 : epsC0 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsnl = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 8 - 11 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+
+ case 2 :
+ {
+ TypeCont = GeomAbs_G2;
+ switch(n)
+ {
+ case 13 : maxlen = Draw::Atof (a[12]);
+ Standard_FALLTHROUGH
+ case 12 : perce = Draw::Atof(a[11]);
+ Standard_FALLTHROUGH
+ case 11 : epsG1 = Draw::Atof(a[10]);
+ Standard_FALLTHROUGH
+ case 10 : epsC0 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsnl = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 8 - 13 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+ default:
+ std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 1 or 2" << std::endl;
+ return 1;
+ }
+
+ LocalAnalysis_SurfaceContinuity RES (surf1, U1, V1, surf2, U2, V2,
+ TypeCont, epsnl, epsC0, epsC1, epsC2, epsG1, perce, maxlen);
+ //LocalAnalysis::Dump(RES,cout);
+ Standard_SStream aSStream;
+ LocalAnalysis::Dump(RES,aSStream);
+ di << aSStream;
+ return 0;
}
/*********************************************************************************/
static Standard_Integer curveGcontinuity(Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, u1, u2;
+{
+ Standard_Real U1, U2, u1, u2;
GeomAbs_Shape TypeCont;
Standard_Integer ord;
Standard_Boolean b1, b2;
InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
switch ( ord )
- {
- case 1 : {
- switch(n)
- { case 9 : epsG1=Draw::Atof(a[8]);
- case 8 : epsC0= Draw::Atof(a[7]);
- case 7 : epsnl = Draw::Atof(a[6]);
- case 6 : {} break;
- default : return 1;
- }
- TypeCont=GeomAbs_G1;
- LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
- epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
- case 2 : {
- TypeCont=GeomAbs_G2;
- switch(n)
- {case 12 :maxlen =Draw::Atof(a[11]);
- case 11 :percent=Draw::Atof(a[10]);
- case 10 : epsG2= Draw::Atof(a[9]);
- case 9 : epsG1=Draw::Atof(a[8]);
- case 8 : epsC0= Draw::Atof(a[7]);
- case 7 : epsnl = Draw::Atof(a[6]);
- case 6 : {} break;
- default : return 1;
- }
- LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
- epsnl,epsC0, epsC1, epsC2, epsG1, epsG2,percent,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
- default : {}
- }
- return 0;
+ {
+ case 1 :
+ {
+ TypeCont = GeomAbs_G1;
+ switch(n)
+ {
+ case 9 : epsG1 = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : epsC0 = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsnl = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 6 - 8 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+ case 2 :
+ {
+ TypeCont = GeomAbs_G2;
+ switch(n)
+ {
+ case 12 : maxlen = Draw::Atof(a[11]);
+ Standard_FALLTHROUGH
+ case 11 : percent = Draw::Atof(a[10]);
+ Standard_FALLTHROUGH
+ case 10 : epsG2 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsG1 = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : epsC0 = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsnl = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 6 - 12 parameters" << std::endl;
+ return 1;
+ }
}
+ break;
+
+ default:
+ std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 1 or 2" << std::endl;
+ return 1;
+ }
+
+ LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
+ epsnl, epsC0, epsC1, epsC2, epsG1, epsG2, percent, maxlen);
+ //LocalAnalysis::Dump(RES,cout);
+ Standard_SStream aSStream;
+ LocalAnalysis::Dump(RES,aSStream);
+ di << aSStream;
+ return 0;
+}
/*********************************************************************************/
static Standard_Integer curveCcontinuity(Draw_Interpretor& di, Standard_Integer n, const char** a)
-{ Standard_Real U1, U2, u1, u2;
+{
+ Standard_Real U1, U2, u1, u2;
GeomAbs_Shape TypeCont;
Standard_Integer ord;
Standard_Boolean b1, b2;
Handle(Geom_Curve) curv2 = DrawTrSurf::GetCurve(a[4]);
if (curv2.IsNull()) return 1;
- U1 = Draw::Atof(a[3]);
- U2 = Draw::Atof(a[5]);
-
- ord = Draw::Atoi(a[1]);
+ U1 = Draw::Atof(a[3]);
+ U2 = Draw::Atof(a[5]);
- u1=curv1->FirstParameter();
- u2=curv1->LastParameter();
- b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
-
- u1=curv2->FirstParameter();
- u2=curv2->LastParameter();
- b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
-
- if (!(b1 && b2)) return 1;
-
-
- InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
- switch ( ord )
- { case 0 : { switch(n)
- { case 8 : epsC0= Draw::Atof(a[7]);
- case 7 : epsnl = Draw::Atof(a[6]);
- case 6 : {} break;
- default : return 1;
- }
- TypeCont=GeomAbs_C0;
- LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
- epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
-
- } break;
- case 1 : { switch(n)
- { case 9 : epsC1 =Draw::Atof(a[8]);
- case 8 : epsC0= Draw::Atof(a[7]);
- case 7 : epsnl = Draw::Atof(a[6]);
- case 6 : {} break;
- default : return 1;
- }
- TypeCont=GeomAbs_C1;
- LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
- epsnl,epsC0, epsC1, epsC2, epsG1,epsG2,percent,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
-
- } break;
- case 2 : { TypeCont=GeomAbs_C2;
- switch(n)
- {
- case 10 : epsC2= Draw::Atof(a[9]);
- case 9 : epsC1=Draw::Atof(a[8]);
- case 8 : epsC0= Draw::Atof(a[7]);
- case 7 : epsnl = Draw::Atof(a[6]);
- case 6 : {} break;
- default : return 1;
- }
- LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
- epsnl,epsC0, epsC1, epsC2, epsG1, epsG2,percent,maxlen );
- //LocalAnalysis::Dump(RES,cout);
- Standard_SStream aSStream;
- LocalAnalysis::Dump(RES,aSStream);
- di << aSStream;
- }
- break;
- default : {}
- }
- return 0;
+ ord = Draw::Atoi(a[1]);
+
+ u1=curv1->FirstParameter();
+ u2=curv1->LastParameter();
+ b1 = ((((U1>=u1)&&(U1<=u2))||((U1<=u1)&&(U1>=u2))));
+
+ u1=curv2->FirstParameter();
+ u2=curv2->LastParameter();
+ b2 = ((((U2>=u1)&&(U2<=u2))||((U2<=u1)&&(U2>=u2))));
+
+ if (!(b1 && b2)) return 1;
+
+ InitEpsCurv( epsnl,epsC0, epsC1, epsC2, epsG1, epsG2, percent,maxlen);
+ switch ( ord )
+ {
+ case 0 :
+ {
+ TypeCont = GeomAbs_C0;
+ switch(n)
+ {
+ case 8 : epsC0 = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsnl = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 6 - 8 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+ case 1 :
+ {
+ TypeCont = GeomAbs_C1;
+ switch(n)
+ {
+ case 9 : epsC1 = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : epsC0 = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsnl = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 6 - 9 parameters" << std::endl;
+ return 1;
+ }
+ }
+ break;
+
+ case 2 :
+ {
+ TypeCont = GeomAbs_C2;
+ switch(n)
+ {
+ case 10 : epsC2 = Draw::Atof(a[9]);
+ Standard_FALLTHROUGH
+ case 9 : epsC1 = Draw::Atof(a[8]);
+ Standard_FALLTHROUGH
+ case 8 : epsC0 = Draw::Atof(a[7]);
+ Standard_FALLTHROUGH
+ case 7 : epsnl = Draw::Atof(a[6]);
+ Standard_FALLTHROUGH
+ case 6 : break;
+ default :
+ std::cerr << "Error: invalid number of arguments: expected to get 6 - 10 parameters" << std::endl;
+ return 1;
+ }
}
+ break;
+
+ default:
+ std::cerr << "Error: invalid value of parameter 1 (" << a[1] << "): should be 0, 1, or 2" << std::endl;
+ return 1;
+ }
+
+ LocalAnalysis_CurveContinuity RES (curv1, U1, curv2, U2, TypeCont,
+ epsnl, epsC0, epsC1, epsC2, epsG1, epsG2, percent, maxlen);
+ //LocalAnalysis::Dump(RES,cout);
+ Standard_SStream aSStream;
+ LocalAnalysis::Dump(RES,aSStream);
+ di << aSStream;
+ return 0;
+}
+
/***************************************************************************/
void GeometryTest::ContinuityCommands( Draw_Interpretor& theCommands)
{
g = "GEOMETRY curves and surfaces continuity analysis ";
-
-
theCommands.Add("surfaceCcontinuity",
" surfaceCcontinuity order surf1 parU1 parV1 surf2 parU2 parV2 [eps_nul[ epsC0 [epsC1 [epsC2]]]]",
__FILE__,
modhelp = 1;
cout<<" -- Commands candidate for xsnew --"<<endl;
// HELP : soit complet (par defaut) soit limite a xsnew
+ Standard_FALLTHROUGH
case 0 : { // **** HELP
Handle(TColStd_HSequenceOfAsciiString) list;
// Help complet : on donne la liste des commandes, sans plus (deja pas mal)
switch (degree) {
case 3 :
coeff.SetValue(coeff.Lower()+3, gp_Pnt(DX*Di3, DY*Di3, DZ*Di3));
+ Standard_FALLTHROUGH
case 2 :
coeff.SetValue(coeff.Lower()+2, gp_Pnt(CX*Di2, CY*Di2, CZ*Di2));
+ Standard_FALLTHROUGH
case 1 :
coeff.SetValue(coeff.Lower()+1, gp_Pnt(BX*Di, BY*Di, BZ*Di));
coeff.SetValue(coeff.Lower()+0, gp_Pnt(AX, AY, AZ));
IGESDraw_ToolViewsVisible tool;
tool.OwnImplied(anent,iter);
}
+ break;
case 14 : {
DeclareAndCast(IGESDraw_ViewsVisibleWithAttr,anent,ent);
if (anent.IsNull()) break;
IGESDraw_ToolViewsVisibleWithAttr tool;
tool.OwnImplied(anent,iter);
}
+ break;
default : break;
}
}
break; // Nothing to be dumped here
case 5 : // Presently level 5 and 6 have the same Dump
S << endl;
+ Standard_FALLTHROUGH
case 6 :
{
Standard_Integer I;
}
case TopAbs_SHELL :
{
- SendWarning(st, "The First Surface only will be transfered.");
TopoDS_Iterator dabovil(igesShape);
if (dabovil.More()) {
- face = TopoDS::Face(dabovil.Value());
- break;
+ SendWarning(st, "The First Surface only will be transfered.");
+ face = TopoDS::Face(dabovil.Value());
+ break;
}
/* else AddF("... */
}
+ Standard_FALLTHROUGH
default:
{
Message_Msg msg1156("IGES_1156");
break;
}
}
+ Standard_FALLTHROUGH
case GeomAbs_Torus:
if(aType == GeomAbs_Torus)
{
break;
}
}
+ Standard_FALLTHROUGH
case GeomAbs_Cylinder:
theSingularSurfaceID = i + 1;
AddVertexPoint(theLine, theVertex, theArrPeriods);
case GeomAbs_Torus:
while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI;
while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI;
+ Standard_FALLTHROUGH
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
case GeomAbs_Torus:
while(V2<(V2p-1.5*M_PI)) V2+=M_PI+M_PI;
while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI;
+ Standard_FALLTHROUGH
case GeomAbs_Cylinder:
case GeomAbs_Cone:
case GeomAbs_Sphere:
if (Intersector.IsDone() && Intersector.IsEmpty())
break;
}
+ Standard_FALLTHROUGH
default:
{
IntPatch_PrmPrmIntersection interpp;
break;
}
}
+ Standard_FALLTHROUGH
case GeomAbs_Hyperbola :
case GeomAbs_Parabola :
case GeomAbs_OtherCurve :{
break;
}
}
+ Standard_FALLTHROUGH
default:
aRes = theResCoeff * theR3D;
break;
case Intrv_Similar :
Tins.FuseAtStart(myInter(index).Start(),
myInter(index).TolStart()); // modifier le debut
+ Standard_FALLTHROUGH
case Intrv_JustEnclosingAtEnd :
Tins.FuseAtEnd (myInter(index).End (),
myInter(index).TolEnd ()); // modifier la fin
+ Standard_FALLTHROUGH
case Intrv_Enclosing :
myInter.Remove(index); // detruire et
index--; // continuer
memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
break;
}
+ Standard_FALLTHROUGH
case LDOM_AsciiDoc:
case LDOM_AsciiDocClear:
case LDOM_AsciiHashed:
memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
break;
}
+ Standard_FALLTHROUGH
case LDOM_AsciiDoc:
case LDOM_AsciiDocClear:
case LDOM_AsciiHashed:
break;
}
isDoctype = Standard_True;
+ continue;
case LDOM_XmlReader::XML_COMMENT:
continue;
case LDOM_XmlReader::XML_FULL_ELEMENT:
}
continue;
}
+ isError = Standard_True;
+ myError = "Expected comment or end-of-file";
+ break;
case LDOM_XmlReader::XML_START_ELEMENT:
if (isElement == Standard_False) {
isElement = Standard_True;
}
isError = Standard_True;
myError = "Expected comment or end-of-file";
+ break;
case LDOM_XmlReader::XML_END_ELEMENT:
if (endElement()) {
isError = Standard_True;
myError = "User abort at endElement()";
}
+ break;
case LDOM_XmlReader::XML_EOF:
break;
case LDOM_XmlReader::XML_UNKNOWN:
break;
case LDOM_AsciiFree:
myType = LDOM_AsciiDoc;
+ Standard_FALLTHROUGH
case LDOM_AsciiDocClear:
case LDOM_AsciiDoc:
{
return XML_UNKNOWN;
case '\0':
if (myEOF == Standard_True) continue;
+ Standard_FALLTHROUGH
default:
// Limitation: we do not treat '&' as special character
aPtr = (const char *) memchr (myPtr, '<', myEndPtr - myPtr);
switch (myPtr[0]) {
case '=' :
aState = STATE_ATTRIBUTE_VALUE;
+ Standard_FALLTHROUGH
case ' ' :
case '\t':
case '\n':
aNameEnd = aPtr;
return Standard_False;
}
+ Standard_FALLTHROUGH
case '.' :
case '-' :
case '_' :
aMessage += aString;
break;
}
+ Standard_FALLTHROUGH
case MsgFile_WaitingMessage:
if (isKeyword == Standard_False)
{
break;
}
// Pass from here to 'case MsgFile_WaitingKeyword'
+ Standard_FALLTHROUGH
case MsgFile_WaitingKeyword:
if (isKeyword)
{
switch (aBytesToRead)
{
case 5: myCharUtf32 += *aPos++; myCharUtf32 <<= 6; // remember, illegal UTF-8
+ Standard_FALLTHROUGH
case 4: myCharUtf32 += *aPos++; myCharUtf32 <<= 6; // remember, illegal UTF-8
+ Standard_FALLTHROUGH
case 3: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+ Standard_FALLTHROUGH
case 2: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+ Standard_FALLTHROUGH
case 1: myCharUtf32 += *aPos++; myCharUtf32 <<= 6;
+ Standard_FALLTHROUGH
case 0: myCharUtf32 += *aPos++;
}
myCharUtf32 -= offsetsFromUTF8[aBytesToRead];
Handle(TColStd_HArray1OfByte) aBitMap = fillPointBitmap (aSize);
aMarkerImage2 = new Graphic3d_MarkerImage (aBitMap, aSize, aSize);
}
+ Standard_FALLTHROUGH
case Aspect_TOM_O_PLUS:
case Aspect_TOM_O_STAR:
case Aspect_TOM_O_X:
}
case Aspect_TOM_RING1:
if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+ Standard_FALLTHROUGH
case Aspect_TOM_RING2:
if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+ Standard_FALLTHROUGH
case Aspect_TOM_RING3:
{
if (aLimit == 0.0f) aLimit = aScale * 0.8f;
glBitmap (aSize, aSize, (GLfloat )(0.5f * aSize), (GLfloat )(0.5f * aSize),
0.0f, 0.0f, &aBitMap->Array1().Value (aBitMap->Lower()));
}
+ Standard_FALLTHROUGH
case Aspect_TOM_O_PLUS:
case Aspect_TOM_O_STAR:
case Aspect_TOM_O_X:
}
case Aspect_TOM_RING1:
if (aLimit == 0.0f) aLimit = aScale * 0.2f;
+ Standard_FALLTHROUGH
case Aspect_TOM_RING2:
if (aLimit == 0.0f) aLimit = aScale * 0.5f;
+ Standard_FALLTHROUGH
case Aspect_TOM_RING3:
{
if (aLimit == 0.0f) aLimit = aScale * 0.8f;
R1 = R2 = Circ.Radius();
}
+ Standard_FALLTHROUGH
case GeomAbs_Ellipse:
{
if ( Type == GeomAbs_Ellipse) {
case STEPControl_BrepWithVoids : ModeTrans() = 5; break;
case STEPControl_FacetedBrep : ModeTrans() = 1; break;
case STEPControl_FacetedBrepAndBrepWithVoids : ModeTrans() = 6; break;
- case STEPControl_ShellBasedSurfaceModel : ModeTrans() = 2;
- case STEPControl_GeometricCurveSet : ModeTrans() = 4;
+ case STEPControl_ShellBasedSurfaceModel : ModeTrans() = 2; break;
+ case STEPControl_GeometricCurveSet : ModeTrans() = 4; break;
case STEPControl_Hybrid : ModeTrans() = 0; break; // PAS IMPLEMENTE !!
default: break;
}
switch (aSelection->UpdateStatus())
{
- case SelectMgr_TOU_Full:
- if (theObject->HasSelection (theMode))
- theSelector->RemoveSelectionOfObject (theObject, aSelection);
- theObject->RecomputePrimitives (theMode);
- case SelectMgr_TOU_Partial:
- if(theObject->HasTransformation())
- theObject->UpdateTransformations (aSelection);
- theSelector->RebuildObjectsTree();
- break;
- default:
- break;
+ case SelectMgr_TOU_Full:
+ {
+ if (theObject->HasSelection (theMode))
+ {
+ theSelector->RemoveSelectionOfObject (theObject, aSelection);
+ }
+ theObject->RecomputePrimitives (theMode);
+ // pass through SelectMgr_TOU_Partial
+ }
+ Standard_FALLTHROUGH
+ case SelectMgr_TOU_Partial:
+ {
+ if(theObject->HasTransformation())
+ {
+ theObject->UpdateTransformations (aSelection);
+ }
+ theSelector->RebuildObjectsTree();
+ break;
+ }
+ default:
+ break;
}
aSelection->UpdateStatus(SelectMgr_TOU_None);
{
switch (aSelection->UpdateStatus())
{
- case SelectMgr_TOU_Full:
- ClearSelectionStructures (theObject, aSelection->Mode());
- theObject->RecomputePrimitives (aSelection->Mode()); // no break on purpose...
- RestoreSelectionStructures (theObject, aSelection->Mode());
- case SelectMgr_TOU_Partial:
- theObject->UpdateTransformations (aSelection);
- rebuildSelectionStructures();
- break;
- default:
- break;
+ case SelectMgr_TOU_Full:
+ {
+ ClearSelectionStructures (theObject, aSelection->Mode());
+ theObject->RecomputePrimitives (aSelection->Mode()); // no break on purpose...
+ RestoreSelectionStructures (theObject, aSelection->Mode());
+ // pass through SelectMgr_TOU_Partial
+ }
+ Standard_FALLTHROUGH
+ case SelectMgr_TOU_Partial:
+ {
+ theObject->UpdateTransformations (aSelection);
+ rebuildSelectionStructures();
+ break;
+ }
+ default:
+ break;
}
aSelection->UpdateStatus (SelectMgr_TOU_None);
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
{
switch (aSelection->UpdateStatus())
{
- case SelectMgr_TOU_Full:
- ClearSelectionStructures (theObject, aSelection->Mode());
- theObject->RecomputePrimitives (aSelection->Mode());
- RestoreSelectionStructures (theObject, aSelection->Mode());
- case SelectMgr_TOU_Partial:
- theObject->UpdateTransformations (aSelection);
- rebuildSelectionStructures();
- break;
- default:
- break;
+ case SelectMgr_TOU_Full:
+ {
+ ClearSelectionStructures (theObject, aSelection->Mode());
+ theObject->RecomputePrimitives (aSelection->Mode());
+ RestoreSelectionStructures (theObject, aSelection->Mode());
+ // pass through SelectMgr_TOU_Partial
+ }
+ Standard_FALLTHROUGH
+ case SelectMgr_TOU_Partial:
+ {
+ theObject->UpdateTransformations (aSelection);
+ rebuildSelectionStructures();
+ break;
+ }
+ default:
+ break;
}
aSelection->UpdateStatus (SelectMgr_TOU_None);
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
{
switch (aSelection->UpdateStatus())
{
- case SelectMgr_TOU_Full:
- ClearSelectionStructures (theObject, aSelection->Mode(), theSelector);
- theObject->RecomputePrimitives (aSelection->Mode());
- RestoreSelectionStructures (theObject, aSelection->Mode(), theSelector);
- case SelectMgr_TOU_Partial:
- if (theObject->HasTransformation())
+ case SelectMgr_TOU_Full:
{
- theObject->UpdateTransformations (aSelection);
- theSelector->RebuildObjectsTree();
+ ClearSelectionStructures (theObject, aSelection->Mode(), theSelector);
+ theObject->RecomputePrimitives (aSelection->Mode());
+ RestoreSelectionStructures (theObject, aSelection->Mode(), theSelector);
+ // pass through SelectMgr_TOU_Partial
}
- break;
- default:
- break;
+ Standard_FALLTHROUGH
+ case SelectMgr_TOU_Partial:
+ {
+ if (theObject->HasTransformation())
+ {
+ theObject->UpdateTransformations (aSelection);
+ theSelector->RebuildObjectsTree();
+ }
+ break;
+ }
+ default:
+ break;
}
aSelection->UpdateStatus(SelectMgr_TOU_None);
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Purpose: This file is intended to be the first file #included to any
-// Open CASCADE source. It defines platform-specific pre-processor
-// macros necessary for correct compilation of Open CASCADE code
+//! @file
+//! This file is intended to be the first file included to any
+//! Open CASCADE source. It defines platform-specific pre-processor
+//! macros necessary for correct compilation of Open CASCADE code.
#ifndef _Standard_Macro_HeaderFile
# define _Standard_Macro_HeaderFile
+//! @def Standard_OVERRIDE
+//! Should be used in declarations of virtual methods overriden in the
+//! derived classes, to cause compilation error in the case if that virtual
+//! function disappears or changes its signature in the base class.
+//!
+//! Expands to C++11 keyword "override" on compilers that are known to
+//! suppot it; empty in other cases.
#if defined(__cplusplus) && (__cplusplus >= 201100L)
// part of C++11 standard
#define Standard_OVERRIDE override
#define Standard_OVERRIDE
#endif
-// Macro for marking variables / functions as possibly unused
-// so that compiler will not emit redundant "unused" warnings.
+//! @def Standard_FALLTHROUGH
+//! Should be used in a switch statement immediately before a case label,
+//! if code associated with the previous case label may fall through to that
+//! next label (i.e. does not end with "break" or "return" etc.).
+//! This macro indicates that the fall through is intentional and should not be
+//! diagnosed by a compiler that warns on fallthrough.
+//!
+//! Expands to C++17 attribute statement "[[fallthrough]];" on compilers that
+//! declare support of C++17, or to "__attribute__((fallthrough));" on
+//! GCC 7+.
+#if defined(__cplusplus) && (__cplusplus >= 201703L)
+ // part of C++17 standard
+ #define Standard_FALLTHROUGH [[fallthrough]];
+#elif defined(__GNUC__) && (__GNUC__ >= 7)
+ // gcc 7+
+ #define Standard_FALLTHROUGH __attribute__((fallthrough));
+#else
+ #define Standard_FALLTHROUGH
+#endif
+
+//! @def Standard_UNUSED
+//! Macro for marking variables / functions as possibly unused
+//! so that compiler will not emit redundant "unused" warnings.
+//!
+//! Expands to "__attribute__((unused))" on GCC and CLang.
#if defined(__GNUC__) || defined(__clang__)
#define Standard_UNUSED __attribute__((unused))
#else
#define Standard_UNUSED
#endif
-// Macro Standard_DEPRECATED("message") can be used to declare a method deprecated.
-// If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.
+//! @def Standard_DEPRECATED("message")
+//! Can be used in declaration of a method or a class to mark it as deprecated.
+//! Use of such method or class will cause compiler warning (if supported by
+//! compiler and unless disabled).
+//! If macro OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is defined empty.
#ifdef OCCT_NO_DEPRECATED
#define Standard_DEPRECATED(theMsg)
#else
#endif
#endif
-// Disable warnings about deprecated features.
-// This is useful for sections of code kept for backward compatibility and scheduled for removal.
-
+//! @def Standard_DISABLE_DEPRECATION_WARNINGS
+//! Disables warnings on use of deprecated features (see Standard_DEPRECATED),
+//! from the current point till appearance of Standard_ENABLE_DEPRECATION_WARNINGS macro.
+//! This is useful for sections of code kept for backward compatibility and scheduled for removal.
+//!
+//! @def Standard_ENABLE_DEPRECATION_WARNINGS
+//! Enables warnings on use of deprecated features previously disabled by
+//! Standard_DISABLE_DEPRECATION_WARNINGS.
#if defined(__ICL) || defined (__INTEL_COMPILER)
#define Standard_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478))
#define Standard_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop))
#endif
+//! @def Standard_EXPORT
+//! This macro should be used in declarations of public methods
+//! to ensure that they are exported from DLL on Windows and thus
+//! can be called from other (dependent) libraries or applications.
+
# if defined(_WIN32) && !defined(HAVE_NO_DLL)
//======================================================
# endif // __Standard_DLL
# endif // __Standard_API
-// Support of Universal Windows Platform
+//! @def OCCT_UWP
+//! This macro is defined on Windows platform in the case if the code
+//! is being compiled for UWP (Universal Windows Platform).
#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
#define OCCT_UWP
#else
// TopLoc_Location loc;
Handle(Geom_Curve) curve = BRep_Tool::Curve (edge,first,last);
if (!curve.IsNull()) {
- if (curve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) {
- curve = (Handle(Geom_TrimmedCurve)::DownCast (curve))->BasisCurve ();
- }
- if (curve->IsInstance(STANDARD_TYPE(Geom_Line))) {
- type = TDataXtd_LINE;
- }
- else if (curve->IsInstance(STANDARD_TYPE(Geom_Circle))) {
- type = TDataXtd_CIRCLE;
- }
- else if (curve->IsInstance(STANDARD_TYPE(Geom_Ellipse))) {
- type = TDataXtd_ELLIPSE;
- }
- break;
+ if (curve->IsInstance (STANDARD_TYPE (Geom_TrimmedCurve))) {
+ curve = (Handle(Geom_TrimmedCurve)::DownCast (curve))->BasisCurve ();
+ }
+ if (curve->IsInstance(STANDARD_TYPE(Geom_Line))) {
+ type = TDataXtd_LINE;
+ }
+ else if (curve->IsInstance(STANDARD_TYPE(Geom_Circle))) {
+ type = TDataXtd_CIRCLE;
+ }
+ else if (curve->IsInstance(STANDARD_TYPE(Geom_Ellipse))) {
+ type = TDataXtd_ELLIPSE;
+ }
}
#ifdef OCCT_DEBUG
else {
- throw Standard_Failure("curve Null dans TDataXtd_Geometry");
+ throw Standard_Failure("curve Null dans TDataXtd_Geometry");
}
#endif
+ break;
}
case TopAbs_FACE :
{
const TopoDS_Face& face = TopoDS::Face(shape);
Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
if (!surface.IsNull()) {
- if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
- surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
- }
- if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
- type = TDataXtd_CYLINDER;
- }
- else if (surface->IsInstance(STANDARD_TYPE(Geom_Plane))) {
- type = TDataXtd_PLANE;
- }
+ if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
+ surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
+ }
+ if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
+ type = TDataXtd_CYLINDER;
+ }
+ else if (surface->IsInstance(STANDARD_TYPE(Geom_Plane))) {
+ type = TDataXtd_PLANE;
+ }
}
#ifdef OCCT_DEBUG
else {
- throw Standard_Failure("surface Null dans TDataXtd_Geometry");
+ throw Standard_Failure("surface Null dans TDataXtd_Geometry");
}
#endif
break;
}
default :
- {
- break;
- }
+ break;
}
return type;
}
switch (aType) {
case TopAbs_VERTEX: // can't do something from vertex
break;
- case TopAbs_EDGE: {// make wire from edges
- if (theType <= TopAbs_SOLID) break;
- BRepBuilderAPI_MakeWire aMakeWire;
- aMakeWire.Add(aShapes);
- if (!aMakeWire.IsDone()) return theShape;
- if (theType == TopAbs_WIRE) return aMakeWire.Wire();
- aShapes.Clear(); // don't break: we can do something more of it
- aShapes.Append(aMakeWire.Wire());
- aListIter.Initialize(aShapes);
- }
- case TopAbs_WIRE: {// make faceS from wires (one per one)
- if (theType < TopAbs_SOLID) break;
- TopTools_ListOfShape aFaces;
- for(;aListIter.More();aListIter.Next()) {
- BRepBuilderAPI_MakeFace aMakeFace(TopoDS::Wire(aListIter.Value()));
- if (!aMakeFace.IsDone()) aFaces.Append(aMakeFace.Face());
+ case TopAbs_EDGE:
+ {
+ // make wire from edges
+ if (theType <= TopAbs_SOLID) break;
+ BRepBuilderAPI_MakeWire aMakeWire;
+ aMakeWire.Add(aShapes);
+ if (!aMakeWire.IsDone()) return theShape;
+ if (theType == TopAbs_WIRE) return aMakeWire.Wire();
+ aShapes.Clear(); // don't break: we can do something more of it
+ aShapes.Append(aMakeWire.Wire());
+ aListIter.Initialize(aShapes);
}
- if (theType == TopAbs_FACE) {
- if (aFaces.Extent() == 1) return aFaces.First();
- return theShape;
+ Standard_FALLTHROUGH
+ case TopAbs_WIRE:
+ {
+ // make faceS from wires (one per one)
+ if (theType < TopAbs_SOLID) break;
+ TopTools_ListOfShape aFaces;
+ for(;aListIter.More();aListIter.Next()) {
+ BRepBuilderAPI_MakeFace aMakeFace(TopoDS::Wire(aListIter.Value()));
+ if (!aMakeFace.IsDone()) aFaces.Append(aMakeFace.Face());
+ }
+ if (theType == TopAbs_FACE) {
+ if (aFaces.Extent() == 1) return aFaces.First();
+ return theShape;
+ }
+ aShapes.Assign(aFaces); // don't break: we can do something more of it
+ aListIter.Initialize(aShapes);
}
- aShapes.Assign(aFaces); // don't break: we can do something more of it
- aListIter.Initialize(aShapes);
- }
- case TopAbs_FACE: {// make shell from faces
- if (theType < TopAbs_SOLID) break;
- BRep_Builder aShellBuilder;
- TopoDS_Shell aShell;
- aShellBuilder.MakeShell(aShell);
- for(;aListIter.More();aListIter.Next()) aShellBuilder.Add(aShell,TopoDS::Face(aListIter.Value()));
- aShell.Closed (BRep_Tool::IsClosed (aShell));
- if (theType == TopAbs_SHELL) return aShell;
- aShapes.Clear(); // don't break: we can do something more of it
- aShapes.Append(aShell);
- aListIter.Initialize(aShapes);
- }
- case TopAbs_SHELL: {// make solids from shells (one per one)
- TopTools_ListOfShape aSolids;
- for(;aListIter.More();aListIter.Next()) {
- BRepBuilderAPI_MakeSolid aMakeSolid(TopoDS::Shell(aListIter.Value()));
- if (aMakeSolid.IsDone()) aSolids.Append(aMakeSolid.Solid());
+ Standard_FALLTHROUGH
+ case TopAbs_FACE:
+ {
+ // make shell from faces
+ if (theType < TopAbs_SOLID) break;
+ BRep_Builder aShellBuilder;
+ TopoDS_Shell aShell;
+ aShellBuilder.MakeShell(aShell);
+ for(;aListIter.More();aListIter.Next()) aShellBuilder.Add(aShell,TopoDS::Face(aListIter.Value()));
+ aShell.Closed (BRep_Tool::IsClosed (aShell));
+ if (theType == TopAbs_SHELL) return aShell;
+ aShapes.Clear(); // don't break: we can do something more of it
+ aShapes.Append(aShell);
+ aListIter.Initialize(aShapes);
}
- if (theType == TopAbs_SOLID) {
- if (aSolids.Extent() == 1) return aSolids.First();
- return theShape;
+ Standard_FALLTHROUGH
+ case TopAbs_SHELL:
+ {
+ // make solids from shells (one per one)
+ TopTools_ListOfShape aSolids;
+ for(;aListIter.More();aListIter.Next()) {
+ BRepBuilderAPI_MakeSolid aMakeSolid(TopoDS::Shell(aListIter.Value()));
+ if (aMakeSolid.IsDone()) aSolids.Append(aMakeSolid.Solid());
+ }
+ if (theType == TopAbs_SOLID) {
+ if (aSolids.Extent() == 1) return aSolids.First();
+ return theShape;
+ }
+ aShapes.Assign(aSolids); // don't break: we can do something more of it
+ aListIter.Initialize(aShapes);
+ }
+ Standard_FALLTHROUGH
+ case TopAbs_SOLID:
+ {
+ // make compsolid from solids
+ BRep_Builder aCompBuilder;
+ TopoDS_CompSolid aCompSolid;
+ aCompBuilder.MakeCompSolid(aCompSolid);
+ for(;aListIter.More();aListIter.Next()) aCompBuilder.Add(aCompSolid,TopoDS::Solid(aListIter.Value()));
+ if (theType == TopAbs_COMPSOLID) return aCompSolid;
}
- aShapes.Assign(aSolids); // don't break: we can do something more of it
- aListIter.Initialize(aShapes);
- }
- case TopAbs_SOLID: {// make compsolid from solids
- BRep_Builder aCompBuilder;
- TopoDS_CompSolid aCompSolid;
- aCompBuilder.MakeCompSolid(aCompSolid);
- for(;aListIter.More();aListIter.Next()) aCompBuilder.Add(aCompSolid,TopoDS::Solid(aListIter.Value()));
- if (theType == TopAbs_COMPSOLID) return aCompSolid;
- }
}
}
return theShape;
switch (aSystemUnits) {
case UnitsAPI_DEFAULT :
if( !CurrentUnits.IsNull() ) break;
+ Standard_FALLTHROUGH
case UnitsAPI_SI :
currentSystem = UnitsAPI_SI;
if( SICurrentUnits.IsNull() ) {
return;
}
}
+ Standard_FALLTHROUGH
case ViewerTest_AutoUpdater::RedrawMode_Forced:
{
if (!myContext.IsNull())