#include "SMESH_PythonDump.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_Filter_i.hxx"
+#include "SMESH_2smeshpy.hxx"
#include <TColStd_HSequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx>
TPythonDump&
TPythonDump::
operator<<(const char* theArg){
- myStream<<theArg;
+ if ( theArg )
+ myStream<<theArg;
return *this;
}
{
myStream<<"SMESH.";
switch(theArg){
- case ALL:
- myStream<<"ALL";
- break;
- case NODE:
- myStream<<"NODE";
- break;
- case EDGE:
- myStream<<"EDGE";
- break;
- case FACE:
- myStream<<"FACE";
- break;
- case VOLUME:
- myStream<<"VOLUME";
- break;
+ case ALL: myStream<<"ALL";break;
+ case NODE: myStream<<"NODE";break;
+ case EDGE: myStream<<"EDGE";break;
+ case FACE: myStream<<"FACE";break;
+ case VOLUME:myStream<<"VOLUME";break;
}
return *this;
}
+ template<class TArray>
+ void DumpArray(const TArray& theArray, std::ostringstream & theStream)
+ {
+ theStream << "[ ";
+ for (int i = 1; i <= theArray.length(); i++) {
+ theStream << theArray[i-1];
+ if ( i < theArray.length() )
+ theStream << ", ";
+ }
+ theStream << " ]";
+ }
TPythonDump&
- TPythonDump::
- operator<<(const SMESH::long_array& theArg)
+ TPythonDump::operator<<(const SMESH::long_array& theArg)
{
- myStream<<"[ ";
- CORBA::Long i = 1, iEnd = theArg.length();
- for(; i <= iEnd; i++) {
- myStream<<theArg[i-1];
- if(i < iEnd)
- myStream<< ", ";
- }
- myStream<<" ]";
+ DumpArray( theArg, myStream );
return *this;
}
+ TPythonDump&
+ TPythonDump::operator<<(const SMESH::double_array& theArg)
+ {
+ DumpArray( theArg, myStream );
+ return *this;
+ }
+
+ TPythonDump&
+ TPythonDump::
+ operator<<(SALOMEDS::SObject_ptr aSObject)
+ {
+ if ( !aSObject->_is_nil() )
+ myStream << aSObject->GetID();
+ else
+ myStream << NotPublishedObjectName();
+ return *this;
+ }
TPythonDump&
TPythonDump::
operator<<(CORBA::Object_ptr theArg)
{
- TCollection_AsciiString aString("None");
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
SALOMEDS::SObject_var aSObject = SMESH_Gen_i::ObjectToSObject(aStudy,theArg);
- if(!aSObject->_is_nil()){
- aString = aSObject->GetID();
- }else if(!CORBA::is_nil(theArg)){
- aString = "smeshObj_";
+ if(!aSObject->_is_nil()) {
+ myStream << aSObject->GetID();
+ } else if ( !CORBA::is_nil(theArg)) {
if ( aSMESHGen->CanPublishInStudy( theArg )) // not published SMESH object
- aString += (int) theArg;
+ myStream << "smeshObj_" << (int) theArg;
else
- aString = NotPublishedObjectName();
+ myStream << NotPublishedObjectName();
}
- myStream<<aString.ToCString();
+ else
+ myStream << "None";
return *this;
}
TPythonDump::
operator<<(SMESH::Functor_i* theArg)
{
- FunctorType aFunctorType = theArg->GetFunctorType();
- switch(aFunctorType){
- case FT_AspectRatio:
- myStream<<"anAspectRatio";
- break;
- case FT_AspectRatio3D:
- myStream<<"anAspectRatio3D";
- break;
- case FT_Warping:
- myStream<<"aWarping";
- break;
- case FT_MinimumAngle:
- myStream<<"aMinimumAngle";
- break;
- case FT_Taper:
- myStream<<"aTaper";
- break;
- case FT_Skew:
- myStream<<"aSkew";
- break;
- case FT_Area:
- myStream<<"aArea";
- break;
- case FT_FreeBorders:
- myStream<<"aFreeBorders";
- break;
- case FT_FreeEdges:
- myStream<<"aFreeEdges";
- break;
- case FT_MultiConnection:
- myStream<<"aMultiConnection";
- break;
- case FT_MultiConnection2D:
- myStream<<"aMultiConnection2D";
- break;
- case FT_Length:
- myStream<<"aLength";
- break;
- case FT_Length2D:
- myStream<<"aLength";
- break;
- case FT_BelongToGeom:
- myStream<<"aBelongToGeom";
- break;
- case FT_BelongToPlane:
- myStream<<"aBelongToPlane";
- break;
- case FT_BelongToCylinder:
- myStream<<"aBelongToCylinder";
- break;
- case FT_LyingOnGeom:
- myStream<<"aLyingOnGeom";
- break;
- case FT_RangeOfIds:
- myStream<<"aRangeOfIds";
- break;
- case FT_BadOrientedVolume:
- myStream<<"aBadOrientedVolume";
- break;
- case FT_LessThan:
- myStream<<"aLessThan";
- break;
- case FT_MoreThan:
- myStream<<"aMoreThan";
- break;
- case FT_EqualTo:
- myStream<<"anEqualTo";
- break;
- case FT_LogicalNOT:
- myStream<<"aLogicalNOT";
- break;
- case FT_LogicalAND:
- myStream<<"aLogicalAND";
- break;
- case FT_LogicalOR:
- myStream<<"aLogicalOR";
- break;
- case FT_Undefined:
- myStream<<"anUndefined";
- break;
+ if ( theArg ) {
+ FunctorType aFunctorType = theArg->GetFunctorType();
+ switch(aFunctorType){
+ case FT_AspectRatio: myStream<< "anAspectRatio"; break;
+ case FT_AspectRatio3D: myStream<< "anAspectRatio3D"; break;
+ case FT_Warping: myStream<< "aWarping"; break;
+ case FT_MinimumAngle: myStream<< "aMinimumAngle"; break;
+ case FT_Taper: myStream<< "aTaper"; break;
+ case FT_Skew: myStream<< "aSkew"; break;
+ case FT_Area: myStream<< "aArea"; break;
+ case FT_FreeBorders: myStream<< "aFreeBorders"; break;
+ case FT_FreeEdges: myStream<< "aFreeEdges"; break;
+ case FT_MultiConnection: myStream<< "aMultiConnection"; break;
+ case FT_MultiConnection2D:myStream<< "aMultiConnection2D";break;
+ case FT_Length: myStream<< "aLength"; break;
+ case FT_Length2D: myStream<< "aLength"; break;
+ case FT_BelongToGeom: myStream<< "aBelongToGeom"; break;
+ case FT_BelongToPlane: myStream<< "aBelongToPlane"; break;
+ case FT_BelongToCylinder: myStream<< "aBelongToCylinder"; break;
+ case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break;
+ case FT_RangeOfIds: myStream<< "aRangeOfIds"; break;
+ case FT_BadOrientedVolume:myStream<< "aBadOrientedVolume";break;
+ case FT_LessThan: myStream<< "aLessThan"; break;
+ case FT_MoreThan: myStream<< "aMoreThan"; break;
+ case FT_EqualTo: myStream<< "anEqualTo"; break;
+ case FT_LogicalNOT: myStream<< "aLogicalNOT"; break;
+ case FT_LogicalAND: myStream<< "aLogicalAND"; break;
+ case FT_LogicalOR: myStream<< "aLogicalOR"; break;
+ case FT_Undefined: myStream<< "anUndefined"; break;
+ }
+ myStream<<theArg;
+ }
+ return *this;
+ }
+
+ TPythonDump& TPythonDump:: operator<<(SMESH_Gen_i* theArg)
+ {
+ myStream << SMESHGenName(); return *this;
+ }
+
+ TPythonDump& TPythonDump::operator<<(SMESH_MeshEditor_i* theArg)
+ {
+ myStream << MeshEditorName(); return *this;
+ }
+
+ TPythonDump& TPythonDump::operator<<(const TCollection_AsciiString & theStr)
+ {
+ myStream << theStr; return *this;
+ }
+
+
+ TPythonDump& TPythonDump::operator<<(SMESH::MED_VERSION theVersion)
+ {
+ switch (theVersion) {
+ case SMESH::MED_V2_1: myStream << "SMESH.MED_V2_1"; break;
+ case SMESH::MED_V2_2: myStream << "SMESH.MED_V2_2"; break;
+ default: myStream << theVersion;
}
- myStream<<theArg;
+ return *this;
+ }
+
+ TPythonDump& TPythonDump::operator<<(const SMESH::AxisStruct & theAxis)
+ {
+ myStream << "SMESH.AxisStruct( "
+ << theAxis.x << ", "
+ << theAxis.y << ", "
+ << theAxis.z << ", "
+ << theAxis.vx << ", "
+ << theAxis.vy << ", "
+ << theAxis.vz << " )";
+ return *this;
+ }
+
+ TPythonDump& TPythonDump::operator<<(const SMESH::DirStruct & theDir)
+ {
+ const SMESH::PointStruct & P = theDir.PS;
+ myStream << "SMESH.DirStruct( SMESH.PointStruct ( "
+ << P.x << ", "
+ << P.y << ", "
+ << P.z << " ))";
return *this;
}
}
// Map study entries to object names
Resource_DataMapOfAsciiStringAsciiString aMap;
Resource_DataMapOfAsciiStringAsciiString aMapNames;
- TCollection_AsciiString s ("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM0987654321_");
+ //TCollection_AsciiString s ("qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM0987654321_");
SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aSO);
for (Itr->InitEx(true); Itr->More(); Itr->Next()) {
TCollection_AsciiString aSavedTrace (oldValue);
// Add trace of API methods calls and replace study entries by names
- //TCollection_AsciiString aScript =
- // SALOMEDSImpl_Study::GetDumpStudyComment("SMESH") + "\n\n" +
- // DumpPython_impl(aStudy->StudyId(), aMap, aMapNames, isPublished, isValidScript, aSavedTrace);
TCollection_AsciiString aScript =
"### This file is generated by SALOME automatically by dump python functionality of SMESH component\n\n";
aScript += DumpPython_impl(aStudy->StudyId(), aMap, aMapNames,
}
}
-//=======================================================================
-//function : AddToCurrentPyScript
-//purpose :
-//=======================================================================
-
-void SMESH_Gen_i::AddToCurrentPyScript (const TCollection_AsciiString& theString)
-{
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
- if (aStudy->_is_nil()) return;
- aSMESHGen->AddToPythonScript(aStudy->StudyId(), theString);
-}
-
-
-//=======================================================================
-//function : AddObject
-//purpose : add object to script string
-//=======================================================================
-
-TCollection_AsciiString& SMESH_Gen_i::AddObject(TCollection_AsciiString& theStr,
- CORBA::Object_ptr theObject)
-{
- TCollection_AsciiString aString("None");
- SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::SObject_var aSObject =
- aSMESHGen->ObjectToSObject(aSMESHGen->GetCurrentStudy(), theObject);
- if ( !aSObject->_is_nil() ) {
- aString = aSObject->GetID();
- } else if ( !CORBA::is_nil( theObject )) {
- aString = "smeshObj_";
- if ( aSMESHGen->CanPublishInStudy( theObject )) // not published SMESH object
- aString += (int) theObject;
- else
- aString = NotPublishedObjectName();
- }
- theStr += aString;
- return theStr;
-}
-
//=======================================================================
//function : SavePython
//purpose :
while(i < aLen) {
int c = (int)arr[i];
j = i+1;
- if(c >= 48 && c <= 57) { //Is digit?
+ if ( isdigit( c )) { //Is digit?
isFound = Standard_False;
- while((j < aLen) && ((c >= 48 && c <= 57) || c == 58) ) { //Check if it is an entry
+ while((j < aLen) && ( isdigit(c) || c == ':' )) { //Check if it is an entry
c = (int)arr[j++];
- if(c == 58) isFound = Standard_True;
+ if(c == ':') isFound = Standard_True;
}
if (isFound) {
int prev = (i < 1) ? 0 : (int)arr[i - 1];
- // last char should be a diggit,
+ // to distinguish from a sketcher command:
+ // last char should be a digit, not ":",
// previous char should not be '"'.
- if (arr[j-2] != 58 && prev != 34) {
+ if (arr[j-2] != ':' && prev != '"') {
aSeq->Append(i+1); // +1 because AsciiString starts from 1
aSeq->Append(j-1);
}
bool& aValidScript,
const TCollection_AsciiString& theSavedTrace)
{
+ TCollection_AsciiString helper; // to comfortably concatenate C strings
+ TCollection_AsciiString aSmeshpy( SMESH_2smeshpy::SmeshpyName() );
+ TCollection_AsciiString aSMESHGen( SMESH_2smeshpy::GenName() );
+ TCollection_AsciiString anOldGen( SMESH::TPythonDump::SMESHGenName() );
+
TCollection_AsciiString aScript;
- aScript = "def RebuildData(theStudy):";
- aScript += "\n\tsmesh = salome.lcc.FindOrLoadComponent(\"FactoryServer\", \"SMESH\")";
- aScript += "\n\taFilterManager = smesh.CreateFilterManager()";
+ aScript = "def RebuildData(theStudy):\n\t";
+ aScript += helper + "aFilterManager = " + aSMESHGen + ".CreateFilterManager()\n\t";
if ( isPublished )
- aScript += "\n\tsmesh.SetCurrentStudy(theStudy)";
+ aScript += aSMESHGen + ".SetCurrentStudy(theStudy)";
else
- aScript += "\n\tsmesh.SetCurrentStudy(None)";
+ aScript += aSMESHGen + ".SetCurrentStudy(None)";
// Dump trace of restored study
if (theSavedTrace.Length() > 0) {
- aScript += "\n";
- aScript += theSavedTrace;
+ // For the convertion of IDL API calls -> smesh.py API, "smesh" standing for SMESH_Gen
+ // was replaces with "smeshgen" (==TPythonDump::SMESHGenName()).
+ // Change "smesh" -> "smeshgen" in the trace saved before passage to smesh.py API
+ bool isNewVersion =
+ theSavedTrace.Location( anOldGen + ".", 1, theSavedTrace.Length() );
+ if ( !isNewVersion ) {
+ TCollection_AsciiString aSavedTrace( theSavedTrace );
+ TCollection_AsciiString aSmeshCall ( "smesh." ), gen( "gen" );
+ int beg, end = aSavedTrace.Length(), from = 1;
+ while ( from < end && ( beg = aSavedTrace.Location( aSmeshCall, from, end ))) {
+ char charBefore = ( beg == 1 ) ? ' ' : aSavedTrace.Value( beg - 1 );
+ if ( isspace( charBefore ) || charBefore == '=' ) {
+ aSavedTrace.Insert( beg + aSmeshCall.Length() - 1, gen );
+ end += gen.Length();
+ }
+ from = beg + aSmeshCall.Length();
+ }
+ aScript += helper + "\n" + aSavedTrace;
+ }
+ else
+ // append a saved trace to the script
+ aScript += helper + "\n" + theSavedTrace;
}
// Dump trace of API methods calls
TCollection_AsciiString aNewLines = GetNewPythonLines(theStudyID);
if (aNewLines.Length() > 0) {
- aScript += "\n";
- aScript += aNewLines;
+ aScript += helper + "\n" + aNewLines;
}
+ // Convert IDL API calls into smesh.py API.
+ // Some objects are wrapped with python classes and
+ // Resource_DataMapOfAsciiStringAsciiString holds methods returning wrapped objects
+ Resource_DataMapOfAsciiStringAsciiString anEntry2AccessorMethod;
+ aScript = SMESH_2smeshpy::ConvertScript( aScript, anEntry2AccessorMethod );
+
// Find entries to be replaced by names
Handle(TColStd_HSequenceOfInteger) aSeq = FindEntries(aScript);
Standard_Integer aLen = aSeq->Length();
aName = theObjectNames.Find(anEntry);
// check validity of aName
bool isValidName = true;
- if ( aName.IsIntegerValue() ) { // aName must not start with a digit
- aName.Insert( 1, 'a' );
+ int p=1; // replace not allowed chars with underscore
+ while (p <= aName.Length() &&
+ (p = aName.FirstLocationNotInSet(allowedChars, p, aName.Length())))
+ {
+ if ( p == 1 || p == aName.Length() || aName.Value(p-1) == '_')
+ aName.Remove( p, 1 ); // remove double _ and from the start and the end
+ else
+ aName.SetValue(p, '_');
isValidName = false;
}
- int p, p2=1; // replace not allowed chars
- while ((p = aName.FirstLocationNotInSet(allowedChars, p2, aName.Length()))) {
- aName.SetValue(p, '_');
- p2=p;
+ if ( aName.IsIntegerValue() ) { // aName must not start with a digit
+ aName.Insert( 1, 'a' );
isValidName = false;
}
if (theObjectNames.IsBound(aName) && anEntry != theObjectNames(aName)) {
} else {
// Removed Object
do {
- aName = aBaseName + TCollection_AsciiString(++objectCounter);
+ aName = aBaseName + (++objectCounter);
} while (theObjectNames.IsBound(aName));
seqRemoved.Append(aName);
mapRemoved.Bind(anEntry, "1");
}
// set initial part of aSript
- TCollection_AsciiString initPart = "import salome, SMESH, StdMeshers\n\n";
+ TCollection_AsciiString initPart = "import salome, SMESH\n";
+ initPart += helper + "import " + aSmeshpy + "\n\n";
if ( importGeom )
{
- initPart += ("import string, os, sys, re\n"
+ initPart += ("## import GEOM dump file ## \n"
+ "import string, os, sys, re\n"
"sys.path.insert( 0, os.path.dirname(__file__) )\n"
"exec(\"from \"+re.sub(\"SMESH$\",\"GEOM\",__name__)+\" import *\")\n\n");
}
anUpdatedScript += aScript.SubString(aSeq->Value(aLen) + 1, aScriptLength);
// Remove removed objects
- anUpdatedScript += "\n\taStudyBuilder = theStudy.NewBuilder()";
+ if ( seqRemoved.Length() > 0 ) {
+ anUpdatedScript += "\n\t## some objects were removed";
+ anUpdatedScript += "\n\taStudyBuilder = theStudy.NewBuilder()";
+ }
for (int ir = 1; ir <= seqRemoved.Length(); ir++) {
anUpdatedScript += "\n\tSO = theStudy.FindObjectIOR(theStudy.ConvertObjectToIOR(";
anUpdatedScript += seqRemoved.Value(ir);
}
// Set object names
- anUpdatedScript += "\n\n\tisGUIMode = ";
- anUpdatedScript += isPublished;
- anUpdatedScript += "\n\tif isGUIMode:";
- anUpdatedScript += "\n\t\tsmeshgui = salome.ImportComponentGUI(\"SMESH\")";
- anUpdatedScript += "\n\t\tsmeshgui.Init(theStudy._get_StudyId())";
- anUpdatedScript += "\n";
+ anUpdatedScript += "\n\t## set object names";
+ anUpdatedScript += helper + " \n\tisGUIMode = " + isPublished;
+ anUpdatedScript += "\n\tif isGUIMode and salome.sg.hasDesktop():";
+// anUpdatedScript += "\n\t\tsmeshgui = salome.ImportComponentGUI(\"SMESH\")";
+// anUpdatedScript += "\n\t\tsmeshgui.Init(theStudy._get_StudyId())";
+// anUpdatedScript += "\n";
TCollection_AsciiString aGUIName;
Resource_DataMapOfAsciiStringAsciiString mapEntries;
- for (Standard_Integer i = 1; i <= aLen; i += 2) {
+ for (Standard_Integer i = 1; i <= aLen; i += 2)
+ {
anEntry = aScript.SubString(aSeq->Value(i), aSeq->Value(i + 1));
aName = geom->GetDumpName( anEntry.ToCString() );
if (aName.IsEmpty() && // Not a GEOM object
theNames.IsBound(anEntry) &&
!mapEntries.IsBound(anEntry) && // Not yet processed
- !mapRemoved.IsBound(anEntry)) { // Was not removed
+ !mapRemoved.IsBound(anEntry)) // Was not removed
+ {
aName = theObjectNames.Find(anEntry);
aGUIName = theNames.Find(anEntry);
mapEntries.Bind(anEntry, aName);
- anUpdatedScript += "\n\t\tsmeshgui.SetName(salome.ObjectToID(";
- anUpdatedScript += aName + "), \"" + aGUIName + "\")";
+ anUpdatedScript += helper + "\n\t\t" + aSmeshpy + ".SetName(" + aName;
+ if ( anEntry2AccessorMethod.IsBound( anEntry ) )
+ anUpdatedScript += helper + "." + anEntry2AccessorMethod( anEntry );
+ anUpdatedScript += helper + ", '" + aGUIName + "')";
}
}
anUpdatedScript += "\n\n\t\tsalome.sg.updateObjBrowser(0)";
#include "SMESH_Gen_i.hxx"
#include "SMESH_Filter_i.hxx"
+#include "SMESH_PythonDump.hxx"
#include "utilities.h"
list<const SMDS_MeshElement*> > TElemOfElemListMap;
using namespace std;
-
-//=======================================================================
-//function : addAxis
-//purpose :
-//=======================================================================
-
-static TCollection_AsciiString& addAxis(TCollection_AsciiString& theStr,
- const SMESH::AxisStruct & theAxis)
-{
- theStr += "SMESH.AxisStruct( ";
- theStr += TCollection_AsciiString( theAxis.x ) + ", ";
- theStr += TCollection_AsciiString( theAxis.y ) + ", ";
- theStr += TCollection_AsciiString( theAxis.z ) + ", ";
- theStr += TCollection_AsciiString( theAxis.vx ) + ", ";
- theStr += TCollection_AsciiString( theAxis.vy ) + ", ";
- theStr += TCollection_AsciiString( theAxis.vz ) + " )";
- return theStr;
-}
+using SMESH::TPythonDump;
//=============================================================================
/*!
IdList.push_back( IDsOfElements[i] );
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.RemoveElements(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".RemoveElements( " << IDsOfElements << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"RemoveElements: \", isDone" );
+ TPythonDump() << "print 'RemoveElements: ', isDone";
#endif
// Remove Elements
return anEditor.Remove( IdList, false );
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::
- long_array & IDsOfNodes)
+CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNodes)
{
::SMESH_MeshEditor anEditor( _myMesh );
list< int > IdList;
IdList.push_back( IDsOfNodes[i] );
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.RemoveNodes(");
- SMESH_Gen_i::AddArray( str, IDsOfNodes ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".RemoveNodes( " << IDsOfNodes << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"RemoveNodes: \", isDone" );
+ TPythonDump() << "print 'RemoveNodes: ', isDone";
#endif
return anEditor.Remove( IdList, true );
GetMeshDS()->AddEdge(GetMeshDS()->FindNode(index1), GetMeshDS()->FindNode(index2));
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddEdge([");
- str += TCollection_AsciiString((int) index1) + ", ";
- str += TCollection_AsciiString((int) index2) + " ])";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddEdge([ "
+ << index1 << ", " << index2 <<" ])";
}
return true;
}
GetMeshDS()->AddNode(x, y, z);
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddNode(");
- str += TCollection_AsciiString( x ) + ", ";
- str += TCollection_AsciiString( y ) + ", ";
- str += TCollection_AsciiString( z ) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddNode( "
+ << x << ", " << y << ", " << z << " )";
return true;
}
}
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddFace(");
- SMESH_Gen_i::AddArray( str, IDsOfNodes ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddFace( " << IDsOfNodes << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"AddFace: \", isDone" );
+ TPythonDump() << "print 'AddFace: ', isDone";
#endif
return true;
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::
- long_array & IDsOfNodes)
+CORBA::Boolean SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
{
int NbNodes = IDsOfNodes.length();
vector< const SMDS_MeshNode*> n(NbNodes);
case 8:GetMeshDS()->AddVolume(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]); break;
}
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddVolume(");
- SMESH_Gen_i::AddArray( str, IDsOfNodes ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddVolume( " << IDsOfNodes << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"AddVolume: \", isDone" );
+ TPythonDump() << "print 'AddVolume: ', isDone";
#endif
return true;
GetMeshDS()->AddPolyhedralVolume(n, q);
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddPolyhedralVolume(");
- SMESH_Gen_i::AddArray( str, IDsOfNodes ) += ", ";
- SMESH_Gen_i::AddArray( str, Quantities ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddPolyhedralVolume( "
+ << IDsOfNodes << ", " << Quantities << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"AddPolyhedralVolume: \", isDone" );
+ TPythonDump() << "print 'AddPolyhedralVolume: ', isDone";
#endif
return true;
GetMeshDS()->AddPolyhedralVolume(poly_nodes, quantities);
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.AddPolyhedralVolumeByFaces(");
- SMESH_Gen_i::AddArray( str, IdsOfFaces ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".AddPolyhedralVolumeByFaces( "
+ << IdsOfFaces << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"AddPolyhedralVolume: \", isDone" );
+ TPythonDump() << "print 'AddPolyhedralVolume: ', isDone";
#endif
return true;
GetMeshDS()->MoveNode(node, x, y, z);
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.MoveNode(");
- str += TCollection_AsciiString((Standard_Integer) NodeID) + ", ";
- str += TCollection_AsciiString((Standard_Real) x) + ", ";
- str += TCollection_AsciiString((Standard_Real) y) + ", ";
- str += TCollection_AsciiString((Standard_Real) z) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".MoveNode( "
+ << NodeID << ", " << x << ", " << y << ", " << z << " )";
return true;
}
return false;
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.InverseDiag(");
- str += TCollection_AsciiString((Standard_Integer) NodeID1) + ", ";
- str += TCollection_AsciiString((Standard_Integer) NodeID2) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".InverseDiag( "
+ << NodeID1 << ", " << NodeID2 << " )";
::SMESH_MeshEditor aMeshEditor( _myMesh );
return aMeshEditor.InverseDiag ( n1, n2 );
return false;
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.DeleteDiag(");
- str += TCollection_AsciiString((Standard_Integer) NodeID1) + ", ";
- str += TCollection_AsciiString((Standard_Integer) NodeID2) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".DeleteDiag( "
+ << NodeID1 << ", " << NodeID2 << " )";
::SMESH_MeshEditor aMeshEditor( _myMesh );
return aMeshEditor.DeleteDiag ( n1, n2 );
anEditor.Reorient( elem );
}
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.Reorient(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".Reorient( " << IDsOfElements << " )";
return true;
}
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.ReorientObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".ReorientObject( " << theObject << " )";
return isDone;
}
aCrit = aNumericalFunctor->GetNumericalFunctor();
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.TriToQuad(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", None, ";
- str += TCollection_AsciiString((Standard_Real) MaxAngle) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".TriToQuad( "
+ << IDsOfElements << ", None, " << MaxAngle << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"TriToQuad: \", isDone" );
+ TPythonDump() << "print 'TriToQuad: ', isDone";
#endif
::SMESH_MeshEditor anEditor( _myMesh );
#endif
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.TriToQuadObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", None, ";
- str += TCollection_AsciiString((Standard_Real) MaxAngle) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".TriToQuadObject("
+ << theObject << ", None, " << MaxAngle << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"TriToQuadObject: \", isDone" );
+ TPythonDump() << "print 'TriToQuadObject: ', isDone";
#endif
return isDone;
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.QuadToTri(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", None )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".QuadToTri( " << IDsOfElements << ", None )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"QuadToTri: \", isDone" );
+ TPythonDump() << "print 'QuadToTri: ', isDone";
#endif
::SMESH_MeshEditor anEditor( _myMesh );
#endif
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.QuadToTriObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", None )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".QuadToTriObject(" << theObject << ", None )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"QuadToTriObject: \", isDone" );
+ TPythonDump() << "print 'QuadToTriObject: ', isDone";
#endif
return isDone;
}
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.SplitQuad(");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", ";
- str += TCollection_AsciiString( Diag13 ) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".SplitQuad( "
+ << IDsOfElements << ", " << Diag13 << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"SplitQuad: \", isDone" );
+ TPythonDump() << "print 'SplitQuad: ', isDone";
#endif
::SMESH_MeshEditor anEditor( _myMesh );
#endif
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.SplitQuadObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", ";
- str += TCollection_AsciiString( Diag13 ) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << ".SplitQuadObject( "
+ << theObject << ", " << Diag13 << " )";
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"SplitQuadObject: \", isDone" );
+ TPythonDump() << "print 'SplitQuadObject: ', isDone";
#endif
return isDone;
MaxNbOfIterations, MaxAspectRatio, IsParametric );
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.");
- str += (char*) (IsParametric ? "SmoothParametric( " : "Smooth( ");
- SMESH_Gen_i::AddArray( str, IDsOfElements ) += ", ";
- SMESH_Gen_i::AddArray( str, IDsOfFixedNodes ) += ", ";
- str += (Standard_Integer) MaxNbOfIterations;
- str += ", ";
- str += (Standard_Real) MaxAspectRatio;
- if ( method == ::SMESH_MeshEditor::CENTROIDAL )
- str += ", SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH, ";
- else
- str += ", SMESH.SMESH_MeshEditor.LAPLACIAN_SMOOTH, ";
- str += IsParametric;
- str += " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << "."
+ << (IsParametric ? "SmoothParametric( " : "Smooth( ")
+ << IDsOfElements << ", " << IDsOfFixedNodes << ", "
+ << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << "SMESH.SMESH_MeshEditor."
+ << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
+ "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"Smooth: \", isDone" );
+ TPythonDump() << "print 'Smooth: ', isDone";
#endif
return true;
//=============================================================================
CORBA::Boolean
- SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
- CORBA::Double MaxAspectRatio,
- SMESH::SMESH_MeshEditor::Smooth_Method Method,
- bool IsParametric)
+SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObject,
+ const SMESH::long_array & IDsOfFixedNodes,
+ CORBA::Long MaxNbOfIterations,
+ CORBA::Double MaxAspectRatio,
+ SMESH::SMESH_MeshEditor::Smooth_Method Method,
+ bool IsParametric)
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
#endif
// Update Python script
- TCollection_AsciiString str ("isDone = mesh_editor.");
- str += (char*) (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ");
- SMESH_Gen_i::AddObject( str, theObject ) += ", ";
- SMESH_Gen_i::AddArray( str, IDsOfFixedNodes ) += ", ";
- str += (Standard_Integer) MaxNbOfIterations;
- str += ", ";
- str += (Standard_Real) MaxAspectRatio;
- if ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH )
- str += ", SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH, ";
- else
- str += ", SMESH.SMESH_MeshEditor.LAPLACIAN_SMOOTH, ";
- str += IsParametric;
- str += " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "isDone = " << this << "."
+ << (IsParametric ? "SmoothParametricObject( " : "SmoothObject( ")
+ << theObject << ", " << IDsOfFixedNodes << ", "
+ << MaxNbOfIterations << ", " << MaxAspectRatio << ", "
+ << "SMESH.SMESH_MeshEditor."
+ << ( Method == SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH ?
+ "CENTROIDAL_SMOOTH )" : "LAPLACIAN_SMOOTH )");
#ifdef _DEBUG_
- SMESH_Gen_i::AddToCurrentPyScript( "print \"SmoothObject: \", isDone" );
+ TPythonDump() << "print 'SmoothObject: ', isDone";
#endif
return isDone;
void SMESH_MeshEditor_i::RenumberNodes()
{
// Update Python script
- SMESH_Gen_i::AddToCurrentPyScript( "mesh_editor.RenumberNodes()" );
+ TPythonDump() << this << ".RenumberNodes()";
GetMeshDS()->Renumber( true );
}
void SMESH_MeshEditor_i::RenumberElements()
{
// Update Python script
- SMESH_Gen_i::AddToCurrentPyScript( "mesh_editor.RenumberElements()" );
+ TPythonDump() << this << ".RenumberElements()";
GetMeshDS()->Renumber( false );
}
theNbOfSteps, theTolerance);
// Update Python script
- TCollection_AsciiString str = "axis = ";
- addAxis( str, theAxis );
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = "mesh_editor.RotationSweep(";
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", axis, ";
- str += TCollection_AsciiString( theAngleInRadians ) + ", ";
- str += TCollection_AsciiString( (int)theNbOfSteps ) + ", ";
- str += TCollection_AsciiString( theTolerance ) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "axis = " << theAxis;
+ TPythonDump() << this << ".RotationSweep( "
+ << theIDsOfElements
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
//=======================================================================
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("mesh_editor.RotationSweepObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", axis, ";
- str += TCollection_AsciiString( theAngleInRadians ) + ", ";
- str += TCollection_AsciiString( (int)theNbOfSteps ) + ", ";
- str += TCollection_AsciiString( theTolerance ) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << this << ".RotationSweepObject( "
+ << theObject
+ << ", axis, "
+ << theAngleInRadians << ", "
+ << theNbOfSteps << ", "
+ << theTolerance << " )";
}
//=======================================================================
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
// Update Python script
- TCollection_AsciiString str = "stepVector = SMESH.DirStruct( SMESH.PointStruct ( ";
- str += (TCollection_AsciiString) stepVec.X() + ", ";
- str += (TCollection_AsciiString) stepVec.Y() + ", ";
- str += (TCollection_AsciiString) stepVec.Z() + " ))";
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = ("mesh_editor.ExtrusionSweep(");
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", stepVector, ";
- str += TCollection_AsciiString((int)theNbOfSteps) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "stepVector = " << theStepVector;
+ TPythonDump() << this << ".ExtrusionSweep( "
+ << theIDsOfElements << ", stepVector, " << theNbOfSteps << " )";
}
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("mesh_editor.ExtrusionSweepObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", stepVector, ";
- str += TCollection_AsciiString((int)theNbOfSteps) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << this << ".ExtrusionSweepObject( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
//=======================================================================
//anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps);
TElemOfElemListMap aHystory;
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
+
+ // Update Python script
+ TPythonDump() << "stepVector = " << theStepVector;
+ TPythonDump() << this << ".ExtrusionSweepObject1D( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
//=======================================================================
//anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps);
TElemOfElemListMap aHystory;
anEditor.ExtrusionSweep (elements, stepVec, theNbOfSteps, aHystory);
+
+ // Update Python script
+ TPythonDump() << "stepVector = " << theStepVector;
+ TPythonDump() << this << ".ExtrusionSweepObject2D( "
+ << theObject << ", stepVector, " << theNbOfSteps << " )";
}
theExtrFlags, theSewTolerance);
// Update Python script
- TCollection_AsciiString str = "stepVector = SMESH.DirStruct( SMESH.PointStruct ( ";
- str += (TCollection_AsciiString) stepVec.X() + ", ";
- str += (TCollection_AsciiString) stepVec.Y() + ", ";
- str += (TCollection_AsciiString) stepVec.Z() + " ))";
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = ("mesh_editor.AdvancedExtrusion(");
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", stepVector, ";
- str += TCollection_AsciiString((int)theNbOfSteps) + ",";
- str += TCollection_AsciiString((int)theExtrFlags) + ", ";
- str += TCollection_AsciiString((double)theSewTolerance) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "stepVector = " << theStepVector;
+ TPythonDump() << this << ".AdvancedExtrusion("
+ << theIDsOfElements
+ << ", stepVector, "
+ << theNbOfSteps << ","
+ << theExtrFlags << ", "
+ << theSewTolerance << " )";
}
gp_Pnt refPnt( theRefPoint.x, theRefPoint.y, theRefPoint.z );
// Update Python script
- TCollection_AsciiString str = "refPoint = SMESH.PointStruct( ";
- str += (TCollection_AsciiString) refPnt.X() + ", ";
- str += (TCollection_AsciiString) refPnt.Y() + ", ";
- str += (TCollection_AsciiString) refPnt.Z() + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = ("error = mesh_editor.ExtrusionAlongPath(");
- SMESH_Gen_i::AddArray ( str, theIDsOfElements ) += ", ";
- SMESH_Gen_i::AddObject( str, thePathMesh ) += ", ";
- SMESH_Gen_i::AddObject( str, thePathShape ) += ", ";
- str += TCollection_AsciiString( (int)theNodeStart ) + ", ";
- str += TCollection_AsciiString( (int)theHasAngles ) + ", ";
- SMESH_Gen_i::AddArray ( str, theAngles ) += ", ";
- str += (TCollection_AsciiString) theHasRefPoint + ", refPoint )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "refPoint = SMESH.PointStruct( "
+ << refPnt.X() << ", "
+ << refPnt.Y() << ", "
+ << refPnt.Z() << " )";
+ TPythonDump() << "error = " << this << ".ExtrusionAlongPath( "
+ << theIDsOfElements << ", "
+ << thePathMesh << ", "
+ << thePathShape << ", "
+ << theNodeStart << ", "
+ << theHasAngles << ", "
+ << theAngles << ", "
+ << theHasRefPoint << ", refPoint )";
::SMESH_MeshEditor anEditor( _myMesh );
- return convExtrError( anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart, theHasAngles, angles, theHasRefPoint, refPnt ) );
+ return convExtrError( anEditor.ExtrusionAlongTrack( elements, aSubMesh, nodeStart,
+ theHasAngles, angles,
+ theHasRefPoint, refPnt ) );
}
//=======================================================================
//=======================================================================
SMESH::SMESH_MeshEditor::Extrusion_Error
- SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
- SMESH::SMESH_Mesh_ptr thePathMesh,
- GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
- CORBA::Boolean theHasAngles,
- const SMESH::double_array & theAngles,
- CORBA::Boolean theHasRefPoint,
- const SMESH::PointStruct & theRefPoint)
+SMESH_MeshEditor_i::ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::SMESH_Mesh_ptr thePathMesh,
+ GEOM::GEOM_Object_ptr thePathShape,
+ CORBA::Long theNodeStart,
+ CORBA::Boolean theHasAngles,
+ const SMESH::double_array & theAngles,
+ CORBA::Boolean theHasRefPoint,
+ const SMESH::PointStruct & theRefPoint)
{
SMESH::long_array_var anElementsId = theObject->GetIDs();
SMESH::SMESH_MeshEditor::Extrusion_Error error = ExtrusionAlongPath
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("error = mesh_editor.ExtrusionAlongPathObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", ";
- SMESH_Gen_i::AddObject( str, thePathMesh ) += ", ";
- SMESH_Gen_i::AddObject( str, thePathShape ) += ", ";
- str += TCollection_AsciiString( (int)theNodeStart ) + ", ";
- str += TCollection_AsciiString( theHasAngles ) + ", ";
- SMESH_Gen_i::AddArray ( str, theAngles ) += ", ";
- str += TCollection_AsciiString( theHasRefPoint ) + ", refPoint )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "error = " << this << ".ExtrusionAlongPathObject( "
+ << theObject << ", "
+ << thePathMesh << ", "
+ << thePathShape << ", "
+ << theNodeStart << ", "
+ << theHasAngles << ", "
+ << theAngles << ", "
+ << theHasRefPoint << ", refPoint )";
return error;
}
gp_Vec V ( theAxis.vx, theAxis.vy, theAxis.vz );
gp_Trsf aTrsf;
- TCollection_AsciiString typeStr, copyStr( theCopy );
+ TCollection_AsciiString typeStr;
switch ( theMirrorType ) {
case SMESH::SMESH_MeshEditor::POINT:
aTrsf.SetMirror( P );
}
// Update Python script
- TCollection_AsciiString str ("mesh_editor.Mirror(");
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", ";
- addAxis( str, theAxis ) += ", ";
- str += typeStr + ", ";
- str += copyStr + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << this << ".Mirror( "
+ << theIDsOfElements << ", "
+ << theAxis << ", "
+ << typeStr << ", "
+ << theCopy << " )";
::SMESH_MeshEditor anEditor( _myMesh );
anEditor.Transform (elements, aTrsf, theCopy);
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString typeStr, copyStr( theCopy );
+ TCollection_AsciiString typeStr;
switch ( theMirrorType ) {
case SMESH::SMESH_MeshEditor::POINT:
typeStr = "SMESH.SMESH_MeshEditor.POINT";
default:
typeStr = "SMESH.SMESH_MeshEditor.PLANE";
}
-
- TCollection_AsciiString str ("mesh_editor.MirrorObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", ";
- addAxis( str, theAxis ) += ", ";
- str += typeStr + ", " + copyStr + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "axis = " << theAxis;
+ TPythonDump() << this << ".MirrorObject( "
+ << theObject << ", "
+ << "axis, "
+ << typeStr << ", "
+ << theCopy << " )";
}
//=======================================================================
anEditor.Transform (elements, aTrsf, theCopy);
// Update Python script
- TCollection_AsciiString str = "vector = SMESH.DirStruct( SMESH.PointStruct ( ";
- str += (TCollection_AsciiString) P->x + ", ";
- str += (TCollection_AsciiString) P->y + ", ";
- str += (TCollection_AsciiString) P->z + " ))";
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = ("mesh_editor.Translate(");
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", vector, ";
- str += (TCollection_AsciiString) theCopy + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "vector = " << theVector;
+ TPythonDump() << this << ".Translate( "
+ << theIDsOfElements
+ << ", vector, "
+ << theCopy << " )";
}
//=======================================================================
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("mesh_editor.TranslateObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", vector, ";
- str += TCollection_AsciiString( theCopy ) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << this << ".TranslateObject( "
+ << theObject
+ << ", vector, "
+ << theCopy << " )";
}
//=======================================================================
anEditor.Transform (elements, aTrsf, theCopy);
// Update Python script
- TCollection_AsciiString str ("axis = ");
- addAxis( str, theAxis );
- SMESH_Gen_i::AddToCurrentPyScript( str );
- str = ("mesh_editor.Rotate(");
- SMESH_Gen_i::AddArray( str, theIDsOfElements ) += ", axis, ";
- str += (TCollection_AsciiString) theAngle + ", ";
- str += (TCollection_AsciiString) theCopy + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "axis = " << theAxis;
+ TPythonDump() << this << ".Rotate( "
+ << theIDsOfElements
+ << ", axis, "
+ << theAngle << ", "
+ << theCopy << " )";
}
//=======================================================================
aSMESHGen->RemoveLastFromPythonScript(aSMESHGen->GetCurrentStudyID());
// Update Python script
- TCollection_AsciiString str ("mesh_editor.RotateObject(");
- SMESH_Gen_i::AddObject( str, theObject ) += ", axis, ";
- str += TCollection_AsciiString( theAngle ) + ", ";
- str += TCollection_AsciiString( theCopy ) + " )";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << this << ".RotateObject( "
+ << theObject
+ << ", axis, "
+ << theAngle << ", "
+ << theCopy << " )";
}
//=======================================================================
for ( int j = 0; lIt != aListOfNodes.end(); lIt++, j++ )
aGroup[ j ] = (*lIt)->GetID();
}
+ // Update Python script
+ TPythonDump() << "coincident_nodes = " << this << ".FindCoincidentNodes( "
+ << Tolerance << " )";
}
//=======================================================================
{
SMESHDS_Mesh* aMesh = GetMeshDS();
- TCollection_AsciiString str( "mesh_editor.MergeNodes([" );
+ TPythonDump aTPythonDump;
+ aTPythonDump << this << ".MergeNodes([";
::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes;
for (int i = 0; i < GroupsOfNodes.length(); i++)
{
if ( aListOfNodes.size() < 2 )
aListOfListOfNodes.pop_back();
- if ( i > 0 )
- str += ",";
- SMESH_Gen_i::AddArray( str, aNodeGroup );
+ if ( i > 0 ) aTPythonDump << ", ";
+ aTPythonDump << aNodeGroup;
}
::SMESH_MeshEditor anEditor( _myMesh );
anEditor.MergeNodes( aListOfListOfNodes );
// Update Python script
- SMESH_Gen_i::AddToCurrentPyScript( str + "])" );
+ aTPythonDump << "])";
}
//=======================================================================
anEditor.MergeEqualElements();
// Update Python script
- SMESH_Gen_i::AddToCurrentPyScript( "mesh_editor.MergeEqualElements()" );
+ TPythonDump() << this << ".MergeEqualElements()";
}
//=======================================================================
return SMESH::SMESH_MeshEditor::SEW_BORDER2_NOT_FOUND;
// Update Python script
- TCollection_AsciiString str ("error = mesh_editor.SewFreeBorders( ");
- str += TCollection_AsciiString( (int) FirstNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) SecondNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) LastNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) FirstNodeID2 ) + ", ";
- str += TCollection_AsciiString( (int) SecondNodeID2 ) + ", ";
- str += TCollection_AsciiString( (int) LastNodeID2 ) + ", ";
- str += TCollection_AsciiString( CreatePolygons ) + ", ";
- str += TCollection_AsciiString( CreatePolyedrs ) + ") ";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "error = " << this << ".SewFreeBorders( "
+ << FirstNodeID1 << ", "
+ << SecondNodeID1 << ", "
+ << LastNodeID1 << ", "
+ << FirstNodeID2 << ", "
+ << SecondNodeID2 << ", "
+ << LastNodeID2 << ", "
+ << CreatePolygons<< ", "
+ << CreatePolyedrs<< " )";
::SMESH_MeshEditor anEditor( _myMesh );
return convError( anEditor.SewFreeBorder (aBorderFirstNode,
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
- SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1,
- CORBA::Long SecondNodeID1,
- CORBA::Long LastNodeID1,
- CORBA::Long FirstNodeID2,
- CORBA::Long SecondNodeID2)
+SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1,
+ CORBA::Long SecondNodeID1,
+ CORBA::Long LastNodeID1,
+ CORBA::Long FirstNodeID2,
+ CORBA::Long SecondNodeID2)
{
SMESHDS_Mesh* aMesh = GetMeshDS();
return SMESH::SMESH_MeshEditor::SEW_BORDER2_NOT_FOUND;
// Update Python script
- TCollection_AsciiString str ("error = mesh_editor.SewConformFreeBorders( ");
- str += TCollection_AsciiString( (int) FirstNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) SecondNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) LastNodeID1 ) + ", ";
- str += TCollection_AsciiString( (int) FirstNodeID2 ) + ", ";
- str += TCollection_AsciiString( (int) SecondNodeID2 ) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "error = " << this << ".SewConformFreeBorders( "
+ << FirstNodeID1 << ", "
+ << SecondNodeID1 << ", "
+ << LastNodeID1 << ", "
+ << FirstNodeID2 << ", "
+ << SecondNodeID2 << " )";
::SMESH_MeshEditor anEditor( _myMesh );
return convError( anEditor.SewFreeBorder (aBorderFirstNode,
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
- SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
- CORBA::Long SecondNodeIDOnFreeBorder,
- CORBA::Long LastNodeIDOnFreeBorder,
- CORBA::Long FirstNodeIDOnSide,
- CORBA::Long LastNodeIDOnSide,
- CORBA::Boolean CreatePolygons,
- CORBA::Boolean CreatePolyedrs)
+SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
+ CORBA::Long SecondNodeIDOnFreeBorder,
+ CORBA::Long LastNodeIDOnFreeBorder,
+ CORBA::Long FirstNodeIDOnSide,
+ CORBA::Long LastNodeIDOnSide,
+ CORBA::Boolean CreatePolygons,
+ CORBA::Boolean CreatePolyedrs)
{
SMESHDS_Mesh* aMesh = GetMeshDS();
return SMESH::SMESH_MeshEditor::SEW_BAD_SIDE_NODES;
// Update Python script
- TCollection_AsciiString str ("error = mesh_editor.SewBorderToSide( ");
- str += TCollection_AsciiString( (int) FirstNodeIDOnFreeBorder ) + ", ";
- str += TCollection_AsciiString( (int) SecondNodeIDOnFreeBorder ) + ", ";
- str += TCollection_AsciiString( (int) LastNodeIDOnFreeBorder ) + ", ";
- str += TCollection_AsciiString( (int) FirstNodeIDOnSide ) + ", ";
- str += TCollection_AsciiString( (int) LastNodeIDOnSide ) + ", ";
- str += TCollection_AsciiString( CreatePolygons ) + ", ";
- str += TCollection_AsciiString( CreatePolyedrs ) + ") ";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "error = " << this << ".SewBorderToSide( "
+ << FirstNodeIDOnFreeBorder << ", "
+ << SecondNodeIDOnFreeBorder << ", "
+ << LastNodeIDOnFreeBorder << ", "
+ << FirstNodeIDOnSide << ", "
+ << LastNodeIDOnSide << ", "
+ << CreatePolygons << ", "
+ << CreatePolyedrs << ") ";
::SMESH_MeshEditor anEditor( _myMesh );
return convError( anEditor.SewFreeBorder (aBorderFirstNode,
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
- SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
- const SMESH::long_array& IDsOfSide2Elements,
- CORBA::Long NodeID1OfSide1ToMerge,
- CORBA::Long NodeID1OfSide2ToMerge,
- CORBA::Long NodeID2OfSide1ToMerge,
- CORBA::Long NodeID2OfSide2ToMerge)
+SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
+ const SMESH::long_array& IDsOfSide2Elements,
+ CORBA::Long NodeID1OfSide1ToMerge,
+ CORBA::Long NodeID1OfSide2ToMerge,
+ CORBA::Long NodeID2OfSide1ToMerge,
+ CORBA::Long NodeID2OfSide2ToMerge)
{
SMESHDS_Mesh* aMesh = GetMeshDS();
aSide2Elems.insert( elem );
}
// Update Python script
- TCollection_AsciiString str ("error = mesh_editor.SewSideElements( ");
- SMESH_Gen_i::AddArray( str, IDsOfSide1Elements ) += ", ";
- SMESH_Gen_i::AddArray( str, IDsOfSide2Elements ) += ", ";
- str += TCollection_AsciiString( (int) NodeID1OfSide1ToMerge ) + ", ";
- str += TCollection_AsciiString( (int) NodeID1OfSide2ToMerge ) + ", ";
- str += TCollection_AsciiString( (int) NodeID2OfSide1ToMerge ) + ", ";
- str += TCollection_AsciiString( (int) NodeID2OfSide2ToMerge ) + ")";
- SMESH_Gen_i::AddToCurrentPyScript( str );
+ TPythonDump() << "error = " << this << ".SewSideElements( "
+ << IDsOfSide1Elements << ", "
+ << IDsOfSide2Elements << ", "
+ << NodeID1OfSide1ToMerge << ", "
+ << NodeID1OfSide2ToMerge << ", "
+ << NodeID2OfSide1ToMerge << ", "
+ << NodeID2OfSide2ToMerge << ")";
::SMESH_MeshEditor anEditor( _myMesh );
return convError( anEditor.SewSideElements (aSide1Elems, aSide2Elems,
#include "SMESH_MEDMesh_i.hxx"
#include "SMESH_Group_i.hxx"
#include "SMESH_Filter_i.hxx"
+#include "SMESH_PythonDump.hxx"
#include "Utils_CorbaException.hxx"
#include "Utils_ExceptHandlers.hxx"
#endif
using namespace std;
+using SMESH::TPythonDump;
int SMESH_Mesh_i::myIdGenerator = 0;
if(MYDEBUG) MESSAGE( " AddHypothesis(): status = " << status );
// Update Python script
- TCollection_AsciiString aStr ("status = ");
- SMESH_Gen_i::AddObject(aStr, _this()) += ".AddHypothesis(";
- SMESH_Gen_i::AddObject(aStr, aSubShapeObject) += ", ";
- SMESH_Gen_i::AddObject(aStr, anHyp) += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << "status = " << _this() << ".AddHypothesis( "
+ << aSubShapeObject << ", " << anHyp << " )";
return ConvertHypothesisStatus(status);
}
aSubShapeObject, anHyp );
// Update Python script
- TCollection_AsciiString aStr ("status = ");
- SMESH_Gen_i::AddObject(aStr, _this()) += ".RemoveHypothesis(";
- SMESH_Gen_i::AddObject(aStr, aSubShapeObject) += ", ";
- SMESH_Gen_i::AddObject(aStr, anHyp) += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << "status = " << _this() << ".RemoveHypothesis( "
+ << aSubShapeObject << ", " << anHyp << " )";
return ConvertHypothesisStatus(status);
}
subMesh, aSubShapeObject, theName );
if ( !aSO->_is_nil()) {
// Update Python script
- TCollection_AsciiString aStr (aSO->GetID());
- aStr += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".GetSubMesh(";
- SMESH_Gen_i::AddObject(aStr, aSubShapeObject) += ", \"";
- aStr += (char*)theName;
- aStr += "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aSO << " = " << _this() << ".GetSubMesh( "
+ << aSubShapeObject << ", '" << theName << "' )";
}
}
}
aStudy->NewBuilder()->RemoveObjectWithChildren( anSO );
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".RemoveSubMesh(";
- aStr += anSO->GetID();
- aStr += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".RemoveSubMesh( " << anSO << " )";
}
}
* ElementTypeString
*/
//=============================================================================
+#define CASE2STRING(enum) case SMESH::enum: return "SMESH."#enum;
inline TCollection_AsciiString ElementTypeString (SMESH::ElementType theElemType)
{
- TCollection_AsciiString aStr;
switch (theElemType) {
- case SMESH::ALL:
- aStr = "SMESH.ALL";
- break;
- case SMESH::NODE:
- aStr = "SMESH.NODE";
- break;
- case SMESH::EDGE:
- aStr = "SMESH.EDGE";
- break;
- case SMESH::FACE:
- aStr = "SMESH.FACE";
- break;
- case SMESH::VOLUME:
- aStr = "SMESH.VOLUME";
- break;
- default:
- break;
+ CASE2STRING( ALL );
+ CASE2STRING( NODE );
+ CASE2STRING( EDGE );
+ CASE2STRING( FACE );
+ CASE2STRING( VOLUME );
+ default:;
}
- return aStr;
+ return "";
}
//=============================================================================
aNewGroup, GEOM::GEOM_Object::_nil(), theName);
if ( !aSO->_is_nil()) {
// Update Python script
- TCollection_AsciiString aStr (aSO->GetID());
- aStr += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".CreateGroup(";
- aStr += ElementTypeString(theElemType) + ", \"" + (char*)theName + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aSO << " = " << _this() << ".CreateGroup( "
+ << ElementTypeString(theElemType) << ", '" << theName << "' )";
}
}
-
return aNewGroup._retn();
}
aNewGroup, theGeomObj, theName);
if ( !aSO->_is_nil()) {
// Update Python script
- TCollection_AsciiString aStr (aSO->GetID());
- aStr += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".CreateGroupFromGEOM(";
- aStr += ElementTypeString(theElemType) + ", \"" + (char*)theName + "\", ";
- SMESH_Gen_i::AddObject(aStr, theGeomObj) += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aSO << " = " << _this() << ".CreateGroupFromGEOM("
+ << ElementTypeString(theElemType) << ", '" << theName << "', "
+ << theGeomObj << " )";
}
}
}
if ( !aGroupSO->_is_nil() ) {
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".RemoveGroup(";
- aStr += aGroupSO->GetID();
- aStr += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".RemoveGroup( " << aGroupSO << " )";
// Remove group's SObject
aStudy->NewBuilder()->RemoveObject( aGroupSO );
SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor();
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".RemoveGroupWithContents(";
- SMESH_Gen_i::AddObject(aStr, theGroup) += ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".RemoveGroupWithContents( " << theGroup << " )";
// Remove contents
if ( aGroup->GetType() == SMESH::NODE )
_gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, aResGrp) += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".UnionGroups(";
- SMESH_Gen_i::AddObject(aStr, theGroup1) += ", ";
- SMESH_Gen_i::AddObject(aStr, theGroup2) += ", \"";
- aStr += TCollection_AsciiString((char*)theName) + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aResGrp << " = " << _this() << ".UnionGroups( "
+ << theGroup1 << ", " << theGroup2 << ", '"
+ << theName << "' )";
return aResGrp._retn();
}
_gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, aResGrp) += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".IntersectGroups(";
- SMESH_Gen_i::AddObject(aStr, theGroup1) += ", ";
- SMESH_Gen_i::AddObject(aStr, theGroup2) += ", \"";
- aStr += TCollection_AsciiString((char*)theName) + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aResGrp << " = " << _this() << ".IntersectGroups( "
+ << theGroup1 << ", " << theGroup2 << ", '" << theName << "')";
return aResGrp._retn();
}
_gen_i->RemoveLastFromPythonScript(aStudy->StudyId());
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, aResGrp) += " = ";
- SMESH_Gen_i::AddObject(aStr, _this()) += ".CutGroups(";
- SMESH_Gen_i::AddObject(aStr, theGroup1) += ", ";
- SMESH_Gen_i::AddObject(aStr, theGroup2) += ", \"";
- aStr += TCollection_AsciiString((char*)theName) + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << aResGrp << " = " << _this() << ".CutGroups( "
+ << theGroup1 << ", " << theGroup2 << ", '"
+ << theName << "' )";
return aResGrp._retn();
}
SMESH::SMESH_MeshEditor_ptr SMESH_Mesh_i::GetMeshEditor()
{
- // Update Python script
- TCollection_AsciiString aStr ("mesh_editor = ");
- SMESH_Gen_i::AddObject(aStr, _this()) += ".GetMeshEditor()";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
-
// Create MeshEditor
SMESH_MeshEditor_i *aMeshEditor = new SMESH_MeshEditor_i( _impl );
SMESH::SMESH_MeshEditor_var aMesh = aMeshEditor->_this();
+
+ // Update Python script
+ TPythonDump() << aMeshEditor << " = " << _this() << ".GetMeshEditor()";
+
return aMesh._retn();
}
Unexpect aCatch(SALOME_SalomeException);
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".ExportToMED(\"";
- aStr += TCollection_AsciiString((char*)file) + "\", ";
- aStr += TCollection_AsciiString((int)auto_groups) + ", ";
- switch (theVersion) {
- case SMESH::MED_V2_1:
- aStr += "SMESH.MED_V2_1)";
- break;
- case SMESH::MED_V2_2:
- aStr += "SMESH.MED_V2_2)";
- break;
- default:
- aStr += TCollection_AsciiString(theVersion) + ")";
- break;
- }
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".ExportToMED( '"
+ << file << "', " << auto_groups << ", " << theVersion << " )";
// Perform Export
PrepareForWriting(file);
Unexpect aCatch(SALOME_SalomeException);
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".ExportDAT(\"";
- aStr += TCollection_AsciiString((char*)file) + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".ExportDAT( '" << file << "' )";
// Perform Export
PrepareForWriting(file);
Unexpect aCatch(SALOME_SalomeException);
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".ExportUNV(\"";
- aStr += TCollection_AsciiString((char*)file) + "\")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".ExportUNV( '" << file << "' )";
// Perform Export
PrepareForWriting(file);
Unexpect aCatch(SALOME_SalomeException);
// Update Python script
- TCollection_AsciiString aStr;
- SMESH_Gen_i::AddObject(aStr, _this()) += ".ExportSTL(\"";
- aStr += TCollection_AsciiString((char*)file) + "\", ";
- aStr += TCollection_AsciiString((int)isascii) + ")";
-
- SMESH_Gen_i::AddToCurrentPyScript(aStr);
+ TPythonDump() << _this() << ".ExportSTL( '" << file << "', " << isascii << " )";
// Perform Export
PrepareForWriting(file);