OpenLexocad  28.0
PropertyVector.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 namespace Core
6 {
7 class LX_CORE_EXPORT PropertyVector : public Core::Property
8 {
10 
11 public:
12  void setValue(const Geom::Vec& v);
13  bool setValueFromVariant(const Core::Variant& value);
15 
16  const Geom::Vec& getValue() const;
18 
19  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
21  virtual bool isEqual(const Property*) const;
22  virtual Core::Property* copy(void) const override;
23  virtual void paste(const Core::Property& from) override;
24 
25 protected:
26  Geom::Vec _vec{0,0,0};
27 };
28 
29 
30 class LX_CORE_EXPORT PropertyVectorList : public Core::Property
31 {
33 
34 public:
35  void setValue(const std::list<Geom::Vec>& list);
36  bool setValueFromVariant(const Core::Variant& value);
38 
39  void addVector(const Geom::Vec& v);
40  void setEmpty();
41  bool isEmpty() const;
42 
43  const std::list<Geom::Vec>& getValue() const;
44 
45  Core::Variant getVariant(void) const { return Core::Variant(_vectorList); }
46 
47  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
49  virtual bool isEqual(const Property*) const;
50  virtual Core::Property* copy(void) const override;
51  virtual void paste(const Core::Property& from) override;
52 
53 protected:
54  std::list<Geom::Vec> _vectorList;
55 };
56 
57 
60 
62 } // namespace Core
Property.h
Core::PropertyVector::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::PropertyVector::isEqual
virtual bool isEqual(const Property *) const
compare properties
Geom::Vec
Defines a non-persistent vector in 3D space.
Definition: Vec.h:41
Core::PropertyVectorList::getValue
const std::list< Geom::Vec > & getValue() const
Core::PropertyVectorList::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyVectorList::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyVectorList::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::PropertyVectorList
Definition: PropertyVector.h:31
Core::PropertyVector::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyVectorList::setEmpty
void setEmpty()
Core::PropertyVector::getValue
const Geom::Vec & getValue() const
Core::PropertyVectorList::copyValue
void copyValue(Core::Property *p)
Core::PropertyVector::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyVector
Definition: PropertyVector.h:8
Base::PersistenceVersion
Definition: Persistence.h:13
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyVector::setValue
void setValue(const Geom::Vec &v)
Core::PropertyVector::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyVectorList::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...
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyVectorList::getVariant
Core::Variant getVariant(void) const
Definition: PropertyVector.h:45
Core::PropertyVector::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::version
LX_CORE_EXPORT Version & version
Core::PropertyVectorList::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyVectorList::setValue
void setValue(const std::list< Geom::Vec > &list)
Core::Property
Definition: Property.h:72
Core::PropertyVectorList::isEmpty
bool isEmpty() const
Core::PropertyVector::copyValue
void copyValue(Core::Property *p)
Core::DECLARE_OPTIONAL_PROPERTY_HEADER
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Core::PropertyVector::getVariant
Core::Variant getVariant(void) const
Core::PropertyVectorList::_vectorList
std::list< Geom::Vec > _vectorList
Definition: PropertyVector.h:54
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::PropertyVectorList::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyVectorList::addVector
void addVector(const Geom::Vec &v)