13#ifndef ML_STYLE_PALETTE_H
14#define ML_STYLE_PALETTE_H
35#define MKT_DASH (static_cast<int>(StylePalette::mktDash))
90 static const char *
const lineStyleNames[lstNumLineStyles];
93 static const char *
const markerTypeNames[mktNumMarkerTypes];
157 return lineStyleNames[
static_cast<int>(
lst)];
162 return markerTypeNames[
static_cast<int>(
mkt)];
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Base object class StylePalette for providing a collection of colors, line styles and marker types.
static const int defaultNumStyles
Default number of styles (=12)
Vector3 getColor(MLssize_t index) const
~StylePalette() override
Destructor.
void copyStylesFrom(const StylePalette &palette)
Copy style palette from palette.
virtual StylePalette * clone() const
Create a clone of the StylePalette.
const char * getLineStyleName(LineStyle lst) const
Get name of line style lst.
std::string getName(MLssize_t index) const
void setColorDefaults()
Set color default values.
StylePalette * deepCopy() const override
Set addStateToTree version number that can be accessed via getAddStateVersion()
int getMarkerSize(MLssize_t index) const
void setAntiAlias(MLssize_t index, bool aa)
void setLineWidth(MLssize_t index, int lw)
MarkerType
Marker type constants.
void setLineStyle(MLssize_t index, LineStyle lst)
void addStateToTree(TreeNode *parent) const override
Attach the object state as children of the given parent node.
LineStyle
Line style constants.
int getLineWidth(MLssize_t index) const
ML_SET_ADDSTATE_VERSION(0)
Sets addState version number.
bool getStyleIndexForName(const std::string curveTitle, std::vector< MLssize_t > &indices)
Get style indices using name, writes all matching indices into vector, returns true if at least one w...
MLssize_t getNumStyles() const
void dumpStyles()
Dump current style definitions to cout.
void setName(MLssize_t index, const std::string &n)
void setColor(MLssize_t index, const Vector3 &color)
StylePalette(MLssize_t numStyles)
void readStateFromTree(TreeNode *parent) override
Read the object state from the children of the given parent node.
const char * getMarkerTypeName(MarkerType mkt) const
Get name of marker type mkt.
void setColor(MLssize_t index, float r, float g, float b)
void clear()
Deallocate style definition arrays.
MarkerType getMarkerType(MLssize_t index) const
LineStyle getLineStyle(MLssize_t index) const
bool getAntiAlias(MLssize_t index) const
void setMarkerType(MLssize_t index, MarkerType mkt)
MLssize_t getAutoStyleIndex(MLssize_t n)
Get index for automatic style n (>= 1).
MLssize_t getReservedEntries() const
void setReservedEntries(MLssize_t reserved)
void getColor(MLssize_t index, float &r, float &g, float &b) const
void setMarkerSize(MLssize_t index, int ms)
void setMonoDefaults()
Set monochrome default values.
void setNumStyles(MLssize_t newNumStyles)
StylePalette(const StylePalette &palette)
void init(MLssize_t numStyles)
Allocate style definition arrays.
The class TreeNode is the abstract base class for the import/export of ML objects.
#define MLBASEEXPORT
defined Header file mlBaseInit.h
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
SSIZE_T MLssize_t
The signed ML size type which is a signed 32 bit size_t on 32 bit platforms and 64 bit one on 64 bit ...
Tvec3< MLdouble > Vector3
A vector with 3 components of type double.