OpenLexocad  28.0
PropertyString2DoubleMap.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 namespace Core
6 {
7 class LX_CORE_EXPORT PropertyString2DoubleMap : public Core::Property
8 {
10 
11 public:
12  void setValue(const std::map<Base::String, double>& string2doubleMap);
13  bool setValueFromVariant(const Core::Variant& value) override;
14  void copyValue(Core::Property* p) override;
15 
16  const std::map<Base::String, double>& getValue() const;
17  Core::Variant getVariant() const override { return Core::Variant(_map); }
18 
19  void clear();
20  void insert(const Base::String& key, double value);
21 
22  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version) override;
24 
25  bool isEqual(const Property*) const override;
26 
27  Core::Property* copy() const override;
28  void paste(const Core::Property& from) override;
29 
30 protected:
31  std::map<Base::String, double> _map;
32 };
33 
35 
36 DECLARE_PROPERTY_FACTORY(PropertyString2DoubleMap_Factory, Core::PropertyString2DoubleMap);
37 
38 } // namespace Core
Core::PropertyString2DoubleMap
Definition: PropertyString2DoubleMap.h:8
Property.h
Core::PropertyString2DoubleMap::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value) override
Core::PropertyString2DoubleMap::setValue
void setValue(const std::map< Base::String, double > &string2doubleMap)
Core::PropertyString2DoubleMap::isEqual
bool isEqual(const Property *) const override
compare properties
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyString2DoubleMap::copyValue
void copyValue(Core::Property *p) override
Core
Definition: Base.h:5
Core::PropertyString2DoubleMap::clear
void clear()
Core::PropertyString2DoubleMap::getValue
const std::map< Base::String, double > & getValue() const
Core::Variant
Definition: Variant.h:78
Core::PropertyString2DoubleMap::restore
void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
This method is used to restore properties from an XML document.
Base::AbstractWriter
Definition: Writer.h:13
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyString2DoubleMap::_map
std::map< Base::String, double > _map
Definition: PropertyString2DoubleMap.h:31
Core::PropertyString2DoubleMap::copy
Core::Property * copy() const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::PropertyString2DoubleMap::insert
void insert(const Base::String &key, double value)
Core::PropertyString2DoubleMap::getVariant
Core::Variant getVariant() const override
Definition: PropertyString2DoubleMap.h:17
Core::PropertyString2DoubleMap::paste
void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::version
LX_CORE_EXPORT Version & version
Core::Property
Definition: Property.h:72
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Core::DECLARE_OPTIONAL_PROPERTY_HEADER
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::DECLARE_PROPERTY_FACTORY
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Core::PropertyString2DoubleMap::save
void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version) override
This method is used to save properties or very small amounts of data to an XML document.