1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-10-09 23:57:26 -04:00

C++11 extensions update after enums with ImPlot

This commit is contained in:
ozlb 2020-05-13 17:23:27 +02:00 committed by GitHub
parent 36e0aa3ce1
commit ff4f27175c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,10 +30,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
typedef int ImPlotFlags; typedef int ImPlotFlags;
typedef int ImAxisFlags; typedef int ImPlotAxisFlags;
typedef int ImPlotCol; typedef int ImPlotCol;
typedef int ImPlotStyleVar; typedef int ImPlotStyleVar;
typedef int ImMarker; typedef int ImPlotMarker;
// Options for plots // Options for plots
enum ImPlotFlags_ { enum ImPlotFlags_ {
@ -53,18 +53,18 @@ enum ImPlotFlags_ {
}; };
// Options for plot axes (X and Y) // Options for plot axes (X and Y)
enum ImAxisFlags_ { enum ImPlotAxisFlags_ {
ImAxisFlags_GridLines = 1 << 0, // grid lines will be displayed ImPlotAxisFlags_GridLines = 1 << 0, // grid lines will be displayed
ImAxisFlags_TickMarks = 1 << 1, // tick marks will be displayed for each grid line ImPlotAxisFlags_TickMarks = 1 << 1, // tick marks will be displayed for each grid line
ImAxisFlags_TickLabels = 1 << 2, // text labels will be displayed for each grid line ImPlotAxisFlags_TickLabels = 1 << 2, // text labels will be displayed for each grid line
ImAxisFlags_Invert = 1 << 3, // the axis will be inverted ImPlotAxisFlags_Invert = 1 << 3, // the axis will be inverted
ImAxisFlags_LockMin = 1 << 4, // the axis minimum value will be locked when panning/zooming ImPlotAxisFlags_LockMin = 1 << 4, // the axis minimum value will be locked when panning/zooming
ImAxisFlags_LockMax = 1 << 5, // the axis maximum value will be locked when panning/zooming ImPlotAxisFlags_LockMax = 1 << 5, // the axis maximum value will be locked when panning/zooming
ImAxisFlags_Adaptive = 1 << 6, // grid divisions will adapt to the current pixel size the axis ImPlotAxisFlags_Adaptive = 1 << 6, // grid divisions will adapt to the current pixel size the axis
ImAxisFlags_LogScale = 1 << 7, // a logartithmic (base 10) axis scale will be used ImPlotAxisFlags_LogScale = 1 << 7, // a logartithmic (base 10) axis scale will be used
ImAxisFlags_Scientific = 1 << 8, // scientific notation will be used for tick labels if displayed (WIP, not very good yet) ImPlotAxisFlags_Scientific = 1 << 8, // scientific notation will be used for tick labels if displayed (WIP, not very good yet)
ImAxisFlags_Default = ImAxisFlags_GridLines | ImAxisFlags_TickMarks | ImAxisFlags_TickLabels | ImAxisFlags_Adaptive, ImPlotAxisFlags_Default = ImPlotAxisFlags_GridLines | ImPlotAxisFlags_TickMarks | ImPlotAxisFlags_TickLabels | ImPlotAxisFlags_Adaptive,
ImAxisFlags_Auxiliary = ImAxisFlags_Default & ~ImAxisFlags_GridLines, ImPlotAxisFlags_Auxiliary = ImPlotAxisFlags_Default & ~ImPlotAxisFlags_GridLines,
}; };
// Plot styling colors // Plot styling colors
@ -100,18 +100,18 @@ enum ImPlotStyleVar_ {
}; };
// Marker specification // Marker specification
enum ImMarker_ { enum ImPlotMarker_ {
ImMarker_None = 1 << 0, // no marker ImPlotMarker_None = 1 << 0, // no marker
ImMarker_Circle = 1 << 1, // a circle marker will be rendered at each point ImPlotMarker_Circle = 1 << 1, // a circle marker will be rendered at each point
ImMarker_Square = 1 << 2, // a square maker will be rendered at each point ImPlotMarker_Square = 1 << 2, // a square maker will be rendered at each point
ImMarker_Diamond = 1 << 3, // a diamond marker will be rendered at each point ImPlotMarker_Diamond = 1 << 3, // a diamond marker will be rendered at each point
ImMarker_Up = 1 << 4, // an upward-pointing triangle marker will up rendered at each point ImPlotMarker_Up = 1 << 4, // an upward-pointing triangle marker will up rendered at each point
ImMarker_Down = 1 << 5, // an downward-pointing triangle marker will up rendered at each point ImPlotMarker_Down = 1 << 5, // an downward-pointing triangle marker will up rendered at each point
ImMarker_Left = 1 << 6, // an leftward-pointing triangle marker will up rendered at each point ImPlotMarker_Left = 1 << 6, // an leftward-pointing triangle marker will up rendered at each point
ImMarker_Right = 1 << 7, // an rightward-pointing triangle marker will up rendered at each point ImPlotMarker_Right = 1 << 7, // an rightward-pointing triangle marker will up rendered at each point
ImMarker_Cross = 1 << 8, // a cross marker will be rendered at each point (not filled) ImPlotMarker_Cross = 1 << 8, // a cross marker will be rendered at each point (not filled)
ImMarker_Plus = 1 << 9, // a plus marker will be rendered at each point (not filled) ImPlotMarker_Plus = 1 << 9, // a plus marker will be rendered at each point (not filled)
ImMarker_Asterisk = 1 << 10, // a asterisk marker will be rendered at each point (not filled) ImPlotMarker_Asterisk = 1 << 10, // a asterisk marker will be rendered at each point (not filled)
}; };
// A range defined by a min/max value. Used for plot axes ranges. // A range defined by a min/max value. Used for plot axes ranges.
@ -133,7 +133,7 @@ struct ImPlotLimits {
// Plot style structure // Plot style structure
struct ImPlotStyle { struct ImPlotStyle {
float LineWeight; // = 1, line weight in pixels float LineWeight; // = 1, line weight in pixels
ImMarker Marker; // = ImMarker_None, marker specification ImPlotMarker Marker; // = ImPlotMarker_None, marker specification
float MarkerSize; // = 5, marker size in pixels (roughly the marker's "radius") float MarkerSize; // = 5, marker size in pixels (roughly the marker's "radius")
float MarkerWeight; // = 1, outline weight of markers in pixels float MarkerWeight; // = 1, outline weight of markers in pixels
float ErrorBarSize; // = 5, error bar whisker width in pixels float ErrorBarSize; // = 5, error bar whisker width in pixels
@ -160,10 +160,10 @@ bool BeginPlot(const char* title_id,
const char* y_label = NULL, const char* y_label = NULL,
const ImVec2& size = ImVec2(-1,-1), const ImVec2& size = ImVec2(-1,-1),
ImPlotFlags flags = ImPlotFlags_Default, ImPlotFlags flags = ImPlotFlags_Default,
ImAxisFlags x_flags = ImAxisFlags_Default, ImPlotAxisFlags x_flags = ImPlotAxisFlags_Default,
ImAxisFlags y_flags = ImAxisFlags_Default, ImPlotAxisFlags y_flags = ImPlotAxisFlags_Default,
ImAxisFlags y2_flags = ImAxisFlags_Auxiliary, ImPlotAxisFlags y2_flags = ImPlotAxisFlags_Auxiliary,
ImAxisFlags y3_flags = ImAxisFlags_Auxiliary); ImPlotAxisFlags y3_flags = ImPlotAxisFlags_Auxiliary);
// Only call EndPlot() if BeginPlot() returns true! Typically called at the end // Only call EndPlot() if BeginPlot() returns true! Typically called at the end
// of an if statement conditioned on BeginPlot(). // of an if statement conditioned on BeginPlot().
void EndPlot(); void EndPlot();