Back to index

salome-geom  6.5.0
Functions
GEOMImpl_PipeTShapeDriver.cxx File Reference
#include <Standard_Stream.hxx>
#include <GEOMImpl_PipeTShapeDriver.hxx>
#include <GEOMImpl_IPipeTShape.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOMImpl_Block6Explorer.hxx>
#include <GEOM_Function.hxx>
#include <GEOMImpl_IShapesOperations.hxx>
#include "GEOMAlgo_FinderShapeOn1.hxx"
#include "GEOMAlgo_FinderShapeOn2.hxx"
#include <GEOMAlgo_ClsfBox.hxx>
#include <TFunction_Logbook.hxx>
#include <StdFail_NotDone.hxx>
#include <GEOMAlgo_Splitter.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Ax2.hxx>
#include <gp_Pln.hxx>
#include <gp_Dir.hxx>
#include <gp_Trsf.hxx>
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepAlgoAPI_Cut.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepFilletAPI_MakeFillet.hxx>
#include <BRepFilletAPI_MakeChamfer.hxx>
#include <BRep_Builder.hxx>
#include <TopoDS_Compound.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <TopoDS.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <vector>

Go to the source code of this file.

Functions

 Handle (TColStd_HSequenceOfInteger) GEOMImpl_PipeTShapeDriver
 Find IDs of sub-shapes complying with given status about surface.
Standard_EXPORT
Handle_Standard_Type & 
GEOMImpl_PipeTShapeDriver_Type_ ()
const Handle (GEOMImpl_PipeTShapeDriver) Handle(GEOMImpl_PipeTShapeDriver)

Function Documentation

Definition at line 623 of file GEOMImpl_PipeTShapeDriver.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_PipeTShapeDriver",
                                                         sizeof(GEOMImpl_PipeTShapeDriver),
                                                         1,
                                                         (Standard_Address)_Ancestors,
                                                         (Standard_Address)NULL);
  return _aType;
}

Here is the call graph for this function:

Handle ( TColStd_HSequenceOfInteger  )

Find IDs of sub-shapes complying with given status about surface.

Parameters:
theBox- the box to check state of sub-shapes against
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theState- required state
Return values:
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes
Parameters:
theSurface- the surface to check state of sub-shapes against
theShape- the shape to explore
theShapeType- type of sub-shape of theShape
theState- required state
Return values:
Handle(TColStd_HSequenceOfInteger)- IDs of found sub-shapes

Definition at line 100 of file GEOMImpl_PipeTShapeDriver.cxx.

{
  Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;

  // Check presence of triangulation, build if need
  if (!GEOMImpl_IShapesOperations::CheckTriangulation(aShape)) {
    StdFail_NotDone::Raise("Cannot build triangulation on the shape");
    return aSeqOfIDs;
  }

  // Call algo
  GEOMAlgo_FinderShapeOn2 aFinder;
  Standard_Real aTol = 0.0001; // default value

  Handle(GEOMAlgo_ClsfBox) aClsfBox = new GEOMAlgo_ClsfBox;
  aClsfBox->SetBox(aBox);

  aFinder.SetShape(aShape);
  aFinder.SetTolerance(aTol);
  aFinder.SetClsf(aClsfBox);
  aFinder.SetShapeType( (TopAbs_ShapeEnum)theShapeType );
  aFinder.SetState(theState);
  aFinder.Perform();

  // Interprete results
  Standard_Integer iErr = aFinder.ErrorStatus();
  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
  if (iErr) {
    TCollection_AsciiString aMsg (" iErr : ");
    aMsg += TCollection_AsciiString(iErr);
    StdFail_NotDone::Raise(aMsg.ToCString());
    return aSeqOfIDs;
  }


  const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result

  if (listSS.Extent() < 1) {
    StdFail_NotDone::Raise(NOT_FOUND_ANY); // NPAL18017
    return aSeqOfIDs;
  }

  // Fill sequence of object IDs
  aSeqOfIDs = new TColStd_HSequenceOfInteger;

  TopTools_IndexedMapOfShape anIndices;
  TopExp::MapShapes(aShape, anIndices);

  TopTools_ListIteratorOfListOfShape itSub (listSS);
  for (int index = 1; itSub.More(); itSub.Next(), ++index) {
    int id = anIndices.FindIndex(itSub.Value());
//    std::cerr << "Shape with ID " << id << " found" << std::endl;
    aSeqOfIDs->Append(id);
  }

  return aSeqOfIDs;
}

Here is the call graph for this function:

Definition at line 645 of file GEOMImpl_PipeTShapeDriver.cxx.

{
  Handle(GEOMImpl_PipeTShapeDriver) _anOtherObject;

  if (!AnObject.IsNull()) {
     if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_PipeTShapeDriver))) {
       _anOtherObject = Handle(GEOMImpl_PipeTShapeDriver)((Handle(GEOMImpl_PipeTShapeDriver)&)AnObject);
     }
  }

  return _anOtherObject;
}

Here is the call graph for this function: