static Standard_Boolean ToFuse(const TopoDS_Face& ,
const TopoDS_Face&);
-
-static void SetGluedFaces(const TopoDS_Face& theSkface,
- const TopoDS_Shape& theSbase,
- const TopoDS_Shape& thePbase,
- const TopTools_DataMapOfShapeListOfShape& theSlmap,
- LocOpe_Prism&,
- TopTools_DataMapOfShapeShape&);
-
-#ifdef DEB
-static void VerifGluedFaces(const TopoDS_Face& theSkface,
- const TopoDS_Shape& thePbase,
- Handle(Geom_Curve)& theBCurve,
- TColGeom_SequenceOfCurve& theCurves,
- LocOpe_Prism& thePrism,
- TopTools_DataMapOfShapeShape& theMap);
-#endif
-
static Standard_Real HeightMax(const TopoDS_Shape& theSbase,
const TopoDS_Face& theSkface,
const TopoDS_Shape& theSFrom,
if(ToFuse(ff, FFace)) {
TopTools_DataMapOfShapeListOfShape sl;
if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace))
-// SetGluedFaces(ff, mySbase, FFace, sl, thePrism, myGluedF);
break;
}
}
// management of faces of gluing given by the user
-// SetGluedFaces(mySkface, mySbase, myPbase, mySlface, thePrism, myGluedF);
GluedFacesValid();
-// VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF);
if(!myGluedF.IsEmpty()) { // case gluing
myJustGluer = Standard_True;
MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
myGShape = VraiPrism;
GeneratedShapeValid();
-
- //SetGluedFaces(mySkface, mySbase, myPbase, mySlface, thePrism, myGluedF);
GluedFacesValid();
-// VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF);
-
thePrism.Curves(myCurves);
myBCurve = thePrism.BarycCurve();
GlobalPerform();
myGShape = VraiPrism;
GeneratedShapeValid();
-
- //SetGluedFaces(TopoDS_Face(), // on ne veut pas binder mySkface
- // mySbase, myPbase, mySlface, thePrism, myGluedF);
GluedFacesValid();
-//// VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF);
-
thePrism.Curves(myCurves);
myBCurve = thePrism.BarycCurve();
GlobalPerform();
myGShape = VraiPrism;
GeneratedShapeValid();
-
- //SetGluedFaces(mySkface, mySbase, myPbase, mySlface, thePrism, myGluedF);
GluedFacesValid();
-// VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF);
-
thePrism.Curves(myCurves);
myBCurve = thePrism.BarycCurve();
GlobalPerform();
return sens;
}
-
-//=======================================================================
-//function : SetGluedFaces
-//purpose : management of gluing faces
-//=======================================================================
-
-static void SetGluedFaces(const TopoDS_Face& theSkface,
- const TopoDS_Shape& theSbase,
- const TopoDS_Shape& thePbase,
- const TopTools_DataMapOfShapeListOfShape& theSlmap,
- LocOpe_Prism& thePrism,
- TopTools_DataMapOfShapeShape& theMap)
-{
- TopExp_Explorer exp;
- if (!theSkface.IsNull() && thePbase.ShapeType() == TopAbs_FACE) {
- for (exp.Init(theSbase,TopAbs_FACE); exp.More(); exp.Next()) {
- if (exp.Current().IsSame(theSkface)) {
- theMap.Bind(thePbase,theSkface);
- break;
- }
- }
- }
- else {
- for (exp.Init(theSbase,TopAbs_FACE); exp.More(); exp.Next()) {
- if (exp.Current().IsSame(theSkface)) {
- TopExp_Explorer exp2;
- for (exp2.Init(thePbase,TopAbs_FACE);exp2.More();exp2.Next()) {
- theMap.Bind(exp2.Current(),theSkface);
- }
- break;
- }
- }
- }
-
- // Sliding
- TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
- if(!theSlmap.IsEmpty()) {
- for (; itm.More(); itm.Next()) {
- const TopoDS_Face& fac = TopoDS::Face(itm.Key());
- const TopTools_ListOfShape& ledg = itm.Value();
- TopTools_ListIteratorOfListOfShape it;
- for (it.Initialize(ledg); it.More(); it.Next()) {
- const TopTools_ListOfShape& gfac = thePrism.Shapes(it.Value());
- if (gfac.Extent() != 1) {
-#ifdef DEB
- Standard_Boolean trc = BRepFeat_GettraceFEAT();
- if (trc) cout << " BRepFeat_MakePrism : Pb SetGluedFace" << endl;
-#endif
- }
- theMap.Bind(gfac.First(),fac);
- }
- }
- }
-}
-
-
-//=======================================================================
-//function : VerifGluedFaces
-//purpose : Verification intersection Tool/theSkface = thePbase
-// If yes -> OK otherwise -> case without gluing
-//=======================================================================
-#ifdef DEB
-static void VerifGluedFaces(const TopoDS_Face& theSkface,
- const TopoDS_Shape& thePbase,
- Handle(Geom_Curve)& theBCurve,
- TColGeom_SequenceOfCurve& theCurves,
- LocOpe_Prism& thePrism,
- TopTools_DataMapOfShapeShape& theMap)
-{
- Standard_Boolean GluedFaces = Standard_True;
- TopoDS_Shape VraiPrism = thePrism.Shape();
-
- TColGeom_SequenceOfCurve scur;
- thePrism.Curves(theCurves);
- theBCurve = thePrism.BarycCurve();
- scur.Clear();
- scur.Append(theBCurve);
- LocOpe_CSIntersector ASI(theSkface);
- ASI.Perform(scur);
- if (ASI.IsDone() && ASI.NbPoints(1) >=1) {
- TopAbs_Orientation Or = ASI.Point(1,1).Orientation();
- TopoDS_Face FSk = ASI.Point(1,1).Face();
- TopoDS_Shape Comp;
- BRep_Builder B;
- B.MakeCompound(TopoDS::Compound(Comp));
- TopoDS_Solid S = BRepFeat::Tool(theSkface, FSk, Or);
- if (!S.IsNull()) B.Add(Comp,S);
- //modified by NIZNHY-PKV Thu Mar 21 18:07:35 2002 f
- //BRepAlgo_Cut trP(VraiPrism,Comp);
- BRepAlgoAPI_Cut trP(VraiPrism,Comp);
- //modified by NIZNHY-PKV Thu Mar 21 18:07:39 2002 t
- TopoDS_Shape Cutsh = trP.Shape();
- TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
- for(; ex.More(); ex.Next()) {
- TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
- for(; ex1.More(); ex1.Next()) {
- const TopoDS_Face& fac1 = TopoDS::Face(ex1.Current());
- TopExp_Explorer ex2(thePbase, TopAbs_FACE);
- for(; ex2.More(); ex2.Next()) {
- const TopoDS_Face& fac2 = TopoDS::Face(ex2.Current());
- if(fac1.IsSame(fac2)) break;
- }
- if (ex2.More()) break;
- }
- if (ex1.More()) continue;
- GluedFaces = Standard_False;
- break;
- }
- if (!GluedFaces) {
-#ifdef DEB
- Standard_Boolean trc = BRepFeat_GettraceFEAT();
- if (trc) cout << " Intersection Prism/skface : no gluing" << endl;
-#endif
- theMap.Clear();
- }
- }
-}
-#endif
-
//=======================================================================
//function : MajMap
//purpose : management of descendants