CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::Line Class Reference

Line segment between two PointFloat endpoints with a drawing width. More...

#include <MathClasses.h>

Collaboration diagram for cmlabs::Line:
[legend]

Public Member Functions

 Line ()
 Degenerate line at the origin.
 Line (PointFloat startpoint, PointFloat endpoint, double width=0)
 From endpoints and optional width.
virtual ~Line ()
PointFloat getStartPoint () const
PointFloat getEndPoint () const
double getLineWidth () const
bool setStartPoint (PointFloat point)
 Set the start point.
bool setEndPoint (PointFloat point)
 Set the end point.
bool setLineWidth (double width)
 Set the stroke width.
std::string print ()
 Human-readable representation for debugging.

Public Attributes

PointFloat startPoint
 First endpoint.
PointFloat endPoint
 Second endpoint.
double lineWidth
 Stroke width (drawing hint).

Detailed Description

Line segment between two PointFloat endpoints with a drawing width.

Definition at line 490 of file MathClasses.h.

Constructor & Destructor Documentation

◆ Line() [1/2]

cmlabs::Line::Line ( )

Degenerate line at the origin.

Definition at line 375 of file MathClasses.cpp.

References lineWidth.

◆ Line() [2/2]

cmlabs::Line::Line ( PointFloat startpoint,
PointFloat endpoint,
double width = 0 )

From endpoints and optional width.

Definition at line 379 of file MathClasses.cpp.

References endPoint, lineWidth, and startPoint.

◆ ~Line()

cmlabs::Line::~Line ( )
virtual

Definition at line 385 of file MathClasses.cpp.

Member Function Documentation

◆ getEndPoint()

PointFloat cmlabs::Line::getEndPoint ( ) const
Returns
End point.

Definition at line 391 of file MathClasses.cpp.

References endPoint.

◆ getLineWidth()

double cmlabs::Line::getLineWidth ( ) const
Returns
Stroke width.

Definition at line 394 of file MathClasses.cpp.

References lineWidth.

Referenced by _wrap_Line_getLineWidth().

◆ getStartPoint()

PointFloat cmlabs::Line::getStartPoint ( ) const
Returns
Start point.

Definition at line 388 of file MathClasses.cpp.

References startPoint.

◆ print()

std::string cmlabs::Line::print ( )

Human-readable representation for debugging.

Definition at line 411 of file MathClasses.cpp.

References endPoint, lineWidth, startPoint, and cmlabs::utils::StringFormat().

◆ setEndPoint()

bool cmlabs::Line::setEndPoint ( PointFloat point)

Set the end point.

Returns
true.

Definition at line 402 of file MathClasses.cpp.

References endPoint.

Referenced by _wrap_Line_setEndPoint().

◆ setLineWidth()

bool cmlabs::Line::setLineWidth ( double width)

Set the stroke width.

Returns
true.

Definition at line 406 of file MathClasses.cpp.

References lineWidth.

◆ setStartPoint()

bool cmlabs::Line::setStartPoint ( PointFloat point)

Set the start point.

Returns
true.

Definition at line 398 of file MathClasses.cpp.

References startPoint.

Referenced by _wrap_Line_setStartPoint().

Member Data Documentation

◆ endPoint

PointFloat cmlabs::Line::endPoint

Second endpoint.

Definition at line 498 of file MathClasses.h.

Referenced by cmlabs::Bitmap::drawLine(), getEndPoint(), Line(), print(), and setEndPoint().

◆ lineWidth

double cmlabs::Line::lineWidth

Stroke width (drawing hint).

Definition at line 499 of file MathClasses.h.

Referenced by cmlabs::Bitmap::drawLine(), getLineWidth(), Line(), Line(), print(), and setLineWidth().

◆ startPoint

PointFloat cmlabs::Line::startPoint

First endpoint.

Definition at line 497 of file MathClasses.h.

Referenced by cmlabs::Bitmap::drawLine(), getStartPoint(), Line(), print(), and setStartPoint().


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