Part: Make 3rd party libraries into PCH

This commit is contained in:
Abdullah Tahiri
2019-05-01 13:59:37 +02:00
committed by abdullahtahiriyo
parent 43bdef67d6
commit a56658489b
28 changed files with 475 additions and 326 deletions

View File

@@ -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<TopoShapePy*>(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)) {

View File

@@ -40,7 +40,6 @@
# include <GC_MakeArcOfHyperbola.hxx>
#endif
#include "ArcPy.h"
#include "ArcPy.cpp"
#include "CirclePy.h"

View File

@@ -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!

View File

@@ -38,9 +38,9 @@
# include <TColStd_Array1OfReal.hxx>
# include <TColStd_HArray1OfBoolean.hxx>
# include <Precision.hxx>
# include <cmath>
#endif
#include <cmath>
#include <Base/VectorPy.h>
#include <Base/GeometryPyCXX.h>
@@ -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, &degMax,
&continuity, &tol3d, &degMin,
&continuity, &tol3d, &degMin,
&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<double>(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;
}

View File

@@ -29,31 +29,33 @@
#ifdef FCUseFreeType
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <stdexcept>
#include <vector>
#ifndef _PreComp_
# include <iostream>
# include <fstream>
# include <string>
# include <sstream>
# include <cstdio>
# include <cstdlib>
# include <stdexcept>
# include <vector>
#include <BRepLib.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <GCE2d_MakeSegment.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <gp_Trsf.hxx>
#include <Precision.hxx>
# include <BRepLib.hxx>
# include <BRepBuilderAPI_MakeEdge.hxx>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <BRepBuilderAPI_Transform.hxx>
# include <gp_Pnt.hxx>
# include <gp_Vec.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Edge.hxx>
# include <TopoDS_Wire.hxx>
# include <TColgp_Array1OfPnt2d.hxx>
# include <GCE2d_MakeSegment.hxx>
# include <Geom2d_TrimmedCurve.hxx>
# include <Geom_Plane.hxx>
# include <Geom2d_BezierCurve.hxx>
# include <gp_Trsf.hxx>
# include <Precision.hxx>
#endif // _PreComp
#include <Base/Console.h>
#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<length; i++) {
@@ -178,10 +180,10 @@ PyObject* FT2FC(const Py_UNICODE *PyUString,
return(CharList);
}
//********** FT Decompose callbacks and data defns
// FT Decomp Context for 1 char
struct FTDC_Ctx {
struct FTDC_Ctx {
std::vector<TopoDS_Wire> Wires;
std::vector<TopoDS_Edge> 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) {

View File

@@ -45,6 +45,7 @@
# include <TopExp_Explorer.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
# include <TopTools_HSequenceOfShape.hxx>
# include <QtGlobal>
#endif
#include "FaceMakerBullseye.h"
@@ -52,7 +53,7 @@
#include "TopoShape.h"
#include <QtGlobal>
using namespace Part;

View File

@@ -43,11 +43,12 @@
# include <TopExp_Explorer.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
# include <TopTools_HSequenceOfShape.hxx>
# include <QtGlobal>
#endif
#include "FaceMakerCheese.h"
#include <QtGlobal>
using namespace Part;

View File

@@ -44,7 +44,6 @@
# include <BRepLib_FindSurface.hxx>
#endif
#include "FeatureExtrusion.h"
#include <Base/Tools.h>
#include <Base/Exception.h>

View File

@@ -99,7 +99,10 @@
# include <GeomAPI_ExtremaCurveCurve.hxx>
# include <ShapeConstruct_Curve.hxx>
# include <LProp_NotDefined.hxx>
#endif
# include <ctime>
# include <cmath>
#endif //_PreComp_
#include <Base/VectorPy.h>
#include <Mod/Part/App/LinePy.h>
@@ -135,9 +138,6 @@
#include <Base/Reader.h>
#include <Base/Tools.h>
#include <ctime>
#include <cmath>
#include "Geometry.h"
using namespace Part;

View File

@@ -33,9 +33,9 @@
# include <Geom_Surface.hxx>
# include <Precision.hxx>
# include <Standard_Failure.hxx>
#endif
#include <boost/uuid/uuid_io.hpp>
# include <boost/uuid/uuid_io.hpp>
#endif
#include <Base/GeometryPyCXX.h>
#include <Base/Matrix.h>

View File

@@ -41,18 +41,14 @@
# include <IGESBasic_Group.hxx>
# include <IGESSolid_ManifoldSolid.hxx>
# include <IGESBasic_SingularSubfigure.hxx>
# include <XSControl_WorkSession.hxx>
# include <XSControl_TransferReader.hxx>
# include <Transfer_TransientProcess.hxx>
# include <Interface_EntityIterator.hxx>
# include <Quantity_Color.hxx>
# include <TCollection_ExtendedString.hxx>
#endif
#include <XSControl_WorkSession.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_TransferReader.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Interface_EntityIterator.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Base/Console.h>
#include <Base/Sequencer.h>
#include <App/Application.h>
@@ -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)) {

View File

@@ -36,39 +36,37 @@
# include <TopoDS_Compound.hxx>
# include <TopExp_Explorer.hxx>
# include <sstream>
# include <Standard_Version.hxx>
# include <XSControl_WorkSession.hxx>
# include <XSControl_TransferReader.hxx>
# include <XSControl_WorkSession.hxx>
# include <XSControl_TransferReader.hxx>
# include <Transfer_TransientProcess.hxx>
# include <STEPConstruct_Styles.hxx>
# include <TColStd_HSequenceOfTransient.hxx>
# include <STEPConstruct.hxx>
# include <StepVisual_StyledItem.hxx>
# include <StepShape_ShapeRepresentation.hxx>
# include <StepVisual_PresentationStyleByContext.hxx>
# include <StepVisual_StyleContextSelect.hxx>
# include <StepVisual_PresentationStyleByContext.hxx>
# include <Interface_EntityIterator.hxx>
# include <StepRepr_RepresentedDefinition.hxx>
# include <StepShape_ShapeDefinitionRepresentation.hxx>
# include <StepRepr_CharacterizedDefinition.hxx>
# include <StepRepr_ProductDefinitionShape.hxx>
# include <StepRepr_AssemblyComponentUsage.hxx>
# include <StepRepr_AssemblyComponentUsage.hxx>
# include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
# include <Quantity_Color.hxx>
# include <TCollection_ExtendedString.hxx>
# include <StepBasic_Product.hxx>
# include <StepBasic_Product.hxx>
# include <StepBasic_ProductDefinition.hxx>
# include <StepBasic_ProductDefinition.hxx>
# include <StepBasic_ProductDefinitionFormation.hxx>
#endif
#include <Standard_Version.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_TransferReader.hxx>
#include <Transfer_TransientProcess.hxx>
#include <STEPConstruct_Styles.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <STEPConstruct.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <Base/Console.h>
#include <Base/Sequencer.h>
#include <App/Application.h>
@@ -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::map<int, Qu
if (PDS.IsNull())
continue;
StepRepr_CharacterizedDefinition aCharDef = PDS->Definition();
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::map<int, Qu
Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(ACU);
if (NAUO.IsNull())
continue;
TopoDS_Shape aSh;
// PTV 10.02.2003 to find component of assembly CORRECTLY
STEPConstruct_Tool Tool( WS );
@@ -353,14 +351,14 @@ bool Part::ReadColors (const Handle(XSControl_WorkSession) &WS, std::map<int, Qu
}
if (isSkipSHUOstyle)
continue; // skip styled item which refer to SHUO
if ( S.IsNull() ) {
#ifdef FC_DEBUG
std::cout << "Warning: item No " << i << "(" << style->Item()->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::map<int, Qu
// sets the invisibility for shape.
}
}
return Standard_True;
#endif
}
@@ -411,17 +409,17 @@ bool Part::ReadNames (const Handle(XSControl_WorkSession) &WS)
// get description of NAUO
if (enti->DynamicType() == 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();

View File

@@ -79,6 +79,11 @@
#include <Standard_UUID.hxx>
#include <Standard_Version.hxx>
#include <gce_MakeLin.hxx>
#include <BRepIntCurveSurface_Inter.hxx>
#include <IntCurveSurface_IntersectionPoint.hxx>
#include <gce_MakeDir.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_Array1OfReal.hxx>
@@ -96,15 +101,19 @@
#include <TColgp_Array1OfVec.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_CompSolid.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shell.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
@@ -117,8 +126,69 @@
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
#include <BOPAlgo_ArgumentAnalyzer.hxx>
#include <BSplCLib.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepLib_FuseEdges.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <Geom_Conic.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeFix_Face.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
#include <BRep_Builder.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeAnalysis_Curve.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <Standard_Version.hxx>
#include <STEPConstruct_Styles.hxx>
#include <TColStd_HSequenceOfTransient.hxx>
#include <STEPConstruct.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepShape_ShapeRepresentation.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyleContextSelect.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <Interface_EntityIterator.hxx>
#include <StepRepr_RepresentedDefinition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <StepRepr_CharacterizedDefinition.hxx>
#include <StepRepr_ProductDefinitionShape.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_AssemblyComponentUsage.hxx>
#include <StepRepr_SpecifiedHigherUsageOccurrence.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_Product.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinition.hxx>
#include <StepBasic_ProductDefinitionFormation.hxx>
#include <NCollection_List.hxx>
#include <HLRAppli_ReflectLines.hxx>
#include <BRepAlgo_NormalProjection.hxx>
#include <ShapeAnalysis_ShapeTolerance.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
#include <BRepOffset_MakeOffset.hxx>
#if OCC_VERSION_HEX >= 0x060600
#include <BRepClass3d.hxx>
#endif
#include <BRepAdaptor_CompCurve.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
@@ -137,6 +207,7 @@
#include <BRepAlgo_NormalProjection.hxx>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI.hxx>
#include <BRepBuilderAPI_FindPlane.hxx>
#include <BRepBuilderAPI_GTransform.hxx>
@@ -149,6 +220,9 @@
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <BRepLProp_SurfaceTool.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepClass_FaceClassifier.hxx>
#if OCC_VERSION_HEX >= 0x060600
#include <BRepClass3d.hxx>
@@ -280,6 +354,7 @@
#include <Geom_Plane.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomAPI.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomAPI_PointsToBSpline.hxx>
@@ -295,6 +370,9 @@
#include <GeomConvert_BSplineCurveToBezierCurve.hxx>
#include <GeomConvert_CompCurveToBSplineCurve.hxx>
#include <GeomFill.hxx>
#include <GeomFill_AppSurf.hxx>
#include <GeomFill_Line.hxx>
#include <GeomFill_SectionGenerator.hxx>
#include <GeomFill_ApproxStyle.hxx>
#include <GeomFill_CorrectedFrenet.hxx>
#include <GeomFill_CurveAndTrihedron.hxx>
@@ -315,9 +393,13 @@
#include <GeomPlate_PlateG0Criterion.hxx>
#include <GeomPlate_PointConstraint.hxx>
#include <GeomPlate_Surface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <GeomTools_Curve2dSet.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax2d.hxx>
#include <gp_Ax3.hxx>
#include <gp_Circ.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Cone.hxx>
@@ -401,6 +483,33 @@
#include <BinTools.hxx>
#include <BinTools_ShapeSet.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_TransferWriter.hxx>
#include <Transfer_TransientProcess.hxx>
#include <Transfer_FinderProcess.hxx>
#include <Interface_EntityIterator.hxx>
#include <Quantity_Color.hxx>
#include <TCollection_ExtendedString.hxx>
#include <BinTools.hxx>
#include <BinTools_ShapeSet.hxx>
#include <APIHeaderSection_MakeHeader.hxx>
#include <ShapeAnalysis_FreeBoundsProperties.hxx>
#include <ShapeAnalysis_FreeBoundData.hxx>
#if OCC_VERSION_HEX >= 0x060600
# include <BOPAlgo_ArgumentAnalyzer.hxx>
# include <BOPAlgo_ListOfCheckResult.hxx>
#endif
#if OCC_VERSION_HEX >= 0x070300
# include <BRepAlgoAPI_Defeaturing.hxx>
#endif
#if OCC_VERSION_HEX >= 0x060800
#include <OSD_OpenFile.hxx>
#endif
#endif // __OpenCascadeAll__

View File

@@ -24,6 +24,8 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <sstream>
# include <gp_Trsf.hxx>
# include <gp_Ax1.hxx>
# include <BRepBuilderAPI_MakeShape.hxx>
@@ -40,10 +42,15 @@
# include <Bnd_Box.hxx>
# include <BRepBndLib.hxx>
# include <BRepExtrema_DistShapeShape.hxx>
# include <GProp_GProps.hxx>
# include <BRepGProp.hxx>
# include <gce_MakeLin.hxx>
# include <BRepIntCurveSurface_Inter.hxx>
# include <IntCurveSurface_IntersectionPoint.hxx>
# include <gce_MakeDir.hxx>
#endif
#include <sstream>
#include <Base/Console.h>
#include <Base/Writer.h>
#include <Base/Reader.h>
@@ -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<PyObject *> Feature::getPySubObjects(const std::vector<std::string>& NameVec) const
@@ -145,7 +152,7 @@ void Feature::onChanged(const App::Property* prop)
}
}
}
GeoFeature::onChanged(prop);
}
@@ -293,14 +300,14 @@ template class PartExport FeaturePythonT<Part::Feature>;
}
// ----------------------------------------------------------------
/*
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>
#include <gce_MakeLin.hxx>
#include <BRepIntCurveSurface_Inter.hxx>
#include <IntCurveSurface_IntersectionPoint.hxx>
#include <gce_MakeDir.hxx>
*/
std::vector<Part::cutFaces> 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);
}
}

