Version: 6.3.1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes

_pyCommand Class Reference

Class operating on a command string looking like ResultValue = Object.Method( Arg1, Arg2,...) More...

#include <SMESH_2smeshpy.hxx>

Inheritance diagram for _pyCommand:
Inheritance graph
[legend]

Public Member Functions

 _pyCommand ()
 _pyCommand (const TCollection_AsciiString &theString, int theNb)
TCollection_AsciiString & GetString ()
int GetOrderNb () const
void SetOrderNb (int theNb)
int Length ()
void Clear ()
bool IsEmpty () const
TCollection_AsciiString GetIndentation ()
 Returns whitespace symbols at the line beginning.
const TCollection_AsciiString & GetResultValue ()
 Return substring of python command looking like ResultValue = Obj.Meth()
const int GetNbResultValues ()
 Return number of python command result value ResultValue = Obj.Meth()
const TCollection_AsciiString & GetResultValue (int res)
 Return substring of python command looking like ResultValue1 , ResultValue1,...
const TCollection_AsciiString & GetObject ()
 Return substring of python command looking like ResVal = Object.Meth()
const TCollection_AsciiString & GetMethod ()
 Return substring of python command looking like ResVal = Obj.Method()
const TCollection_AsciiString & GetArg (int index)
 Return substring of python command looking like ResVal = Obj.Meth(Arg1,...)
int GetNbArgs ()
void SetResultValue (const TCollection_AsciiString &theResult)
void SetObject (const TCollection_AsciiString &theObject)
void SetMethod (const TCollection_AsciiString &theMethod)
void SetArg (int index, const TCollection_AsciiString &theArg)
 Set agrument.
void RemoveArgs ()
 Empty arg list.
void AddDependantCmd (Handle(_pyCommand) cmd, bool prepend=false)
bool SetDependentCmdsAfter () const
 Set dependent commands after this one.
bool AddAccessorMethod (_pyID theObjectID, const char *theAcsMethod)
 Insert accessor method after theObjectID.

Static Public Member Functions

static bool SkipSpaces (const TCollection_AsciiString &theSring, int &thePos)
 Look for position where not space char is.
static TCollection_AsciiString GetWord (const TCollection_AsciiString &theSring, int &theStartPos, const bool theForward, const bool dotIsWord=false)
 Looks for a word in the string and returns word's beginning.

Private Types

enum  {
  UNKNOWN = -1, EMPTY = 0, RESULT_IND, OBJECT_IND,
  METHOD_IND, ARG1_IND
}

Private Member Functions

int GetBegPos (int thePartIndex)
 Return starting position of a part of python command.
void SetBegPos (int thePartIndex, int thePosition)
 Store starting position of a part of python command.
void SetPart (int thePartIndex, const TCollection_AsciiString &theNewPart, TCollection_AsciiString &theOldPart)
 Modify a part of the command.
void FindAllArgs ()

Private Attributes

int myOrderNb
 position within the script
TCollection_AsciiString myString
 command text
TCollection_AsciiString myRes
TCollection_AsciiString myObj
TCollection_AsciiString myMeth
 found parts of command
TColStd_SequenceOfAsciiString myArgs
 found arguments
TColStd_SequenceOfInteger myBegPos
 where myRes, myObj, ...
std::list< Handle(_pyCommand) > myDependentCmds
 commands that sould follow me in the script

Detailed Description

Class operating on a command string looking like ResultValue = Object.Method( Arg1, Arg2,...)

Definition at line 93 of file SMESH_2smeshpy.hxx.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
UNKNOWN 
EMPTY 
RESULT_IND 
OBJECT_IND 
METHOD_IND 
ARG1_IND 

Definition at line 102 of file SMESH_2smeshpy.hxx.


Constructor & Destructor Documentation

_pyCommand._pyCommand ( )

Definition at line 110 of file SMESH_2smeshpy.hxx.

{};
_pyCommand._pyCommand ( const TCollection_AsciiString &  theString,
int  theNb 
)

Definition at line 111 of file SMESH_2smeshpy.hxx.

    : myString( theString ), myOrderNb( theNb ) {};

