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

Functor that creates a shape from sketcher command. More...

Inheritance diagram for Sketcher_Profile::ShapeFunctor:
Inheritance graph

Public Member Functions

 ShapeFunctor ()
 Constructor. More...
 
virtual void initCommand ()
 Prepare functor for processing of new sketcher operator. More...
 
virtual void addPoint (const TCollection_AsciiString &x, const TCollection_AsciiString &y)
 Add point with absolute coordinates (x, y) More...
 
virtual void addAngle (const TCollection_AsciiString &angle)
 Add angle. More...
 
virtual void addSegmentParalX (const TCollection_AsciiString &x)
 Add new segment of x length along X axis. More...
 
virtual void addSegmentParalXToZero ()
 Add new segment along X axis with X coordinate of end set to 0. More...
 
virtual void addSegmentParalY (const TCollection_AsciiString &y)
 Add new segment of y length along Y axis. More...
 
virtual void addSegmentParalYToZero ()
 Add new segment along Y axis with Y coordinate of end set to 0. More...
 
virtual void setAngle (const TCollection_AsciiString &angle)
 Set current angle. More...
 
virtual void setDirection (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy)
 Set current direction. More...
 
virtual void addSegmentAbsolute (const TCollection_AsciiString &x, const TCollection_AsciiString &y)
 Add segment by absolute coordinates. More...
 
virtual void addSegmentRelative (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy)
 Add segment by relativ coordinates. More...
 
virtual void addSegmentLength (const TCollection_AsciiString &length)
 Add segment with specified length along current direction. More...
 
virtual void addSegmentX (const TCollection_AsciiString &x, int CurrentIndex)
 Add segment along X axis to reach specified X coordinate. More...
 
virtual void addSegmentY (const TCollection_AsciiString &y, int CurrentIndex)
 Add segment along Y axis to reach specified Y coordinate. More...
 
virtual void addSegmentAngleLength (const TCollection_AsciiString &angle, const TCollection_AsciiString &length, int &CurrentIndex)
 Add segment by specified angle and length. More...
 
virtual void addSegmentAngleX (const TCollection_AsciiString &angle, const TCollection_AsciiString &x, int &CurrentIndex)
 Add segment that crosses Y axis by specified angle and X coordinate. More...
 
virtual void addSegmentAngleY (const TCollection_AsciiString &angle, const TCollection_AsciiString &y, int &CurrentIndex)
 Add segment that crosses X axis by specified angle and Y coordinate. More...
 
virtual void addSegmentDirectionLength (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &length, int &CurrentIndex)
 Add segment by specified direction and length. More...
 
virtual void addSegmentDirectionX (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &x, int &CurrentIndex)
 Add segment by specified direction and X coordinate. More...
 
virtual void addSegmentDirectionY (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &y, int &CurrentIndex)
 Add segment by specified direction and Y coordinate. More...
 
virtual void addArcAbsolute (const TCollection_AsciiString &x, const TCollection_AsciiString &y)
 Add arc along current direction vector by specified absolute coordinates. More...
 
virtual void addArcRelative (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy)
 Add arc along current direction vector by specified relative coordinates. More...
 
virtual void addArcRadiusAbsolute (const TCollection_AsciiString &x, const TCollection_AsciiString &y, const TCollection_AsciiString &radius, const TCollection_AsciiString &flag)
 Add arc with given radius by specified absolute coordinates. More...
 
virtual void addArcRadiusRelative (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &radius, const TCollection_AsciiString &flag)
 Add arc with given radius by specified relative coordinates. More...
 
virtual void addArcCenterAbsolute (const TCollection_AsciiString &x, const TCollection_AsciiString &y, const TCollection_AsciiString &xc, const TCollection_AsciiString &yc, const TCollection_AsciiString &flag1, const TCollection_AsciiString &flag2)
 Add arc with given center by specified absolute coordinates. More...
 
virtual void addArcCenterRelative (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &xc, const TCollection_AsciiString &yc, const TCollection_AsciiString &flag1, const TCollection_AsciiString &flag2)
 Add arc with given center by specified relative coordinates. More...
 
virtual void addArcRadiusLength (const TCollection_AsciiString &radius, const TCollection_AsciiString &length)
 Add arc with given radius by specified length. More...
 
virtual void addArcAngleRadiusLength (const TCollection_AsciiString &angle, const TCollection_AsciiString &radius, const TCollection_AsciiString &length, int &CurrentIndex)
 Add arc with given radius by specified angle and length. More...
 
virtual void addArcDirectionRadiusLength (const TCollection_AsciiString &dx, const TCollection_AsciiString &dy, const TCollection_AsciiString &radius, const TCollection_AsciiString &length, int &CurrentIndex)
 Add arc with given radius by specified direction and length. More...
 
virtual void closeWire ()
 Close wire. More...
 
