Back to index

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

Class ShHealOper_ShapeProcess. More...

#include <ShHealOper_ShapeProcess.hxx>

List of all members.

Public Member Functions

Standard_EXPORT ShHealOper_ShapeProcess ()
 Empty constructor.
Standard_EXPORT ShHealOper_ShapeProcess (const TCollection_AsciiString &theNameResource, const TCollection_AsciiString &thePrefix="ShapeProcess")
 Copy constructor.
Standard_EXPORT void Perform (const TopoDS_Shape &theOldShape, TopoDS_Shape &theNewShape)
Standard_EXPORT void SetOperators (const TColStd_SequenceOfAsciiString &theSeqOperators)
Standard_EXPORT Standard_Boolean GetOperators (TColStd_SequenceOfAsciiString &theSeqOperators)
Standard_EXPORT void SetParameter (const TCollection_AsciiString &theNameParam, const TCollection_AsciiString &theVal)
Standard_EXPORT Standard_Boolean GetParameter (const TCollection_AsciiString &theNameParam, TCollection_AsciiString &theVal)
void SetSaveHistoryMode (const Standard_Boolean theSaveHistory, TopAbs_ShapeEnum theuntil=TopAbs_FACE)
Standard_Boolean GetSaveHistoryMode ()
Standard_Boolean GetModifiedShape (const TopoDS_Shape &theOldShape, TopoDS_Shape &theNewShape)
Standard_Boolean isDone ()

Private Attributes

ShapeProcessAPI_ApplySequence myOperations
TCollection_AsciiString myPrefix
TopTools_DataMapOfShapeShape myMapModifications
Standard_Boolean mySaveHistoryMode
TopAbs_ShapeEnum myLevel
Standard_Boolean myDone

Detailed Description

Class ShHealOper_ShapeProcess.

Definition at line 41 of file ShHealOper_ShapeProcess.hxx.


Constructor & Destructor Documentation

Empty constructor.

Definition at line 48 of file ShHealOper_ShapeProcess.cxx.

                                                    :
       myOperations(TCollection_AsciiString("ShHealing").ToCString(),
                    TCollection_AsciiString("ShapeProcess").ToCString())
{
   //myResource = new Resource_Manager("ShHealing");
   myPrefix = "ShapeProcess";
   mySaveHistoryMode = Standard_False;
   myLevel = TopAbs_FACE;
   myDone = Standard_False;
}
ShHealOper_ShapeProcess::ShHealOper_ShapeProcess ( const TCollection_AsciiString &  theNameResource,
const TCollection_AsciiString &  thePrefix = "ShapeProcess" 
)

Copy constructor.

Definition at line 64 of file ShHealOper_ShapeProcess.cxx.

                                                                                             :
       myOperations(theNameResource.ToCString(),thePrefix.ToCString())
{
  //myResource = new Resource_Manager(theNameResource);
  myPrefix = thePrefix;
  mySaveHistoryMode = Standard_False;
  myLevel = TopAbs_FACE;
  myDone = Standard_False;
}

Member Function Documentation

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

Definition at line 92 of file ShHealOper_ShapeProcess.hxx.

  {
    Standard_Boolean isModif = (!myMapModifications.IsEmpty() && 
                                myMapModifications.IsBound(theOldShape));
    if(isModif)
      theNewShape = myMapModifications.Find(theOldShape);
    else
      theNewShape = theOldShape;
    return isModif;
  }
Standard_Boolean ShHealOper_ShapeProcess::GetOperators ( TColStd_SequenceOfAsciiString &  theSeqOperators)

Definition at line 152 of file ShHealOper_ShapeProcess.cxx.

{
  TCollection_AsciiString nameSeq(myPrefix);
  nameSeq +=".exec.op";
  if(!myOperations.Context()->ResourceManager()->Find(nameSeq.ToCString()))
    return Standard_False;
  
  TCollection_AsciiString seqoper = myOperations.Context()->ResourceManager()->Value(nameSeq.ToCString());
  Standard_Integer i;
  for ( i=1; ; i++ ) {
    TCollection_AsciiString anOper = seqoper.Token ( " \t,;", i );
    if ( anOper.Length() <=0 ) break;
    theSeqOperators.Append(anOper);
  }
  return (theSeqOperators.Length());
}

Here is the caller graph for this function:

Standard_Boolean ShHealOper_ShapeProcess::GetParameter ( const TCollection_AsciiString &  theNameParam,
TCollection_AsciiString &  theVal 
)

Definition at line 173 of file ShHealOper_ShapeProcess.cxx.

{
  TCollection_AsciiString namePar(myPrefix);
  namePar += ".";
  namePar += theNameParam;
  if(!myOperations.Context()->ResourceManager()->Find(namePar.ToCString()))
    return Standard_False;
  
  theVal = myOperations.Context()->ResourceManager()->Value(namePar.ToCString());
  return Standard_True;
}