View File

@@ -62,6 +62,18 @@
#include <set>
#include <map>
#include <fstream>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <stdexcept>
#include <cmath>
#include <ctime>
// QT
#include <QtGlobal>
// Boost
#include <boost/signals2.hpp>
#include <boost/bind.hpp>
@@ -77,6 +89,8 @@
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/uuid/uuid_io.hpp>
#include "OpenCascadeAll.h"
#elif defined(FC_OS_WIN32)

View File

@@ -61,7 +61,6 @@
# include <Standard_Version.hxx>
#endif
#include "PrimitiveFeature.h"
#include <Mod/Part/App/PartFeaturePy.h>
#include <App/FeaturePythonPyImp.h>
@@ -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<double>(this->Angle0.getValue()),
Base::toRadians<double>(this->Angle1.getValue()));
const TopoDS_Edge& edge = clMakeEdge.Edge();

View File

@@ -42,12 +42,13 @@
# include <Standard_Version.hxx>
# include <gp_GTrsf.hxx>
# include <gp_Trsf.hxx>
#endif
#if OCC_VERSION_HEX >= 0x060800
#include <OSD_OpenFile.hxx>
# include <OSD_OpenFile.hxx>
#endif
#endif // _PreComp_
#include <Base/Console.h>
#include <Base/Writer.h>
#include <Base/Reader.h>
@@ -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() << "<Part file=\""
writer.Stream() << writer.ind() << "<Part file=\""
<< writer.addFile("PartShape.bin", this)
<< "\"/>" << std::endl;
}
else {
writer.Stream() << writer.ind() << "<Part file=\""
writer.Stream() << writer.ind() << "<Part file=\""
<< writer.addFile("PartShape.brp", this)
<< "\"/>" << 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<App::DocumentObject*>(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<App::DocumentObject*>(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 {

View File

@@ -28,6 +28,7 @@
# include <cstdlib>
# include <sstream>
# include <QString>
# include <BRepLib.hxx>
# include <BSplCLib.hxx>
# include <Bnd_Box.hxx>
@@ -152,9 +153,6 @@
# include <ShapeUpgrade_ShellSewing.hxx>
# include <ShapeUpgrade_RemoveInternalWires.hxx>
# include <Standard_Version.hxx>
#if OCC_VERSION_HEX < 0x070300
# include <BRepAlgo_Fuse.hxx>
#endif
# include <BinTools.hxx>
# include <BinTools_ShapeSet.hxx>
# include <Poly_Polygon3D.hxx>
@@ -169,13 +167,17 @@
# include <ShapeAnalysis_FreeBoundsProperties.hxx>
# include <ShapeAnalysis_FreeBoundData.hxx>
#if OCC_VERSION_HEX < 0x070300
# include <BRepAlgo_Fuse.hxx>
#endif
#if OCC_VERSION_HEX >= 0x060600
#include <BOPAlgo_ArgumentAnalyzer.hxx>
#include <BOPAlgo_ListOfCheckResult.hxx>
# include <BOPAlgo_ArgumentAnalyzer.hxx>
# include <BOPAlgo_ListOfCheckResult.hxx>
#endif
#if OCC_VERSION_HEX >= 0x070300
#include <BRepAlgoAPI_Defeaturing.hxx>
# include <BRepAlgoAPI_Defeaturing.hxx>
#endif
#endif // _PreComp_

View File

@@ -22,10 +22,11 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <BRep_Builder.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS_CompSolid.hxx>
# include <BRep_Builder.hxx>
# include <Standard_Failure.hxx>
# include <TopoDS_CompSolid.hxx>
#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<TopoShapePy*>(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;
}

View File

@@ -24,14 +24,15 @@
#include "PreCompiled.h"
#include "TopoShape.h"
#ifndef _PreComp_
#include <BRep_Builder.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS_Compound.hxx>
#include <TopTools_HSequenceOfShape.hxx>
#include <ShapeAnalysis_FreeBounds.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
# include <BRep_Builder.hxx>
# include <Standard_Failure.hxx>
# include <TopoDS_Compound.hxx>
# include <TopTools_HSequenceOfShape.hxx>
# include <ShapeAnalysis_FreeBounds.hxx>
# include <Precision.hxx>
# include <TopExp_Explorer.hxx>
#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<TopoShapePy*>(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;
}

View File

@@ -71,7 +71,7 @@
# include <GCPnts_TangentialDeflection.hxx>
# include <GCPnts_QuasiUniformAbscissa.hxx>
# include <GCPnts_QuasiUniformDeflection.hxx>
#endif
#endif // _PreComp_
#include <Base/Vector3D.h>
#include <Base/VectorPy.h>
@@ -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;
}

View File

@@ -69,7 +69,7 @@
# include <BRepGProp_Face.hxx>
# include <GeomLProp_SLProps.hxx>
# include <BRep_Tool.hxx>
#endif
#endif // _PreComp
#include <Base/VectorPy.h>
#include <Base/GeometryPyCXX.h>
@@ -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;
}

