Back to index

salome-geom  6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
ShHealOper_RemoveInternalWires Class Reference

Class ShHealOper_RemoveInternalWires. More...

#include <ShHealOper_RemoveInternalWires.hxx>

Inheritance diagram for ShHealOper_RemoveInternalWires:
Inheritance graph
[legend]
Collaboration diagram for ShHealOper_RemoveInternalWires:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT ShHealOper_RemoveInternalWires ()
 Empty constructor.
Standard_EXPORT ShHealOper_RemoveInternalWires (const TopoDS_Shape &theShape)
 Copy constructor.
virtual Standard_EXPORT void Init (const TopoDS_Shape &theShape)
Standard_EXPORT Standard_Boolean Remove ()
Standard_EXPORT Standard_Boolean Remove (const TopTools_SequenceOfShape &theRemovedShapes)
const TopoDS_Shape & GetResultShape () const
Standard_Boolean GetModifiedShape (const TopoDS_Shape &theOldShape, TopoDS_Shape &theNewShape) const
Standard_Boolean IsDone () const
void SetContext (Handle(ShapeBuild_ReShape)&theContext)
 Handle (ShapeBuild_ReShape) Context()
Standard_Integer GetErrorStatus ()

Protected Member Functions

 Handle (ShapeBuild_ReShape) myContext

Protected Attributes

TopoDS_Shape myInitShape
TopoDS_Shape myResultShape
Standard_Boolean myDone
ShHealOper_Error myErrorStatus

Private Member Functions

Standard_Boolean removeWire (const TopoDS_Face &theFace, const TopoDS_Wire &theWire)
void fixShape (const TopoDS_Shape &theShape)

Private Attributes

TopTools_IndexedDataMapOfShapeListOfShape myMapWiresFace

Detailed Description

Class ShHealOper_RemoveInternalWires.

Definition at line 41 of file ShHealOper_RemoveInternalWires.hxx.


Constructor & Destructor Documentation

Empty constructor.

Definition at line 47 of file ShHealOper_RemoveInternalWires.hxx.

{}

Copy constructor.

Definition at line 42 of file ShHealOper_RemoveInternalWires.cxx.

{
  Init(theShape);
}

Here is the call graph for this function:


Member Function Documentation

void ShHealOper_RemoveInternalWires::fixShape ( const TopoDS_Shape &  theShape) [private]

Definition at line 147 of file ShHealOper_RemoveInternalWires.cxx.

