Jameo Core Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
jm::PaintingBackend Class Referenceabstract

This class provides the parent class for the graphic output. This class draws. More...

Inheritance diagram for jm::PaintingBackend:
jm::Object

Public Member Functions

 PaintingBackend ()
 Constructor.
 
 ~PaintingBackend () override
 Destructor.
 
void cancelProcess (bool status)
 This method is called to interrupt the work of the drawing thread as soon as possible.
 
void pushTransform (const Matrix &t)
 This method pushes a new transformation onto the transformation stack.
 
void popTransform ()
 This method removes the top element from the transformation stack.
 
virtual void setColor (Color color)=0
 This method changes the color used for drawing on the target context.
 
virtual Color color () const =0
 Returns the current color used for drawing on the target context.
 
virtual void setLineWeight (double lineweight)=0
 This method sets the line weight used for drawing the objects.
 
virtual double lineWeight () const =0
 
void moveTo (const Vertex3 &pt)
 This method moves the pen from the current position to the new position, without drawing anything.
 
void blindTo (const Vertex3 &pt)
 This method "draws" an invisible line to the new point. This is necessary because, for example, in hatching, the line pattern depends on the position and lines may be interrupted. Here, only the offset in the line pattern is changed.
 
void lineTo (const Vertex3 &pt)
 This method moves the pen from the current position to the new position, and draws a straight line in the process.
 
void stroke ()
 This method closes the current path, draws it, and implicitly opens a new path.
 
virtual void fill ()=0
 This method closes the current path, fills the enclosed area with the current color, and implicitly opens a new path.
 
virtual void fillAndStroke ()=0
 This method closes the current path, fills the enclosed area with the current color, draws it, and implicitly opens a new path.
 
void arc (const Vertex3 &center, const Vertex3 &normal, double radius, double startAngle, double endAngle)
 This method is used to add the graphics primitive Arc to the current path.
 
void elliptic (const Vertex3 &center, const Vertex3 &majorAxis, const Vertex3 &minorAxis, double startAngle, double endAngle)
 This method is used to add the graphics primitive Elliptic to the current path.
 
void nurbs (Nurbs *nurbs)
 This method draws a NURBS (Non-Uniform Rational Basis-Spline) curve.
 
virtual void drawLineSegment (const Vertex3 &start, const Vertex3 &end)=0
 This method draws a straight line between two points in the target context.
 
virtual void finishStroke ()=0
 
virtual void drawPoint (const Vertex3 &point)=0
 This method draws a point on the target context.
 
virtual void resetLinePatternOffset ()=0
 This method resets the line pattern for drawing, so that when starting a new line, the pattern starts from the beginning. This is particularly important for hatching.
 
bool wantCancel ()
 
- Public Member Functions inherited from jm::Object
 Object () noexcept
 Constructor.
 
virtual ~Object () noexcept
 Destructor.
 
void release () noexcept
 Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
 
Objectretain () noexcept
 Increases the reference counter of this object by 1.
 
Objectautorelease () noexcept
 Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
 
int32 referenceCount () const noexcept
 Returns the value of the reference counter.
 
virtual bool equals (const Object *other) const
 Comparison of objects.
 
virtual String displayName () const
 Returns the display name of the object intended to present to a user.
 
virtual void printDiffInfo (DiffOperation operation, Object *other) const
 Output method for outputting the diff results for the diff algorithm.
 
void setHighBit (bool status) noexcept
 
bool highBit () const noexcept
 

Protected Member Functions

void blindLine (const Vertex3 &p1, const Vertex3 &p2)
 
void putLine (const Vertex3 &p1, const Vertex3 &p2, bool pendown)
 

Detailed Description

This class provides the parent class for the graphic output. This class draws.

Constructor & Destructor Documentation

◆ PaintingBackend()

jm::PaintingBackend::PaintingBackend ( )

Constructor.

◆ ~PaintingBackend()

jm::PaintingBackend::~PaintingBackend ( )
override

Destructor.

Member Function Documentation

◆ arc()

void jm::PaintingBackend::arc ( const Vertex3 center,
const Vertex3 normal,
double  radius,
double  startAngle,
double  endAngle 
)

This method is used to add the graphics primitive Arc to the current path.

If the end angle is greater than the start angle, the arc is drawn in a counter-clockwise direction. If the end angle is less than the start angle, the arc is drawn in a clockwise direction.

Parameters
centerThe center of the arc in global WCS coordinates.
normalThe resulting direction vector of the arc plane.
radiusThe scaled radius of the arc.
startAngleThe start angle in degrees.
endAngleThe end angle in degrees.

