OpenLexocad  28.0
PropertyRelaxation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 typedef std::pair<double, double> CA_Relaxation;
6 
7 // first -> double relaxationValue;
8 // second -> double initialStress;
9 
10 namespace Core
11 {
12 class LX_CORE_EXPORT PropertyRelaxation : public Core::Property
13 {
15 
16 public:
17  void setValue(const CA_Relaxation& r);
18  bool setValueFromVariant(const Core::Variant& value);
20 
21  const CA_Relaxation& getValue() const;
23 
24  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
26  virtual bool isEqual(const Property*) const;
27  virtual Core::Property* copy(void) const override;
28  virtual void paste(const Core::Property& from) override;
29 
30 protected:
31  CA_Relaxation _value{0,0};
32 };
33 
34 class LX_CORE_EXPORT PropertyRelaxationSet : public Core::Property
35 {
37 
38 public:
39  void setValue(const std::set<CA_Relaxation>& relaxSet);
40  bool setValueFromVariant(const Core::Variant& /*value*/) { return false; }
42 
43  void insert(const CA_Relaxation& r);
44  const std::set<CA_Relaxation>& getValue() const;
45 
46  Core::Variant getVariant(void) const { return Core::Variant(0); }
47 
48  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
50  virtual bool isEqual(const Property*) const;
51  virtual Core::Property* copy(void) const override;
52  virtual void paste(const Core::Property& from) override;
53 
54 protected:
55  std::set<CA_Relaxation> _relaxSet;
56 };
57 
59 DECLARE_PROPERTY_FACTORY(PropertyRelaxationSet_Factory, Core::PropertyRelaxationSet);
60 
61 } // namespace Core
Property.h
Core::PropertyRelaxationSet::copyValue
void copyValue(Core::Property *p)
Core::PropertyRelaxationSet::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyRelaxationSet::insert
void insert(const CA_Relaxation &r)
Core::PropertyRelaxationSet::setValue
void setValue(const std::set< CA_Relaxation > &relaxSet)
Core::PropertyRelaxation::getValue
const CA_Relaxation & getValue() const
Core::PropertyRelaxationSet::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyRelaxationSet
Definition: PropertyRelaxation.h:35
Core::PropertyRelaxation::getVariant
Core::Variant getVariant(void) const
Core::PropertyRelaxation::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyRelaxationSet::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::PropertyRelaxation::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::PropertyRelaxation::setValue
void setValue(const CA_Relaxation &r)
Base::PersistenceVersion
Definition: Persistence.h:13
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyRelaxation
Definition: PropertyRelaxation.h:13
Core::PropertyRelaxationSet::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::PropertyRelaxation::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyRelaxation::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::PropertyRelaxation::copyValue
void copyValue(Core::Property *p)
Core::PropertyRelaxationSet::getValue
const std::set< CA_Relaxation > & getValue() const
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyRelaxationSet::_relaxSet
std::set< CA_Relaxation > _relaxSet
Definition: PropertyRelaxation.h:55
Core::PropertyRelaxationSet::getVariant
Core::Variant getVariant(void) const
Definition: PropertyRelaxation.h:46
Core::Property
Definition: Property.h:72
Core::PropertyRelaxation::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
CA_Relaxation
std::pair< double, double > CA_Relaxation
Definition: PropertyRelaxation.h:5
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::PropertyRelaxation::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyRelaxationSet::setValueFromVariant
bool setValueFromVariant(const Core::Variant &)
Definition: PropertyRelaxation.h:40
Core::PropertyRelaxationSet::isEqual
virtual bool isEqual(const Property *) const
compare properties