Back to index

salome-geom  6.5.0
Functions
GEOM_Object_i.cc File Reference
#include <Standard_OStream.hxx>
#include <GEOM_Object_i.hh>
#include <GEOM_ISubShape.hxx>
#include <GEOMImpl_Types.hxx>
#include "utilities.h"
#include <fstream>
#include <sstream>
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <TDF_Tool.hxx>
#include <TDF_Label.hxx>
#include <TCollection_AsciiString.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <BRepTools.hxx>
#include <TopAbs.hxx>
#include <TopoDS_Iterator.hxx>

Go to the source code of this file.

Functions

static GEOM::shape_type getMinMaxShapeType (const TopoDS_Shape &shape, bool ismin)

Function Documentation

static GEOM::shape_type getMinMaxShapeType ( const TopoDS_Shape &  shape,
bool  ismin 
) [static]

Definition at line 144 of file GEOM_Object_i.cc.

{
  if ( shape.IsNull() )
    return GEOM::SHAPE;

  GEOM::shape_type ret = (GEOM::shape_type)shape.ShapeType();

  if ( shape.ShapeType() == TopAbs_COMPOUND || shape.ShapeType() == TopAbs_COMPSOLID ) {
    TopoDS_Iterator it(shape, Standard_True, Standard_False);
    for (; it.More(); it.Next()) {
      TopoDS_Shape sub_shape = it.Value();
      if ( sub_shape.IsNull() ) continue;
      GEOM::shape_type stype = (GEOM::shape_type)getMinMaxShapeType( sub_shape, ismin );
      if ( stype == GEOM::SHAPE ) continue;
      if ( ismin && stype > ret )
       ret = stype;
      else if ( !ismin && ( ret < GEOM::SOLID || stype < ret ) )
       ret = stype;
    }
  }

  return ret;
}