GEOM_Object GetSubShape (in GEOM_Object theMainShape,
in long theID);
+ /*!
+ * Get global index of \a theSubShape in \a theMainShape.
+ * \param theMainShape Main shape.
+ * \param theSubShape Sub-shape of the main shape.
+ * \return global index of \a theSubShape in \a theMainShape.
+ */
+ long GetSubShapeIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
+
+ /*!
+ * Get index of \a theSubShape in \a theMainShape, unique among sub-shapes of the same type.
+ * Together with method <VAR>GetShapeTypeString()</VAR> it can be used
+ * to generate automatic names for sub-shapes, when publishing them in a study.
+ * \param theMainShape Main shape.
+ * \param theSubShape Sub-shape of the main shape.
+ * \return index of \a theSubShape in a list of all sub-shapes of \a theMainShape of the same type.
+ */
+ long GetTopologyIndex (in GEOM_Object theMainShape, in GEOM_Object theSubShape);
+
+ /*!
+ * \brief Get name of type of \a theShape.
+ *
+ * Use wide type notation, taking into consideration both topology and geometry of the shape.
+ * Together with method <VAR>GetTopologyIndex()</VAR> it can be used
+ * to generate automatic names for sub-shapes, when publishing them in a study.
+ * \param theShape The shape to get a type of.
+ * \return String, containing a type name of \a theShape.
+ */
+ string GetShapeTypeString (in GEOM_Object theShape);
+
/*!
* Count number of faces in the given shape.
* \param theShape Shape to count faces in.
* \param theDirFace2 Second direction face global index.
* \param theNbTimes Quantity of transformations to be done.
* \note Global index of sub-shape can be obtained, using method
- * <VAR>GEOM_ILocalOperations.GetSubShapeIndex()</VAR>.
+ * <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock,
* \param theShape Shape, to perform fillet on.
* \param theR Fillet radius.
* \param theEdges Global indices of edges to perform fillet on.
- * \note Global index of sub-shape can be obtained, using method <VAR>GetSubShapeIndex()</VAR>.
+ * \note Global index of sub-shape can be obtained, using method
+ * <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeFilletEdges (in GEOM_Object theShape,
* \param theShape Shape, to perform fillet on.
* \param theR Fillet radius.
* \param theFaces Global indices of faces to perform fillet on.
- * \note Global index of sub-shape can be obtained, using method <VAR>GetSubShapeIndex()</VAR>.
+ * \note Global index of sub-shape can be obtained, using method
+ * <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeFilletFaces (in GEOM_Object theShape,
* \param theD1 Chamfer size along \a theFace1.
* \param theD2 Chamfer size along \a theFace2.
* \param theFace1,theFace2 Global indices of two faces of \a theShape.
- * \note Global index of sub-shape can be obtained, using method <VAR>GetSubShapeIndex()</VAR>.
+ * \note Global index of sub-shape can be obtained, using method
+ * <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeChamferEdge (in GEOM_Object theShape,
* will be get along face, which is nearer to \a theFaces beginning.
* \param theD2 Chamfer size along another of two faces, connected to the edge.
* \param theFaces Sequence of global indices of faces of \a theShape.
- * \note Global index of sub-shape can be obtained, using method <VAR>GetSubShapeIndex()</VAR>.
+ * \note Global index of sub-shape can be obtained, using method
+ * <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeChamferFaces (in GEOM_Object theShape,
in double theMeshDeflection);
/*!
- * Get global index of \a theSubShape in \a theShape.
- * \param theShape Main shape.
- * \param theSubShape Sub-shape of the main shape.
- * \return global index of \a theSubShape in \a theShape.
+ * Duplicates <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR>.
+ * Present here only for compatibility.
*/
long GetSubShapeIndex (in GEOM_Object theShape, in GEOM_Object theSubShape);
};
* Adds a sub object with ID theSubShapeId to the group
* \param theGroup is a GEOM group to which the new sub shape is added
* \param theSubShapeId is a sub shape ID in the main object.
- * \note Use method <VAR>ILocalOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
+ * \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
*/
void AddObject (in GEOM_Object theGroup, in long theSubShapeId);
* Removes a sub object with ID \a theSubShapeId from the group
* \param theGroup is a GEOM group from which the sub shape is removed.
* \param theSubShapeId is a sub shape ID in the main object.
- * \note Use method <VAR>ILocalOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
+ * \note Use method <VAR>GEOM_IShapesOperations.GetSubShapeIndex()</VAR> to get an ID by the sub shape
*/
void RemoveObject (in GEOM_Object theGroup, in long theSubShapeId);
#include "SALOMEDSClient.hxx"
// OCCT Includes
-#include <TopExp_Explorer.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <BRepAdaptor_Surface.hxx>
-#include <BRepAdaptor_Curve.hxx>
-#include <GeomAbs_CurveType.hxx>
-#include <GeomAbs_SurfaceType.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Iterator.hxx>
+//#include <TopExp_Explorer.hxx>
+//#include <TopTools_MapOfShape.hxx>
+//#include <TopTools_ListOfShape.hxx>
+//#include <TopTools_ListIteratorOfListOfShape.hxx>
+//#include <GeomAbs_CurveType.hxx>
+//#include <GeomAbs_SurfaceType.hxx>
+//#include <TopoDS.hxx>
+#include <TopAbs.hxx>
+#include <TopoDS_Shape.hxx>
+//#include <TopoDS_Edge.hxx>
+//#include <TopoDS_Face.hxx>
+//#include <TopoDS_Iterator.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
-#include <V3d_Viewer.hxx>
+//#include <V3d_Viewer.hxx>
+
+// IDL Headers
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
using namespace std;
public:
TEventUpdateBrowser() {}
virtual void Execute() {
- SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
+ SalomeApp_Application* app =
+ dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
if (app) {
CAM_Module* module = app->module("Geometry");
SalomeApp_Module* appMod = dynamic_cast<SalomeApp_Module*>(module);
}
-int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR)
+int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR)
{
- GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen();
- if ( CORBA::is_nil( Geom ) )
+ GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
+ if (CORBA::is_nil(aGeomGen))
return -1;
- GEOM::GEOM_Object_var aMainShape = Geom->GetIORFromString(IOR);
- TopoDS_Shape shape = ShapeReader.GetShape(Geom, aMainShape);
-
- GEOM::GEOM_Object_var aSubShape = Geom->GetIORFromString(SubIOR);
- TopoDS_Shape subshape = ShapeReader.GetShape(Geom, aSubShape);
-
- int index = 1;
- if(subshape.ShapeType() == TopAbs_COMPOUND) {
- TopoDS_Iterator it;
- TopTools_ListOfShape CL;
- CL.Append(shape);
- TopTools_ListIteratorOfListOfShape itC;
- for(itC.Initialize(CL); itC.More(); itC.Next()) {
- for(it.Initialize(itC.Value()); it.More(); it.Next()) {
- if (it.Value().ShapeType() == TopAbs_COMPOUND) {
- if (it.Value().IsSame(subshape))
- return index;
- else
- index++;
- CL.Append(it.Value());
- }
- }
- }
- }
- else {
- TopExp_Explorer Exp(shape, subshape.ShapeType());
- TopTools_MapOfShape M;
- while(Exp.More()) {
- if(M.Add(Exp.Current())) {
- if(Exp.Current().IsSame(subshape))
- return index;
- index++;
- }
- Exp.Next();
- }
- }
+ GEOM::GEOM_Object_var aMainShape = aGeomGen->GetIORFromString(IOR);
+ GEOM::GEOM_Object_var aSubShape = aGeomGen->GetIORFromString(SubIOR);
+ if (CORBA::is_nil(aMainShape) || CORBA::is_nil(aSubShape))
+ return -1;
+
+ GEOM::GEOM_IShapesOperations_var anIShapesOperations =
+ aGeomGen->GetIShapesOperations(aMainShape->GetStudyID());
+ if (CORBA::is_nil(anIShapesOperations))
+ return -1;
- return -1;
+ return anIShapesOperations->GetTopologyIndex(aMainShape, aSubShape);
}
const char* GEOM_Swig::getShapeTypeString(const char* IOR)
{
- GEOM::GEOM_Gen_var Geom = GeometryGUI::GetGeomGen();
- if ( CORBA::is_nil( Geom ) )
- return 0;
-
- GEOM::GEOM_Object_var aShape = Geom->GetIORFromString(IOR);
- TopoDS_Shape shape = ShapeReader.GetShape(Geom, aShape);
-
- if( shape.IsNull() ) {
- return "Null Shape" ;
- }
+ TCollection_AsciiString aTypeName ("Shape of unknown type");
- switch (shape.ShapeType() )
+ GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
+ if (!CORBA::is_nil(aGeomGen))
{
- case TopAbs_COMPOUND:
- { return "Compound" ;}
- case TopAbs_COMPSOLID:
- { return "Compound Solid" ;}
- case TopAbs_SOLID:
- { return "Solid" ;}
- case TopAbs_SHELL:
- { return "Shell" ;}
- case TopAbs_FACE:
- {
- BRepAdaptor_Surface surf(TopoDS::Face(shape));
- if ( surf.GetType() == GeomAbs_Plane ) {
- return "Plane" ;
- } else if ( surf.GetType() == GeomAbs_Cylinder ) {
- return "Cylindrical Face" ;
- } else if ( surf.GetType() == GeomAbs_Sphere ) {
- return "Spherical Face" ;
- } else if ( surf.GetType() == GeomAbs_Torus ) {
- return "Toroidal Face" ;
- } else if ( surf.GetType() == GeomAbs_Cone ) {
- return "Conical Face" ;
- } else {
- return "GEOM::FACE" ;
- }
- }
- case TopAbs_WIRE:
- { return "Wire" ;}
- case TopAbs_EDGE:
+ GEOM::GEOM_Object_var aShape = aGeomGen->GetIORFromString(IOR);
+ if (!CORBA::is_nil(aShape))
{
- BRepAdaptor_Curve curv(TopoDS::Edge(shape));
- if ( curv.GetType() == GeomAbs_Line ) {
- if ( (Abs(curv.FirstParameter()) >= 1E6 ) ||
- (Abs(curv.LastParameter()) >= 1E6 )) {
- return "Line" ;
- } else
- return "Edge" ;
- } else if ( curv.GetType() == GeomAbs_Circle ) {
- if ( curv.IsClosed() )
- return "Circle" ;
- else
- return "Arc" ;
- } else {
- return "Edge" ;
+ GEOM::GEOM_IShapesOperations_var anIShapesOperations =
+ aGeomGen->GetIShapesOperations(aShape->GetStudyID());
+ if (!CORBA::is_nil(anIShapesOperations))
+ {
+ aTypeName = anIShapesOperations->GetShapeTypeString(aShape);
}
}
- case TopAbs_VERTEX:
- { return "Vertex" ;}
- case TopAbs_SHAPE:
- { return "Shape" ;}
}
- return 0;
+
+ return CORBA::string_dup(aTypeName.ToCString());
}
SALOMEDS.idl \
SALOMEDS_Attributes.idl \
SALOME_GenericObj.idl \
- SALOME_Component.idl
+ SALOME_Component.idl \
+ GEOM_Gen.idl
LIB_SERVER_IDL =
#include <GEOMImpl_IArchimede.hxx>
#include <GEOMImpl_ArchimedeDriver.hxx>
+#include <GEOMImpl_Gen.hxx>
+#include <GEOMImpl_IShapesOperations.hxx>
+
#include "utilities.h"
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
{
SetErrorCode(KO);
- TopoDS_Shape aShape = theShape->GetValue();
- TopoDS_Shape aSubShape = theSubShape->GetValue();
-
- if (aShape.IsNull() || aSubShape.IsNull()) return -1;
+ Standard_Integer anInd = -1;
+ GEOM_Engine* anEngine = GetEngine();
+ //GEOMImpl_Gen* aGen = dynamic_cast<GEOMImpl_Gen*>(anEngine);
+ GEOMImpl_Gen* aGen = (GEOMImpl_Gen*)anEngine;
- TopTools_IndexedMapOfShape anIndices;
- TopExp::MapShapes(aShape, anIndices);
- if (anIndices.Contains(aSubShape)) {
- SetErrorCode(OK);
- return anIndices.FindIndex(aSubShape);
+ if (aGen) {
+ GEOMImpl_IShapesOperations* anIShapesOperations =
+ aGen->GetIShapesOperations(GetDocID());
+ anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape);
+ SetErrorCode(anIShapesOperations->GetErrorCode());
}
- return -1;
+ return anInd;
}
#include <BRep_Tool.hxx>
#include <BRepGProp.hxx>
#include <BRepAdaptor_Curve.hxx>
+#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
return anObj;
}
+//=============================================================================
+/*!
+ * GetSubShapeIndex
+ */
+//=============================================================================
+Standard_Integer GEOMImpl_IShapesOperations::GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
+ Handle(GEOM_Object) theSubShape)
+{
+ SetErrorCode(KO);
+
+ TopoDS_Shape aMainShape = theMainShape->GetValue();
+ TopoDS_Shape aSubShape = theSubShape->GetValue();
+
+ if (aMainShape.IsNull() || aSubShape.IsNull()) return -1;
+
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aMainShape, anIndices);
+ if (anIndices.Contains(aSubShape)) {
+ SetErrorCode(OK);
+ return anIndices.FindIndex(aSubShape);
+ }
+
+ return -1;
+}
+
+//=============================================================================
+/*!
+ * GetTopologyIndex
+ */
+//=============================================================================
+Standard_Integer GEOMImpl_IShapesOperations::GetTopologyIndex (Handle(GEOM_Object) theMainShape,
+ Handle(GEOM_Object) theSubShape)
+{
+ SetErrorCode(OK);
+
+ TopoDS_Shape aMainShape = theMainShape->GetValue();
+ TopoDS_Shape aSubShape = theSubShape->GetValue();
+
+ if (aMainShape.IsNull() || aSubShape.IsNull()) {
+ SetErrorCode("Null argument shape given");
+ return -1;
+ }
+
+ int index = 1;
+ if (aSubShape.ShapeType() == TopAbs_COMPOUND) {
+ TopoDS_Iterator it;
+ TopTools_ListOfShape CL;
+ CL.Append(aMainShape);
+ TopTools_ListIteratorOfListOfShape itC;
+ for (itC.Initialize(CL); itC.More(); itC.Next()) {
+ for (it.Initialize(itC.Value()); it.More(); it.Next()) {
+ if (it.Value().ShapeType() == TopAbs_COMPOUND) {
+ if (it.Value().IsSame(aSubShape))
+ return index;
+ else
+ index++;
+ CL.Append(it.Value());
+ }
+ }
+ }
+ } else {
+ TopExp_Explorer anExp (aMainShape, aSubShape.ShapeType());
+ TopTools_MapOfShape M;
+ for (; anExp.More(); anExp.Next()) {
+ if (M.Add(anExp.Current())) {
+ if (anExp.Current().IsSame(aSubShape))
+ return index;
+ index++;
+ }
+ }
+ }
+
+ SetErrorCode("The sub-shape does not belong to the main shape");
+ return -1;
+}
+
+//=============================================================================
+/*!
+ * GetShapeTypeString
+ */
+//=============================================================================
+TCollection_AsciiString GEOMImpl_IShapesOperations::GetShapeTypeString (Handle(GEOM_Object) theShape)
+{
+ SetErrorCode(KO);
+
+ TCollection_AsciiString aTypeName ("Null Shape");
+
+ TopoDS_Shape aShape = theShape->GetValue();
+ if (aShape.IsNull())
+ return aTypeName;
+
+ switch (aShape.ShapeType() )
+ {
+ case TopAbs_COMPOUND:
+ aTypeName = "Compound";
+ break;
+ case TopAbs_COMPSOLID:
+ aTypeName = "Compound Solid";
+ break;
+ case TopAbs_SOLID:
+ aTypeName = "Solid";
+ break;
+ case TopAbs_SHELL:
+ aTypeName = "Shell";
+ break;
+ case TopAbs_FACE:
+ {
+ BRepAdaptor_Surface surf (TopoDS::Face(aShape));
+ if (surf.GetType() == GeomAbs_Plane)
+ aTypeName = "Plane";
+ else if (surf.GetType() == GeomAbs_Cylinder)
+ aTypeName = "Cylindrical Face";
+ else if (surf.GetType() == GeomAbs_Sphere)
+ aTypeName = "Spherical Face";
+ else if (surf.GetType() == GeomAbs_Torus)
+ aTypeName = "Toroidal Face";
+ else if (surf.GetType() == GeomAbs_Cone)
+ aTypeName = "Conical Face";
+ else
+ aTypeName = "GEOM::FACE";
+ }
+ break;
+ case TopAbs_WIRE:
+ aTypeName = "Wire";
+ break;
+ case TopAbs_EDGE:
+ {
+ BRepAdaptor_Curve curv (TopoDS::Edge(aShape));
+ if (curv.GetType() == GeomAbs_Line) {
+ if ((Abs(curv.FirstParameter()) >= 1E6) ||
+ (Abs(curv.LastParameter()) >= 1E6))
+ aTypeName = "Line";
+ else
+ aTypeName = "Edge" ;
+ } else if (curv.GetType() == GeomAbs_Circle) {
+ if (curv.IsClosed())
+ aTypeName = "Circle";
+ else
+ aTypeName = "Arc";
+ } else {
+ aTypeName = "Edge";
+ }
+ }
+ break;
+ case TopAbs_VERTEX:
+ aTypeName = "Vertex";
+ break;
+ case TopAbs_SHAPE:
+ aTypeName = "Shape";
+ break;
+ default:
+ aTypeName = "Shape of unknown type";
+ }
+
+ return aTypeName;
+}
+
//=============================================================================
/*!
const Standard_Boolean isSorted);
Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object) theMainShape,
- const Standard_Integer theID);
+ const Standard_Integer theID);
+
+ Standard_EXPORT Standard_Integer GetSubShapeIndex (Handle(GEOM_Object) theMainShape,
+ Handle(GEOM_Object) theSubShape);
+
+ Standard_EXPORT Standard_Integer GetTopologyIndex (Handle(GEOM_Object) theMainShape,
+ Handle(GEOM_Object) theSubShape);
+
+ Standard_EXPORT TCollection_AsciiString GetShapeTypeString (Handle(GEOM_Object) theShape);
Standard_EXPORT Standard_Integer NumberOfFaces (Handle(GEOM_Object) theShape);
Standard_EXPORT Standard_Integer NumberOfEdges (Handle(GEOM_Object) theShape);
// Get shape parameters
TCollection_AsciiString aDescription = GetOperations()->WhatIs(aShape);
- return strdup(aDescription.ToCString());
+ return CORBA::string_dup(aDescription.ToCString());
}
//=============================================================================
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetSubShapeIndex
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::GetSubShapeIndex
+ (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
+{
+ if (theMainShape == NULL || theSubShape == NULL) return -1;
+
+ //Get the reference shapes
+ Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
+ (theMainShape->GetStudyID(), theMainShape->GetEntry());
+ Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
+ (theSubShape->GetStudyID(), theSubShape->GetEntry());
+ if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
+
+ //Get the unique ID of <theSubShape> inside <theMainShape>
+ CORBA::Long anID = GetOperations()->GetSubShapeIndex(aMainShapeRef, aSubShapeRef);
+ if (!GetOperations()->IsDone())
+ return -1;
+
+ return anID;
+}
+
+//=============================================================================
+/*!
+ * GetTopologyIndex
+ */
+//=============================================================================
+CORBA::Long GEOM_IShapesOperations_i::GetTopologyIndex
+ (GEOM::GEOM_Object_ptr theMainShape, GEOM::GEOM_Object_ptr theSubShape)
+{
+ if (theMainShape == NULL || theSubShape == NULL) return -1;
+
+ //Get the reference shapes
+ Handle(GEOM_Object) aMainShapeRef = GetOperations()->GetEngine()->GetObject
+ (theMainShape->GetStudyID(), theMainShape->GetEntry());
+ Handle(GEOM_Object) aSubShapeRef = GetOperations()->GetEngine()->GetObject
+ (theSubShape->GetStudyID(), theSubShape->GetEntry());
+ if (aMainShapeRef.IsNull() || aSubShapeRef.IsNull()) return -1;
+
+ //Get an ID of <theSubShape>, unique among all sub-shapes of <theMainShape> of the same type
+ CORBA::Long anID = GetOperations()->GetTopologyIndex(aMainShapeRef, aSubShapeRef);
+ if (!GetOperations()->IsDone())
+ return -1;
+
+ return anID;
+}
+
+//=============================================================================
+/*!
+ * GetShapeTypeString
+ */
+//=============================================================================
+char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theShape)
+{
+ if (theShape == NULL) return NULL;
+
+ //Get the reference shape
+ Handle(GEOM_Object) aShape = GetOperations()->GetEngine()->GetObject
+ (theShape->GetStudyID(), theShape->GetEntry());
+
+ if (aShape.IsNull()) return NULL;
+
+ // Get shape parameters
+ TCollection_AsciiString aDescription = GetOperations()->GetShapeTypeString(aShape);
+ return CORBA::string_dup(aDescription.ToCString());
+}
+
//=============================================================================
/*!
* NumberOfFaces
GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
CORBA::Long theID);
+ CORBA::Long GetSubShapeIndex (GEOM::GEOM_Object_ptr theMainShape,
+ GEOM::GEOM_Object_ptr theSubShape);
+
+ CORBA::Long GetTopologyIndex (GEOM::GEOM_Object_ptr theMainShape,
+ GEOM::GEOM_Object_ptr theSubShape);
+
+ char* GetShapeTypeString (GEOM::GEOM_Object_ptr theShape);
+
CORBA::Long NumberOfFaces (GEOM::GEOM_Object_ptr theShape);
CORBA::Long NumberOfEdges (GEOM::GEOM_Object_ptr theShape);
* Example: see GEOM_TestAll.py
"""
- aSubId = orb.object_to_string(aSubObj)
- aMainId = orb.object_to_string(aMainObj)
- index = gg.getIndexTopology(aSubId, aMainId)
- name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
+ #aSubId = orb.object_to_string(aSubObj)
+ #aMainId = orb.object_to_string(aMainObj)
+ #index = gg.getIndexTopology(aSubId, aMainId)
+ #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
+ index = ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
+ name = ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
return name
def addToStudy(aShape, aName):