OpenLexocad  28.0
PropertyDescriptor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/GeometryLimit.h>
4 #include <Core/PropertyBoolean.h>
5 
6 namespace Core
7 {
8 /* @brief Saves and restore the characteristics of a Property
9  */
10 class LX_CORE_EXPORT PropertyDescriptor : public Core::DocObject
11 {
12  typedef Core::DocObject inherited;
13 
16 public:
17  enum Type
18  {
32  };
33 
34  enum struct LxzType : int
35  {
36  NotLxz = 0,
37  Lxz_eBKP = 101,
38  Lxz_4D = 102,
39  Lxz_NPK = 103,
40  };
41 
43  PropertyTextOpt defaultDisplayName;
44  PropertyTextOpt defaultDisplayNameEn;
45  PropertyTextOpt defaultDisplayNameFr;
46  PropertyTextOpt defaultDisplayNameIt;
47 
54  PropertyTextOpt ifcPropertyName;
55 
60  PropertyBoolean forPropertySetInfo; // all properties for PropertySetInfo should have unique name
61  PropertyBoolean forceLxProperty; // property is "lx user property" even if it does not start with "lx_"
63  PropertyInteger isLuccProperty; // 0 is not lucc property, 1 is lucc property, 2 is unmodified lucc property from csv file
71 
77 
80 
81  bool mustbeSaved() const override;
82  void setMustbeSaved(bool aValue);
83  virtual Type getType() const = 0;
84 
87 
88  int getAvailableLmeIndex(int aMin = 1) const;
89 
91 
92  // for App::PropertySetInfo
93  bool isLxzProperty() const;
94  Base::String getEntryType() const; // returns only existing type
95  static Base::String getEntryType(const Base::String& s); // fix for import
96  static const std::vector<std::pair<Base::String, int>>& getEntryTypes() { return _entryTypes; }
97 
99  static Core::PropertyDescriptor* getByCompanyChapterIndex(Core::CoreDocument* doc, int aCompany, const Base::String& aChapter, int aIndex);
100 
101  virtual size_t computeHash(bool strictComparison = false);
102 
103 protected:
105 
108  const Base::String& name,
109  Base::AbstractXMLReader& reader,
111 
112 private:
113  PropertyBoolean mustbeSaved_;
114 
115  static std::vector<std::pair<Base::String, int>> _entryTypes; // entryType, translation id //for App::PropertySetInfo
116 };
117 
119 } // namespace Core
Core::PropertyDescriptor::INTEGER
@ INTEGER
Definition: PropertyDescriptor.h:20
Core::PropertyDescriptor::BUTTON
@ BUTTON
Definition: PropertyDescriptor.h:25
Core::PropertyDescriptor::isMaterialProperty
PropertyBoolean isMaterialProperty
Definition: PropertyDescriptor.h:62
Core::PropertyDescriptor::npkChapter
PropertyText npkChapter
Definition: PropertyDescriptor.h:69
Core::PropertyDescriptor::copyValuesFrom
void copyValuesFrom(const Core::PropertyDescriptor *other)
Core::PropertyDescriptor::defaultDisplayName
PropertyTextOpt defaultDisplayName
Definition: PropertyDescriptor.h:43
Core::PropertyDescriptor::UNDEFINED
@ UNDEFINED
Definition: PropertyDescriptor.h:19
Core::PropertyDescriptor::formulaArg3
PropertyText formulaArg3
Definition: PropertyDescriptor.h:76
Core::CoreDocument
Definition: CoreDocument.h:269
Core::PropertyDescriptor::index
PropertyInteger index
Definition: PropertyDescriptor.h:51
Core::PropertyDescriptor::ifcPropertyName
PropertyTextOpt ifcPropertyName
Definition: PropertyDescriptor.h:54
Core::PropertyDescriptor::lccCompany
PropertyInteger lccCompany
Definition: PropertyDescriptor.h:65
Core::PropertyDescriptor::getDisplayName
Base::String getDisplayName() const
Core::PropertyDescriptor::formulaOp2
PropertyText formulaOp2
Definition: PropertyDescriptor.h:75
Core::PropertyDescriptor::formulaArg2
PropertyText formulaArg2
Definition: PropertyDescriptor.h:74
Core::PropertyDescriptor::PropertyDescriptor
PropertyDescriptor()
Core::PropertyDescriptor::lxzType
PropertyInteger lxzType
Definition: PropertyDescriptor.h:64
Core::PropertyDescriptor::formulaArg1
PropertyText formulaArg1
Definition: PropertyDescriptor.h:72
Core::PropertyDescriptor::copy
Core::DocObject * copy(Core::CoreDocument *toDoc, DocObjectMap &copyMap) override
Core::PropertyDescriptor::getByCompanyChapterIndex
static Core::PropertyDescriptor * getByCompanyChapterIndex(Core::CoreDocument *doc, int aCompany, const Base::String &aChapter, int aIndex)
Core::PropertyDescriptor::geometryLimit1
Core::PropertyLink< Core::GeometryLimit * > geometryLimit1
Definition: PropertyDescriptor.h:70
Core::PropertyDescriptor::defaultDisplayNameIt
PropertyTextOpt defaultDisplayNameIt
Definition: PropertyDescriptor.h:46
Core::PropertyDescriptor::ENUM
@ ENUM
Definition: PropertyDescriptor.h:24
Core::DocObjectMap
std::map< Core::DocObject *, Core::DocObject * > DocObjectMap
Definition: DocObject.h:50
Core::PropertyBoolean
Definition: PropertyBoolean.h:14
Core::PropertyDescriptor::mustbeSaved
bool mustbeSaved() const override
Return 'true' if this object must always be saved in the file.
Core::PropertyDescriptor::getAvailableLmeIndex
int getAvailableLmeIndex(int aMin=1) const
Core::PropertyDescriptor::Type
Type
Definition: PropertyDescriptor.h:18
Core::PropertyDescriptor::computeHash
virtual size_t computeHash(bool strictComparison=false)
Core::PropertyDescriptor::entryType
PropertyText entryType
Definition: PropertyDescriptor.h:56
Core::PropertyDescriptor::extended
PropertyBoolean extended
Definition: PropertyDescriptor.h:67
Core::PropertyDescriptor::isLuccProperty
PropertyInteger isLuccProperty
Definition: PropertyDescriptor.h:63
Core::PropertyDescriptor::BOOL
@ BOOL
Definition: PropertyDescriptor.h:22
Core::PropertyDescriptor::restoreProperty
void restoreProperty(Core::Property *property, const Base::String &name, Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
Restores property from from reader in specified version.
Core::PropertyDescriptor::defaultDisplayNameEn
PropertyTextOpt defaultDisplayNameEn
Definition: PropertyDescriptor.h:44
PropertyBoolean.h
Core::PropertyDescriptor::unit
PropertyText unit
Definition: PropertyDescriptor.h:57
Core::PropertyDescriptor::GROUP
@ GROUP
Definition: PropertyDescriptor.h:29
Core::PropertyDescriptor::DOUBLE
@ DOUBLE
Definition: PropertyDescriptor.h:21
Core::DocObject
Definition: DocObject.h:54
Core::PropertyDescriptor::detail
PropertyText detail
Definition: PropertyDescriptor.h:58
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyDescriptor::setMustbeSaved
void setMustbeSaved(bool aValue)
Core
Definition: Base.h:5
Core::PropertyDescriptor::getFormula
Base::String getFormula() const
Core::PropertyDescriptor::POINT
@ POINT
Definition: PropertyDescriptor.h:27
LX_NODE_HEADER
#define LX_NODE_HEADER()
Definition: PropertyMacros.h:7
Core::PropertyDescriptor::isEditable
PropertyBoolean isEditable
Definition: PropertyDescriptor.h:49
Core::PropertyDescriptor
Definition: PropertyDescriptor.h:11
Core::PropertyDescriptor::getByParameterName
static Core::PropertyDescriptor * getByParameterName(Core::CoreDocument *doc, const Base::String &name)
Core::PropertyDescriptor::STRING
@ STRING
Definition: PropertyDescriptor.h:23
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
GeometryLimit.h
Core::PropertyDescriptor::isLxzProperty
bool isLxzProperty() const
Core::PropertyDescriptor::isVisible
PropertyBoolean isVisible
Definition: PropertyDescriptor.h:48
Core::PropertyDescriptor::getEntryType
static Base::String getEntryType(const Base::String &s)
Core::PropertyDescriptor::COLOR
@ COLOR
Definition: PropertyDescriptor.h:26
Core::PropertyText
Definition: PropertyText.h:8
Core::PropertyDescriptor::isUserLxz
PropertyBoolean isUserLxz
Definition: PropertyDescriptor.h:66
Core::PropertyDescriptor::extendedVisible
PropertyBoolean extendedVisible
Definition: PropertyDescriptor.h:68
Core::PropertyDescriptor::~PropertyDescriptor
virtual ~PropertyDescriptor()
Core::PropertyDescriptor::indexDecimalPart
PropertyInteger indexDecimalPart
Definition: PropertyDescriptor.h:52
Core::PropertyDescriptor::forceLxProperty
PropertyBoolean forceLxProperty
Definition: PropertyDescriptor.h:61
Core::PropertyDescriptor::negative
PropertyBoolean negative
Definition: PropertyDescriptor.h:59
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyDescriptor::guid
PropertyText guid
Definition: PropertyDescriptor.h:53
Core::PropertyDescriptor::getEntryType
Base::String getEntryType() const
Core::Property
Definition: Property.h:72
Core::PropertyDescriptor::LXFORMULA
@ LXFORMULA
Definition: PropertyDescriptor.h:31
Core::PropertyDescriptor::LXATTRIBUTE
@ LXATTRIBUTE
Definition: PropertyDescriptor.h:30
Core::PropertyDescriptor::forPropertySetInfo
PropertyBoolean forPropertySetInfo
Definition: PropertyDescriptor.h:60
Core::DECLARE_PROPERTY_TEMPLATES
DECLARE_PROPERTY_TEMPLATES(Core::ColorSetForPED, LX_CORE_EXPORT)
Core::PropertyDescriptor::OBJECT
@ OBJECT
Definition: PropertyDescriptor.h:28
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Core::PropertyDescriptor::formulaOp1
PropertyText formulaOp1
Definition: PropertyDescriptor.h:73
Core::PropertyDescriptor::getType
virtual Type getType() const =0
Core::PropertyDescriptor::translationId
PropertyInteger translationId
Definition: PropertyDescriptor.h:50
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::PropertyDescriptor::parameterName
PropertyText parameterName
Definition: PropertyDescriptor.h:42
Core::PropertyDescriptor::defaultDisplayNameFr
PropertyTextOpt defaultDisplayNameFr
Definition: PropertyDescriptor.h:45
Core::PropertyDescriptor::getEntryTypes
static const std::vector< std::pair< Base::String, int > > & getEntryTypes()
Definition: PropertyDescriptor.h:96
Core::PropertyInteger
Definition: PropertyInteger.h:8
Core::PropertyDescriptor::LxzType
LxzType
Definition: PropertyDescriptor.h:35