OpenLexocad  27.1
PropertyBrepData.h
Go to the documentation of this file.
1 #pragma once
2 #include <Geom/BrepData.h>
3 
4 #include <vector>
5 
6 #include "Core/Property.h"
7 #include "Core/Variant.h"
8 
9 
10 namespace Core
11 {
12 class LX_CORE_EXPORT PropertyBrepData : public Core::Property
13 {
15 
16 public:
19 
20  void setValue(pBrepData data);
21  bool setValueFromVariant(const Core::Variant& value);
22  void copyValue(Core::Property* p);
23 
24  pConstBrepData getValue() const;
25  void setEmpty();
26 
27  Core::Variant getVariant(void) const { return Core::Variant(_data); }
28 
29  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
30  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
31  virtual bool isEqual(const Property*) const;
32  virtual Core::Property* copy(void) const override;
33  virtual void paste(const Core::Property& from) override;
34 
35 protected:
37 };
38 
40 
41 class LX_CORE_EXPORT PropertyBrepDataSet : public Core::Property
42 {
44 
45 public:
48 
49  void setValue(const std::vector<pBrepData>& dataSet);
50  bool setValueFromVariant(const Core::Variant& value);
51  void copyValue(Core::Property* p);
52 
53  void addBrepData(pBrepData data);
54 
55  const std::vector<pBrepData>& getValue() const;
56  void setEmpty();
57 
58  Core::Variant getVariant(void) const { return Core::Variant(_dataSet); }
59 
60  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
61  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
62  virtual bool isEqual(const Property*) const;
63  virtual Core::Property* copy(void) const override;
64  virtual void paste(const Core::Property& from) override;
65 
66 protected:
67  std::vector<pBrepData> _dataSet;
68 };
69 
71 DECLARE_PROPERTY_FACTORY(PropertyBrepData_Factory, Core::PropertyBrepData);
72 DECLARE_PROPERTY_FACTORY(PropertyBrepDataSet_Factory, Core::PropertyBrepDataSet);
73 
74 } // namespace Core
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Core::Variant getVariant(void) const
Definition: PropertyBrepData.h:27
Definition: Persistence.h:14
Core::Variant getVariant(void) const
Definition: PropertyBrepData.h:58
std::shared_ptr< Geom::BrepData > pBrepData
Definition: BrepData.h:28
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:31
Definition: Base.h:12
Definition: Writer.h:16
std::vector< pBrepData > _dataSet
Definition: PropertyBrepData.h:67
Definition: Property.h:77
TYPESYSTEM_HEADER()
pBrepData _data
Definition: PropertyBrepData.h:36
Definition: PropertyBrepData.h:41
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Definition: PropertyBrepData.h:12