/*********************************************************************************/
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__,
// 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
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;