Back to index

salome-geom  6.5.0
Public Member Functions | Static Public Member Functions | Public Attributes
GEOMImpl_IHealingOperations Class Reference

#include <GEOMImpl_IHealingOperations.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMImpl_IHealingOperations (GEOM_Engine *theEngine, int theDocID)
 constructor:
Standard_EXPORT ~GEOMImpl_IHealingOperations ()
 destructor
Standard_EXPORT Handle (GEOM_Object) ShapeProcess(Handle(GEOM_Object) theObject
Standard_EXPORT const Handle (TColStd_HArray1OfExtendedString)&theOperations
Standard_EXPORT const const Handle (TColStd_HArray1OfExtendedString)&theParams
Standard_EXPORT const const const Handle (TColStd_HArray1OfExtendedString)&theValues)
Standard_EXPORT void GetShapeProcessParameters (std::list< std::string > &theOperations, std::list< std::string > &theParams, std::list< std::string > &theValues)
 ShapeProcess.
Standard_EXPORT bool GetOperatorParameters (const std::string theOperation, std::list< std::string > &theParams, std::list< std::string > &theValues)
 GetOperatorParameters.
Standard_EXPORT Handle (GEOM_Object) SuppressFaces(Handle(GEOM_Object) theObject
Standard_EXPORT const Handle (TColStd_HArray1OfInteger)&theFaces)
Standard_EXPORT Handle (GEOM_Object) CloseContour(Handle(GEOM_Object) theObject
Standard_EXPORT const Handle (TColStd_HArray1OfInteger)&theWires
Standard_EXPORT Handle (GEOM_Object) RemoveIntWires(Handle(GEOM_Object) theObject
Standard_EXPORT const Handle (TColStd_HArray1OfInteger)&theWires)
Standard_EXPORT Handle (GEOM_Object) FillHoles(Handle(GEOM_Object) theObject
Standard_EXPORT const Handle (TColStd_HArray1OfInteger)&theWires)
Standard_EXPORT Handle (GEOM_Object) Sew(Handle(GEOM_Object) theObject
Standard_EXPORT Handle (GEOM_Object) DivideEdge(Handle(GEOM_Object) theObject
Standard_EXPORT bool GetFreeBoundary (Handle(GEOM_Object) theObject, Handle(TColStd_HSequenceOfTransient)&theOutClosedWires, Handle(TColStd_HSequenceOfTransient)&theOutOpenWires)
 GetFreeBoundary.
Standard_EXPORT Handle (GEOM_Object) ChangeOrientation(Handle(GEOM_Object) theObject)
Standard_EXPORT Handle (GEOM_Object) ChangeOrientationCopy(Handle(GEOM_Object) theObject)
Standard_EXPORT Handle (GEOM_Object) LimitTolerance(Handle(GEOM_Object) theObject
Standard_EXPORT void StartOperation ()
 StartOperation.
Standard_EXPORT void FinishOperation ()
 FinishOperation.
Standard_EXPORT void AbortOperation ()
 AbortOperation.
Standard_EXPORT bool IsDone ()
 IsDone.
Standard_EXPORT void SetNotDone ()
Standard_EXPORT void SetErrorCode (const TCollection_AsciiString &theErrorCode)
Standard_EXPORT char * GetErrorCode ()
Standard_EXPORT GEOM_EngineGetEngine ()
Standard_EXPORT GEOM_SolverGetSolver ()
Standard_EXPORT int GetDocID ()

Static Public Member Functions

static Standard_EXPORT bool GetParameters (const std::string theOperation, std::list< std::string > &theParams)
 GetParameters.

Public Attributes

Standard_EXPORT const bool isCommonVertex
Standard_EXPORT double theTolerance
Standard_EXPORT int theIndex
Standard_EXPORT int double theValue
Standard_EXPORT int double bool isByParameter

Detailed Description

Definition at line 35 of file GEOMImpl_IHealingOperations.hxx.


Constructor & Destructor Documentation

constructor:

Definition at line 68 of file GEOMImpl_IHealingOperations.cxx.

: GEOM_IOperations(theEngine, theDocID)
{
  MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
}

destructor

Definition at line 79 of file GEOMImpl_IHealingOperations.cxx.

{
  MESSAGE("GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations");
}

Member Function Documentation

void GEOM_IOperations::AbortOperation ( ) [inherited]

AbortOperation.

Definition at line 89 of file GEOM_IOperations.cxx.

{
  Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
  aDoc->AbortCommand();
}

Here is the call graph for this function:

void GEOM_IOperations::FinishOperation ( ) [inherited]

FinishOperation.

Definition at line 77 of file GEOM_IOperations.cxx.

{
  Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
  if(aDoc->GetUndoLimit() > 0) 
    aDoc->CommitCommand();
}

Here is the call graph for this function:

Standard_EXPORT int GEOM_IOperations::GetDocID ( ) [inline, inherited]

Definition at line 77 of file GEOM_IOperations.hxx.

{ return _docID; }

Here is the caller graph for this function:

Definition at line 71 of file GEOM_IOperations.hxx.

{ return _engine; }

Here is the caller graph for this function:

Standard_EXPORT char* GEOM_IOperations::GetErrorCode ( ) [inline, inherited]

Definition at line 66 of file GEOM_IOperations.hxx.

                                       {
    return (char*) _errorCode.ToCString();    
  }

Here is the caller graph for this function:

bool GEOMImpl_IHealingOperations::GetFreeBoundary ( Handle(GEOM_Object theObject,
Handle(TColStd_HSequenceOfTransient)&  theOutClosedWires,
Handle(TColStd_HSequenceOfTransient)&  theOutOpenWires 
)

GetFreeBoundary.

Definition at line 720 of file GEOMImpl_IHealingOperations.cxx.

{
  // set error code, check parameters
  SetErrorCode(KO);

  if ( theObject.IsNull() || theClosed.IsNull() || theOpen.IsNull() )
    return false;

  TopoDS_Shape aShape = theObject->GetValue();
  if ( aShape.IsNull() )
    return false;

  // get free boundary shapes

#if OCC_VERSION_LARGE > 0x06030008
  ShapeAnalysis_FreeBounds anAnalizer(aShape, Standard_False,
                                      Standard_True, Standard_True);
#else
  ShapeAnalysis_FreeBounds anAnalizer(aShape);
#endif
  TopoDS_Compound aClosed = anAnalizer.GetClosedWires();
  TopoDS_Compound anOpen = anAnalizer.GetOpenWires();

  // iterate through shapes and append them to the return sequence
  Handle(GEOM_Object) anObj;
  Handle(GEOM_Function) aFunction;
  TopExp_Explorer anExp;
  for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() )
  {
    anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
    aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
    TopoDS_Shape aValueShape = anExp.Current();
    aFunction->SetValue( aValueShape );
    theClosed->Append(anObj);
  }
  for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() )
  {
    anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
    aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
    TopoDS_Shape aValueShape = anExp.Current();
    aFunction->SetValue( aValueShape );
    theOpen->Append(anObj);
  }

  if(!aFunction.IsNull()) {

    //Make a Python command
    GEOM::TPythonDump pd (aFunction);

    Standard_Integer i, aLen = theClosed->Length();
    if (aLen > 0) {
      pd << "(isDone, [";
      for (i = 1; i <= aLen; i++) {
        Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theClosed->Value(i));
        pd << anObj_i << ((i < aLen) ? ", " : "");
      }
      pd << "], ";
    } else {
      pd << "(isDone, empty_list, ";
    }

    aLen = theOpen->Length();
    if (aLen > 0) {
      pd << "[";
      for (i = 1; i <= aLen; i++) {
        Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theOpen->Value(i));
        pd << anObj_i << ((i < aLen) ? ", " : "");
      }
      pd << "]";
    } else {
      pd << "empty_list";
    }

    pd << ") = geompy.GetFreeBoundary(" << theObject << ")";
  }

  SetErrorCode(OK);
  return true;
}

Here is the call graph for this function:

bool GEOMImpl_IHealingOperations::GetOperatorParameters ( const std::string  theOperation,
std::list< std::string > &  theParams,
std::list< std::string > &  theValues 
)

GetOperatorParameters.

Definition at line 230 of file GEOMImpl_IHealingOperations.cxx.

{
  ShHealOper_ShapeProcess aHealer;
  int nbParamValueErrors( 0 );
  std::list<std::string> aParams;
  if ( GetParameters( theOperation, aParams ) ) {
    for ( std::list<std::string>::iterator it = aParams.begin(); it != aParams.end(); ++it ) {
      TCollection_AsciiString aParam( (Standard_CString)(*it).c_str() );
      TCollection_AsciiString aValue;
      if ( aHealer.GetParameter( aParam, aValue ) ) {
        theParams.push_back( aParam.ToCString() );
        theValues.push_back( aValue.ToCString() );
      }
      else
        nbParamValueErrors++;
    }
  }
  else
    return false;

  if ( nbParamValueErrors ) {
    TCollection_AsciiString aMsg ("ERRORS retrieving ShapeProcess parameter values (GEOMImpl_IHealingOperations): nbParamValueErrors = ");
    aMsg += TCollection_AsciiString( nbParamValueErrors );
    MESSAGE(aMsg.ToCString());
  }

  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool GEOMImpl_IHealingOperations::GetParameters ( const std::string  theOperation,
std::list< std::string > &  theParams 
) [static]

GetParameters.

Definition at line 266 of file GEOMImpl_IHealingOperations.cxx.

{
  if ( theOperation == "SplitAngle" ) {
    theParams.push_back( "SplitAngle.Angle" );
    theParams.push_back( "SplitAngle.MaxTolerance" );

  } else if ( theOperation == "SplitClosedFaces" ) {
    theParams.push_back( "SplitClosedFaces.NbSplitPoints" );

  } else if ( theOperation == "FixFaceSize" ) {
    theParams.push_back( "FixFaceSize.Tolerance" );

  } else if( theOperation == "DropSmallEdges" ) {
    theParams.push_back( "DropSmallEdges.Tolerance3d" );

  } else if( theOperation == "BSplineRestriction" ) {
    theParams.push_back( "BSplineRestriction.SurfaceMode" );
    theParams.push_back( "BSplineRestriction.Curve3dMode" );
    theParams.push_back( "BSplineRestriction.Curve2dMode" );
    theParams.push_back( "BSplineRestriction.Tolerance3d" );
    theParams.push_back( "BSplineRestriction.Tolerance2d" );
    theParams.push_back( "BSplineRestriction.RequiredDegree" );
    theParams.push_back( "BSplineRestriction.RequiredNbSegments" );
    theParams.push_back( "BSplineRestriction.Continuity3d" );
    theParams.push_back( "BSplineRestriction.Continuity2d" );

  } else if( theOperation == "SplitContinuity" ) {
    theParams.push_back( "SplitContinuity.Tolerance3d" );
    theParams.push_back( "SplitContinuity.SurfaceContinuity" );
    theParams.push_back( "SplitContinuity.CurveContinuity" );

  } else if( theOperation == "ToBezier" ) {
    theParams.push_back( "ToBezier.SurfaceMode" );
    theParams.push_back( "ToBezier.Curve3dMode" );
    theParams.push_back( "ToBezier.Curve2dMode" );
    theParams.push_back( "ToBezier.MaxTolerance" );

  } else if( theOperation == "SameParameter" ) {
    theParams.push_back( "SameParameter.Tolerance3d" );

  } else if( theOperation == "FixShape" ) {
    theParams.push_back( "FixShape.Tolerance3d" );
    theParams.push_back( "FixShape.MaxTolerance3d" );

  } else {
    return false;
  }

  return true;
}

Here is the caller graph for this function:

void GEOMImpl_IHealingOperations::GetShapeProcessParameters ( std::list< std::string > &  theOperations,
std::list< std::string > &  theParams,
std::list< std::string > &  theValues 
)

ShapeProcess.

Definition at line 195 of file GEOMImpl_IHealingOperations.cxx.

{
  ShHealOper_ShapeProcess aHealer;
  TColStd_SequenceOfAsciiString anOperators;
  int nbOperatorErrors( 0 );
  if ( aHealer.GetOperators( anOperators ) )
  {
    for ( Standard_Integer i = 1; i <= anOperators.Length(); i++ )
    {
      std::string anOperation = anOperators.Value( i ).ToCString();
      if ( GetOperatorParameters( anOperation, theParams, theValues ) )
        theOperations.push_back( anOperation );
      else
        nbOperatorErrors++;
    }
  }
  else
  {
    SetErrorCode("ERROR retrieving operators (GEOMImpl_IHealingOperations)");
  }

  if ( nbOperatorErrors ) {
    TCollection_AsciiString aMsg ("ERRORS retrieving ShapeProcess parameters (GEOMImpl_IHealingOperations): nbOperatorErrors = ");
    aMsg += TCollection_AsciiString( nbOperatorErrors );
    MESSAGE(aMsg.ToCString());
  }
}

Here is the call graph for this function:

Definition at line 74 of file GEOM_IOperations.hxx.

{ return _solver; }
Standard_EXPORT const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfExtendedString  )
Standard_EXPORT const const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfExtendedString  )
Standard_EXPORT const const const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfExtendedString  )
Standard_EXPORT const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfInteger  )
Standard_EXPORT const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfInteger  )
Standard_EXPORT const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfInteger  )
Standard_EXPORT const GEOMImpl_IHealingOperations::Handle ( TColStd_HArray1OfInteger  )
bool GEOM_IOperations::IsDone ( ) [inherited]

IsDone.

Definition at line 101 of file GEOM_IOperations.cxx.

{
  return (_errorCode == OK);
}  
Standard_EXPORT void GEOM_IOperations::SetErrorCode ( const TCollection_AsciiString &  theErrorCode) [inline, inherited]

Definition at line 61 of file GEOM_IOperations.hxx.

                                                                                 {
    _errorCode = theErrorCode;    
  } 

Here is the caller graph for this function:

Standard_EXPORT void GEOM_IOperations::SetNotDone ( ) [inline, inherited]

Definition at line 58 of file GEOM_IOperations.hxx.

{ _errorCode = KO; }
void GEOM_IOperations::StartOperation ( ) [inherited]

StartOperation.

Definition at line 65 of file GEOM_IOperations.cxx.

{
  Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
  if(aDoc->GetUndoLimit() > 0) 
    aDoc->NewCommand();
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 77 of file GEOMImpl_IHealingOperations.hxx.

Definition at line 65 of file GEOMImpl_IHealingOperations.hxx.

Definition at line 77 of file GEOMImpl_IHealingOperations.hxx.

Definition at line 74 of file GEOMImpl_IHealingOperations.hxx.

Definition at line 77 of file GEOMImpl_IHealingOperations.hxx.


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