virtual void closeWireAndBuildFace ()
 Close wire and build face. More...
 
virtual void nextCommand (int &CurrentIndex)
 Complete parsing of current operator. More...
 
virtual void makeResult ()
 Finish parsing and create result. More...
 
TopoDS_Shape getShape ()
 Get resulting shape. More...
 
- Public Member Functions inherited from Sketcher_Profile::Functor
 Functor ()
 Constructor. More...
 
virtual ~Functor ()
 Destructor. More...
 
virtual void init (const TCollection_AsciiString &)
 Initialize functor from the script. More...
 
void setNumberOfCommand (int n)
 Set total number of sketcher operators. More...
 
double error ()
 Get error (numerical value that describes, e.g. a deviation of point from the specified arc) More...
 
bool isOk ()
 Get result of parsing. More...
 

Private Types

enum  { line, circle, point, none }
 

Private Member Functions

void setMove (int &CurrentIndex)
 Set internal parameters according to the current operator type. More...
 

Private Attributes

Standard_Real myX0
 
Standard_Real myY0
 
Standard_Real myX
 
Standard_Real myY
 
Standard_Real myDx
 
Standard_Real myDy
 
Standard_Boolean myFirst
 
Standard_Boolean myStayFirst
 
Standard_Boolean myFace
 
Standard_Boolean myClose
 
Standard_Real myLength
 
Standard_Real myRadius
 
Standard_Real myAngle
 
enum
Sketcher_Profile::ShapeFunctor:: { ... }  
myMove
 
TopLoc_Location TheLocation
 
gp_Pln myPlane
 
TopoDS_Vertex myVertex
 
BRepBuilderAPI_MakeWire myMakeWire
 
TopoDS_Shape myShape
 

Additional Inherited Members

- Protected Attributes inherited from Sketcher_Profile::Functor
int myNumberOfCommand
 
double myError
 
bool myOk
 

Detailed Description

Functor that generates a Python script from sketcher command.

Member Enumeration Documentation

anonymous enum
private
Enumerator
line 
circle 
point 
none 

Constructor & Destructor Documentation

Sketcher_Profile::ShapeFunctor::ShapeFunctor ( )

Member Function Documentation

