#include <LabeledPolylineFigure.h>
inet::LabeledPolylineFigure::LabeledPolylineFigure |
( |
const char * |
name = nullptr | ) |
|
cTextFigure* inet::LabeledPolylineFigure::getLabelFigure |
( |
| ) |
const |
|
inline |
cPolylineFigure* inet::LabeledPolylineFigure::getPolylineFigure |
( |
| ) |
const |
|
inline |
void inet::LabeledPolylineFigure::setPoints |
( |
const std::vector< cFigure::Point > & |
points | ) |
|
void inet::LabeledPolylineFigure::updateLabelPosition |
( |
| ) |
|
|
protected |
Referenced by setPoints().
45 int index = (points.size() - 1) / 2;
46 auto position = (points[index] + points[index + 1]) / 2;
47 auto direction = points[index + 1] - points[index];
48 double alpha = atan2(-direction.y, direction.x);
49 if (alpha >
M_PI / 2 || alpha < -
M_PI / 2)
51 panelFigure->setTransform(cFigure::Transform().rotate(-alpha));
const value< double, units::unit > alpha(7.2973525376e-3)
cTextFigure* inet::LabeledPolylineFigure::labelFigure |
|
protected |
cPolylineFigure* inet::LabeledPolylineFigure::polylineFigure |
|
protected |
The documentation for this class was generated from the following files: