OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyDouble.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTGui/Property.h"
10
11namespace ot {
12
15 public:
16 PropertyDouble(const PropertyDouble* _other);
17 PropertyDouble(const PropertyBase& _base);
19 PropertyDouble(double _value, PropertyFlags _flags = PropertyFlags(NoFlags));
20 PropertyDouble(const std::string& _name, double _value, PropertyFlags _flags = PropertyFlags(NoFlags));
21 PropertyDouble(const std::string& _name, double _value, double _min, double _max, PropertyFlags _flags = PropertyFlags(NoFlags));
22 virtual ~PropertyDouble() {};
23
24 static std::string propertyTypeString(void) { return "Double"; };
25 virtual std::string getPropertyType(void) const override { return PropertyDouble::propertyTypeString(); };
26
27 virtual Property* createCopy(void) const override;
28
29 void setValue(double _value) { m_value = _value; };
30 double getValue(void) const { return m_value; };
31
32 void setRange(double _min, double _max) { m_min = _min; m_max = _max; };
33
34 void setMin(double _value) { m_min = _value; };
35 double getMin(void) const { return m_min; };
36
37 void setMax(double _value) { m_max = _value; };
38 double getMax(void) const { return m_max; };
39
40 void setPrecision(int _p) { m_precision = _p; };
41 int getPrecision(void) const { return m_precision; };
42
43 protected:
48 virtual void getPropertyData(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
49
53 virtual void setPropertyData(const ot::ConstJsonObject& _object) override;
54
55 private:
56 double m_value;
57 double m_min;
58 double m_max;
59 int m_precision;
60 };
61
62}
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The PropertyBase class is used to hold general Property information.
Definition PropertyBase.h:25
Definition PropertyDouble.h:13
void setRange(double _min, double _max)
Definition PropertyDouble.h:32
void setPrecision(int _p)
Definition PropertyDouble.h:40
double getMax(void) const
Definition PropertyDouble.h:38
virtual ~PropertyDouble()
Definition PropertyDouble.h:22
int getPrecision(void) const
Definition PropertyDouble.h:41
double getValue(void) const
Definition PropertyDouble.h:30
void setValue(double _value)
Definition PropertyDouble.h:29
static std::string propertyTypeString(void)
Definition PropertyDouble.h:24
virtual std::string getPropertyType(void) const override
Definition PropertyDouble.h:25
double getMin(void) const
Definition PropertyDouble.h:35
void setMin(double _value)
Definition PropertyDouble.h:34
void setMax(double _value)
Definition PropertyDouble.h:37
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30