// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <BRepFeat_Form.ixx>
+#include <Bnd_Box.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepAlgo.hxx>
+#include <BRepAlgoAPI_BooleanOperation.hxx>
+#include <BRepAlgoAPI_Cut.hxx>
+#include <BRepAlgoAPI_Fuse.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepCheck_Analyzer.hxx>
+#include <BRepFeat.hxx>
+#include <BRepFeat_Builder.hxx>
+#include <BRepFeat_Form.hxx>
+#include <BRepLib.hxx>
+#include <BRepTools_Modifier.hxx>
+#include <BRepTools_TrsfModification.hxx>
+#include <ElCLib.hxx>
+#include <Geom_ConicalSurface.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
#include <LocOpe.hxx>
-#include <LocOpe_Gluer.hxx>
-#include <LocOpe_FindEdges.hxx>
+#include <LocOpe_BuildShape.hxx>
#include <LocOpe_CSIntersector.hxx>
-#include <LocOpe_SequenceOfCirc.hxx>
+#include <LocOpe_FindEdges.hxx>
+#include <LocOpe_Gluer.hxx>
#include <LocOpe_PntFace.hxx>
-#include <LocOpe_BuildShape.hxx>
-
+#include <LocOpe_SequenceOfCirc.hxx>
+#include <Precision.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Solid.hxx>
#include <TopOpeBRepBuild_HBuilder.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
-#include <Standard_NoSuchObject.hxx>
-#include <Precision.hxx>
-
-#include <BRep_Tool.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_CylindricalSurface.hxx>
-#include <Geom_ConicalSurface.hxx>
-
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRepTools_Modifier.hxx>
-#include <BRepTools_TrsfModification.hxx>
-#include <BRepFeat.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <TopoDS.hxx>
-
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <BRepLib.hxx>
-
-#include <ElCLib.hxx>
-
-#include <BRepAlgo.hxx>
-//modified by NIZNHY-PKV Thu Mar 21 17:30:25 2002 f
-//#include <BRepAlgo_Cut.hxx>
-//#include <BRepAlgo_Fuse.hxx>
-
-#include <BRepAlgoAPI_Cut.hxx>
-#include <BRepAlgoAPI_Fuse.hxx>
-#include <BRepFeat_Builder.hxx>
-//modified by NIZNHY-PKV Thu Mar 21 17:30:29 2002 t
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
-#ifdef DEB
+#ifdef OCCT_DEBUG
extern Standard_Boolean BRepFeat_GettraceFEAT();
#endif
void BRepFeat_Form::GlobalPerform ()
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << "BRepFeat_Form::GlobalPerform ()" << endl;
#endif
if (!mySbOK || !myGSOK || !mySFOK || !mySUOK || !myGFOK ||
!mySkOK || !myPSOK) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Fields not initialized in BRepFeat_Form" << endl;
#endif
myStatusError = BRepFeat_NotInitialized;
TopTools_DataMapIteratorOfDataMapOfShapeShape itm;
if(myJustFeat && !myFuse) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Invalid option : myJustFeat + Cut" << endl;
#endif
myStatusError = BRepFeat_InvOption;
}
if (!exp.More()) {
FromInShape = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " From not in Shape" << endl;
#endif
break;
}
if (!exp.More()) {
UntilInShape = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Until not in Shape" << endl;
#endif
break;
TColGeom_SequenceOfCurve scur;
Curves(scur);
- Standard_Real locmin;
- Standard_Real locmax;
Standard_Real mf, Mf, mu, Mu;
TopAbs_Orientation Orifuntil = TopAbs_INTERNAL;
}
{
-// Find sens, locmin, locmax, FFrom, FUntil
- locmin = RealFirst();
- locmax = RealLast();
+// Find sens, FFrom, FUntil
for (Standard_Integer jj=1; jj<=scur.Length(); jj++) {
if (ASI1.IsDone() && ASI2.IsDone()) {
if (ASI1.NbPoints(jj) <= 0) {
}
mu = ASI2.Point(jj,1).Parameter();
Mu = ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter();
- if (scur(jj)->IsPeriodic()) {
- Standard_Real period = scur(jj)->Period();
- locmin = mf;
- locmax = ElCLib::InPeriod(Mu,locmin,locmin+period);
- }
- else {
+ if (!scur(jj)->IsPeriodic()) {
Standard_Integer ku, kf;
if (! (mu > Mf || mf > Mu)) { //overlapping intervals
sens = 1;
kf = 1;
ku = ASI2.NbPoints(jj);
- locmin = mf;
- locmax = Max(Mf, Mu);
}
else if (mu > Mf) {
if (sens == -1) {
sens = 1;
kf = 1;
ku = ASI2.NbPoints(jj);
- locmin = mf;
- locmax = Mu;
}
else {
if (sens == 1) {
sens = -1;
kf = ASI1.NbPoints(jj);
ku = 1;
- locmin = mu;
- locmax = Mf;
}
if (Oriffrom == TopAbs_INTERNAL) {
TopAbs_Orientation Oript = ASI1.Point(jj,kf).Orientation();
Standard_Integer ku;
if (sens == -1) {
ku = 1;
- locmax = -ASI2.Point(jj,ku).Parameter();
- locmin = 0.;
}
else {
ku = ASI2.NbPoints(jj);
- locmin = 0;
- locmax = ASI2.Point(jj,ku).Parameter();
}
if (Orifuntil == TopAbs_INTERNAL && sens != 0) {
TopAbs_Orientation Oript = ASI2.Point(jj,ku).Orientation();
}
}
else {
- locmin = 0.;
- locmax = RealLast();
sens = 1;
break;
}
//--- case of gluing
if (theOpe == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Gluer" << endl;
#endif
Standard_Boolean Collage = Standard_True;
TopTools_DataMapOfShapeListOfShape locmap;
TopExp_Explorer expp(Comp, TopAbs_SOLID);
if(expp.More() && !Comp.IsNull() && !myGShape.IsNull()) {
- //modified by NIZNHY-PKV Thu Mar 21 17:15:36 2002 f
- //BRepAlgo_Cut trP(myGShape,Comp);
BRepAlgoAPI_Cut trP(myGShape, Comp);
- //modified by NIZNHY-PKV Thu Mar 21 17:15:58 2002 t
exp.Init(trP.Shape(), TopAbs_SOLID);
if (exp.Current().IsNull()) {
theOpe = 2;
else {// else X0
// Only solids are preserved
TopoDS_Shape theGShape;
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape));
for (; exp.More(); exp.Next()) {
B.Add(theGShape,exp.Current());
}
}// if(!mySUntil.IsNull())
//
- //modified by NIZNHY-PKV Thu Mar 21 17:21:49 2002 f
- //UpdateDescendants(trP.Builder(),theGShape,Standard_True); // skip faces
UpdateDescendants(trP,theGShape,Standard_True); // skip faces
- //modified by NIZNHY-PKV Thu Mar 21 17:22:32 2002 t
theGlue.Init(mySbase,theGShape);
for (itm.Initialize(myGluedF);itm.More();itm.Next()) {
//--- if the gluing is always applicable
if (theOpe == 1) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " still Gluer" << endl;
#endif
theGlue.Perform();
UpdateDescendants(theGlue);
myNewEdges = theGlue.Edges();
myTgtEdges = theGlue.TgtEdges();
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Gluer result" << endl;
#endif
Done();
//--- case without gluing + Tool with proper dimensions
if (theOpe == 2 && ChangeOpe && myJustGluer) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Gluer failure" << endl;
#endif
myJustGluer = Standard_False;
//--- case without gluing
if (theOpe == 2) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " No Gluer" << endl;
#endif
TopoDS_Shape theGShape = myGShape;
if (ChangeOpe) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " Passage to topological operations" << endl;
#endif
}
TopExp_Explorer expp(Comp, TopAbs_SOLID);
if(expp.More() && !Comp.IsNull() && !myGShape.IsNull()) {
- //modified by NIZNHY-PKV Thu Mar 21 17:24:52 2002 f
- //BRepAlgo_Cut trP(myGShape,Comp);
BRepAlgoAPI_Cut trP(myGShape, Comp);
- //modified by NIZNHY-PKV Thu Mar 21 17:24:56 2002 t
// the result is necessarily a compound.
exp.Init(trP.Shape(),TopAbs_SOLID);
if (!exp.More()) {
}
// Only solids are preserved
theGShape.Nullify();
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape));
for (; exp.More(); exp.Next()) {
B.Add(theGShape,exp.Current());
}
}
}
- //modified by NIZNHY-PKV Thu Mar 21 17:27:23 2002 f
- //UpdateDescendants(trP.Builder(),theGShape,Standard_True);
UpdateDescendants(trP,theGShape,Standard_True);
- //modified by NIZNHY-PKV Thu Mar 21 17:27:31 2002 t
}//if(expp.More() && !Comp.IsNull() && !myGShape.IsNull()) {
//
// Case when no part of the tool is preserved
if (!KeepParts) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " No parts of tool kept" << endl;
#endif
myStatusError = BRepFeat_NoParts;
Standard_Real min, max, pmin, pmax;
Standard_Boolean flag2;
TopoDS_Shape Compo;
- BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Compo));
for (it.Initialize(lshape); it.More(); it.Next()) {
BRepFeat::ParametricMinMax(it.Value(),C,
if (!myJustFeat) {
// removal of edges of section that have no common vertices
// with PartsOfTool preserved
- //modified by NIZHNY-EMV Thu May 10 15:56:24 2012
if (bFlag) {
theBuilder.PerformResult();
myShape = theBuilder.Shape();
} else {
myShape = theBuilder.Shape();
}
- //modified by NIZHNY-EMV Thu May 10 15:56:26 2012
Done();
}
else {
Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean trc = BRepFeat_GettraceFEAT();
#endif
Standard_Boolean Trf = Standard_False;
TopExp_Explorer exp(shapefu, TopAbs_FACE);
if (!exp.More()) { // no faces... It is necessary to return an error
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) cout << " BRepFeat_Form::TransformShapeFU : invalid Shape" << endl;
#endif
return Trf;
myMap(fac).Append(fac);
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) {
if (Trf && (flag == 0)) cout << " TransformShapeFU From" << endl;
if (Trf && (flag == 1)) cout << " TransformShapeFU Until" << endl;
}
}
}
-//modified by NIZNHY-PKV Thu Mar 21 18:43:18 2002 f
//=======================================================================
//function : UpdateDescendants
//purpose :
}
}
}
-//modified by NIZNHY-PKV Thu Mar 21 18:43:36 2002 t