static
void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ const TopTools_MapOfShape& theFSelfRebAvoid,
TopTools_IndexedDataMapOfShapeListOfShape& theDMFFIm,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeShape& theFacesOrigins,
static
void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ const TopTools_MapOfShape& theFSelfRebAvoid,
TopTools_IndexedDataMapOfShapeListOfShape& theDMFFIm,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeListOfShape& theOEImages,
void FindFacesToRebuild(TopTools_IndexedDataMapOfShapeListOfShape& theLFImages,
const TopTools_IndexedMapOfShape& theInvEdges,
const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
- TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild);
+ TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ TopTools_MapOfShape& theFSelfRebAvoid);
static
void FindCommonParts(const TopTools_ListOfShape& theLF1,
// Find faces to rebuild
if (anInvFaces.Extent()) {
TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild;
- FindFacesToRebuild(aDMFFIm, anInvEdges, anInvFaces, aFToRebuild);
+ TopTools_MapOfShape aFSelfRebAvoid;
+ FindFacesToRebuild(aDMFFIm, anInvEdges, anInvFaces, aFToRebuild, aFSelfRebAvoid);
//
if (aFToRebuild.Extent()) {
- RebuildFaces(aFToRebuild, aDMFFIm, theEdgesOrigins, theFacesOrigins,
+ RebuildFaces(aFToRebuild, aFSelfRebAvoid, aDMFFIm, theEdgesOrigins, theFacesOrigins,
anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges,
anAlreadyInvFaces, anInvFaces, anArtInvFaces, aVAEmpty, theETrimEInf, theAsDes);
}
void FindFacesToRebuild(TopTools_IndexedDataMapOfShapeListOfShape& theLFImages,
const TopTools_IndexedMapOfShape& theInvEdges,
const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
- TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild)
+ TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ TopTools_MapOfShape& theFSelfRebAvoid)
{
Standard_Integer i, aNb = theLFImages.Extent();
if (!aNb) {
}
}
//
+ if (!bRebuild) {
+ bRebuild = aLFIm.Extent() && theInvFaces.Contains(aF);
+ if (bRebuild) {
+ theFSelfRebAvoid.Add(aF);
+ }
+ }
+ //
if (bRebuild) {
theFToRebuild.Add(aF, aLEValid);
}
//purpose :
//=======================================================================
void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ const TopTools_MapOfShape& theFSelfRebAvoid,
TopTools_IndexedDataMapOfShapeListOfShape& theDMFFIm,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeShape& theFacesOrigins,
TopTools_MapOfShape aModifiedEdges;
//
// 1. Intersect faces
- IntersectFaces(theFToRebuild, theDMFFIm, theEdgesOrigins, theOEImages,
+ IntersectFaces(theFToRebuild, theFSelfRebAvoid, theDMFFIm, theEdgesOrigins, theOEImages,
theOEOrigins, theInvEdges, theValidEdges, theInvFaces, theArtInvFaces,
theVertsToAvoid, theETrimEInf, aModifiedEdges, theAsDes);
//
//purpose :
//=======================================================================
void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild,
+ const TopTools_MapOfShape& theFSelfRebAvoid,
TopTools_IndexedDataMapOfShapeListOfShape& theDMFFIm,
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeListOfShape& theOEImages,
}
//
// The faces should be intersected selectively -
- // intersect only faces neighboring to the same invalid faceupdatevla
+ // intersect only faces neighboring to the same invalid face
// and connected to its invalid edges and its valid edges with free bounds
TopTools_MapOfShape aMEAlone;
TopTools_IndexedDataMapOfShapeListOfShape aDMVEVal;
aNbInv = theInvFaces.Extent();
for (k = 1; k <= aNbInv; ++k) {
const TopoDS_Shape& aFInv = theInvFaces.FindKey(k);
+ Standard_Boolean bSelfRebAvoid = theFSelfRebAvoid.Contains(aFInv);
const TopTools_ListOfShape& aLFInv = theInvFaces(k);
//
BOPCol_ListOfShape aLCB;
Standard_Integer aNb = aMFInt.Extent();
for (i = 1; i <= aNb; ++i) {
const TopoDS_Face& aFi = TopoDS::Face(aMFInt(i));
+ if (bSelfRebAvoid && aFi.IsSame(aFInv)) {
+ continue;
+ }
+ //
const TopTools_ListOfShape& aLFImi = theDMFFIm.FindFromKey(aFi);
//
TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey(aFi);
//
for (j = i + 1; j <= aNb; ++j) {
const TopoDS_Face& aFj = TopoDS::Face(aMFInt(j));
+ if (bSelfRebAvoid && aFj.IsSame(aFInv)) {
+ continue;
+ }
+ //
const TopTools_ListOfShape& aLFImj = theDMFFIm.FindFromKey(aFj);
//
TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey(aFj);
//
if (anInvFaces.Extent()) {
TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild;
- FindFacesToRebuild(theDMFFIm, anInvEdges, anInvFaces, aFToRebuild);
+ TopTools_MapOfShape aFSelfRebAvoid;
+ FindFacesToRebuild(theDMFFIm, anInvEdges, anInvFaces, aFToRebuild, aFSelfRebAvoid);
//
if (aFToRebuild.Extent()) {
- RebuildFaces(aFToRebuild, theDMFFIm, theEdgesOrigins, theFacesOrigins,
+ RebuildFaces(aFToRebuild, aFSelfRebAvoid, theDMFFIm, theEdgesOrigins, theFacesOrigins,
theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges,
theAlreadyInvFaces, anInvFaces, anArtInvFaces, theVertsToAvoid, theETrimEInf, theAsDes);
}
TopTools_IndexedMapOfShape& theMERemoved)
{
BOPCol_ListOfShape aLS;
- TopTools_MapOfShape aMFInv, aMFence, aMFToRem;
+ TopTools_MapOfShape aMFence, aMFToRem;
+ TopTools_IndexedMapOfShape aMFInv;
TopTools_ListIteratorOfListOfShape aItLF;
//
Standard_Integer i, aNb = theInvFaces.Extent();
TopExp::MapShapesAndAncestors(aSols, TopAbs_FACE, TopAbs_SOLID, aDMFS);
//
aNb = aDMFS.Extent();
+ if (!aNb) {
+ return;
+ }
+ //
for (i = 1; i <= aNb; ++i) {
const TopTools_ListOfShape& aLSol = aDMFS(i);
if (aLSol.Extent() > 1) {
}
}
//
+ // update invalid faces with images
+ aNb = aMFInv.Extent();
+ for (i = 1; i <= aNb; ++i) {
+ const TopoDS_Shape& aFInv = aMFInv(i);
+ const TopTools_ListOfShape& aLFInvIm = aMV.Modified(aFInv);
+ TopTools_ListIteratorOfListOfShape aItLFInvIm(aLFInvIm);
+ for (; aItLFInvIm.More(); aItLFInvIm.Next()) {
+ const TopoDS_Shape& aFInvIm = aItLFInvIm.Value();
+ aMFInv.Add(aFInvIm);
+ }
+ }
+ //
TopExp_Explorer aExpS(aSols, TopAbs_SOLID);
for (; aExpS.More(); aExpS.Next()) {
const TopoDS_Shape& aSol = aExpS.Current();