OpenLexocad  27.1
PropertyAxis2.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Geom/Ax2.h>
4 #include <Geom/Ax22d.h>
5 
6 #include <list>
7 
8 #include "Core/Property.h"
9 #include "Core/Variant.h"
10 
11 namespace Core
12 {
13 class LX_CORE_EXPORT PropertyAxis2 : public Core::Property
14 {
16 
17 public:
18  PropertyAxis2(void);
19  virtual ~PropertyAxis2(void);
20 
21  void setValue(const Geom::Ax2& ax2);
22  bool setValueFromVariant(const Core::Variant& value);
23  virtual bool setKeyValue(const std::string& name, const Core::Variant& value);
24 
25  void setLocation(const Geom::Pnt& loc);
26  void setDirection(const Geom::Dir& zDir);
27  void setXDirecetion(const Geom::Dir& xDir);
28  void setYDirecetion(const Geom::Dir& yDir);
29 
30  void copyValue(Core::Property* p);
31 
32  const Geom::Ax2& getValue() const;
33  Core::Variant getVariant(void) const;
34  virtual std::map<std::string, Core::Variant> getKeyValueMap() const;
35 
36  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
37 
39  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
40  virtual Core::Property* copy(void) const override;
41  virtual void paste(const Core::Property& from) override;
42  virtual bool isEqual(const Property*) const;
43  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
44 
45 protected:
47 };
48 
49 class LX_CORE_EXPORT PropertyAxis22D : public Core::Property
50 {
52 
53 public:
54  PropertyAxis22D(void);
55  ~PropertyAxis22D(void);
56 
57  void setValue(const Geom::Ax22d& ax2);
58  bool setValueFromVariant(const Core::Variant& value);
59  void copyValue(Core::Property* p);
60 
61  const Geom::Ax22d& getValue() const;
62  Core::Variant getVariant(void) const;
63 
64  Geom::Ax2 getAxis2() const;
65 
66  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
67 
69  inline void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
70  virtual bool isEqual(const Property*) const;
71  virtual Core::Property* copy(void) const override;
72  virtual void paste(const Core::Property& from) override;
73 
74  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
75 
76 protected:
78 };
79 
80 class LX_CORE_EXPORT PropertyAxis2List : public Core::Property
81 {
83 
84 public:
87 
88  void setValue(const std::list<Geom::Ax2>& ax2list);
89  bool setValueFromVariant(const Core::Variant& /*value*/) { return false; }
90  void copyValue(Core::Property* p);
91 
92  void addAx2(const Geom::Ax2& ax2);
93  void setEmpty();
94  bool isEmpty() const;
95 
96  const std::list<Geom::Ax2>& getValue() const;
97 
98  Core::Variant getVariant(void) const { return Core::Variant(0); }
99 
100  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
101  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
102  virtual bool isEqual(const Property*) const;
103  virtual Core::Property* copy(void) const override;
104  virtual void paste(const Core::Property& from) override;
105 
106 protected:
108 };
109 
110 DECLARE_PROPERTY_FACTORY(PropertyAxis2_Factory, Core::PropertyAxis2);
111 DECLARE_PROPERTY_FACTORY(PropertyAxis22D_Factory, Core::PropertyAxis22D);
112 DECLARE_PROPERTY_FACTORY(PropertyAxis2List_Factory, Core::PropertyAxis2List);
113 
114 
115 } // namespace Core
Geom::Ax2 _ax2
Definition: PropertyAxis2.h:46
bool setValueFromVariant(const Core::Variant &)
Definition: PropertyAxis2.h:89
Definition: Persistence.h:14
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:43
std::list< Geom::Ax2 > _ax2List
Definition: PropertyAxis2.h:107
Core::PropertyText name
Definition: CoreDocument.h:167
Definition: PropertyAxis2.h:80
Definition: PropertyAxis2.h:13
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: Ax2.h:67
Definition: AbstractXMLReader.h:7
Definition: Dir.h:45
Definition: Base.h:12
Core::Variant getVariant(void) const
Definition: PropertyAxis2.h:98
Definition: Writer.h:16
Definition: Ax22d.h:50
Definition: PropertyAxis2.h:49
Definition: Property.h:77
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Geom::Ax22d _ax2
Definition: PropertyAxis2.h:77