Here is the caller graph for this function:

Standard_Boolean ShHealOper_ShapeProcess::GetSaveHistoryMode ( ) [inline]

Definition at line 86 of file ShHealOper_ShapeProcess.hxx.

  {
    return mySaveHistoryMode;
  }
Standard_Boolean ShHealOper_ShapeProcess::isDone ( ) [inline]

Definition at line 105 of file ShHealOper_ShapeProcess.hxx.

  {
    return myDone;
  }

Here is the caller graph for this function:

void ShHealOper_ShapeProcess::Perform ( const TopoDS_Shape &  theOldShape,
TopoDS_Shape &  theNewShape 
)

Definition at line 79 of file ShHealOper_ShapeProcess.cxx.

{
  
  myMapModifications.Clear();
  //ShapeProcessAPI_ApplySequence aOperations(myResource,myPrefix.ToCString());
  //myDone = Standard_False;
  myOperations.ClearMap();
  ShapeAnalysis_ShapeTolerance aSatol;
  Standard_Real ainitTol = aSatol.Tolerance(theOldShape,0);

  // PAL6487: san -- preserve the original shape from being modified
  TopoDS_Shape anOldShape;
  TColStd_IndexedDataMapOfTransientTransient aMap;
  TNaming_CopyShape::CopyTool(theOldShape, aMap, anOldShape);
  // PAL6487: san -- preserve the original shape from being modified

  theNewShape = myOperations.PrepareShape(anOldShape,mySaveHistoryMode,myLevel);
  if(mySaveHistoryMode)
    myMapModifications = myOperations.Map();
  myDone = !anOldShape.IsSame(theNewShape);
  if(!myDone) {
    Standard_Real aendTol =aSatol.Tolerance(theNewShape,0);
    myDone = (fabs(ainitTol - aendTol) > Precision::Confusion()); 
  }
}

Here is the caller graph for this function:

void ShHealOper_ShapeProcess::SetOperators ( const TColStd_SequenceOfAsciiString &  theSeqOperators)

Definition at line 110 of file ShHealOper_ShapeProcess.cxx.

{
  
  TCollection_AsciiString anameParam(myPrefix);
  anameParam += ".";
  anameParam += "exec.op";
  TCollection_AsciiString aseq;
  Standard_Integer i =1;
  for( ; i <= theSeqOperators.Length(); i++) {
    aseq += theSeqOperators.Value(i);
    aseq += " ";
  }
    
  myOperations.Context()->ResourceManager()->SetResource(anameParam.ToCString(),aseq.ToCString());
}

Here is the caller graph for this function:

void ShHealOper_ShapeProcess::SetParameter ( const TCollection_AsciiString &  theNameParam,
const TCollection_AsciiString &  theVal 
)

Definition at line 130 of file ShHealOper_ShapeProcess.cxx.

{
  TCollection_AsciiString anameParam(myPrefix);
  anameParam += ".";
  anameParam+= theNameParam;
  if(theVal.IsIntegerValue())
    myOperations.Context()->ResourceManager()->
      SetResource(anameParam.ToCString(),theVal.IntegerValue());
  else if(theVal.IsRealValue())
    myOperations.Context()->ResourceManager()->
      SetResource(anameParam.ToCString(),theVal.RealValue());
  else
    myOperations.Context()->ResourceManager()->
      SetResource(anameParam.ToCString(),theVal.ToCString());

}

Here is the caller graph for this function:

void ShHealOper_ShapeProcess::SetSaveHistoryMode ( const Standard_Boolean  theSaveHistory,
TopAbs_ShapeEnum  theuntil = TopAbs_FACE 
) [inline]

Definition at line 76 of file ShHealOper_ShapeProcess.hxx.

 {
   mySaveHistoryMode = theSaveHistory;
   myLevel = theuntil;
 }

Member Data Documentation

Standard_Boolean ShHealOper_ShapeProcess::myDone [private]

Definition at line 124 of file ShHealOper_ShapeProcess.hxx.

TopAbs_ShapeEnum ShHealOper_ShapeProcess::myLevel [private]

Definition at line 123 of file ShHealOper_ShapeProcess.hxx.

TopTools_DataMapOfShapeShape ShHealOper_ShapeProcess::myMapModifications [private]

Definition at line 121 of file ShHealOper_ShapeProcess.hxx.

ShapeProcessAPI_ApplySequence ShHealOper_ShapeProcess::myOperations [private]

Definition at line 119 of file ShHealOper_ShapeProcess.hxx.

TCollection_AsciiString ShHealOper_ShapeProcess::myPrefix [private]

Definition at line 120 of file ShHealOper_ShapeProcess.hxx.

Standard_Boolean ShHealOper_ShapeProcess::mySaveHistoryMode [private]

Definition at line 122 of file ShHealOper_ShapeProcess.hxx.


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