Back to index

salome-geom  6.5.0
Classes | Functions
GEOMAlgo_GetInPlace_2.cxx File Reference
#include <GEOMAlgo_GetInPlace.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <GProp_GProps.hxx>
#include <BRepGProp.hxx>

Go to the source code of this file.

Classes

class  GEOMAlgo_GProps

Functions

static Standard_Integer Dimension (const TopAbs_ShapeEnum aType)
static void PointProperties (const TopoDS_Shape &aS, GProp_GProps &aGProps)

Function Documentation

Standard_Integer Dimension ( const TopAbs_ShapeEnum  aType) [static]

Definition at line 159 of file GEOMAlgo_GetInPlace_2.cxx.

{
  Standard_Integer iDim;
  //
  iDim=-1;
  switch (aType) {
    case TopAbs_VERTEX:
      iDim=0;
      break;
    case TopAbs_EDGE:
    case TopAbs_WIRE:
      iDim=1;
      break;
    case TopAbs_FACE:
    case TopAbs_SHELL:
      iDim=2;
      break;
    case TopAbs_SOLID:
    case TopAbs_COMPSOLID:
      iDim=3;
      break;
    default:
      break;
  }
  return iDim;
}

Here is the caller graph for this function:

void PointProperties ( const TopoDS_Shape &  aS,
GProp_GProps &  aGProps 
) [static]

Definition at line 212 of file GEOMAlgo_GetInPlace_2.cxx.

{
  Standard_Integer i, aNbS;
  Standard_Real aDensity;
  gp_Pnt aPX;
  TopTools_IndexedMapOfShape aMS;
  //
  aDensity=1.;
  //
  TopExp::MapShapes(aS, TopAbs_VERTEX, aMS);
  aNbS=aMS.Extent();
  for (i=1; i<=aNbS; ++i) {
    GEOMAlgo_GProps aGPropsX;
    //
    const TopoDS_Vertex& aVX=*((TopoDS_Vertex*)&aMS(i));
    aPX=BRep_Tool::Pnt(aVX);
    aGPropsX.SetMass(1.);
    aGPropsX.SetCG(aPX);
    aGProps.Add(aGPropsX, aDensity);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: