OpenLexocad  28.0
PropertyAxis2.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 namespace Base { class AbstractWriter; }
5 namespace Base { class AbstractXMLReader; }
6 namespace Core { class CoreDocument; }
7 namespace Core { class DbgInfo; }
8 
9 namespace Core
10 {
11 class LX_CORE_EXPORT PropertyAxis2 : public Core::Property
12 {
14 
15 public:
17 
18  void setValue(const Geom::Ax2& ax2);
19  bool setValueFromVariant(const Core::Variant& value);
20  virtual bool setKeyValue(const std::string& name, const Core::Variant& value);
21 
22  void setLocation(const Geom::Pnt& loc);
23  void setDirection(const Geom::Dir& zDir);
24  void setXDirecetion(const Geom::Dir& xDir);
25  void setYDirecetion(const Geom::Dir& yDir);
26 
28 
29  const Geom::Ax2& getValue() const;
31  virtual std::map<std::string, Core::Variant> getKeyValueMap() const;
32 
33  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
34 
37  virtual Core::Property* copy(void) const override;
38  virtual void paste(const Core::Property& from) override;
39  virtual bool isEqual(const Property*) const;
40  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
41 
42  bool isIdentity() const;
43 
44 protected:
46 };
47 
48 class LX_CORE_EXPORT PropertyAxis22D : public Core::Property
49 {
51 
52 public:
55 
56  void setValue(const Geom::Ax22d& ax2);
57  bool setValueFromVariant(const Core::Variant& value);
59 
60  const Geom::Ax22d& getValue() const;
62 
64 
65  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
66 
69  virtual bool isEqual(const Property*) const;
70  virtual Core::Property* copy(void) const override;
71  virtual void paste(const Core::Property& from) override;
72 
73  std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
74 
75 protected:
77 };
78 
79 class LX_CORE_EXPORT PropertyAxis2List : public Core::Property
80 {
82 
83 public:
84  PropertyAxis2List() = default;
85 
86  void setValue(const std::list<Geom::Ax2>& ax2list);
87  bool setValueFromVariant(const Core::Variant& value);
89 
90  void addAx2(const Geom::Ax2& ax2);
91  void setEmpty();
92  bool isEmpty() const;
93 
94  const std::list<Geom::Ax2>& getValue() const;
95 
96  Core::Variant getVariant(void) const { return Core::Variant(0); }
97 
98  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
100  virtual bool isEqual(const Property*) const;
101  virtual Core::Property* copy(void) const override;
102  virtual void paste(const Core::Property& from) override;
103 
104 protected:
105  std::list<Geom::Ax2> _ax2List;
106 };
107 
111 
112 
113 } // namespace Core
Core::PropertyAxis2List::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Property.h
Core::PropertyAxis22D::getDbgInfo
std::shared_ptr< Core::DbgInfo > getDbgInfo() const override
Returns the debug information for this property.
Core::PropertyAxis2::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::PropertyAxis2::copyValue
void copyValue(Core::Property *p)
Core::PropertyAxis22D::save
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::PropertyAxis22D::getVariant
Core::Variant getVariant(void) const
Core::PropertyAxis22D::copyValue
void copyValue(Core::Property *p)
Core::PropertyAxis2::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
Throws Base::FileException.
Core::PropertyAxis2::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyAxis2List
Definition: PropertyAxis2.h:80
Core::PropertyAxis2List::addAx2
void addAx2(const Geom::Ax2 &ax2)
Core::PropertyAxis22D::~PropertyAxis22D
~PropertyAxis22D(void)
Core::PropertyAxis2List::setEmpty
void setEmpty()
Core::PropertyAxis2List::_ax2List
std::list< Geom::Ax2 > _ax2List
Definition: PropertyAxis2.h:105
Core::PropertyAxis22D::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::PropertyAxis2::setValue
void setValue(const Geom::Ax2 &ax2)
Core::PropertyAxis22D::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyAxis2List::getValue
const std::list< Geom::Ax2 > & getValue() const
Core::PropertyAxis2List::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::PropertyAxis2::getVariant
Core::Variant getVariant(void) const
Geom::Dir
Definition: Dir.h:45
Core::PropertyAxis22D::setValue
void setValue(const Geom::Ax22d &ax2)
Core::PropertyAxis22D::PropertyAxis22D
PropertyAxis22D(void)
Core::PropertyAxis2::getValue
const Geom::Ax2 & getValue() const
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyAxis22D::restore
void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
Throws Base::FileException.
Core::PropertyAxis22D::getValue
const Geom::Ax22d & getValue() const
Core::PropertyAxis2::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core
Definition: Base.h:5
Core::PropertyAxis2List::getVariant
Core::Variant getVariant(void) const
Definition: PropertyAxis2.h:96
Core::PropertyAxis2::setLocation
void setLocation(const Geom::Pnt &loc)
Core::Variant
Definition: Variant.h:78
Core::PropertyAxis2List::isEmpty
bool isEmpty() const
Geom::Pnt
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
Geom::Ax2
Definition: Ax2.h:66
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyAxis2
Definition: PropertyAxis2.h:12
Core::PropertyAxis22D::getAxis2
Geom::Ax2 getAxis2() const
Core::PropertyAxis2List::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::PropertyAxis2::PropertyAxis2
PropertyAxis2(void)
Core::PropertyAxis2::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyAxis22D::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyAxis2::setYDirecetion
void setYDirecetion(const Geom::Dir &yDir)
Core::PropertyAxis2List::PropertyAxis2List
PropertyAxis2List()=default
Core::PropertyAxis2::setXDirecetion
void setXDirecetion(const Geom::Dir &xDir)
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyAxis2::_ax2
Geom::Ax2 _ax2
Definition: PropertyAxis2.h:45
Core::PropertyAxis2List::setValue
void setValue(const std::list< Geom::Ax2 > &ax2list)
Core::PropertyAxis2::getDbgInfo
std::shared_ptr< Core::DbgInfo > getDbgInfo() const override
Returns the debug information for this property.
Core::Property
Definition: Property.h:72
Geom::Ax22d
Definition: Ax22d.h:51
Core::PropertyAxis2List::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyAxis2::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::PropertyAxis22D
Definition: PropertyAxis2.h:49
Core::PropertyAxis22D::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyAxis22D::_ax2
Geom::Ax22d _ax2
Definition: PropertyAxis2.h:76
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::PropertyAxis2::setDirection
void setDirection(const Geom::Dir &zDir)
Core::PropertyAxis2::setKeyValue
virtual bool setKeyValue(const std::string &name, const Core::Variant &value)
Sets a sub key in this property.
Core::PropertyAxis2List::copyValue
void copyValue(Core::Property *p)
Core::PropertyAxis2::getKeyValueMap
virtual std::map< std::string, Core::Variant > getKeyValueMap() const
Returns all keys and their values of this property.
Core::PropertyAxis2::isIdentity
bool isIdentity() const
Base
Definition: AbstractXMLReader.h:5
Core::PropertyAxis2List::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyAxis2List::isEqual
virtual bool isEqual(const Property *) const
compare properties