Member Function Documentation

bool _pyCommand::AddAccessorMethod ( _pyID  theObjectID,
const char *  theAcsMethod 
)

Insert accessor method after theObjectID.

Parameters:
theObjectID- id of the accessed object
theAcsMethod- name of the method giving access to the object
Return values:
bool- false if theObjectID is not found in the command string

Definition at line 2440 of file SMESH_2smeshpy.cxx.

References GetBegPos(), GetObject(), Length(), myBegPos, myString, and OBJECT_IND.

Referenced by _pyGen.AddAlgoAccessorMethod(), and _pyGen.AddMeshAccessorMethod().

{
  if ( !theAcsMethod )
    return false;
  // start object search from the object, i.e. ignore result
  GetObject();
  int beg = GetBegPos( OBJECT_IND );
  if ( beg < 1 || beg > Length() )
    return false;
  bool added = false;
  while (( beg = myString.Location( theObjectID, beg, Length() )))
  {
    // check that theObjectID is not just a part of a longer ID
    int afterEnd = beg + theObjectID.Length();
    Standard_Character c = myString.Value( afterEnd );
    if ( !isalnum( c ) && c != ':' ) {
      // check if accessor method already present
      if ( c != '.' ||
           myString.Location( (char*) theAcsMethod, afterEnd, Length() ) != afterEnd+1) {
        // insertion
        int oldLen = Length();
        myString.Insert( afterEnd, (char*) theAcsMethod );
        myString.Insert( afterEnd, "." );
        // update starting positions of the parts following the modified one
        int posDelta = Length() - oldLen;
        for ( int i = 1; i <= myBegPos.Length(); ++i ) {
          if ( myBegPos( i ) > afterEnd )
            myBegPos( i ) += posDelta;
        }
        added = true;
      }
    }
    beg = afterEnd; // is a part - next search
  }
  return added;
}
void _pyCommand.AddDependantCmd ( Handle(_pyCommand cmd,
bool  prepend = false 
)

Definition at line 140 of file SMESH_2smeshpy.hxx.

References myDependentCmds.

Referenced by _pyLayerDistributionHypo.Addition2Creation().

  { if (prepend) myDependentCmds.push_front( cmd ); else myDependentCmds.push_back( cmd ); }
void _pyCommand.Clear ( )

Definition at line 117 of file SMESH_2smeshpy.hxx.

References myArgs, myBegPos, and myString.

Referenced by _pyMeshEditor._pyMeshEditor(), _pyMesh.Process(), and _pyGen.Process().

{ myString.Clear(); myBegPos.Clear(); myArgs.Clear(); }
void _pyCommand.FindAllArgs ( ) [private]

Definition at line 107 of file SMESH_2smeshpy.hxx.

References GetArg().

Referenced by GetNbArgs(), and SetArg().

{ GetArg(1); }
const TCollection_AsciiString & _pyCommand::GetArg ( int  index)

Return substring of python command looking like ResVal = Obj.Meth(Arg1,...)

Return values:
constTCollection_AsciiString & - Arg<index> substring

Definition at line 2173 of file SMESH_2smeshpy.cxx.

References ARG1_IND, EMPTY, GetBegPos(), GetWord(), Length(), METHOD_IND, myArgs, myMeth, myString, SetBegPos(), and UNKNOWN.

Referenced by _pySegmentLengthAroundVertexHyp.Addition2Creation(), _pyLayerDistributionHypo.Addition2Creation(), _pyHypothesis.Addition2Creation(), FindAllArgs(), Handle(), _pyLayerDistributionHypo.Process(), _pyComplexParamHypo.Process(), _pyHypothesis.Process(), _pyMeshEditor.Process(), _pyMesh.Process(), _pyGen.Process(), and SetArg().

{
  if ( GetBegPos( ARG1_IND ) == UNKNOWN )
  {
    // find all args
    int begPos = GetBegPos( METHOD_IND ) + myMeth.Length();
    if ( begPos < 1 )
      begPos = myString.Location( "(", 1, Length() ) + 1;

    int i = 0, prevLen = 0, nbNestings = 0;
    while ( begPos != EMPTY ) {
      begPos += prevLen;
      if( myString.Value( begPos ) == '(' )
        nbNestings++;
      // check if we are looking at the closing parenthesis
      while ( begPos <= Length() && isspace( myString.Value( begPos )))
        ++begPos;
      if ( begPos > Length() )
        break;
      if ( myString.Value( begPos ) == ')' ) {
        nbNestings--;
        if( nbNestings == 0 )
          break;
      }
      myArgs.Append( GetWord( myString, begPos, true, true ));
      SetBegPos( ARG1_IND + i, begPos );
      prevLen = myArgs.Last().Length();
      if ( prevLen == 0 )
        myArgs.Remove( myArgs.Length() ); // no more args
      i++;
    }
  }
  if ( myArgs.Length() < index )
    return theEmptyString;
  return myArgs( index );
}
int _pyCommand::GetBegPos ( int  thePartIndex) [private]

Return starting position of a part of python command.

Parameters:
thePartIndex- The index of command part
Return values:
int- Part position

Definition at line 1979 of file SMESH_2smeshpy.cxx.

References EMPTY, IsEmpty(), myBegPos, and UNKNOWN.

Referenced by AddAccessorMethod(), GetArg(), GetIndentation(), GetMethod(), GetObject(), GetResultValue(), SetArg(), and SetPart().

{
  if ( IsEmpty() )
    return EMPTY;
  if ( myBegPos.Length() < thePartIndex )
    return UNKNOWN;
  return myBegPos( thePartIndex );
}
TCollection_AsciiString _pyCommand::GetIndentation ( )

Returns whitespace symbols at the line beginning.

Return values:
TCollection_AsciiString- result

Definition at line 2010 of file SMESH_2smeshpy.cxx.

References GetBegPos(), GetWord(), myString, RESULT_IND, and UNKNOWN.

{
  int end = 1;
  if ( GetBegPos( RESULT_IND ) == UNKNOWN )
    GetWord( myString, end, true );
  else
    end = GetBegPos( RESULT_IND );
  return myString.SubString( 1, end - 1 );
}
const TCollection_AsciiString & _pyCommand::GetMethod ( )

Return substring of python command looking like ResVal = Obj.Method()

Return values:
constTCollection_AsciiString & - Method substring

Definition at line 2147 of file SMESH_2smeshpy.cxx.

References GetBegPos(), GetWord(), Length(), METHOD_IND, myMeth, myObj, myString, OBJECT_IND, SetBegPos(), and UNKNOWN.

Referenced by _pyHypothesis.Addition2Creation(), _pyMesh.NeedMeshAccess(), _pyLayerDistributionHypo.Process(), _pyComplexParamHypo.Process(), _pyHypothesis.Process(), _pyMeshEditor.Process(), _pyMesh.Process(), _pyGen.Process(), and SetMethod().

{
  if ( GetBegPos( METHOD_IND ) == UNKNOWN )
  {
    // beginning
    int begPos = GetBegPos( OBJECT_IND ) + myObj.Length();
    bool forward = true;
    if ( begPos < 1 ) {
      begPos = myString.Location( "(", 1, Length() ) - 1;
      forward = false;
    }
    // store
    myMeth = GetWord( myString, begPos, forward );
    SetBegPos( METHOD_IND, begPos );
  }
  //SCRUTE(myMeth);
  return myMeth;
}
int _pyCommand.GetNbArgs ( )

Definition at line 126 of file SMESH_2smeshpy.hxx.

References FindAllArgs(), and myArgs.

Referenced by Handle(), _pyMeshEditor.Process(), _pyGen.Process(), and SetArg().

{ FindAllArgs(); return myArgs.Length(); }
const int _pyCommand::GetNbResultValues ( )

Return number of python command result value ResultValue = Obj.Meth()

Return values:
constint

Definition at line 2048 of file SMESH_2smeshpy.cxx.

References GetWord(), Length(), and myString.

Referenced by _pyGen.Process().

{
  int begPos = 1;
  int Nb=0;
  int endPos = myString.Location( "=", 1, Length() );
  TCollection_AsciiString str = "";
  while ( begPos < endPos) {
    str = GetWord( myString, begPos, true );
    begPos = begPos+ str.Length();
    Nb++;
  }
  return (Nb-1);
}
const TCollection_AsciiString & _pyCommand::GetObject ( )

Return substring of python command looking like ResVal = Object.Meth()

Return values:
constTCollection_AsciiString & - Object substring

Definition at line 2096 of file SMESH_2smeshpy.cxx.

References GetBegPos(), GetWord(), Length(), myObj, myRes, myString, OBJECT_IND, RESULT_IND, SetBegPos(), and UNKNOWN.

Referenced by _pyMeshEditor._pyMeshEditor(), AddAccessorMethod(), _pyMesh.AddMeshAccess(), and SetObject().

{
  if ( GetBegPos( OBJECT_IND ) == UNKNOWN )
  {
    // beginning
    int begPos = GetBegPos( RESULT_IND ) + myRes.Length();
    if ( begPos < 1 ) {
      begPos = myString.Location( "=", 1, Length() ) + 1;
      // is '=' in the string argument (for example, name) or not
      int nb1 = 0; // number of ' character at the left of =
      int nb2 = 0; // number of " character at the left of =
      for ( int i = 1; i < begPos-1; i++ ) {
        if ( myString.Value( i )=='\'' )
          nb1 += 1;
        else if ( myString.Value( i )=='"' )
          nb2 += 1;
      }
      // if number of ' or " is not divisible by 2,
      // then get an object at the start of the command
      if ( nb1 % 2 != 0 || nb2 % 2 != 0 )
        begPos = 1;
    }
    myObj = GetWord( myString, begPos, true );
    // check if object is complex,
    // so far consider case like "smesh.smesh.Method()"
    if ( int bracketPos = myString.Location( "(", begPos, Length() )) {
      //if ( bracketPos==0 ) bracketPos = Length();
      int dotPos = begPos+myObj.Length();
      while ( dotPos+1 < bracketPos ) {
        if ( int pos = myString.Location( ".", dotPos+1, bracketPos ))
          dotPos = pos;
        else
          break;
      }
      if ( dotPos > begPos+myObj.Length() )
        myObj = myString.SubString( begPos, dotPos-1 );
    }
    // store
    SetBegPos( OBJECT_IND, begPos );
  }
  //SCRUTE(myObj);
  return myObj;
}
int _pyCommand.GetOrderNb ( ) const

Definition at line 114 of file SMESH_2smeshpy.hxx.

References myOrderNb.

Referenced by _pyGen.ExchangeCommands(), and SetDependentCmdsAfter().

{ return myOrderNb; }
const TCollection_AsciiString & _pyCommand::GetResultValue ( )

Return substring of python command looking like ResultValue = Obj.Meth()

Return values:
constTCollection_AsciiString & - ResultValue substring

Definition at line 2027 of file SMESH_2smeshpy.cxx.

References EMPTY, GetBegPos(), GetWord(), Length(), myRes, myString, RESULT_IND, SetBegPos(), and UNKNOWN.

Referenced by _pyMesh.Process(), _pyGen.Process(), and SetResultValue().

{
  if ( GetBegPos( RESULT_IND ) == UNKNOWN )
  {
    int begPos = myString.Location( "=", 1, Length() );
    if ( begPos )
      myRes = GetWord( myString, begPos, false );
    else
      begPos = EMPTY;
    SetBegPos( RESULT_IND, begPos );
  }
  return myRes;
}
const TCollection_AsciiString & _pyCommand::GetResultValue ( int  res)

Return substring of python command looking like ResultValue1 , ResultValue1,...

= Obj.Meth() with res index

Return values:
constTCollection_AsciiString & - ResultValue with res index substring

Definition at line 2070 of file SMESH_2smeshpy.cxx.

References GetWord(), Length(), myRes, myString, and theEmptyString.

{
  int begPos = 1;
  int Nb=0;
  int endPos = myString.Location( "=", 1, Length() );
  while ( begPos < endPos) {
    myRes = GetWord( myString, begPos, true );
    begPos = begPos + myRes.Length();
    Nb++;
    if(res == Nb){
      myRes.RemoveAll('[');myRes.RemoveAll(']');
      return myRes;
    }
    if(Nb>res)
      break;
  }
  return theEmptyString;
}
TCollection_AsciiString& _pyCommand.GetString ( )

Definition at line 113 of file SMESH_2smeshpy.hxx.

References myString.

Referenced by _pyMeshEditor._pyMeshEditor(), Handle(), and _pyMesh.Process().

{ return myString; }
TCollection_AsciiString _pyCommand::GetWord ( const TCollection_AsciiString &  theString,
int theStartPos,
const bool  theForward,
const bool  dotIsWord = false 
) [static]

Looks for a word in the string and returns word's beginning.

Parameters:
theString- The input string
theStartPos- The position to start the search, returning word's beginning
theForward- The search direction
Return values:
TCollection_AsciiString- The found word

Definition at line 2234 of file SMESH_2smeshpy.cxx.

References EMPTY, isWord(), and theEmptyString.

Referenced by GetArg(), GetIndentation(), GetMethod(), GetNbResultValues(), GetObject(), and GetResultValue().

{
  int beg = theStartPos, end = theStartPos;
  theStartPos = EMPTY;
  if ( beg < 1 || beg > theString.Length() )
    return theEmptyString;

  if ( theForward ) { // search forward
    // beg
    while ( beg <= theString.Length() && !isWord( theString.Value( beg ), dotIsWord))
      ++beg;
    if ( beg > theString.Length() )
      return theEmptyString; // no word found
    // end
    end = beg + 1;
    char begChar = theString.Value( beg );
    if ( begChar == '"' || begChar == '\'' || begChar == '[') {
      char endChar = ( begChar == '[' ) ? ']' : begChar;
      // end is at the corresponding quoting mark or bracket
      while ( end < theString.Length() &&
              ( theString.Value( end ) != endChar || theString.Value( end-1 ) == '\\'))
        ++end;
    }
    else {
      while ( end <= theString.Length() && isWord( theString.Value( end ), dotIsWord))
        ++end;
      --end;
    }
  }
  else {  // search backward
    // end
    while ( end > 0 && !isWord( theString.Value( end ), dotIsWord))
      --end;
    if ( end == 0 )
      return theEmptyString; // no word found
    beg = end - 1;
    char endChar = theString.Value( end );
    if ( endChar == '"' || endChar == '\'' ) {
      // beg is at the corresponding quoting mark
      while ( beg > 1 &&
              ( theString.Value( beg ) != endChar || theString.Value( beg-1 ) == '\\'))
        --beg;
    }
    else {
      while ( beg > 0 && isWord( theString.Value( beg ), dotIsWord))
        --beg;
      ++beg;
    }
  }
  theStartPos = beg;
  //cout << theString << " ---- " << beg << " - " << end << endl;
  return theString.SubString( beg, end );
}
bool _pyCommand.IsEmpty ( ) const

Definition at line 118 of file SMESH_2smeshpy.hxx.

References myString.

Referenced by GetBegPos().

{ return myString.IsEmpty(); }
int _pyCommand.Length ( )

Definition at line 116 of file SMESH_2smeshpy.hxx.

References myString.

Referenced by AddAccessorMethod(), GetArg(), GetMethod(), GetNbResultValues(), GetObject(), GetResultValue(), SetArg(), and SetPart().

{ return myString.Length(); }
void _pyCommand::RemoveArgs ( )

Empty arg list.

Definition at line 2402 of file SMESH_2smeshpy.cxx.

References ARG1_IND, myArgs, myBegPos, and myString.

Referenced by _pyHypothesis.Addition2Creation(), _pyMesh.Process(), and _pyGen.Process().

{
  if ( int pos = myString.Location( '(', 1, Length() ))
    myString.Trunc( pos );
  myString += ")";
  myArgs.Clear();
  if ( myBegPos.Length() >= ARG1_IND )
    myBegPos.Remove( ARG1_IND, myBegPos.Length() );
}
void _pyCommand::SetArg ( int  index,
const TCollection_AsciiString &  theArg 
)

Set agrument.

Parameters:
index- The argument index, it counts from 1
theArg- The argument string

Definition at line 2361 of file SMESH_2smeshpy.cxx.

References ARG1_IND, FindAllArgs(), GetArg(), GetBegPos(), GetNbArgs(), Length(), myArgs, myString, SetBegPos(), and SetPart().

Referenced by _pySegmentLengthAroundVertexHyp.Addition2Creation(), _pyHypothesis.Addition2Creation(), Handle(), _pyMeshEditor.Process(), _pyMesh.Process(), _pyGen.Process(), and SetVariable().

{
  FindAllArgs();
  int argInd = ARG1_IND + index - 1;
  int pos = GetBegPos( argInd );
  if ( pos < 1 ) // no index-th arg exist, append inexistent args
  {
    // find a closing parenthesis
    if ( GetNbArgs() != 0 && index <= GetNbArgs() ) {
      int lastArgInd = GetNbArgs();
      pos = GetBegPos( ARG1_IND + lastArgInd  - 1 ) + GetArg( lastArgInd ).Length();
      while ( pos > 0 && pos <= Length() && myString.Value( pos ) != ')' )
        ++pos;
    }
    else {
      pos = Length();
      while ( pos > 0 && myString.Value( pos ) != ')' )
        --pos;
    }
    if ( pos < 1 || myString.Value( pos ) != ')' ) { // no parentheses at all
      myString += "()";
      pos = Length();
    }
    while ( myArgs.Length() < index ) {
      if ( myArgs.Length() )
        myString.Insert( pos++, "," );
      myArgs.Append("None");
      myString.Insert( pos, myArgs.Last() );
      SetBegPos( ARG1_IND + myArgs.Length() - 1, pos );
      pos += myArgs.Last().Length();
    }
  }
  SetPart( argInd, theArg, myArgs( index ));
}
void _pyCommand::SetBegPos ( int  thePartIndex,
int  thePosition 
) [private]

Store starting position of a part of python command.

Parameters:
thePartIndex- The index of command part
thePosition- Part position

Definition at line 1996 of file SMESH_2smeshpy.cxx.

References myBegPos, and UNKNOWN.

Referenced by GetArg(), GetMethod(), GetObject(), GetResultValue(), and SetArg().

{
  while ( myBegPos.Length() < thePartIndex )
    myBegPos.Append( UNKNOWN );
  myBegPos( thePartIndex ) = thePosition;
}
bool _pyCommand::SetDependentCmdsAfter ( ) const

Set dependent commands after this one.

Definition at line 2418 of file SMESH_2smeshpy.cxx.

References GetOrderNb(), myDependentCmds, and _pyGen.SetCommandAfter().

{
  bool orderChanged = false;
  list< Handle(_pyCommand)>::const_reverse_iterator cmd = myDependentCmds.rbegin();
  for ( ; cmd != myDependentCmds.rend(); ++cmd ) {
    if ( (*cmd)->GetOrderNb() < GetOrderNb() ) {
      orderChanged = true;
      theGen->SetCommandAfter( *cmd, this );
      (*cmd)->SetDependentCmdsAfter();
    }
  }
  return orderChanged;
}
void _pyCommand.SetMethod ( const TCollection_AsciiString &  theMethod)
void _pyCommand.SetObject ( const TCollection_AsciiString &  theObject)
void _pyCommand.SetOrderNb ( int  theNb)

Definition at line 115 of file SMESH_2smeshpy.hxx.

References myOrderNb.

Referenced by _pyGen.ExchangeCommands().

{ myOrderNb = theNb; }
void _pyCommand::SetPart ( int  thePartIndex,
const TCollection_AsciiString &  thePart,
TCollection_AsciiString &  theOldPart 
) [private]

Modify a part of the command.

Parameters:
thePartIndex- The index of the part
thePart- The new part string
theOldPart- The old part

Definition at line 2322 of file SMESH_2smeshpy.cxx.

References GetBegPos(), Length(), METHOD_IND, myBegPos, myString, OBJECT_IND, and RESULT_IND.

Referenced by SetArg(), SetMethod(), SetObject(), and SetResultValue().

{
  int pos = GetBegPos( thePartIndex );
  if ( pos <= Length() && theOldPart != thePart)
  {
    TCollection_AsciiString seperator;
    if ( pos < 1 ) {
      pos = GetBegPos( thePartIndex + 1 );
      if ( pos < 1 ) return;
      switch ( thePartIndex ) {
      case RESULT_IND: seperator = " = "; break;
      case OBJECT_IND: seperator = "."; break;
      case METHOD_IND: seperator = "()"; break;
      default:;
      }
    }      
    myString.Remove( pos, theOldPart.Length() );
    if ( !seperator.IsEmpty() )
      myString.Insert( pos , seperator );
    myString.Insert( pos, thePart );
    // update starting positions of the following parts
    int posDelta = thePart.Length() + seperator.Length() - theOldPart.Length();
    for ( int i = thePartIndex + 1; i <= myBegPos.Length(); ++i ) {
      if ( myBegPos( i ) > 0 )
        myBegPos( i ) += posDelta;
    }
    theOldPart = thePart;
  }
}
void _pyCommand.SetResultValue ( const TCollection_AsciiString &  theResult)

Definition at line 128 of file SMESH_2smeshpy.hxx.

References GetResultValue(), myRes, RESULT_IND, and SetPart().

Referenced by _pyHypothesis.Addition2Creation().

  { GetResultValue(); SetPart( RESULT_IND, theResult, myRes ); }
bool _pyCommand::SkipSpaces ( const TCollection_AsciiString &  theString,
int thePos 
) [static]

Look for position where not space char is.

Parameters:
theString- The string
thePos- The position to search from and which returns result
Return values:
bool- false if there are only space after thePos in theString

Definition at line 2302 of file SMESH_2smeshpy.cxx.

{
  if ( thePos < 1 || thePos > theString.Length() )
    return false;

  while ( thePos <= theString.Length() && isspace( theString.Value( thePos )))
    ++thePos;

  return thePos <= theString.Length();
}

Field Documentation

TColStd_SequenceOfAsciiString _pyCommand.myArgs [private]

found arguments

Definition at line 98 of file SMESH_2smeshpy.hxx.

Referenced by Clear(), GetArg(), GetNbArgs(), RemoveArgs(), and SetArg().

TColStd_SequenceOfInteger _pyCommand.myBegPos [private]

where myRes, myObj, ...

begin

Definition at line 99 of file SMESH_2smeshpy.hxx.

Referenced by AddAccessorMethod(), Clear(), GetBegPos(), RemoveArgs(), SetBegPos(), and SetPart().

std::list< Handle(_pyCommand) > _pyCommand.myDependentCmds [private]

commands that sould follow me in the script

Definition at line 100 of file SMESH_2smeshpy.hxx.

Referenced by AddDependantCmd(), and SetDependentCmdsAfter().

TCollection_AsciiString _pyCommand.myMeth [private]

found parts of command

Definition at line 97 of file SMESH_2smeshpy.hxx.

Referenced by GetArg(), GetMethod(), and SetMethod().

TCollection_AsciiString _pyCommand.myObj [private]

Definition at line 97 of file SMESH_2smeshpy.hxx.

Referenced by GetMethod(), GetObject(), and SetObject().

position within the script

Definition at line 95 of file SMESH_2smeshpy.hxx.

Referenced by GetOrderNb(), and SetOrderNb().

TCollection_AsciiString _pyCommand.myRes [private]

Definition at line 97 of file SMESH_2smeshpy.hxx.

Referenced by GetObject(), GetResultValue(), and SetResultValue().

TCollection_AsciiString _pyCommand.myString [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS