8#include <tracking/trackFindingCDC/display/PrimitivePlotter.h>
11using namespace TrackFindingCDC;
18 m_canvasWidth(s_defaultCanvasWidth),
19 m_canvasHeight(s_defaultCanvasHeight)
27 return std::make_unique<PrimitivePlotter>(*
this);
36 const AttributeMap& attributeMap __attribute__((unused)))
46 const AttributeMap& attributeMap __attribute__((unused)))
55 const AttributeMap& attributeMap __attribute__((unused)))
57 const float left = centerX - radius;
58 const float bottom = centerY - radius;
59 const float right = centerX + radius;
60 const float top = centerY + radius;
70 float radius __attribute__((unused)),
71 bool longArc __attribute__((unused)),
72 bool sweepFlag __attribute__((unused)),
73 const AttributeMap& attributeMap __attribute__((unused)))
81 const std::vector<std::array<float, 2> >& tangents __attribute__((unused)),
84 for (
size_t i = 0; i < points.size() - 1; ++i) {
85 float startX = points[i][0];
86 float startY = points[i][1];
87 float endX = points[i + 1][0];
88 float endY = points[i + 1][1];
A two dimensional rectangle that keeps track of the extend of a drawing.
void clear()
Clears all bounds to NAN.
BoundingBox m_boundingBox
Bounding box of the currently drawn objects.
virtual ~PrimitivePlotter()
Make destructor virtual to handle polymorphic deconstruction.
virtual void drawCurve(const std::vector< std::array< float, 2 > > &points, const std::vector< std::array< float, 2 > > &tangents, const AttributeMap &attributeMap=AttributeMap())
Adds a smooth curve to the plot.
virtual void startGroup(const AttributeMap &attributeMap=AttributeMap())
Indicates the start of a group of drawn elements.
PrimitivePlotter()
Default constructor for ROOT compatibility.
virtual void drawCircleArc(float startX, float startY, float endX, float endY, float radius, bool longArc, bool sweepFlag, const AttributeMap &attributeMap=AttributeMap())
Adds a circle arc to the plot.
void clearBoundingBox()
Clears the current bounding box. Only following draw calls contribute to the bounding box.
virtual void drawArrow(float startX, float startY, float endX, float endY, const AttributeMap &attributeMap=AttributeMap())
Adds an arrow to the plot.
virtual const std::string save(const std::string &fileName)
Saves the current plot state to a file.
Belle2::TrackFindingCDC::AttributeMap AttributeMap
A map type for attributes names to values for additional drawing information.
virtual std::unique_ptr< PrimitivePlotter > clone() const
Returns a newly created plotter instance containing all information of this.
static const float s_defaultCanvasHeight
The default height of the canvas to be plotted into.
virtual void clear()
Clears all drawn elements from the plotter.
virtual void drawLine(float startX, float startY, float endX, float endY, const AttributeMap &attributeMap=AttributeMap())
Adds a line to the plot.
static const float s_defaultCanvasWidth
The default width of the canvas to be plotted into.
virtual void drawCircle(float centerX, float centerY, float radius, const AttributeMap &attributeMap=AttributeMap())
Adds a circle to the plot.
virtual void endGroup()
Indicates the end of a group of drawn elements.
Abstract base class for different kinds of events.