{
  Handle(ShapeFix_Shape) aFixTool = new ShapeFix_Shape(theShape);
  aFixTool->SetContext(myContext);
  aFixTool->FixShellTool()->FixFaceMode() = Standard_False;
  aFixTool->FixFreeFaceMode() = Standard_False;
  aFixTool->FixFreeWireMode() = Standard_False;
  aFixTool->FixSameParameterMode() = Standard_False;
  aFixTool->Perform();
  myResultShape = aFixTool->Shape();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Integer ShHealOper_Tool::GetErrorStatus ( ) [inline, inherited]

Definition at line 90 of file ShHealOper_Tool.hxx.

  {
    return myErrorStatus;
  }

Here is the caller graph for this function:

Standard_Boolean ShHealOper_Tool::GetModifiedShape ( const TopoDS_Shape &  theOldShape,
TopoDS_Shape &  theNewShape 
) const [inline, inherited]

Definition at line 64 of file ShHealOper_Tool.hxx.

  {
    theNewShape = myContext->Apply(theOldShape);
    return (!theNewShape.IsSame(theOldShape));
  }
const TopoDS_Shape& ShHealOper_Tool::GetResultShape ( ) const [inline, inherited]

Definition at line 57 of file ShHealOper_Tool.hxx.

  {
    return myResultShape;

  }

Here is the caller graph for this function:

ShHealOper_Tool::Handle ( ShapeBuild_ReShape  ) [inline, inherited]

Definition at line 84 of file ShHealOper_Tool.hxx.

  {
    return myContext;
  }

Here is the caller graph for this function:

ShHealOper_Tool::Handle ( ShapeBuild_ReShape  ) [protected, inherited]
void ShHealOper_RemoveInternalWires::Init ( const TopoDS_Shape &  theShape) [virtual]

Reimplemented from ShHealOper_Tool.

Definition at line 51 of file ShHealOper_RemoveInternalWires.cxx.

{
  ShHealOper_Tool::Init(theShape);
  myMapWiresFace.Clear();
  TopExp::MapShapesAndAncestors(theShape,TopAbs_WIRE,TopAbs_FACE,myMapWiresFace);
}

Here is the caller graph for this function:

Standard_Boolean ShHealOper_Tool::IsDone ( ) const [inline, inherited]

Definition at line 72 of file ShHealOper_Tool.hxx.

  {
    return myDone;
  }

Definition at line 62 of file ShHealOper_RemoveInternalWires.cxx.

{
  TopExp_Explorer aexpFaces(myInitShape,TopAbs_FACE);
  //removes internal wires from all faces in the shape
  Standard_Boolean isDone = Standard_False;
  for( ; aexpFaces.More(); aexpFaces.Next())
    isDone =  removeWire(TopoDS::Face(aexpFaces.Current()),TopoDS_Wire()) || isDone;
  if(isDone ) {
    TopoDS_Shape aNewShape = myContext->Apply(myInitShape);
    //fix not-connected shell and solids obtained after removing wires
    fixShape(aNewShape);
  }
  myDone = isDone;
  return myDone;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Boolean ShHealOper_RemoveInternalWires::Remove ( const TopTools_SequenceOfShape &  theRemovedShapes)

Definition at line 82 of file ShHealOper_RemoveInternalWires.cxx.

{
  myDone = Standard_False;
  
  Standard_Integer i =1;
  for( ; i <= theRemovedShapes.Length(); i++) {
    //removes internal wires from specified faces.
    if(theRemovedShapes.Value(i).ShapeType() == TopAbs_FACE)
      myDone = (removeWire(TopoDS::Face(theRemovedShapes.Value(i)),TopoDS_Wire()) || myDone) ;
    else if(theRemovedShapes.Value(i).ShapeType() == TopAbs_WIRE)
    {
      //removes specified internal wires. 
      TopoDS_Wire awire = TopoDS::Wire(theRemovedShapes.Value(i));
      if(myMapWiresFace.Contains(awire)) {
        const TopTools_ListOfShape& aLfaces = myMapWiresFace.FindFromKey(awire);
        TopTools_ListIteratorOfListOfShape liter(aLfaces);
        for( ; liter.More(); liter.Next())
          myDone = (removeWire(TopoDS::Face(liter.Value()),awire) || myDone);
      }
    }
  }
  if(myDone ) {
    TopoDS_Shape aNewShape = myContext->Apply(myInitShape);

    //fix not-connected shell and solids obtained after removing wires
    fixShape(aNewShape);
    
  }
  return myDone;
}

Here is the call graph for this function:

Standard_Boolean ShHealOper_RemoveInternalWires::removeWire ( const TopoDS_Face &  theFace,
const TopoDS_Wire &  theWire 
) [private]

Definition at line 117 of file ShHealOper_RemoveInternalWires.cxx.

{
  TopoDS_Wire aBoundWire = ShapeAnalysis::OuterWire(theFace);
  if(!theWire.IsNull() && aBoundWire.IsSame(theWire)) {
    myErrorStatus = ShHealOper_InvalidParameters;
    return Standard_False;
  }
  
  Standard_Boolean isremove = Standard_False;
  if(!theWire.IsNull()) {
    myContext->Remove(theWire);
    isremove= Standard_True;
  }
  else {  
    TopExp_Explorer aExpW(theFace,TopAbs_WIRE);
    for( ; aExpW.More(); aExpW.Next()) {
      if(!aBoundWire.IsSame(aExpW.Current())) {
        myContext->Remove(aExpW.Current());
        isremove= Standard_True;
      }
    }
  }
  return isremove;
}

Here is the caller graph for this function:

void ShHealOper_Tool::SetContext ( Handle(ShapeBuild_ReShape)&  theContext) [inline, inherited]

Definition at line 78 of file ShHealOper_Tool.hxx.

  {
    myContext = theContext;
  }

Member Data Documentation

Standard_Boolean ShHealOper_Tool::myDone [protected, inherited]

Definition at line 100 of file ShHealOper_Tool.hxx.

Definition at line 101 of file ShHealOper_Tool.hxx.

TopoDS_Shape ShHealOper_Tool::myInitShape [protected, inherited]

Definition at line 98 of file ShHealOper_Tool.hxx.

TopTools_IndexedDataMapOfShapeListOfShape ShHealOper_RemoveInternalWires::myMapWiresFace [private]

Definition at line 73 of file ShHealOper_RemoveInternalWires.hxx.

TopoDS_Shape ShHealOper_Tool::myResultShape [protected, inherited]

Definition at line 99 of file ShHealOper_Tool.hxx.


The documentation for this class was generated from the following files: