diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 47d67360bb..f065fecfd0 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -481,7 +481,7 @@ private: #else Part::ImportStep *pcFeature = (Part::ImportStep *)pcDoc->addObject("Part::ImportStep",file.fileNamePure().c_str()); pcFeature->FileName.setValue(Name); -#endif +#endif pcDoc->recompute(); } #if 1 @@ -534,7 +534,7 @@ private: // add Import feature Part::ImportStep *pcFeature = (Part::ImportStep *)pcDoc->addObject("Part::ImportStep",file.fileNamePure().c_str()); pcFeature->FileName.setValue(Name); -#endif +#endif pcDoc->recompute(); } #if 1 @@ -611,7 +611,7 @@ private: if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(TopoShapePy::Type), &pcObj, &name)) throw Py::Exception(); - App::Document *pcDoc = App::GetApplication().getActiveDocument(); + App::Document *pcDoc = App::GetApplication().getActiveDocument(); if (!pcDoc) pcDoc = App::GetApplication().newDocument(); TopoShapePy* pShape = static_cast(pcObj); @@ -631,7 +631,7 @@ private: BRep_Builder builder; TopoDS_Compound Comp; builder.MakeCompound(Comp); - + try { Py::Sequence list(pcObj); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { @@ -660,7 +660,7 @@ private: TopoDS_Shell shell; //BRepOffsetAPI_Sewing mkShell; builder.MakeShell(shell); - + try { Py::Sequence list(obj); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { @@ -1046,7 +1046,7 @@ private: error = "Line through identic points"; break; } - // Error + // Error if (error) { throw Py::Exception(PartExceptionOCCError, error); } @@ -1670,7 +1670,7 @@ private: } else { PyErr_Clear(); - if (PyArg_ParseTuple(args.ptr(), "Osd|d", &intext, + if (PyArg_ParseTuple(args.ptr(), "Osd|d", &intext, &fontspec, &height, &track)) { diff --git a/src/Mod/Part/App/ArcPyImp.cpp b/src/Mod/Part/App/ArcPyImp.cpp index 47348a19e8..0e627b6f65 100644 --- a/src/Mod/Part/App/ArcPyImp.cpp +++ b/src/Mod/Part/App/ArcPyImp.cpp @@ -40,7 +40,6 @@ # include #endif - #include "ArcPy.h" #include "ArcPy.cpp" #include "CirclePy.h" diff --git a/src/Mod/Part/App/Attacher.cpp b/src/Mod/Part/App/Attacher.cpp index e6988570f0..eef3f8f556 100644 --- a/src/Mod/Part/App/Attacher.cpp +++ b/src/Mod/Part/App/Attacher.cpp @@ -420,7 +420,7 @@ eRefType AttachEngine::getShapeType(const TopoDS_Shape& sh) { if(sh.IsNull()) return rtAnything; - + switch (sh.ShapeType()){ case TopAbs_SHAPE: return rtAnything; //note: there's no rtPart detection here - not enough data! diff --git a/src/Mod/Part/App/BSplineCurvePyImp.cpp b/src/Mod/Part/App/BSplineCurvePyImp.cpp index ed74e52b21..8f724b9ad1 100644 --- a/src/Mod/Part/App/BSplineCurvePyImp.cpp +++ b/src/Mod/Part/App/BSplineCurvePyImp.cpp @@ -38,9 +38,9 @@ # include # include # include +# include #endif -#include #include #include @@ -60,7 +60,7 @@ std::string BSplineCurvePy::representation(void) const PyObject *BSplineCurvePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of BSplineCurvePy and the Twin object + // create a new instance of BSplineCurvePy and the Twin object return new BSplineCurvePy(new GeomBSplineCurve); } @@ -76,7 +76,7 @@ int BSplineCurvePy::PyInit(PyObject* args, PyObject* kwd) // poles, [ periodic, degree, interpolate ] // {"poles", "mults", "knots", "periodic", "degree", "weights", "CheckRational", NULL}; obj = buildFromPolesMultsKnots(args,kwd); - + if (obj) { Py_DECREF(obj); return 0; @@ -694,28 +694,28 @@ Py::Long BSplineCurvePy::getDegree(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->Degree()); + return Py::Long(curve->Degree()); } Py::Long BSplineCurvePy::getMaxDegree(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->MaxDegree()); + return Py::Long(curve->MaxDegree()); } Py::Long BSplineCurvePy::getNbPoles(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->NbPoles()); + return Py::Long(curve->NbPoles()); } Py::Long BSplineCurvePy::getNbKnots(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->NbKnots()); + return Py::Long(curve->NbKnots()); } Py::Object BSplineCurvePy::getStartPoint(void) const @@ -738,14 +738,14 @@ Py::Object BSplineCurvePy::getFirstUKnotIndex(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->FirstUKnotIndex()); + return Py::Long(curve->FirstUKnotIndex()); } Py::Object BSplineCurvePy::getLastUKnotIndex(void) const { Handle(Geom_BSplineCurve) curve = Handle(Geom_BSplineCurve)::DownCast (getGeometryPtr()->handle()); - return Py::Long(curve->LastUKnotIndex()); + return Py::Long(curve->LastUKnotIndex()); } Py::List BSplineCurvePy::getKnotSequence(void) const @@ -808,17 +808,17 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) double weight1 = 0; double weight2 = 0; double weight3 = 0; - + static char* kwds_interp[] = {"Points", "DegMax", "Continuity", "Tolerance", "DegMin", "ParamType", "Parameters", "LengthWeight", "CurvatureWeight", "TorsionWeight", NULL}; - + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|isdisOddd",kwds_interp, &obj, °Max, - &continuity, &tol3d, °Min, + &continuity, &tol3d, °Min, &parType, &par, &weight1, &weight2, &weight3)) return 0; - + try { Py::Sequence list(obj); TColgp_Array1OfPnt pnts(1,list.size()); @@ -831,7 +831,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) if (degMin > degMax) { Standard_Failure::Raise("DegMin must be lower or equal to DegMax"); } - + GeomAbs_Shape c; std::string str = continuity; if (str == "C0") @@ -850,7 +850,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) c = GeomAbs_CN; else c = GeomAbs_C2; - + if (weight1 || weight2 || weight3) { // It seems that this function only works with Continuity = C0, C1 or C2 GeomAPI_PointsToBSpline fit(pnts, weight1, weight2, weight3, degMax, c, tol3d); @@ -864,7 +864,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) return 0; // goes to the catch block } } - + if (par) { Py::Sequence plist(par); TColStd_Array1OfReal parameters(1,plist.size()); @@ -873,7 +873,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) Py::Float f(*it); parameters(index++) = static_cast(f); } - + GeomAPI_PointsToBSpline fit(pnts, parameters, degMin, degMax, c, tol3d); Handle(Geom_BSplineCurve) spline = fit.Curve(); if (!spline.IsNull()) { @@ -885,7 +885,7 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds) return 0; // goes to the catch block } } - + Approx_ParametrizationType pt; std::string pstr = parType; if (pstr == "Uniform") @@ -1374,5 +1374,5 @@ PyObject* BSplineCurvePy::getCustomAttributes(const char* /*attr*/) const int BSplineCurvePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/FT2FC.cpp b/src/Mod/Part/App/FT2FC.cpp index c27c345d9d..78d2537a8c 100644 --- a/src/Mod/Part/App/FT2FC.cpp +++ b/src/Mod/Part/App/FT2FC.cpp @@ -29,31 +29,33 @@ #ifdef FCUseFreeType -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef _PreComp_ +# include +# include +# include +# include +# include +# include +# include +# include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // _PreComp #include #include "TopoShape.h" @@ -98,9 +100,9 @@ PyObject* FT2FC(const Py_UNICODE *PyUString, const char *FontSpec, const double stringheight, // fc coords const double tracking) { // fc coords - FT_Library FTLib; - FT_Face FTFont; - FT_Error error; + FT_Library FTLib; + FT_Face FTFont; + FT_Error error; FT_Long FaceIndex = 0; // some fonts have multiple faces FT_Vector kern; FT_UInt FTLoadFlags = FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP; @@ -111,14 +113,14 @@ PyObject* FT2FC(const Py_UNICODE *PyUString, int cadv; size_t i; PyObject *WireList, *CharList; - - error = FT_Init_FreeType(&FTLib); + + error = FT_Init_FreeType(&FTLib); if(error) { ErrorMsg << "FT_Init_FreeType failed: " << error; throw std::runtime_error(ErrorMsg.str()); } - - // FT does not return an error if font file not found? + + // FT does not return an error if font file not found? std::ifstream is; is.open (FontSpec); if (!is) { @@ -126,26 +128,26 @@ PyObject* FT2FC(const Py_UNICODE *PyUString, throw std::runtime_error(ErrorMsg.str()); } - error = FT_New_Face(FTLib,FontSpec,FaceIndex, &FTFont); + error = FT_New_Face(FTLib,FontSpec,FaceIndex, &FTFont); if(error) { ErrorMsg << "FT_New_Face failed: " << error; throw std::runtime_error(ErrorMsg.str()); } - + //TODO: check that FTFont is scalable? only relevant for hinting etc? - -// FT2 blows up if char size is not set to some non-zero value. -// This sets size to 48 point. Magic. - error = FT_Set_Char_Size(FTFont, - 0, /* char_width in 1/64th of points */ - 48*64, /* char_height in 1/64th of points */ - 0, /* horizontal device resolution */ - 0 ); /* vertical device resolution */ + +// FT2 blows up if char size is not set to some non-zero value. +// This sets size to 48 point. Magic. + error = FT_Set_Char_Size(FTFont, + 0, /* char_width in 1/64th of points */ + 48*64, /* char_height in 1/64th of points */ + 0, /* horizontal device resolution */ + 0 ); /* vertical device resolution */ if(error) { ErrorMsg << "FT_Set_Char_Size failed: " << error; throw std::runtime_error(ErrorMsg.str()); } - + CharList = PyList_New(0); scalefactor = stringheight/float(FTFont->height); for (i=0; i Wires; std::vector Edges; UNICHAR currchar; @@ -193,7 +195,7 @@ struct FTDC_Ctx { // p points to the context where we remember what happened previously (last point, etc) static int move_cb(const FT_Vector* pt, void* p) { FTDC_Ctx* dc = (FTDC_Ctx*) p; - if (!dc->Edges.empty()){ + if (!dc->Edges.empty()){ TopoDS_Wire newwire = edgesToWire(dc->Edges); dc->Wires.push_back(newwire); dc->Edges.clear(); @@ -202,7 +204,7 @@ static int move_cb(const FT_Vector* pt, void* p) { return 0; } -// line_cb called for line segment in the current contour: line(LastVert -- pt) +// line_cb called for line segment in the current contour: line(LastVert -- pt) static int line_cb(const FT_Vector* pt, void* p) { FTDC_Ctx* dc = (FTDC_Ctx*) p; gp_Pnt2d v1(dc->LastVert.x, dc->LastVert.y); @@ -215,8 +217,8 @@ static int line_cb(const FT_Vector* pt, void* p) { } return 0; } - -// quad_cb called for quadratic (conic) BCurve segment in the current contour + +// quad_cb called for quadratic (conic) BCurve segment in the current contour // (ie V-C-V in TTF fonts). BCurve(LastVert -- pt0 -- pt1) static int quad_cb(const FT_Vector* pt0, const FT_Vector* pt1, void* p) { FTDC_Ctx* dc = (FTDC_Ctx*) p; @@ -274,8 +276,8 @@ PyObject* getGlyphContours(FT_Face FTFont, UNICHAR currchar, double PenPos, doub ctx.currchar = currchar; ctx.surf = new Geom_Plane(origin,gp::DZ()); - error = FT_Outline_Decompose(&FTFont->glyph->outline, - &FTcbFuncs, + error = FT_Outline_Decompose(&FTFont->glyph->outline, + &FTcbFuncs, &ctx); if(error) { ErrorMsg << "FT_Decompose failed: " << error; @@ -283,7 +285,7 @@ PyObject* getGlyphContours(FT_Face FTFont, UNICHAR currchar, double PenPos, doub } // make the last TopoDS_Wire - if (!ctx.Edges.empty()){ + if (!ctx.Edges.empty()){ ctx.Wires.push_back(edgesToWire(ctx.Edges)); } /*FT_Orientation fontClass =*/ FT_Outline_Get_Orientation(&FTFont->glyph->outline); @@ -303,7 +305,7 @@ PyObject* getGlyphContours(FT_Face FTFont, UNICHAR currchar, double PenPos, doub throw std::runtime_error(ErrorMsg.str()); } PyList_Append(ret,new TopoShapeWirePy(new TopoShape(TopoDS::Wire(BRepScale.Shape())))); - } + } return(ret); } @@ -311,10 +313,10 @@ PyObject* getGlyphContours(FT_Face FTFont, UNICHAR currchar, double PenPos, doub //TODO: should check FT_HASKERNING flag? returns (0,0) if no kerning? FT_Vector getKerning(FT_Face FTFont, UNICHAR lc, UNICHAR rc) { FT_Vector retXY; - FT_Error error; - std::stringstream ErrorMsg; + FT_Error error; + std::stringstream ErrorMsg; FT_Vector ftKern; - FT_UInt lcx = FT_Get_Char_Index(FTFont, lc); + FT_UInt lcx = FT_Get_Char_Index(FTFont, lc); FT_UInt rcx = FT_Get_Char_Index(FTFont, rc); error = FT_Get_Kerning(FTFont,lcx,rcx,FT_KERNING_DEFAULT,&ftKern); if(error) { diff --git a/src/Mod/Part/App/FaceMakerBullseye.cpp b/src/Mod/Part/App/FaceMakerBullseye.cpp index 69404fcf43..0c3fc4e85f 100644 --- a/src/Mod/Part/App/FaceMakerBullseye.cpp +++ b/src/Mod/Part/App/FaceMakerBullseye.cpp @@ -45,6 +45,7 @@ # include # include # include +# include #endif #include "FaceMakerBullseye.h" @@ -52,7 +53,7 @@ #include "TopoShape.h" -#include + using namespace Part; diff --git a/src/Mod/Part/App/FaceMakerCheese.cpp b/src/Mod/Part/App/FaceMakerCheese.cpp index 7e098acb99..a52ffc2939 100644 --- a/src/Mod/Part/App/FaceMakerCheese.cpp +++ b/src/Mod/Part/App/FaceMakerCheese.cpp @@ -43,11 +43,12 @@ # include # include # include +# include #endif #include "FaceMakerCheese.h" -#include + using namespace Part; diff --git a/src/Mod/Part/App/FeatureExtrusion.cpp b/src/Mod/Part/App/FeatureExtrusion.cpp index 302e49103d..801fdad503 100644 --- a/src/Mod/Part/App/FeatureExtrusion.cpp +++ b/src/Mod/Part/App/FeatureExtrusion.cpp @@ -44,7 +44,6 @@ # include #endif - #include "FeatureExtrusion.h" #include #include diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index c206bfb636..8e949a47eb 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -99,7 +99,10 @@ # include # include # include -#endif + +# include +# include +#endif //_PreComp_ #include #include @@ -135,9 +138,6 @@ #include #include -#include -#include - #include "Geometry.h" using namespace Part; diff --git a/src/Mod/Part/App/GeometryPyImp.cpp b/src/Mod/Part/App/GeometryPyImp.cpp index 53fff64a52..c97c8d6d22 100644 --- a/src/Mod/Part/App/GeometryPyImp.cpp +++ b/src/Mod/Part/App/GeometryPyImp.cpp @@ -33,9 +33,9 @@ # include # include # include -#endif -#include +# include +#endif #include #include diff --git a/src/Mod/Part/App/ImportIges.cpp b/src/Mod/Part/App/ImportIges.cpp index abc0faeb59..e0230a9055 100644 --- a/src/Mod/Part/App/ImportIges.cpp +++ b/src/Mod/Part/App/ImportIges.cpp @@ -41,18 +41,14 @@ # include # include # include +# include +# include +# include +# include +# include +# include #endif -#include -#include -#include -#include -#include - -#include -#include -#include - #include #include #include @@ -151,10 +147,10 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName) std::string type = igesEntity->DynamicType()->Name(); (void)type; #endif - + // is it a group, singular sub-figure or solid? if (igesEntity->IsKind(STANDARD_TYPE(IGESBasic_Group)) || - igesEntity->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)) || + igesEntity->IsKind(STANDARD_TYPE(IGESBasic_SingularSubfigure)) || igesEntity->IsKind(STANDARD_TYPE(IGESSolid_ManifoldSolid))) { try { if (aReader.TransferEntity(igesEntity)) { diff --git a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp index f5adf51682..d73320be60 100644 --- a/src/Mod/Part/App/ImportStep.cpp +++ b/src/Mod/Part/App/ImportStep.cpp @@ -36,39 +36,37 @@ # include # include # include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include #endif -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include #include @@ -100,7 +98,7 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) std::string encodednamestr = encodeFilename(std::string(Name)); const char * encodedname = encodednamestr.c_str(); - if (aReader.ReadFile((Standard_CString)encodedname) != + if (aReader.ReadFile((Standard_CString)encodedname) != IFSelect_RetDone) { throw Base::FileException("Cannot open STEP file"); } @@ -141,7 +139,7 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) TopExp_Explorer ex; for (ex.Init(aShape, TopAbs_SOLID); ex.More(); ex.Next()) { - // get the shape + // get the shape const TopoDS_Solid& aSolid = TopoDS::Solid(ex.Current()); std::string name = fi.fileNamePure(); @@ -177,7 +175,7 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) // load all non-solids now for (ex.Init(aShape, TopAbs_SHELL, TopAbs_SOLID); ex.More(); ex.Next()) { - // get the shape + // get the shape const TopoDS_Shell& aShell = TopoDS::Shell(ex.Current()); std::string name = fi.fileNamePure(); @@ -244,7 +242,7 @@ static void findStyledSR (const Handle(StepVisual_StyledItem) &style, if (PSA.IsNull()) continue; StepVisual_StyleContextSelect aStyleCntxSlct = PSA->StyleContext(); - Handle(StepShape_ShapeRepresentation) aCurrentSR = + Handle(StepShape_ShapeRepresentation) aCurrentSR = Handle(StepShape_ShapeRepresentation)::DownCast(aStyleCntxSlct.Representation()); if (aCurrentSR.IsNull()) continue; @@ -324,8 +322,8 @@ bool Part::ReadColors (const Handle(XSControl_WorkSession) &WS, std::mapDefinition(); - - Handle(StepRepr_AssemblyComponentUsage) ACU = + + Handle(StepRepr_AssemblyComponentUsage) ACU = Handle(StepRepr_AssemblyComponentUsage)::DownCast(aCharDef.ProductDefinitionRelationship()); // PTV 10.02.2003 skip styled item that refer to SHUO if (ACU->IsKind(STANDARD_TYPE(StepRepr_SpecifiedHigherUsageOccurrence))) { @@ -336,7 +334,7 @@ bool Part::ReadColors (const Handle(XSControl_WorkSession) &WS, std::mapItem()->DynamicType()->Name() << ") is not mapped to shape" << std::endl; #endif continue; } - + if (!SurfCol.IsNull()) { Quantity_Color col; Styles.DecodeColor (SurfCol, col); @@ -383,7 +381,7 @@ bool Part::ReadColors (const Handle(XSControl_WorkSession) &WS, std::mapDynamicType() == tNAUO) { - Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO = + Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO = Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(enti); if (NAUO.IsNull()) continue; Interface_EntityIterator subs = WS->Graph().Sharings(NAUO); for (subs.Start(); subs.More(); subs.Next()) { - Handle(StepRepr_ProductDefinitionShape) PDS = + Handle(StepRepr_ProductDefinitionShape) PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(subs.Value()); if (PDS.IsNull()) continue; Handle(StepBasic_ProductDefinitionRelationship) PDR = PDS->Definition().ProductDefinitionRelationship(); if (PDR.IsNull()) continue; - if (PDR->HasDescription() && + if (PDR->HasDescription() && PDR->Description()->Length() >0 ) name = PDR->Description(); else if (PDR->Name()->Length() >0) name = PDR->Name(); else name = PDR->Id(); @@ -434,7 +432,7 @@ bool Part::ReadNames (const Handle(XSControl_WorkSession) &WS) // for PD get name of associated product if (enti->DynamicType() == tPD) { - Handle(StepBasic_ProductDefinition) PD = + Handle(StepBasic_ProductDefinition) PD = Handle(StepBasic_ProductDefinition)::DownCast(enti); if (PD.IsNull()) continue; Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct(); diff --git a/src/Mod/Part/App/OpenCascadeAll.h b/src/Mod/Part/App/OpenCascadeAll.h index ff3a00315f..ed007e2851 100644 --- a/src/Mod/Part/App/OpenCascadeAll.h +++ b/src/Mod/Part/App/OpenCascadeAll.h @@ -79,6 +79,11 @@ #include #include +#include +#include +#include +#include + #include #include #include @@ -96,15 +101,19 @@ #include #include +#include + #include #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -117,8 +126,69 @@ #include #include -#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#if OCC_VERSION_HEX >= 0x060600 +#include +#endif + #include #include #include @@ -137,6 +207,7 @@ #include #include #include +#include #include #include #include @@ -149,6 +220,9 @@ #include #include #include +#include +#include +#include #include #if OCC_VERSION_HEX >= 0x060600 #include @@ -280,6 +354,7 @@ #include #include #include +#include #include #include #include @@ -295,6 +370,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -315,9 +393,13 @@ #include #include #include +#include #include +#include +#include #include +#include #include #include #include @@ -401,6 +483,33 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if OCC_VERSION_HEX >= 0x060600 +# include +# include +#endif + +#if OCC_VERSION_HEX >= 0x070300 +# include +#endif + +#if OCC_VERSION_HEX >= 0x060800 +#include +#endif #endif // __OpenCascadeAll__ diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index 78e6f2d18a..93126d36ba 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -24,6 +24,8 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include + # include # include # include @@ -40,10 +42,15 @@ # include # include # include + +# include +# include +# include +# include +# include +# include #endif - -#include #include #include #include @@ -63,7 +70,7 @@ using namespace Part; PROPERTY_SOURCE(Part::Feature, App::GeoFeature) -Feature::Feature(void) +Feature::Feature(void) { ADD_PROPERTY(Shape, (TopoDS_Shape())); } @@ -102,7 +109,7 @@ PyObject *Feature::getPyObject(void) // ref counter is set to 1 PythonObject = Py::Object(new PartFeaturePy(this),true); } - return Py::new_reference_to(PythonObject); + return Py::new_reference_to(PythonObject); } std::vector Feature::getPySubObjects(const std::vector& NameVec) const @@ -145,7 +152,7 @@ void Feature::onChanged(const App::Property* prop) } } } - + GeoFeature::onChanged(prop); } @@ -293,14 +300,14 @@ template class PartExport FeaturePythonT; } // ---------------------------------------------------------------- - +/* #include #include #include #include #include #include - +*/ std::vector Part::findAllFacesCutBy( const TopoDS_Shape& shape, const TopoDS_Shape& face, const gp_Dir& dir) { @@ -351,8 +358,8 @@ bool Part::checkIntersection(const TopoDS_Shape& first, const TopoDS_Shape& seco second_bb.SetGap(0); // Note: This test fails if the objects are touching one another at zero distance - - // Improving reliability: If it fails sometimes when touching and touching is intersection, + + // Improving reliability: If it fails sometimes when touching and touching is intersection, // then please check further unless the user asked for a quick potentially unreliable result if (first_bb.IsOut(second_bb) && !touch_is_intersection) return false; // no intersection @@ -360,10 +367,10 @@ bool Part::checkIntersection(const TopoDS_Shape& first, const TopoDS_Shape& seco return true; // assumed intersection // Try harder - + // This has been disabled because of: // https://www.freecadweb.org/tracker/view.php?id=3065 - + //extrema method /*BRepExtrema_DistShapeShape extrema(first, second); if (!extrema.IsDone()) @@ -372,7 +379,7 @@ bool Part::checkIntersection(const TopoDS_Shape& first, const TopoDS_Shape& seco return false; if (extrema.InnerSolution()) return true; - + //here we should have touching shapes. if (touch_is_intersection) { @@ -387,9 +394,9 @@ bool Part::checkIntersection(const TopoDS_Shape& first, const TopoDS_Shape& seco } else return false;*/ - + //boolean method. - + if (touch_is_intersection) { // If both shapes fuse to a single solid, then they intersect BRepAlgoAPI_Fuse mkFuse(first, second); @@ -421,5 +428,5 @@ bool Part::checkIntersection(const TopoDS_Shape& first, const TopoDS_Shape& seco xp.Init(mkCommon.Shape(),TopAbs_SOLID); return (xp.More() == Standard_True); } - + } diff --git a/src/Mod/Part/App/PreCompiled.h b/src/Mod/Part/App/PreCompiled.h index 9d21862fa3..b7f4496c57 100644 --- a/src/Mod/Part/App/PreCompiled.h +++ b/src/Mod/Part/App/PreCompiled.h @@ -62,6 +62,18 @@ #include #include +#include +#include +#include +#include +#include + +#include +#include + +// QT +#include + // Boost #include #include @@ -77,6 +89,8 @@ #include #include +#include + #include "OpenCascadeAll.h" #elif defined(FC_OS_WIN32) diff --git a/src/Mod/Part/App/PrimitiveFeature.cpp b/src/Mod/Part/App/PrimitiveFeature.cpp index aa18813d8a..bff212f0f0 100644 --- a/src/Mod/Part/App/PrimitiveFeature.cpp +++ b/src/Mod/Part/App/PrimitiveFeature.cpp @@ -61,7 +61,6 @@ # include #endif - #include "PrimitiveFeature.h" #include #include @@ -88,7 +87,7 @@ using namespace Part; PROPERTY_SOURCE_ABSTRACT_WITH_EXTENSIONS(Part::Primitive, Part::Feature) -Primitive::Primitive(void) +Primitive::Primitive(void) { AttachExtension::initExtension(this); touch(); @@ -224,7 +223,7 @@ App::DocumentObjectExecReturn *Vertex::execute(void) point.SetX(this->X.getValue()); point.SetY(this->Y.getValue()); point.SetZ(this->Z.getValue()); - + BRepBuilderAPI_MakeVertex MakeVertex(point); const TopoDS_Vertex& vertex = MakeVertex.Vertex(); this->Shape.setValue(vertex); @@ -479,7 +478,7 @@ App::DocumentObjectExecReturn *Ellipsoid::execute(void) gp_Dir dir(0.0,0.0,1.0); gp_Ax2 ax2(pnt,dir); BRepPrimAPI_MakeSphere mkSphere(ax2, - Radius2.getValue(), + Radius2.getValue(), Angle1.getValue()/180.0f*M_PI, Angle2.getValue()/180.0f*M_PI, Angle3.getValue()/180.0f*M_PI); @@ -854,7 +853,7 @@ App::DocumentObjectExecReturn *Helix::execute(void) TopoShape helix; // work around for OCC bug #23314 (FC #0954) // the exact conditions for failure are unknown. building the helix 1 turn at a time - // seems to always work. + // seems to always work. this->Shape.setValue(helix.makeLongHelix(myPitch, myHeight, myRadius, myAngle, myLocalCS)); // if (myHeight / myPitch > 50.0) // this->Shape.setValue(helix.makeLongHelix(myPitch, myHeight, myRadius, myAngle, myLocalCS)); @@ -1101,7 +1100,7 @@ App::DocumentObjectExecReturn *Ellipse::execute(void) gp_Elips ellipse; ellipse.SetMajorRadius(this->MajorRadius.getValue()); ellipse.SetMinorRadius(this->MinorRadius.getValue()); - + BRepBuilderAPI_MakeEdge clMakeEdge(ellipse, Base::toRadians(this->Angle0.getValue()), Base::toRadians(this->Angle1.getValue())); const TopoDS_Edge& edge = clMakeEdge.Edge(); diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index 908f3b9c6b..b986d82feb 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -42,12 +42,13 @@ # include # include # include -#endif #if OCC_VERSION_HEX >= 0x060800 -#include +# include #endif +#endif // _PreComp_ + #include #include #include @@ -95,7 +96,7 @@ void PropertyPartShape::setValue(const TopoDS_Shape& sh) hasSetValue(); } -const TopoDS_Shape& PropertyPartShape::getValue(void)const +const TopoDS_Shape& PropertyPartShape::getValue(void)const { return _Shape.getShape(); } @@ -245,12 +246,12 @@ void PropertyPartShape::Save (Base::Writer &writer) const if(!writer.isForceXML()) { //See SaveDocFile(), RestoreDocFile() if (writer.getMode("BinaryBrep")) { - writer.Stream() << writer.ind() << "" << std::endl; } else { - writer.Stream() << writer.ind() << "" << std::endl; } @@ -278,7 +279,7 @@ static void BRepTools_Write(const TopoDS_Shape& Sh, Standard_OStream& S) { SS.Write(S); SS.Write(Sh,S); } -static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, +static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, const Standard_CString File) { ofstream os; @@ -292,11 +293,11 @@ static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, Standard_Boolean isGood = (os.good() && !os.eof()); if(!isGood) return isGood; - + BRepTools_ShapeSet SS(Standard_False); // SS.SetProgress(PR); SS.Add(Sh); - + os << "DBRep_DrawableShape\n"; // for easy Draw read SS.Write(os); isGood = os.good(); @@ -341,7 +342,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const App::PropertyContainer* father = this->getContainer(); if (father && father->isDerivedFrom(App::DocumentObject::getClassTypeId())) { App::DocumentObject* obj = static_cast(father); - Base::Console().Error("Shape of '%s' cannot be written to BRep file '%s'\n", + Base::Console().Error("Shape of '%s' cannot be written to BRep file '%s'\n", obj->Label.getValue(),fi.filePath().c_str()); } else { @@ -355,7 +356,7 @@ void PropertyPartShape::SaveDocFile (Base::Writer &writer) const Base::ifstream file(fi, std::ios::in | std::ios::binary); if (file) { - //unsigned long ulSize = 0; + //unsigned long ulSize = 0; std::streambuf* buf = file.rdbuf(); //if (buf) { // unsigned long ulCurr; @@ -399,7 +400,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader) // read in the ASCII file and write back to the file stream Base::ofstream file(fi, std::ios::out | std::ios::binary); - unsigned long ulSize = 0; + unsigned long ulSize = 0; if (reader) { std::streambuf* buf = file.rdbuf(); reader >> buf; @@ -420,7 +421,7 @@ void PropertyPartShape::RestoreDocFile(Base::Reader &reader) App::PropertyContainer* father = this->getContainer(); if (father && father->isDerivedFrom(App::DocumentObject::getClassTypeId())) { App::DocumentObject* obj = static_cast(father); - Base::Console().Error("BRep file '%s' with shape of '%s' seems to be empty\n", + Base::Console().Error("BRep file '%s' with shape of '%s' seems to be empty\n", fi.filePath().c_str(),obj->Label.getValue()); } else { diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index d9ead545c4..54a17137d6 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -28,6 +28,7 @@ # include # include # include + # include # include # include @@ -152,9 +153,6 @@ # include # include # include -#if OCC_VERSION_HEX < 0x070300 -# include -#endif # include # include # include @@ -169,13 +167,17 @@ # include # include +#if OCC_VERSION_HEX < 0x070300 +# include +#endif + #if OCC_VERSION_HEX >= 0x060600 -#include -#include +# include +# include #endif #if OCC_VERSION_HEX >= 0x070300 -#include +# include #endif #endif // _PreComp_ diff --git a/src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp b/src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp index 097b3fde89..afb223d373 100644 --- a/src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeCompSolidPyImp.cpp @@ -22,10 +22,11 @@ #include "PreCompiled.h" + #ifndef _PreComp_ -#include -#include -#include +# include +# include +# include #endif #include "OCCError.h" @@ -91,7 +92,7 @@ PyObject* TopoShapeCompSolidPy::add(PyObject *args) BRep_Builder builder; TopoDS_Shape comp = getTopoShapePtr()->getShape(); - + try { const TopoDS_Shape& sh = static_cast(obj)-> getTopoShapePtr()->getShape(); @@ -118,5 +119,5 @@ PyObject *TopoShapeCompSolidPy::getCustomAttributes(const char* /*attr*/) const int TopoShapeCompSolidPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapeCompoundPyImp.cpp b/src/Mod/Part/App/TopoShapeCompoundPyImp.cpp index 8046a3c265..cbe4bf1914 100644 --- a/src/Mod/Part/App/TopoShapeCompoundPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeCompoundPyImp.cpp @@ -24,14 +24,15 @@ #include "PreCompiled.h" #include "TopoShape.h" + #ifndef _PreComp_ -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include #endif #include "OCCError.h" @@ -65,7 +66,7 @@ int TopoShapeCompoundPy::PyInit(PyObject* args, PyObject* /*kwd*/) BRep_Builder builder; TopoDS_Compound Comp; builder.MakeCompound(Comp); - + try { Py::Sequence list(pcObj); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { @@ -95,7 +96,7 @@ PyObject* TopoShapeCompoundPy::add(PyObject *args) BRep_Builder builder; TopoDS_Shape comp = getTopoShapePtr()->getShape(); - + try { const TopoDS_Shape& sh = static_cast(obj)-> getTopoShapePtr()->getShape(); @@ -129,7 +130,7 @@ PyObject* TopoShapeCompoundPy::connectEdgesToWires(PyObject *args) hEdges->Append(xp.Current()); ShapeAnalysis_FreeBounds::ConnectEdgesToWires(hEdges, tol, PyObject_IsTrue(shared) ? Standard_True : Standard_False, hWires); - + TopoDS_Compound comp; BRep_Builder builder; builder.MakeCompound(comp); @@ -156,5 +157,5 @@ PyObject *TopoShapeCompoundPy::getCustomAttributes(const char* /*attr*/) const int TopoShapeCompoundPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp index b18148cf0f..4d0fecc524 100644 --- a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp @@ -71,7 +71,7 @@ # include # include # include -#endif +#endif // _PreComp_ #include #include @@ -138,7 +138,7 @@ int TopoShapeEdgePy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return -1; } @@ -171,7 +171,7 @@ int TopoShapeEdgePy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return -1; } diff --git a/src/Mod/Part/App/TopoShapeFacePyImp.cpp b/src/Mod/Part/App/TopoShapeFacePyImp.cpp index 4b69f5f6ca..84cac281a2 100644 --- a/src/Mod/Part/App/TopoShapeFacePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeFacePyImp.cpp @@ -69,7 +69,7 @@ # include # include # include -#endif +#endif // _PreComp #include #include @@ -110,7 +110,7 @@ std::string TopoShapeFacePy::representation(void) const PyObject *TopoShapeFacePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of TopoShapeFacePy and the Twin object + // create a new instance of TopoShapeFacePy and the Twin object return new TopoShapeFacePy(new TopoShape); } @@ -388,7 +388,7 @@ PyObject* TopoShapeFacePy::makeOffset(PyObject *args) BRepOffsetAPI_MakeOffset mkOffset(f); mkOffset.Perform(dist); - + return new TopoShapePy(new TopoShape(mkOffset.Shape())); } @@ -1027,5 +1027,5 @@ PyObject *TopoShapeFacePy::getCustomAttributes(const char* ) const int TopoShapeFacePy::setCustomAttributes(const char* , PyObject *) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index e44225db6d..09dfe444ed 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -67,7 +67,6 @@ # include #endif - #include #include #include @@ -118,7 +117,7 @@ std::string TopoShapePy::representation(void) const PyObject *TopoShapePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of TopoShapePy and the Twin object + // create a new instance of TopoShapePy and the Twin object return new TopoShapePy(new TopoShape); } @@ -640,7 +639,7 @@ PyObject* TopoShapePy::extrude(PyObject *args) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return 0; } @@ -706,7 +705,7 @@ PyObject* TopoShapePy::revolve(PyObject *args) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return 0; } @@ -728,7 +727,7 @@ PyObject* TopoShapePy::check(PyObject *args) } } - Py_Return; + Py_Return; } PyObject* TopoShapePy::fuse(PyObject *args) @@ -742,7 +741,7 @@ PyObject* TopoShapePy::fuse(PyObject *args) return new TopoShapePy(new TopoShape(fusShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -871,7 +870,7 @@ PyObject* TopoShapePy::common(PyObject *args) return new TopoShapePy(new TopoShape(comShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -919,7 +918,7 @@ PyObject* TopoShapePy::common(PyObject *args) return new TopoShapePy(new TopoShape(multiCommonShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -945,7 +944,7 @@ PyObject* TopoShapePy::section(PyObject *args) return new TopoShapePy(new TopoShape(secShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -993,7 +992,7 @@ PyObject* TopoShapePy::section(PyObject *args) return new TopoShapePy(new TopoShape(multiSectionShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1073,7 +1072,7 @@ PyObject* TopoShapePy::cut(PyObject *args) return new TopoShapePy(new TopoShape(cutShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1121,7 +1120,7 @@ PyObject* TopoShapePy::cut(PyObject *args) return new TopoShapePy(new TopoShape(multiCutShape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1531,7 +1530,7 @@ PyObject* TopoShapePy::makeFillet(PyObject *args) return new TopoShapePy(new TopoShape(mkFillet.Shape())); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1557,7 +1556,7 @@ PyObject* TopoShapePy::makeFillet(PyObject *args) return new TopoShapePy(new TopoShape(mkFillet.Shape())); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1596,7 +1595,7 @@ PyObject* TopoShapePy::makeChamfer(PyObject *args) return new TopoShapePy(new TopoShape(mkChamfer.Shape())); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1631,7 +1630,7 @@ PyObject* TopoShapePy::makeChamfer(PyObject *args) return new TopoShapePy(new TopoShape(mkChamfer.Shape())); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -1942,7 +1941,7 @@ PyObject* TopoShapePy::makeParallelProjection(PyObject *args) return new TopoShapePy(new TopoShape(projected)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return 0; } @@ -1964,7 +1963,7 @@ PyObject* TopoShapePy::makePerspectiveProjection(PyObject *args) return new TopoShapePy(new TopoShape(projected)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return 0; } @@ -2535,7 +2534,7 @@ PyObject* TopoShapePy::proximity(PyObject *args) PyObject* TopoShapePy::distToShape(PyObject *args) { PyObject* ps2; - PyObject *pts,*geom,*pPt1,*pPt2,*pSuppType1,*pSuppType2, + PyObject *pts,*geom,*pPt1,*pPt2,*pSuppType1,*pSuppType2, *pSupportIndex1, *pSupportIndex2, *pParm1, *pParm2; gp_Pnt P1,P2; BRepExtrema_SupportType supportType1,supportType2; @@ -2762,12 +2761,12 @@ Py::Object TopoShapePy::getLocation(void) const mat[0][1] = trf.Value(1,2); mat[0][2] = trf.Value(1,3); mat[0][3] = trf.Value(1,4); - + mat[1][0] = trf.Value(2,1); mat[1][1] = trf.Value(2,2); mat[1][2] = trf.Value(2,3); mat[1][3] = trf.Value(2,4); - + mat[2][0] = trf.Value(3,1); mat[2][1] = trf.Value(3,2); mat[2][2] = trf.Value(3,3); @@ -2898,7 +2897,7 @@ Py::List TopoShapePy::getFaces(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_FACE); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -2921,7 +2920,7 @@ Py::List TopoShapePy::getVertexes(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_VERTEX); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -2944,7 +2943,7 @@ Py::List TopoShapePy::getShells(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_SHELL); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -2967,7 +2966,7 @@ Py::List TopoShapePy::getSolids(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_SOLID); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -2990,7 +2989,7 @@ Py::List TopoShapePy::getCompSolids(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_COMPSOLID); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -3013,7 +3012,7 @@ Py::List TopoShapePy::getEdges(void) const TopTools_IndexedMapOfShape M; TopExp_Explorer Ex(getTopoShapePtr()->getShape(),TopAbs_EDGE); - while (Ex.More()) + while (Ex.More()) { M.Add(Ex.Current()); Ex.Next(); @@ -3146,5 +3145,5 @@ PyObject *TopoShapePy::getCustomAttributes(const char* attr) const int TopoShapePy::setCustomAttributes(const char* , PyObject *) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapeShellPyImp.cpp b/src/Mod/Part/App/TopoShapeShellPyImp.cpp index 8178569b28..e6aa444e4f 100644 --- a/src/Mod/Part/App/TopoShapeShellPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeShellPyImp.cpp @@ -34,9 +34,9 @@ # include # include # include +# include #endif - #include #include @@ -70,7 +70,7 @@ std::string TopoShapeShellPy::representation(void) const PyObject *TopoShapeShellPy::PyMake(struct _typeobject *, PyObject *, PyObject *) { - // create a new instance of TopoShapeSolidPy and the Twin object + // create a new instance of TopoShapeSolidPy and the Twin object return new TopoShapeShellPy(new TopoShape); } @@ -86,7 +86,7 @@ int TopoShapeShellPy::PyInit(PyObject* args, PyObject* /*kwd*/) TopoDS_Shell shell; //BRepOffsetAPI_Sewing mkShell; builder.MakeShell(shell); - + try { Py::Sequence list(obj); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { @@ -128,7 +128,7 @@ PyObject* TopoShapeShellPy::add(PyObject *args) BRep_Builder builder; TopoDS_Shape shell = getTopoShapePtr()->getShape(); - + try { const TopoDS_Shape& sh = static_cast(obj)-> getTopoShapePtr()->getShape(); @@ -284,5 +284,5 @@ PyObject *TopoShapeShellPy::getCustomAttributes(const char* /*attr*/) const int TopoShapeShellPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp index 39efae0454..405dc3d89a 100644 --- a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp @@ -23,27 +23,29 @@ #include "PreCompiled.h" -#include -#include -#include -#include +#ifndef _PreComp_ +# include +# include +# include +# include #if OCC_VERSION_HEX >= 0x060600 -#include +# include +#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include @@ -70,7 +72,7 @@ std::string TopoShapeSolidPy::representation(void) const PyObject *TopoShapeSolidPy::PyMake(struct _typeobject *, PyObject *, PyObject *) { - // create a new instance of TopoShapeSolidPy and the Twin object + // create a new instance of TopoShapeSolidPy and the Twin object return new TopoShapeSolidPy(new TopoShape); } @@ -331,5 +333,5 @@ PyObject *TopoShapeSolidPy::getCustomAttributes(const char* /*attr*/) const int TopoShapeSolidPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/TopoShapeWirePyImp.cpp b/src/Mod/Part/App/TopoShapeWirePyImp.cpp index 8d813da0d7..675d4f4001 100644 --- a/src/Mod/Part/App/TopoShapeWirePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeWirePyImp.cpp @@ -78,7 +78,7 @@ std::string TopoShapeWirePy::representation(void) const PyObject *TopoShapeWirePy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of TopoShapeWirePy and the Twin object + // create a new instance of TopoShapeWirePy and the Twin object return new TopoShapeWirePy(new TopoShape); } @@ -107,7 +107,7 @@ int TopoShapeWirePy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return -1; } @@ -150,7 +150,7 @@ int TopoShapeWirePy::PyInit(PyObject* args, PyObject* /*kwd*/) return 0; } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return -1; } @@ -241,7 +241,7 @@ PyObject* TopoShapeWirePy::makeOffset(PyObject *args) BRepOffsetAPI_MakeOffset mkOffset(w); mkOffset.Perform(dist); - + return new TopoShapePy(new TopoShape(mkOffset.Shape())); } @@ -255,7 +255,7 @@ PyObject* TopoShapeWirePy::makePipe(PyObject *args) return new TopoShapePy(new TopoShape(shape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return 0; } @@ -284,14 +284,14 @@ PyObject* TopoShapeWirePy::makePipeShell(PyObject *args) sections.Append(shape); } } - TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections, + TopoDS_Shape shape = this->getTopoShapePtr()->makePipeShell(sections, PyObject_IsTrue(make_solid) ? Standard_True : Standard_False, PyObject_IsTrue(is_Frenet) ? Standard_True : Standard_False, transition); return new TopoShapePy(new TopoShape(shape)); } catch (Standard_Failure& e) { - + PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return NULL; } @@ -645,7 +645,7 @@ PyObject *TopoShapeWirePy::getCustomAttributes(const char* /*attr*/) const int TopoShapeWirePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Part/App/edgecluster.cpp b/src/Mod/Part/App/edgecluster.cpp index 3425d0f1e9..3748e15f75 100644 --- a/src/Mod/Part/App/edgecluster.cpp +++ b/src/Mod/Part/App/edgecluster.cpp @@ -37,8 +37,21 @@ # include #endif -#include "edgecluster.h" +#ifndef _PreComp_ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif +#include "edgecluster.h" using namespace Part; @@ -88,7 +101,7 @@ void Edgecluster::Perform() { m_edges.clear(); //Lets start with a vertice that only has one edge (that means start or end point of the merged edges!) - tMapPntEdge::iterator iter; + tMapPntEdge::iterator iter; bool closed = true; for(iter=m_vertices.begin();iter!=m_vertices.end();++iter) { @@ -213,7 +226,6 @@ void Edgecluster::Perform(const TopoDS_Edge& edge) iter.first->second.push_back(edge); } -#include bool Edgecluster::IsValidEdge(const TopoDS_Edge& edge) { diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index fa42f2e68e..a0750a7c9a 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -22,54 +22,60 @@ #include "PreCompiled.h" + #ifndef _PreComp_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // _PreComp_ + #include + #include +#include + #include "modelRefine.h" + using namespace ModelRefine; @@ -466,7 +472,7 @@ bool FaceTypedCylinder::isEqual(const TopoDS_Face &faceOne, const TopoDS_Face &f return false;//probably need an error gp_Cylinder cylinderOne = surfaceOne->Cylinder(); gp_Cylinder cylinderTwo = surfaceTwo->Cylinder(); - + if (fabs(cylinderOne.Radius() - cylinderTwo.Radius()) > Precision::Confusion()) return false; if (!cylinderOne.Axis().IsCoaxial(cylinderTwo.Axis(), Precision::Angular(), Precision::Confusion()) && @@ -617,7 +623,7 @@ bool wireEncirclesAxis(const TopoDS_Wire& wire, const Handle(Geom_CylindricalSur } TopoDS_Face FaceTypedCylinder::buildFace(const FaceVectorType &faces) const -{ +{ static TopoDS_Face dummy; std::vector boundaries; boundarySplit(faces, boundaries); @@ -649,7 +655,7 @@ TopoDS_Face FaceTypedCylinder::buildFace(const FaceVectorType &faces) const if (surface.IsNull()) return dummy; std::vector innerWires, encirclingWires; - std::vector::iterator wireIt; + std::vector::iterator wireIt; for (wireIt = allWires.begin(); wireIt != allWires.end(); ++wireIt) { if (wireEncirclesAxis(*wireIt, surface)) encirclingWires.push_back(*wireIt); @@ -789,7 +795,7 @@ void collectConicEdges(const TopoDS_Shell &shell, TopTools_IndexedMapOfShape &ma { TopTools_IndexedMapOfShape edges; TopExp::MapShapes(shell, TopAbs_EDGE, edges); - + for (int index = 1; index <= edges.Extent(); ++index) { const TopoDS_Edge ¤tEdge = TopoDS::Edge(edges.FindKey(index)); @@ -942,7 +948,7 @@ bool FaceTypedBSpline::isEqual(const TopoDS_Face &faceOne, const TopoDS_Face &fa stream << "FaceTypedBSpline::isEqual: Unknown Error" << std::endl; Base::Console().Message(stream.str().c_str()); } - + return false; } @@ -1118,7 +1124,7 @@ bool FaceUniter::process() for(sewIt = facesToSew.begin(); sewIt != facesToSew.end(); ++sewIt) builder.Add(workShell, *sewIt); } - + BRepLib_FuseEdges edgeFuse(workShell); // TODO: change this version after occ fix. Freecad Mantis 1450 #if OCC_VERSION_HEX <= 0x7fffff