◆ blindLine()

void jm::PaintingBackend::blindLine ( const Vertex3 p1,
const Vertex3 p2 
)
protected

◆ blindTo()

void jm::PaintingBackend::blindTo ( const Vertex3 pt)

This method "draws" an invisible line to the new point. This is necessary because, for example, in hatching, the line pattern depends on the position and lines may be interrupted. Here, only the offset in the line pattern is changed.

Parameters
ptThe new position in the WCS.

◆ cancelProcess()

void jm::PaintingBackend::cancelProcess ( bool  status)

This method is called to interrupt the work of the drawing thread as soon as possible.

Parameters
statusThe status of the cancellation. If "true", the drawing thread should be interrupted.

◆ color()

virtual Color jm::PaintingBackend::color ( ) const
pure virtual

Returns the current color used for drawing on the target context.

◆ drawLineSegment()

virtual void jm::PaintingBackend::drawLineSegment ( const Vertex3 start,
const Vertex3 end 
)
pure virtual

This method draws a straight line between two points in the target context.

Parameters
startThe starting point of the line.
endThe ending point of the line.

◆ drawPoint()

virtual void jm::PaintingBackend::drawPoint ( const Vertex3 point)
pure virtual

This method draws a point on the target context.

Parameters
pointThe point to be drawn.

◆ elliptic()

void jm::PaintingBackend::elliptic ( const Vertex3 center,
const Vertex3 majorAxis,
const Vertex3 minorAxis,
double  startAngle,
double  endAngle 
)

This method is used to add the graphics primitive Elliptic to the current path.

Parameters
centerThe center of the ellipse in global WCS coordinates.
majorAxisThe major axis of the ellipse.
minorAxisThe minor axis of the ellipse.
startAngleThe start angle in radians.
endAngleThe end angle in radians.

◆ fill()

virtual void jm::PaintingBackend::fill ( )
pure virtual

This method closes the current path, fills the enclosed area with the current color, and implicitly opens a new path.

◆ fillAndStroke()

virtual void jm::PaintingBackend::fillAndStroke ( )
pure virtual

This method closes the current path, fills the enclosed area with the current color, draws it, and implicitly opens a new path.

◆ finishStroke()

virtual void jm::PaintingBackend::finishStroke ( )
pure virtual

◆ lineTo()

void jm::PaintingBackend::lineTo ( const Vertex3 pt)

This method moves the pen from the current position to the new position, and draws a straight line in the process.

Parameters
ptThe new position in the WCS.

◆ lineWeight()

virtual double jm::PaintingBackend::lineWeight ( ) const
pure virtual

/brief Returns the current line weight used for drawing on the target context.

◆ moveTo()

void jm::PaintingBackend::moveTo ( const Vertex3 pt)

This method moves the pen from the current position to the new position, without drawing anything.

Parameters
ptThe new position in the WCS.

◆ nurbs()

void jm::PaintingBackend::nurbs ( Nurbs nurbs)

This method draws a NURBS (Non-Uniform Rational Basis-Spline) curve.

Parameters
nurbsThe object describing the curve.

◆ popTransform()

void jm::PaintingBackend::popTransform ( )

This method removes the top element from the transformation stack.

◆ pushTransform()

void jm::PaintingBackend::pushTransform ( const Matrix t)

This method pushes a new transformation onto the transformation stack.

Parameters
tThe transformation to be pushed onto the stack.

◆ putLine()

void jm::PaintingBackend::putLine ( const Vertex3 p1,
const Vertex3 p2,
bool  pendown 
)
protected

◆ resetLinePatternOffset()

virtual void jm::PaintingBackend::resetLinePatternOffset ( )
pure virtual

This method resets the line pattern for drawing, so that when starting a new line, the pattern starts from the beginning. This is particularly important for hatching.

◆ setColor()

virtual void jm::PaintingBackend::setColor ( Color  color)
pure virtual

This method changes the color used for drawing on the target context.

Parameters
colorThe RGB color used for drawing.

◆ setLineWeight()

virtual void jm::PaintingBackend::setLineWeight ( double  lineweight)
pure virtual

This method sets the line weight used for drawing the objects.

Parameters
lineweightThe line weight.

◆ stroke()

void jm::PaintingBackend::stroke ( )

This method closes the current path, draws it, and implicitly opens a new path.

◆ wantCancel()

bool jm::PaintingBackend::wantCancel ( )