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