OpenLexocad  27.1
PropertyGeometryList.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <vector>
5 #include <string>
6 #include <memory>
7 #include <Core/Property.h>
8 #include <Geom/Geometry.h>
9 #include <Base/Writer.h>
10 #include <Base/Reader.h>
11 
12 namespace Core
13 {
14  class Geometry;
15 
16  class LX_CORE_EXPORT PropertyGeometryList : public Core::Property
17  {
19 
20  public:
26 
31  virtual ~PropertyGeometryList();
32 
33  bool setValueFromVariant(const Core::Variant& value) override;
34  void copyValue(Core::Property* p) override;
35  Core::Variant getVariant(void) const override;
36  virtual bool isEqual(const Property*) const override;
37  virtual std::shared_ptr<Core::DbgInfo> getDbgInfo() const override;
38  virtual Core::Property* copy(void) const override;
39  virtual void paste(const Core::Property& from) override;
40 
41  bool setValue(const std::vector<Geom::Geometry*>&);
42 
47  bool setValues(const std::vector<Geom::Geometry*>&);
48  const std::vector<Geom::Geometry*>& getValue() const;
49 
54  const std::vector<Geom::Geometry*>& getValues() const;
55 
56  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
57 
59  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
60 
61  virtual void setSize(int newSize);
62  virtual int getSize(void) const;
63 
66  void set1Value(int idx, std::unique_ptr<Geom::Geometry>&&);
67  bool setSingleValue(const Geom::Geometry*);
68  bool setValues(const std::vector<Geom::Geometry*>&&);
69 
71  Geom::Geometry* operator[] (const int idx) const {
72  return mValueList[idx];
73  }
74 
75  private:
76  std::vector<Geom::Geometry*> mValueList;
77  };
78 
79 } // namespace Part
80 
Definition: Persistence.h:14
Definition: Geometry.h:75
Definition: PropertyGeometryList.h:16
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
Definition: Base.h:12
Definition: Writer.h:16
Definition: Property.h:77
TYPESYSTEM_HEADER()