void Sketcher_Profile::ShapeFunctor::addAngle ( const TCollection_AsciiString &  angle)
virtual
Parameters
angleangle

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcAbsolute ( const TCollection_AsciiString &  x,
const TCollection_AsciiString &  y 
)
virtual
Parameters
xX coordinate of arc end
xY coordinate of arc end

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcAngleRadiusLength ( const TCollection_AsciiString &  angle,
const TCollection_AsciiString &  radius,
const TCollection_AsciiString &  length,
int &  CurrentIndex 
)
virtual
Parameters
angleangle between arc start tangent and current direction
radiusarc radius
lengtharc length
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcCenterAbsolute ( const TCollection_AsciiString &  x,
const TCollection_AsciiString &  y,
const TCollection_AsciiString &  xc,
const TCollection_AsciiString &  yc,
const TCollection_AsciiString &  flag1,
const TCollection_AsciiString &  flag2 
)
virtual
Parameters
xX coordinate of arc end
xY coordinate of arc end
xcX coordinate of arc center
ycY coordinate of arc center
flag1reverse direction flag
flag2tolerance

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcCenterRelative ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  xc,
const TCollection_AsciiString &  yc,
const TCollection_AsciiString &  flag1,
const TCollection_AsciiString &  flag2 
)
virtual
Parameters
dxdX value specifing arc end
dydY value specifing arc end
xcX coordinate of arc center
ycY coordinate of arc center
flag1reverse direction flag
flag2tolerance

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcDirectionRadiusLength ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  radius,
const TCollection_AsciiString &  length,
int &  CurrentIndex 
)
virtual
Parameters
dxX component of direction vector
dxY component of direction vector
radiusarc radius
lengtharc length
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcRadiusAbsolute ( const TCollection_AsciiString &  x,
const TCollection_AsciiString &  y,
const TCollection_AsciiString &  radius,
const TCollection_AsciiString &  flag 
)
virtual
Parameters
xX coordinate of arc end
xY coordinate of arc end
radiusarc radius
flagreverse direction flag

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcRadiusLength ( const TCollection_AsciiString &  radius,
const TCollection_AsciiString &  length 
)
virtual
Parameters
radiusarc radius
lengtharc length

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcRadiusRelative ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  radius,
const TCollection_AsciiString &  flag 
)
virtual
Parameters
dxdX value specifing arc end
dydY value specifing arc end
radiusarc radius
flagreverse direction flag

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addArcRelative ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy 
)
virtual
Parameters
dxdX value specifing arc end
dydY value specifing arc end

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addPoint ( const TCollection_AsciiString &  x,
const TCollection_AsciiString &  y 
)
virtual
Parameters
xX coordinate
yY coordinate

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentAbsolute ( const TCollection_AsciiString &  x,
const TCollection_AsciiString &  y 
)
virtual
Parameters
xX coordinate of segment end
yY coordinate of segment end

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentAngleLength ( const TCollection_AsciiString &  angle,
const TCollection_AsciiString &  length,
int &  CurrentIndex 
)
virtual
Parameters
angleangle that specifies segment direction
lengthsegment length
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentAngleX ( const TCollection_AsciiString &  angle,
const TCollection_AsciiString &  x,
int &  CurrentIndex 
)
virtual
Parameters
angleangle that specifies segment direction
xX coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentAngleY ( const TCollection_AsciiString &  angle,
const TCollection_AsciiString &  y,
int &  CurrentIndex 
)
virtual
Parameters
angleangle that specifies segment direction
yY coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentDirectionLength ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  length,
int &  CurrentIndex 
)
virtual
Parameters
dxX component of direction vector
dxY component of direction vector
lengthsegment length
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentDirectionX ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  x,
int &  CurrentIndex 
)
virtual
Parameters
dxX component of direction vector
dxY component of direction vector
xX coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentDirectionY ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy,
const TCollection_AsciiString &  y,
int &  CurrentIndex 
)
virtual
Parameters
dxX component of direction vector
dxY component of direction vector
yY coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentLength ( const TCollection_AsciiString &  length)
virtual
Parameters
lengthsegment length

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentParalX ( const TCollection_AsciiString &  x)
virtual
Parameters
xlength of segment

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentParalXToZero ( )
virtual
void Sketcher_Profile::ShapeFunctor::addSegmentParalY ( const TCollection_AsciiString &  y)
virtual
Parameters
ylength of segment

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentParalYToZero ( )
virtual
void Sketcher_Profile::ShapeFunctor::addSegmentRelative ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy 
)
virtual
Parameters
dxdX value specifing segment end
dydY value specifing segment end

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentX ( const TCollection_AsciiString &  x,
int  CurrentIndex 
)
virtual
Parameters
xX coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::addSegmentY ( const TCollection_AsciiString &  y,
int  CurrentIndex 
)
virtual
Parameters
yY coordinate of segment end
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::closeWire ( )
virtual
void Sketcher_Profile::ShapeFunctor::closeWireAndBuildFace ( )
virtual
TopoDS_Shape Sketcher_Profile::ShapeFunctor::getShape ( )
Returns
shape resulting from parsing of sketcher command
void Sketcher_Profile::ShapeFunctor::initCommand ( )
virtual
void Sketcher_Profile::ShapeFunctor::makeResult ( )
virtual
void Sketcher_Profile::ShapeFunctor::nextCommand ( int &  CurrentIndex)
virtual
Parameters
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

void Sketcher_Profile::ShapeFunctor::setAngle ( const TCollection_AsciiString &  angle)
virtual
Parameters
anglecurrent working angle
void Sketcher_Profile::ShapeFunctor::setDirection ( const TCollection_AsciiString &  dx,
const TCollection_AsciiString &  dy 
)
virtual
Parameters
dxX component of direction vector
dyY component of direction vector
void Sketcher_Profile::ShapeFunctor::setMove ( int &  CurrentIndex)
private
Parameters
CurrentIndexindex of current operator

References Handle().

Member Data Documentation

Standard_Real Sketcher_Profile::ShapeFunctor::myAngle
private
Standard_Boolean Sketcher_Profile::ShapeFunctor::myClose
private
Standard_Real Sketcher_Profile::ShapeFunctor::myDx
private
Standard_Real Sketcher_Profile::ShapeFunctor::myDy
private
Standard_Boolean Sketcher_Profile::ShapeFunctor::myFace
private
Standard_Boolean Sketcher_Profile::ShapeFunctor::myFirst
private
Standard_Real Sketcher_Profile::ShapeFunctor::myLength
private
BRepBuilderAPI_MakeWire Sketcher_Profile::ShapeFunctor::myMakeWire
private
enum { ... } Sketcher_Profile::ShapeFunctor::myMove
gp_Pln Sketcher_Profile::ShapeFunctor::myPlane
private
Standard_Real Sketcher_Profile::ShapeFunctor::myRadius
private
TopoDS_Shape Sketcher_Profile::ShapeFunctor::myShape
private
Standard_Boolean Sketcher_Profile::ShapeFunctor::myStayFirst
private
TopoDS_Vertex Sketcher_Profile::ShapeFunctor::myVertex
private
Standard_Real Sketcher_Profile::ShapeFunctor::myX
private
Standard_Real Sketcher_Profile::ShapeFunctor::myX0
private
Standard_Real Sketcher_Profile::ShapeFunctor::myY
private
Standard_Real Sketcher_Profile::ShapeFunctor::myY0
private
TopLoc_Location Sketcher_Profile::ShapeFunctor::TheLocation
private

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