*/
string GetStringFromIOR (in GEOM_Object theObject);
- /*!
+ /*!
* Returns a name with which a GEOM object was dumped into python script
* \param theStudyEntry is an entry of the GEOM object in the study
*/
string GetDumpName (in string theStudyEntry);
-};
+
+ /*!
+ * Returns all names with which a GEOM objects was dumped
+ * into python script to avoid the same names in SMESH script
+ */
+ string_array GetAllDumpNames();
+ };
};
#endif
#include <TColStd_HSequenceOfAsciiString.hxx>
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
+//=======================================================================
+//function : DumpPython
+//purpose :
+//=======================================================================
+
Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
CORBA::Boolean isPublished,
CORBA::Boolean& isValidScript)
return NULL;
}
+//=======================================================================
+//function : GetAllDumpNames
+//purpose :
+//=======================================================================
+
+GEOM::string_array* GEOM_Gen_i::GetAllDumpNames()
+{
+ Handle(TColStd_HSequenceOfAsciiString) aHSeq = _impl->GetAllDumpNames();
+ int i = 0, aLen = aHSeq->Length();
+
+ GEOM::string_array_var seq = new GEOM::string_array();
+ seq->length(aLen);
+
+ for (; i < aLen; i++) {
+ seq[i] = CORBA::string_dup(aHSeq->Value(i + 1).ToCString());
+ }
+
+ return seq._retn();
+}
* AddSubShape
*/
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape(GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfLong& theIndices)
+GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainShape,
+ const GEOM::ListOfLong& theIndices)
{
if(theMainShape == NULL || theIndices.length() < 1) return GEOM::GEOM_Object::_nil();
Handle(GEOM_Object) aMainsShape = _impl->GetObject(theMainShape->GetStudyID(), theMainShape->GetEntry());
Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theIndices.length());
for(Standard_Integer i = 0; i<theIndices.length(); i++) anArray->SetValue(i+1, theIndices[i]);
- Handle(GEOM_Object) anObject = _impl->AddSubShape(aMainsShape, anArray);
+ Handle(GEOM_Object) anObject = _impl->AddSubShape(aMainsShape, anArray, true);
if(anObject.IsNull()) return GEOM::GEOM_Object::_nil();
TCollection_AsciiString anEntry;
char* GetDumpName (const char* theStudyEntry);
+ GEOM::string_array* GetAllDumpNames();
+
//********************************************************************************************************//
// Internal methods
//********************************************************************************************************//