View File

@@ -67,7 +67,6 @@
# include <Standard_Version.hxx>
#endif
#include <Base/GeometryPyCXX.h>
#include <Base/Matrix.h>
#include <Base/Rotation.h>
@@ -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;
}

View File

@@ -34,9 +34,9 @@
# include <TopoDS_Shell.hxx>
# include <ShapeUpgrade_ShellSewing.hxx>
# include <ShapeAnalysis_Shell.hxx>
# include <BRepPrimAPI_MakeHalfSpace.hxx>
#endif
#include <Base/VectorPy.h>
#include <Base/GeometryPyCXX.h>
@@ -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<TopoShapeFacePy*>(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;
}

View File

@@ -23,27 +23,29 @@
#include "PreCompiled.h"
#include <Standard_Version.hxx>
#include <BRepGProp.hxx>
#include <BRepTools.hxx>
#include <BRepOffset_MakeOffset.hxx>
#ifndef _PreComp_
# include <Standard_Version.hxx>
# include <BRepGProp.hxx>
# include <BRepTools.hxx>
# include <BRepOffset_MakeOffset.hxx>
#if OCC_VERSION_HEX >= 0x060600
#include <BRepClass3d.hxx>
# include <BRepClass3d.hxx>
#endif
# include <GProp_GProps.hxx>
# include <GProp_PrincipalProps.hxx>
# include <BRepBuilderAPI_MakeSolid.hxx>
# include <BRepLib.hxx>
# include <Precision.hxx>
# include <TopExp_Explorer.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Solid.hxx>
# include <TopoDS_Shell.hxx>
# include <TopoDS_CompSolid.hxx>
# include <gp_Ax1.hxx>
# include <gp_Pnt.hxx>
# include <gp_Dir.hxx>
# include <Standard_Failure.hxx>
#endif
#include <GProp_GProps.hxx>
#include <GProp_PrincipalProps.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepLib.hxx>
#include <Precision.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_CompSolid.hxx>
#include <gp_Ax1.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <Standard_Failure.hxx>
#include <Base/VectorPy.h>
#include <Base/GeometryPyCXX.h>
@@ -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;
}

