Back to index

salome-geom  6.5.0
Public Member Functions | Static Public Member Functions | Friends
GEOMImpl_ThruSectionsDriver Class Reference

#include <GEOMImpl_ThruSectionsDriver.hxx>

List of all members.

Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT GEOMImpl_ThruSectionsDriver ()
virtual Standard_EXPORT
Standard_Integer 
Execute (TFunction_Logbook &log) const
virtual Standard_EXPORT void Validate (TFunction_Logbook &) const
Standard_EXPORT Standard_Boolean MustExecute (const TFunction_Logbook &) const
Standard_EXPORT ~GEOMImpl_ThruSectionsDriver ()
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const
Standard_EXPORT Standard_Boolean IsKind (const Handle(Standard_Type)&AType) const

Static Public Member Functions

static Standard_EXPORT const
Standard_GUID & 
GetID ()

Friends

Standard_EXPORT friend
Handle_Standard_Type & 
GEOMImpl_ThruSectionsDriver_Type_ ()

Detailed Description

Definition at line 129 of file GEOMImpl_ThruSectionsDriver.hxx.


Constructor & Destructor Documentation

Definition at line 65 of file GEOMImpl_ThruSectionsDriver.cxx.

{
}

Definition at line 153 of file GEOMImpl_ThruSectionsDriver.hxx.

{};

Member Function Documentation

Standard_Integer GEOMImpl_ThruSectionsDriver::Execute ( TFunction_Logbook &  log) const [virtual]

Definition at line 73 of file GEOMImpl_ThruSectionsDriver.cxx.

{
  if (Label().IsNull()) return 0;
  Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());

  GEOMImpl_IThruSections aCI (aFunction);
  Standard_Integer aType = aFunction->GetType();

  Standard_Boolean isSolid = (aCI.GetSolidMode() == 1);
  Handle(TColStd_HSequenceOfTransient) aSeqSections = aCI.GetSections();

  if( aSeqSections.IsNull())
    return 0;

  Standard_Integer aNbSections = aSeqSections->Length();
  Standard_Real aPreci = Max(aCI.GetPrecision(),Precision::Confusion());
  if(!aNbSections )
    return 0;

  BRepOffsetAPI_ThruSections aBuilder(isSolid,aType ==THRUSECTIONS_RULED,aPreci);
  
 
  aBuilder.CheckCompatibility(Standard_False);
  //added sections for building surface
  Standard_Integer i =1;
  Standard_Integer nbAdded =0;
  for( ; i <= aNbSections; i++,nbAdded++)
  {
    Handle(Standard_Transient) anItem = aSeqSections->Value(i);
    if(anItem.IsNull())
      continue;

    Handle(GEOM_Function) aSection = Handle(GEOM_Function)::DownCast(anItem);
    if(aSection.IsNull())
      continue;

    TopoDS_Shape aShapeSection = aSection->GetValue();
    TopAbs_ShapeEnum aTypeSect = aShapeSection.ShapeType();
    if(aTypeSect == TopAbs_WIRE)
      aBuilder.AddWire(TopoDS::Wire(aShapeSection));

    else if(aTypeSect == TopAbs_EDGE) {
      TopoDS_Edge anEdge = TopoDS::Edge(aShapeSection);
      TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge);
      aBuilder.AddWire(aWire);
    }
    else if(aTypeSect == TopAbs_VERTEX) {
      TopoDS_Vertex aVert = TopoDS::Vertex(aShapeSection);
      aBuilder.AddVertex(aVert);
    }
    else
       nbAdded--; 
  }  
  if(!nbAdded)
     Standard_TypeMismatch::Raise("ThruSections aborted : invalid types of sections");
  //make surface by sections
  aBuilder.Build();
  TopoDS_Shape aShape = aBuilder.Shape();
  if (aShape.IsNull()) {
    return 0;
  }

  BRepCheck_Analyzer ana (aShape, Standard_False);
  if (!ana.IsValid()) {
    //algoritm thru section creats on the arcs invalid shapes gka
    ShapeFix_ShapeTolerance aSFT;
    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
    aSfs->SetPrecision(Precision::Confusion());
    aSfs->Perform();
    aShape = aSfs->Shape();
    //ana.Init(aShape, Standard_False);
    //if (!ana.IsValid()) 
    //  Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
  }


  aFunction->SetValue(aShape);

  log.SetTouched(Label());

  return 1;
}

Here is the call graph for this function:

const Standard_GUID & GEOMImpl_ThruSectionsDriver::GetID ( ) [static]

Definition at line 54 of file GEOMImpl_ThruSectionsDriver.cxx.

{
  static Standard_GUID aThruSectionsDriver("FF1BB971-E99C-4f89-B989-5B48E061049B");
  return aThruSectionsDriver;
}
Standard_EXPORT const GEOMImpl_ThruSectionsDriver::Handle ( Standard_Type  ) const [inline]

Definition at line 159 of file GEOMImpl_ThruSectionsDriver.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_EXPORT Standard_Boolean GEOMImpl_ThruSectionsDriver::IsKind ( const Handle(Standard_Type)&  AType) const [inline]

Definition at line 160 of file GEOMImpl_ThruSectionsDriver.hxx.

{ return (STANDARD_TYPE(GEOMImpl_ThruSectionsDriver) == AType || TFunction_Driver::IsKind(AType)); } 

Here is the call graph for this function:

Standard_EXPORT Standard_Boolean GEOMImpl_ThruSectionsDriver::MustExecute ( const TFunction_Logbook &  ) const [inline]

Definition at line 151 of file GEOMImpl_ThruSectionsDriver.hxx.

{ return Standard_True; }
void GEOMImpl_ThruSectionsDriver::operator delete ( void *  anAddress) [inline]

Definition at line 141 of file GEOMImpl_ThruSectionsDriver.hxx.

      { 
        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
      }
void* GEOMImpl_ThruSectionsDriver::operator new ( size_t  ,
void *  anAddress 
) [inline]

Definition at line 133 of file GEOMImpl_ThruSectionsDriver.hxx.

      {
        return anAddress;
      }
void* GEOMImpl_ThruSectionsDriver::operator new ( size_t  size) [inline]

Definition at line 137 of file GEOMImpl_ThruSectionsDriver.hxx.

      { 
        return Standard::Allocate(size); 
      }
virtual Standard_EXPORT void GEOMImpl_ThruSectionsDriver::Validate ( TFunction_Logbook &  ) const [inline, virtual]

Definition at line 150 of file GEOMImpl_ThruSectionsDriver.hxx.

{}

Friends And Related Function Documentation

Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_ThruSectionsDriver_Type_ ( ) [friend]

Definition at line 162 of file GEOMImpl_ThruSectionsDriver.cxx.

{

  static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
  static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
  if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared);
  static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
  if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);


  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
  static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_ThruSectionsDriver",
                                                         sizeof(GEOMImpl_ThruSectionsDriver),
                                                         1,
                                                         (Standard_Address)_Ancestors,
                                                         (Standard_Address)NULL);

  return _aType;
}

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