#include "SMESH_PythonDump.hxx"#include "SMESH_Gen_i.hxx"#include "SMESH_Filter_i.hxx"#include "SMESH_MeshEditor_i.hxx"#include "SMESH_2smeshpy.hxx"#include <TColStd_HSequenceOfInteger.hxx>#include <TCollection_AsciiString.hxx>#include <SMESH_Comment.hxx>
Go to the source code of this file.
Packages | |
| package | SMESH |
Functions | |
| static TCollection_AsciiString | NotPublishedObjectName () |
| template<class TArray > | |
| void | SMESH.DumpArray (const TArray &theArray, TPythonDump &theStream) |
| TCollection_AsciiString | SMESH.myLongStringStart ("TPythonDump::LongStringStart") |
| TCollection_AsciiString | SMESH.myLongStringEnd ("TPythonDump::LongStringEnd") |
| void | RemoveTabulation (TCollection_AsciiString &theScript) |
| Handle (TColStd_HSequenceOfInteger) FindEntries(TCollection_AsciiString &theString) | |
| FindEntries: Returns a sequence of start/end positions of entries in the string. | |
Variables | |
| static int | MYDEBUG = 0 |
| Handle | ( | TColStd_HSequenceOfInteger | ) |
FindEntries: Returns a sequence of start/end positions of entries in the string.
Definition at line 640 of file SMESH_DumpPython.cxx.
References Handle().
{
Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
Standard_Integer aLen = theString.Length();
Standard_Boolean isFound = Standard_False;
char* arr = (char*) theString.ToCString();
Standard_Integer i = 0, j;
while(i < aLen) {
int c = (int)arr[i];
j = i+1;
if ( isdigit( c )) { //Is digit?
isFound = Standard_False;
while((j < aLen) && ( isdigit(c) || c == ':' )) { //Check if it is an entry
c = (int)arr[j++];
if(c == ':') isFound = Standard_True;
}
if (isFound) {
int prev = (i < 1) ? 0 : (int)arr[i - 1];
// to distinguish from a sketcher command:
// last char should be a digit, not ":",
// previous char should not be '"'.
if (arr[j-2] != ':' && prev != '"') {
aSeq->Append(i+1); // +1 because AsciiString starts from 1
aSeq->Append(j-1);
}
}
}
i = j;
}
return aSeq;
}
| static TCollection_AsciiString NotPublishedObjectName | ( | ) | [static] |
Definition at line 44 of file SMESH_DumpPython.cxx.
Referenced by SMESH_Gen_i.DumpPython(), and SMESH.TPythonDump.operator<<().
{
return "__NOT__Published__Object__";
}
| void RemoveTabulation | ( | TCollection_AsciiString & | theScript | ) |
Definition at line 495 of file SMESH_DumpPython.cxx.
Referenced by SMESH_Gen_i.DumpPython_impl().
{
std::string aString( theScript.ToCString() );
std::string::size_type aPos = 0;
while( aPos < aString.length() )
{
aPos = aString.find( "\n\t", aPos );
if( aPos == std::string::npos )
break;
aString.replace( aPos, 2, "\n" );
aPos++;
}
theScript = aString.c_str();
}
Definition at line 41 of file SMESH_DumpPython.cxx.