OpenLexocad  27.0
PropertyRelaxation.h
Go to the documentation of this file.
1 #pragma once
2 #include <Core/core_defines2.h>
3 
4 #include <set>
5 
6 #include "Core/Property.h"
7 #include "Core/Variant.h"
8 
9 typedef std::pair<double, double> CA_Relaxation;
10 
11 // first -> double relaxationValue;
12 // second -> double initialStress;
13 
14 namespace Core
15 {
17 {
19 
20 public:
21  PropertyRelaxation(void);
22  virtual ~PropertyRelaxation(void);
23 
24  void setValue(const CA_Relaxation& r);
25  bool setValueFromVariant(const Core::Variant& value);
26  void copyValue(Core::Property* p);
27 
28  const CA_Relaxation& getValue() const;
29  Core::Variant getVariant(void) const;
30 
31  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
32  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
33  virtual bool isEqual(const Property*) const;
34 
35 protected:
37 };
38 
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::PersistanceVersion& save_version);
57  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
58  virtual bool isEqual(const Property*) const;
59 
60 protected:
61  std::set<CA_Relaxation> _relaxSet;
62 };
63 
64 DECLARE_PROPERTY_FACTORY(PropertyRelaxation_Factory, Core::PropertyRelaxation);
65 DECLARE_PROPERTY_FACTORY(PropertyRelaxationSet_Factory, Core::PropertyRelaxationSet);
66 
67 } // namespace Core
#define CORE_EXPORT
Definition: core_defines2.h:10
Definition: PropertyRelaxation.h:16
CA_Relaxation _value
Definition: PropertyRelaxation.h:36
Definition: PropertyRelaxation.h:39
Core::Variant getVariant(void) const
Definition: PropertyRelaxation.h:54
Definition: Persistance.h:20
LX_CORE_EXPORT Version & version
Definition: Variant.h:90
Definition: AbstractXMLReader.h:10
Definition: Base.h:19
Definition: Writer.h:27
std::set< CA_Relaxation > _relaxSet
Definition: PropertyRelaxation.h:61
Definition: Property.h:81
bool setValueFromVariant(const Core::Variant &)
Definition: PropertyRelaxation.h:48
TYPESYSTEM_HEADER()
std::pair< double, double > CA_Relaxation
Definition: PropertyRelaxation.h:9
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)