View File

@@ -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;
}

View File

@@ -37,8 +37,21 @@
# include <BRep_Builder.hxx>
#endif
#include "edgecluster.h"
#ifndef _PreComp_
# include <TopExp_Explorer.hxx>
# include <TopAbs_ShapeEnum.hxx>
# include <BRep_Tool.hxx>
# include <TopExp.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Shape.hxx>
# include <TopoDS_Vertex.hxx>
# include <TopoDS_Compound.hxx>
# include <BRepAdaptor_Curve.hxx>
# include <GCPnts_QuasiUniformDeflection.hxx>
# include <BRep_Builder.hxx>
#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 <BRepAdaptor_Curve.hxx>
bool Edgecluster::IsValidEdge(const TopoDS_Edge& edge)
{

View File

@@ -22,54 +22,60 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <algorithm>
#include <iterator>
#include <Geom_Surface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <gp_Ax3.hxx>
#include <Geom_BSplineSurface.hxx>
#include <gp_Pln.hxx>
#include <gp_Cylinder.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <BRepLib_MakeWire.hxx>
#include <BRepLib_FuseEdges.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <BRepBuilderAPI_Sewing.hxx>
#include <Geom_Conic.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeFix_Face.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
#include <BRep_Builder.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeAnalysis_Curve.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <BRepGProp.hxx>
#include <GProp_GProps.hxx>
#include <Standard_Version.hxx>
#endif
# include <algorithm>
# include <iterator>
# include <Geom_Surface.hxx>
# include <Geom_RectangularTrimmedSurface.hxx>
# include <GeomAdaptor_Surface.hxx>
# include <Geom_Plane.hxx>
# include <Geom_CylindricalSurface.hxx>
# include <gp_Ax3.hxx>
# include <Geom_BSplineSurface.hxx>
# include <gp_Pln.hxx>
# include <gp_Cylinder.hxx>
# include <TColgp_Array2OfPnt.hxx>
# include <TColStd_Array1OfReal.hxx>
# include <TopoDS_Shape.hxx>
# include <TopoDS_Compound.hxx>
# include <TopoDS.hxx>
# include <TopExp.hxx>
# include <TopExp_Explorer.hxx>
# include <BRep_Tool.hxx>
# include <BRepLib_MakeWire.hxx>
# include <BRepLib_FuseEdges.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <BRepBuilderAPI_MakeSolid.hxx>
# include <BRepBuilderAPI_Sewing.hxx>
# include <Geom_Conic.hxx>
# include <ShapeBuild_ReShape.hxx>
# include <ShapeFix_Face.hxx>
# include <TopTools_ListOfShape.hxx>
# include <TopTools_ListIteratorOfListOfShape.hxx>
# include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
# include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
# include <BRep_Builder.hxx>
# include <Bnd_Box.hxx>
# include <BRepBndLib.hxx>
# include <ShapeAnalysis_Edge.hxx>
# include <ShapeAnalysis_Curve.hxx>
# include <BRepAdaptor_Curve.hxx>
# include <TColgp_SequenceOfPnt.hxx>
# include <GeomAPI_ProjectPointOnSurf.hxx>
# include <BRepGProp.hxx>
# include <GProp_GProps.hxx>
# include <Standard_Version.hxx>
#endif // _PreComp_
#include <Base/Tools.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#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<EdgeVectorType> boundaries;
boundarySplit(faces, boundaries);
@@ -649,7 +655,7 @@ TopoDS_Face FaceTypedCylinder::buildFace(const FaceVectorType &faces) const
if (surface.IsNull())
return dummy;
std::vector<TopoDS_Wire> innerWires, encirclingWires;
std::vector<TopoDS_Wire>::iterator wireIt;
std::vector<TopoDS_Wire>::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 &currentEdge = 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