 |
Belle II Software
release-05-01-25
|
12 #include <tracking/trackFindingCDC/display/PrimitivePlotter.h>
20 namespace TrackFindingCDC {
23 class SVGPrimitivePlotter :
public PrimitivePlotter {
50 std::unique_ptr<PrimitivePlotter>
clone()
const override;
125 void drawCurve(
const std::vector<std::array<float, 2>>& points,
126 const std::vector<std::array<float, 2>>& tangents,
149 const std::string
save(
const std::string& fileName)
override;
154 void clear()
override;
184 const std::string& tagName,
199 const std::string& tagName,
217 const std::string& tagName,
237 const std::string& tagName);
std::unique_ptr< PrimitivePlotter > clone() const override
Returns a newly created plotter instance containing all information of this.
SVGPrimitivePlotter()
Default constructor for ROOT compatibility.
void writeSVGDefs(std::ostream &outputStream)
Writes a preamble of <defs> that define an arrow cap which can be referenced by lines.
void drawArrow(float startX, float startY, float endX, float endY, const AttributeMap &attributeMap=AttributeMap()) override
Adds an arrow to the plot.
void dedent()
Decreases the current indention by one.
int m_nIndentationSpaces
Memory for the number of spaces that shall be prepended to each line.
Belle2::TrackFindingCDC::AttributeMap AttributeMap
A map type for attributes names to values for additional drawing information.
void drawLine(float startX, float startY, float endX, float endY, const AttributeMap &attributeMap=AttributeMap()) override
Adds a line to the plot.
void writeClosingTag(std::ostream &outputStream, const std::string &tagName)
Writes a closing xml tag to the given output stream.
void writeAttributes(std::ostream &outputStream, const AttributeMap &attributeMap)
Writes attribute specification that belongs between the <, > brakets after the tag name.
AttributeMap m_svgAttributes
Memory for additional attributes to the toplevel svg element.
void drawCircle(float centerX, float centerY, float radius, const AttributeMap &attributeMap=AttributeMap()) override
Adds a circle to the plot.
Abstract base class for different kinds of events.
void indent()
Increases the current indention by one.
const std::string save(const std::string &fileName) override
Saves the current plot state to a file.
void writeOpeningTag(std::ostream &outputStream, const std::string &tagName, const AttributeMap &geometryAttributeMap=AttributeMap(), const AttributeMap &styleAttributeMap=AttributeMap())
Writes an opening xml tag to the given output stream taking attributes from two sources.
void drawCurve(const std::vector< std::array< float, 2 >> &points, const std::vector< std::array< float, 2 >> &tangents, const AttributeMap &attributeMap=AttributeMap()) override
Adds a smooth curve to the plot.
void writeStandAloneTag(std::ostream &outputStream, const std::string &tagName, const AttributeMap &geometryAttributeMap=AttributeMap(), const AttributeMap &styleAttributeMap=AttributeMap())
Writes a stand alone xml tag to the given output stream taking attributes from two sources.
void endGroup() override
Indicates the end of a group of drawn elements.
static const int s_addtionalNIndentationSpaces
Constant for the additional number of space to be prepended with each open tag group.
void writeTagIntern(std::ostream &outputStream, const std::string &tagName, const AttributeMap &geometryAttributeMap=AttributeMap(), const AttributeMap &styleAttributeMap=AttributeMap())
Writes part that belongs between the <, > brakets.
A concrete plotter that can draw primitive objects to standalone SVG files.
void startGroup(const AttributeMap &attributeMap=AttributeMap()) override
Indicates the start of a group of drawn elements.
static const int s_defaultNIndentationSpaces
Constant for the number of indention space to be used within the svg block.
void clear() override
Clears all drawed elements from the plotter.
void drawCircleArc(float startX, float startY, float endX, float endY, float radius, bool longArc, bool sweepFlag, const AttributeMap &attributeMap=AttributeMap()) override
Adds a circle arc to the plot.
void writeSVGHeader(std::ostream &outputStream)
Writes the xml header that indicates that this document will be a SVG document to the given output st...
std::ostringstream m_svgContentStream
Memory for the plotted elements. This contains only the fragment that is inbetween the svg tags and c...