OpenLexocad  28.0
PropertyDrawStyle.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 PropertyDrawStyle : public Core::Property
8 {
10 
11 public:
12  void setValue(const Draw::DrawStyle& ds);
13  bool setValueFromVariant(const Core::Variant& value);
14  virtual bool setKeyValue(const std::string& name, const Core::Variant& value);
16 
17  const Draw::DrawStyle& getValue() const;
19 
21  virtual std::map<std::string, Core::Variant> getKeyValueMap() const;
22 
23  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
25  virtual bool isEqual(const Property*) const;
26  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
27  virtual Core::Property* copy(void) const override;
28  virtual void paste(const Core::Property& from) override;
29 
30 protected:
31  Draw::DrawStyle _drawstyle;
32 };
33 
35 
37 
38 class LX_CORE_EXPORT PropertyArrowheads : public Core::Property
39 {
41 
42 public:
43  void setValue(const Draw::Arrowheads& value);
44  bool setValueFromVariant(const Core::Variant& value);
45  virtual bool setKeyValue(const std::string& name, const Core::Variant& value);
47 
48  const Draw::Arrowheads& getValue() const;
50  virtual std::map<std::string, Core::Variant> getKeyValueMap() const;
51 
52  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
54  virtual bool isEqual(const Property*) const;
55  virtual Core::Property* copy(void) const override;
56  virtual void paste(const Core::Property& from) override;
57 
58 protected:
59  Draw::Arrowheads _arrowHeads;
60 };
61 
63 } // namespace Core
Core::PropertyDrawStyle::getKeyValueMap
virtual std::map< std::string, Core::Variant > getKeyValueMap() const
Returns all keys and their values of this property.
Property.h
Core::PropertyArrowheads::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyDrawStyle::setValue
void setValue(const Draw::DrawStyle &ds)
Core::PropertyDrawStyle::copyValue
void copyValue(Core::Property *p)
Core::PropertyDrawStyle::copy
virtual Core::Property * copy(void) const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::PropertyArrowheads::setValue
void setValue(const Draw::Arrowheads &value)
Core::PropertyDrawStyle::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyArrowheads::setKeyValue
virtual bool setKeyValue(const std::string &name, const Core::Variant &value)
Sets a sub key in this property.
Core::PropertyDrawStyle::getDbgInfo
std::shared_ptr< Core::DbgInfo > getDbgInfo() const override
Returns the debug information for this property.
Core::PropertyDrawStyle::_drawstyle
Draw::DrawStyle _drawstyle
Definition: PropertyDrawStyle.h:31
Core::PropertyArrowheads::getVariant
Core::Variant getVariant(void) const
Core::PropertyDrawStyle::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyDrawStyle::getVariant
Core::Variant getVariant(void) const
Core::PropertyArrowheads::getValue
const Draw::Arrowheads & getValue() const
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyArrowheads
Definition: PropertyDrawStyle.h:39
Core::PropertyArrowheads::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core
Definition: Base.h:5
Core::PropertyDrawStyle::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyArrowheads::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyDrawStyle::setKeyValue
virtual bool setKeyValue(const std::string &name, const Core::Variant &value)
Sets a sub key in this property.
Core::PropertyArrowheads::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyArrowheads::copy
virtual Core::Property * copy(void) const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::PropertyDrawStyle::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version)
This method is used to save properties or very small amounts of data to an XML document.
Core::PropertyDrawStyle::getValue
const Draw::DrawStyle & getValue() const
Core::PropertyArrowheads::copyValue
void copyValue(Core::Property *p)
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyDrawStyle::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::Property
Definition: Property.h:72
Core::PropertyDrawStyle
Definition: PropertyDrawStyle.h:8
Core::PropertyArrowheads::getKeyValueMap
virtual std::map< std::string, Core::Variant > getKeyValueMap() const
Returns all keys and their values of this property.
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::PropertyArrowheads::_arrowHeads
Draw::Arrowheads _arrowHeads
Definition: PropertyDrawStyle.h:59
Core::PropertyArrowheads::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version)
This method is used to save properties or very small amounts of data to an XML document.