mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: use a flag variable in plotDive()
Positional bool parameters to control the rendering of the plot have been a pain. We are down to one parameter (instant), but more will be readded, so let's use the opportunity to control rendering with a flags parameter. Sadly, C++ has no reasonable way of defining flags that I know of. Either the identifiers leak (enum), or can't be trivially ORed (enum class) or are weakly typed (int). Let's just use an integer for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d3a2c40f52
commit
6dfc2da8d0
2 changed files with 13 additions and 7 deletions
|
@ -42,11 +42,17 @@ public:
|
|||
INIT
|
||||
};
|
||||
|
||||
struct RenderFlags {
|
||||
static constexpr int None = 0;
|
||||
static constexpr int Instant = 1 << 0;
|
||||
static constexpr int DontRecalculatePlotInfo = 1 << 1;
|
||||
};
|
||||
|
||||
// Pass null as plannerModel if no support for planning required
|
||||
ProfileWidget2(DivePlannerPointsModel *plannerModel, double dpr, QWidget *parent = 0);
|
||||
~ProfileWidget2();
|
||||
void resetZoom();
|
||||
void plotDive(const struct dive *d, int dc, bool instant = false);
|
||||
void plotDive(const struct dive *d, int dc, int flags = RenderFlags::None);
|
||||
void setProfileState(const struct dive *d, int dc);
|
||||
void setPlanState(const struct dive *d, int dc);
|
||||
void setEditState(const struct dive *d, int dc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue