Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Sketcher_Profile Class Reference

#include <Sketcher_Profile.hxx>

Classes

class  DumpFunctor
 
class  Functor
 Generic functor class to process sketcher command. More...
 
class  ShapeFunctor
 Functor that creates a shape from sketcher command. More...
 

Public Member Functions

 Sketcher_Profile ()
 Default constructor. More...
 
 Sketcher_Profile (const char *)
 Constructor. More...
 
void SetCommand (const char *)
 Set sketcher script to parse. More...
 
TopoDS_Shape GetShape (bool *=0, double *=0)
 Parse sketcher command and get resulting shape. More...
 
TCollection_AsciiString GetDump (bool *=0)
 Parse sketcher command and get resulting Python script. More...
 

Private Member Functions

void parse (const TCollection_AsciiString &, Functor *)
 Parse sketcher script using specified functor. More...
 
void badArgs ()
 Print an error message if the number of arguments of sketcher operator is wrong. More...
 
void findNextCommand (const TColStd_Array1OfAsciiString &, TColStd_Array1OfAsciiString &, int, int &)
 Find the next sketcher operator in the input string. More...
 
TCollection_AsciiString extractCommand (const TCollection_AsciiString &)
 Extract sketcher command from script. More...
 

Private Attributes

TCollection_AsciiString myCommand
 

Constructor & Destructor Documentation

Sketcher_Profile::Sketcher_Profile ( )
Sketcher_Profile::Sketcher_Profile ( const char *  command)
Parameters
commandsketcher script to parse

References SetCommand().

Member Function Documentation

void Sketcher_Profile::badArgs ( )
private
TCollection_AsciiString Sketcher_Profile::extractCommand ( const TCollection_AsciiString &  cmd)
private
Parameters
cmdsketcher script to parse
Returns
sketcher command
void Sketcher_Profile::findNextCommand ( const TColStd_Array1OfAsciiString &  aTab,
TColStd_Array1OfAsciiString &  a,
int  CurrentIndex,
int &  NumberOfArg 
)
private
Parameters
aTaball sketcher command data
asketcher operator with parameters is returned via this parameter
CurrentIndexcurrent operator index
NumberOfArgnumber of operator arguments is returned via this parameter
TCollection_AsciiString Sketcher_Profile::GetDump ( bool *  isDone = 0)
Parameters
isDoneif specified (non-zero), result of parsing is returned via this parameter
Returns
string representing Python dump resulting from parsing of sketcher command

References Sketcher_Profile::DumpFunctor::getDescription(), Sketcher_Profile::Functor::isOk(), myCommand, and parse().

TopoDS_Shape Sketcher_Profile::GetShape ( bool *  isDone = 0,
double *  error = 0 
)
Parameters
isDoneif specified (non-zero), result of parsing is returned via this parameter
errorif specified (non-zero), numerical error is returned via this parameter
Returns
shape resulting from parsing of sketcher command

References Sketcher_Profile::Functor::error(), Sketcher_Profile::ShapeFunctor::getShape(), Sketcher_Profile::Functor::isOk(), myCommand, and parse().

void Sketcher_Profile::parse ( const TCollection_AsciiString &  cmd,
Functor functor 
)
private
Parameters
cmdsketcher script to parse

References Sketcher_Profile::Functor::addAngle(), Sketcher_Profile::Functor::addArcAbsolute(), Sketcher_Profile::Functor::addArcAngleRadiusLength(), Sketcher_Profile::Functor::addArcCenterAbsolute(), Sketcher_Profile::Functor::addArcCenterRelative(), Sketcher_Profile::Functor::addArcDirectionRadiusLength(), Sketcher_Profile::Functor::addArcRadiusAbsolute(), Sketcher_Profile::Functor::addArcRadiusLength(), Sketcher_Profile::Functor::addArcRadiusRelative(), Sketcher_Profile::Functor::addArcRelative(), Sketcher_Profile::Functor::addPoint(), Sketcher_Profile::Functor::addSegmentAbsolute(), Sketcher_Profile::Functor::addSegmentAngleLength(), Sketcher_Profile::Functor::addSegmentAngleX(), Sketcher_Profile::Functor::addSegmentAngleY(), Sketcher_Profile::Functor::addSegmentDirectionLength(), Sketcher_Profile::Functor::addSegmentDirectionX(), Sketcher_Profile::Functor::addSegmentDirectionY(), Sketcher_Profile::Functor::addSegmentLength(), Sketcher_Profile::Functor::addSegmentParalX(), Sketcher_Profile::Functor::addSegmentParalXToZero(), Sketcher_Profile::Functor::addSegmentParalY(), Sketcher_Profile::Functor::addSegmentParalYToZero(), Sketcher_Profile::Functor::addSegmentRelative(), Sketcher_Profile::Functor::addSegmentX(), Sketcher_Profile::Functor::addSegmentY(), badArgs(), Sketcher_Profile::Functor::closeWire(), Sketcher_Profile::Functor::closeWireAndBuildFace(), extractCommand(), findNextCommand(), Sketcher_Profile::Functor::init(), Sketcher_Profile::Functor::initCommand(), Sketcher_Profile::Functor::makeResult(), myCommand, Sketcher_Profile::Functor::nextCommand(), and Sketcher_Profile::Functor::setNumberOfCommand().

void Sketcher_Profile::SetCommand ( const char *  command)
Parameters
commandsketcher script to parse

References myCommand.

Member Data Documentation

TCollection_AsciiString Sketcher_Profile::myCommand
private

The documentation for this class was generated from the following files: