Version: 9.12.0
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

anonymous enum
private
Enumerator
line 
circle 
point 
none 

Constructor & Destructor Documentation

◆ ShapeFunctor()

Sketcher_Profile::ShapeFunctor::ShapeFunctor ( )

Member Function Documentation

◆ addAngle()

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

Implements Sketcher_Profile::Functor.

◆ addArcAbsolute()

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.

◆ addArcAngleRadiusLength()

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.

◆ addArcCenterAbsolute()

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.

◆ addArcCenterRelative()

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 specifying arc end
dydY value specifying arc end
xcX coordinate of arc center
ycY coordinate of arc center
flag1reverse direction flag
flag2tolerance

Implements Sketcher_Profile::Functor.

◆ addArcDirectionRadiusLength()

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.

◆ addArcRadiusAbsolute()

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.

◆ addArcRadiusLength()

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

Implements Sketcher_Profile::Functor.

◆ addArcRadiusRelative()

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 specifying arc end
dydY value specifying arc end
radiusarc radius
flagreverse direction flag

Implements Sketcher_Profile::Functor.

◆ addArcRelative()

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

Implements Sketcher_Profile::Functor.

◆ addPoint()

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

Implements Sketcher_Profile::Functor.

◆ addSegmentAbsolute()

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.

◆ addSegmentAngleLength()

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.

◆ addSegmentAngleX()

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.

◆ addSegmentAngleY()

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.

◆ addSegmentDirectionLength()

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.

◆ addSegmentDirectionX()

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.

◆ addSegmentDirectionY()

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.

◆ addSegmentLength()

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

Implements Sketcher_Profile::Functor.

◆ addSegmentParalX()

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

Implements Sketcher_Profile::Functor.

◆ addSegmentParalXToZero()

void Sketcher_Profile::ShapeFunctor::addSegmentParalXToZero ( )
virtual

◆ addSegmentParalY()

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

Implements Sketcher_Profile::Functor.

◆ addSegmentParalYToZero()

void Sketcher_Profile::ShapeFunctor::addSegmentParalYToZero ( )
virtual

◆ addSegmentRelative()

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

Implements Sketcher_Profile::Functor.

◆ addSegmentX()

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.

◆ addSegmentY()

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.

◆ closeWire()

void Sketcher_Profile::ShapeFunctor::closeWire ( )
virtual

◆ closeWireAndBuildFace()

void Sketcher_Profile::ShapeFunctor::closeWireAndBuildFace ( )
virtual

◆ getShape()

TopoDS_Shape Sketcher_Profile::ShapeFunctor::getShape ( )
Returns
shape resulting from parsing of sketcher command

◆ initCommand()

void Sketcher_Profile::ShapeFunctor::initCommand ( )
virtual

◆ makeResult()

void Sketcher_Profile::ShapeFunctor::makeResult ( )
virtual

◆ nextCommand()

void Sketcher_Profile::ShapeFunctor::nextCommand ( int &  CurrentIndex)
virtual
Parameters
CurrentIndexindex of current operator

Implements Sketcher_Profile::Functor.

◆ setAngle()

void Sketcher_Profile::ShapeFunctor::setAngle ( const TCollection_AsciiString &  angle)
virtual
Parameters
anglecurrent working angle

◆ setDirection()

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

◆ setMove()

void Sketcher_Profile::ShapeFunctor::setMove ( int &  CurrentIndex)
private
Parameters
CurrentIndexindex of current operator

References Handle().

Member Data Documentation

◆ myAngle

Standard_Real Sketcher_Profile::ShapeFunctor::myAngle
private

◆ myClose

Standard_Boolean Sketcher_Profile::ShapeFunctor::myClose
private

◆ myDx

Standard_Real Sketcher_Profile::ShapeFunctor::myDx
private

◆ myDy

Standard_Real Sketcher_Profile::ShapeFunctor::myDy
private

◆ myFace

Standard_Boolean Sketcher_Profile::ShapeFunctor::myFace
private

◆ myFirst

Standard_Boolean Sketcher_Profile::ShapeFunctor::myFirst
private

◆ myLength

Standard_Real Sketcher_Profile::ShapeFunctor::myLength
private

◆ myMakeWire

BRepBuilderAPI_MakeWire Sketcher_Profile::ShapeFunctor::myMakeWire
private

◆ 

enum { ... } Sketcher_Profile::ShapeFunctor::myMove

◆ myPlane

gp_Pln Sketcher_Profile::ShapeFunctor::myPlane
private

◆ myRadius

Standard_Real Sketcher_Profile::ShapeFunctor::myRadius
private

◆ myShape

TopoDS_Shape Sketcher_Profile::ShapeFunctor::myShape
private

◆ myStayFirst

Standard_Boolean Sketcher_Profile::ShapeFunctor::myStayFirst
private

◆ myVertex

TopoDS_Vertex Sketcher_Profile::ShapeFunctor::myVertex
private

◆ myX

Standard_Real Sketcher_Profile::ShapeFunctor::myX
private

◆ myX0

Standard_Real Sketcher_Profile::ShapeFunctor::myX0
private

◆ myY

Standard_Real Sketcher_Profile::ShapeFunctor::myY
private

◆ myY0

Standard_Real Sketcher_Profile::ShapeFunctor::myY0
private

◆ TheLocation

TopLoc_Location Sketcher_Profile::ShapeFunctor::TheLocation
private

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