Back to index

salome-geom  6.5.0
Functions
GEOMImpl_IGroupOperations.cxx File Reference
#include <Standard_Stream.hxx>
#include <GEOMImpl_IGroupOperations.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
#include <GEOM_ISubShape.hxx>
#include <GEOM_PythonDump.hxx>
#include "utilities.h"
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <TFunction_DriverTable.hxx>
#include <TFunction_Driver.hxx>
#include <TFunction_Logbook.hxx>
#include <TDF_Tool.hxx>
#include <TDataStd_Integer.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>

Go to the source code of this file.

Functions

 Handle (GEOM_Object) GEOMImpl_IGroupOperations
 CreateGroup.
 Handle (TColStd_HArray1OfInteger) GEOMImpl_IGroupOperations
 GetObjects.

Function Documentation

CreateGroup.

GetObject.

GetMainShape.

Definition at line 79 of file GEOMImpl_IGroupOperations.cxx.

{
  SetErrorCode(KO);

  Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
  anArray->SetValue(1, -1);

  //Add a new Sub-shape object
  Handle(GEOM_Object) aGroup = GetEngine()->AddSubShape(theMainShape, anArray);

  //Set a GROUP type
  aGroup->SetType(GEOM_GROUP);

  //Set a sub-shape type
  TDF_Label aFreeLabel = aGroup->GetFreeLabel();
  TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)theShapeType);

  //Make a Python command
  Handle(GEOM_Function) aFunction = aGroup->GetFunction(1);

  GEOM::TPythonDump(aFunction) << aGroup
    << " = geompy.CreateGroup(" << theMainShape << ", " << theShapeType << ")";

  SetErrorCode(OK);
  return aGroup;
}

Here is the call graph for this function:

Handle ( TColStd_HArray1OfInteger  )

GetObjects.

GetIntegerArray.

Definition at line 772 of file GEOMImpl_IGroupOperations.cxx.

{
  SetErrorCode(KO);

  if(theGroup.IsNull()) return NULL;

  Handle(GEOM_Function) aFunction = theGroup->GetFunction(1);
  if(aFunction.IsNull()) return NULL;

  GEOM_ISubShape aSSI(aFunction);
  Handle(TColStd_HArray1OfInteger) aSeq = aSSI.GetIndices();
  if(aSeq.IsNull()) return NULL;

  if(aSeq->Length() == 1 && aSeq->Value(1) == -1) {
    SetErrorCode(OK);
    return NULL;
  }

  SetErrorCode(OK);
  return aSeq;
}

Here is the call graph for this function: