Version: 9.13.0
Plot2d Namespace Reference

Enumerations

enum  MarkerType {
  None , Circle , Rectangle , Diamond ,
  DTriangle , UTriangle , LTriangle , RTriangle ,
  Cross , XCross
}
 
enum  LineType {
  NoPen , Solid , Dash , Dot ,
  DashDot , DashDotDot
}
 

Functions

QwtSymbol::Style plot2qwtMarker (MarkerType)
 Convert Plot2d marker type to Qwt marker type. More...
 
MarkerType qwt2plotMarker (QwtSymbol::Style)
 Convert Qwt marker type to Plot2d marker type. More...
 
Qt::PenStyle plot2qwtLine (LineType)
 Convert Plot2d line type to Qt/Qwt line type. More...
 
LineType qwt2plotLine (Qt::PenStyle)
 Convert Qt/Qwt line type to Plot2d line type. More...
 
void drawLine (QPainter *, const QPoint &, const QPoint &, Qt::PenStyle=Qt::SolidLine, const QColor &=Qt::black, int=0)
 Draw line. More...
 
void drawLine (QPainter *, const QPoint &, const QPoint &, LineType=Solid, const QColor &=Qt::black, int=0)
 Draw line. More...
 
void drawLine (QPainter *, int, int, int, int, Qt::PenStyle=Qt::SolidLine, const QColor &=Qt::black, int=0)
 Draw line. More...
 
void drawLine (QPainter *, int, int, int, int, LineType=Solid, const QColor &=Qt::black, int=0)
 Draw line. More...
 
void drawMarker (QPainter *, const QPoint &, const QRect &, QwtSymbol::Style=QwtSymbol::Ellipse, const QColor &=Qt::black)
 Draw marker. More...
 
void drawMarker (QPainter *, const QPoint &, const QRect &, MarkerType=Circle, const QColor &=Qt::black)
 Draw marker. More...
 
void drawMarker (QPainter *, int, int, int, int, QwtSymbol::Style=QwtSymbol::Ellipse, const QColor &=Qt::black)
 Draw marker. More...
 
void drawMarker (QPainter *, int, int, int, int, MarkerType=Circle, const QColor &=Qt::black)
 Draw marker. More...
 
QPixmap markerIcon (const QSize &, const QColor &, Plot2d::MarkerType)
 Create icon pixmap according to the marker type. More...
 
QPixmap lineIcon (const QSize &, const QColor &, Plot2d::LineType)
 Create icon pixmap according to the line type. More...
 
void getNextMarker (const int rtti, const QwtPlot *, QwtSymbol::Style &, QColor &, Qt::PenStyle &)
 
bool existMarker (const int rtti, const QwtPlot *, const QwtSymbol::Style, const QColor &, const Qt::PenStyle)
 
bool closeColors (const QColor &, const QColor &, int distance=-1)
 

Enumeration Type Documentation

◆ LineType

Enumerator
NoPen 
Solid 
Dash 
Dot 
DashDot 
DashDotDot 

◆ MarkerType

Enumerator
None 
Circle 
Rectangle 
Diamond 
DTriangle 
UTriangle 
LTriangle 
RTriangle 
Cross 
XCross 

Function Documentation

◆ closeColors()

bool Plot2d::closeColors ( const QColor &  color1,
const QColor &  color2,
int  distance = -1 
)

Checks if two colors are close to each other uses COLOR_DISTANCE variable as max tolerance for comparing of colors

References COLOR_DISTANCE.

◆ drawLine() [1/4]

void Plot2d::drawLine ( QPainter *  painter,
const QPoint &  p1,
const QPoint &  p2,
Plot2d::LineType  type = Solid,
const QColor &  color = Qt::black,
int  width = 0 
)

Draw line.

Parameters
painterpainter
p1starting point
p2ending point
typeline type
colorline color
widthline width

References OCCViewer::color(), drawLine(), and plot2qwtLine().

◆ drawLine() [2/4]

void Plot2d::drawLine ( QPainter *  painter,
const QPoint &  p1,
const QPoint &  p2,
Qt::PenStyle  type = Qt::SolidLine,
const QColor &  color = Qt::black,
int  width = 0 
)

Draw line.

Parameters
painterpainter
p1starting point
p2ending point
typeline type
colorline color
widthline width

References OCCViewer::color().

◆ drawLine() [3/4]

void Plot2d::drawLine ( QPainter *  painter,
int  x1,
int  y1,
int  x2,
int  y2,
Plot2d::LineType  type = Solid,
const QColor &  color = Qt::black,
int  width = 0 
)

Draw line.

Parameters
painterpainter
x1X coordinate of the starting point
y1Y coordinate of the starting point
x2X coordinate of the ending point
y2Y coordinate of the ending point
typeline type
colorline color
widthline width

References OCCViewer::color(), drawLine(), and plot2qwtLine().

◆ drawLine() [4/4]

void Plot2d::drawLine ( QPainter *  painter,
int  x1,
int  y1,
int  x2,
int  y2,
Qt::PenStyle  type = Qt::SolidLine,
const QColor &  color = Qt::black,
int  width = 0 
)

Draw line.

Parameters
painterpainter
x1X coordinate of the starting point
y1Y coordinate of the starting point
x2X coordinate of the ending point
y2Y coordinate of the ending point
typeline type
colorline color
widthline width

References OCCViewer::color(), and drawLine().

◆ drawMarker() [1/4]

void Plot2d::drawMarker ( QPainter *  painter,
const QPoint &  p,
const QRect &  r,
Plot2d::MarkerType  type = Circle,
const QColor &  color = Qt::black 
)

Draw marker.

Parameters
painterpainter
pcentral point
rmarker rectangle
typemarker type
colormarker color

References OCCViewer::color(), drawMarker(), and plot2qwtMarker().

◆ drawMarker() [2/4]

void Plot2d::drawMarker ( QPainter *  painter,
const QPoint &  p,
const QRect &  r,
QwtSymbol::Style  type = QwtSymbol::Ellipse,
const QColor &  color = Qt::black 
)

Draw marker.

Parameters
painterpainter
pcentral point
rmarker rectangle
typemarker type
colormarker color

References OCCViewer::color(), Cross, Diamond, DTriangle, LTriangle, RTriangle, UTriangle, and XCross.

◆ drawMarker() [3/4]

void Plot2d::drawMarker ( QPainter *  painter,
int  x,
int  y,
int  w,
int  h,
Plot2d::MarkerType  type = Circle,
const QColor &  color = Qt::black 
)

Draw marker.

Parameters
painterpainter
xX coordinate of the central point
yY coordinate of the central point
wmarker rectangle width
hmarker rectangle height
typemarker type
colormarker color

References OCCViewer::color(), drawMarker(), and plot2qwtMarker().

◆ drawMarker() [4/4]

void Plot2d::drawMarker ( QPainter *  painter,
int  x,
int  y,
int  w,
int  h,
QwtSymbol::Style  type = QwtSymbol::Ellipse,
const QColor &  color = Qt::black 
)

Draw marker.

Parameters
painterpainter
xX coordinate of the central point
yY coordinate of the central point
wmarker rectangle width
hmarker rectangle height
typemarker type
colormarker color

References OCCViewer::color(), and drawMarker().

◆ existMarker()

bool Plot2d::existMarker ( const int  rtti,
const QwtPlot thePlot,
const QwtSymbol::Style  typeMarker,
const QColor &  color,
const Qt::PenStyle  typeLine 
)

Checks if marker belongs to any enitity

References closeColors(), and OCCViewer::color().

◆ getNextMarker()

void Plot2d::getNextMarker ( const int  rtti,
const QwtPlot thePlot,
QwtSymbol::Style &  typeMarker,
QColor &  color,
Qt::PenStyle &  typeLine 
)

Gets new unique marker for item if possible

References OCCViewer::color(), existMarker(), and MAX_ATTEMPTS.

◆ lineIcon()

QPixmap Plot2d::lineIcon ( const QSize &  size,
const QColor &  color,
Plot2d::LineType  type 
)

Create icon pixmap according to the line type.

Parameters
sizeicon size
typeline type
coloricon color
Returns
icon

References OCCViewer::color(), drawLine(), and px().

◆ markerIcon()

QPixmap Plot2d::markerIcon ( const QSize &  size,
const QColor &  color,
Plot2d::MarkerType  type 
)

Create icon pixmap according to the marker type.

Parameters
sizeicon size
typemarker type
coloricon color
Returns
icon

References OCCViewer::color(), drawMarker(), MSIZE, and px().

◆ plot2qwtLine()

Qt::PenStyle Plot2d::plot2qwtLine ( Plot2d::LineType  p)

Convert Plot2d line type to Qt/Qwt line type.

Parameters
pPlot2d line type
Returns
Qt/Qwt line type

References Dash, DashDot, DashDotDot, Dot, NoPen, and Solid.

◆ plot2qwtMarker()

QwtSymbol::Style Plot2d::plot2qwtMarker ( Plot2d::MarkerType  m)

Convert Plot2d marker type to Qwt marker type.

Parameters
mPlot2d marker type
Returns
Qwt marker type

References Circle, Cross, Diamond, DTriangle, LTriangle, None, Rectangle, RTriangle, UTriangle, and XCross.

◆ qwt2plotLine()

Plot2d::LineType Plot2d::qwt2plotLine ( Qt::PenStyle  p)

Convert Qt/Qwt line type to Plot2d line type.

Parameters
pQt/Qwt line type
Returns
Plot2d line type

References Dash, DashDot, DashDotDot, Dot, NoPen, and Solid.

◆ qwt2plotMarker()

Plot2d::MarkerType Plot2d::qwt2plotMarker ( QwtSymbol::Style  m)

Convert Qwt marker type to Plot2d marker type.

Parameters
mQwt marker type
Returns
Plot2d marker type

References Circle, Cross, Diamond, DTriangle, LTriangle, None, Rectangle, RTriangle, UTriangle, and XCross.