OpenLexocad  27.1
PropertyRelaxation.h
Go to the documentation of this file.
1 #pragma once
2 #include <set>
3 
4 #include "Core/Property.h"
5 #include "Core/Variant.h"
6 
7 typedef std::pair<double, double> CA_Relaxation;
8 
9 // first -> double relaxationValue;
10 // second -> double initialStress;
11 
12 namespace Core
13 {
14 class LX_CORE_EXPORT PropertyRelaxation : public Core::Property
15 {
17 
18 public:
19  PropertyRelaxation(void);
20  virtual ~PropertyRelaxation(void);
21 
22  void setValue(const CA_Relaxation& r);
23  bool setValueFromVariant(const Core::Variant& value);
24  void copyValue(Core::Property* p);
25 
26  const CA_Relaxation& getValue() const;
27  Core::Variant getVariant(void) const;
28 
29  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
30  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
31  virtual bool isEqual(const Property*) const;
32  virtual Core::Property* copy(void) const override;
33  virtual void paste(const Core::Property& from) override;
34 
35 protected:
37 };
38 
39 class LX_CORE_EXPORT PropertyRelaxationSet : public Core::Property
40 {
42 
43 public:
46 
47  void setValue(const std::set<CA_Relaxation>& relaxSet);
48  bool setValueFromVariant(const Core::Variant& /*value*/) { return false; }
49  void copyValue(Core::Property* p);
50 
51  void insert(const CA_Relaxation& r);
52  const std::set<CA_Relaxation>& getValue() const;
53 
54  Core::Variant getVariant(void) const { return Core::Variant(0); }
55 
56  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
57  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
58  virtual bool isEqual(const Property*) const;
59  virtual Core::Property* copy(void) const override;
60  virtual void paste(const Core::Property& from) override;
61 
62 protected:
63  std::set<CA_Relaxation> _relaxSet;
64 };
65 
66 DECLARE_PROPERTY_FACTORY(PropertyRelaxation_Factory, Core::PropertyRelaxation);
67 DECLARE_PROPERTY_FACTORY(PropertyRelaxationSet_Factory, Core::PropertyRelaxationSet);
68 
69 } // namespace Core
Definition: PropertyRelaxation.h:14
CA_Relaxation _value
Definition: PropertyRelaxation.h:36
Definition: Persistence.h:14
Definition: PropertyRelaxation.h:39
Core::Variant getVariant(void) const
Definition: PropertyRelaxation.h:54
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
Definition: Base.h:12
Definition: Writer.h:16
std::set< CA_Relaxation > _relaxSet
Definition: PropertyRelaxation.h:63
Definition: Property.h:77
bool setValueFromVariant(const Core::Variant &)
Definition: PropertyRelaxation.h:48
TYPESYSTEM_HEADER()
std::pair< double, double > CA_Relaxation
Definition: PropertyRelaxation.h:7
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)