OpenLexocad  28.0
GeometryLimit.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/DocObject.h>
5 #include <Core/PropertyBoolean.h>
6 #include <Core/PropertyInteger.h>
7 #include <Core/PropertyLink.h>
8 #include <Core/PropertyReal.h>
9 #include <Core/PropertyText.h>
10 #include <Core/PropertyTextList.h>
11 #include <Core/PropertyTextMap.h>
12 
13 namespace Core
14 {
15 /* @brief Defines geometry limits for PropertyDecriptor
16  */
17 class LX_CORE_EXPORT GeometryLimit : public Core::DocObject
18 {
21  using inherited = Core::DocObject;
22 
23 public:
24  friend class GeometryLimit_Factory;
25 
26  enum struct GeometryLimitType : int
27  {
28  Lxz_eBKP = 101,
29  Lxz_4D = 102,
30  Lxz_NPK = 103,
31  };
32 
33  static const int intervalOutOfBounds = 1000;
34 
54 
55  virtual QString getKeyText(bool first = true) const;
56 
57  QString getAsStringComplete() const;
58  QString getAsString(bool first = true) const;
59  QString getIntervalAsString(int i, bool first = true) const;
60 
61  int getNumberOfIntervals(bool first = true) const;
62 
63  int getInterval(double d, bool first = true);
64  int getInterval(const Base::String& str, bool first = true);
65 
66  int getNPKPositionNumberForInterval(int i, bool first = true) const;
67 
69  bool mustbeSaved() const override;
70 
71 protected:
73  virtual ~GeometryLimit();
74 
75  Core::DocObject* copy(Core::CoreDocument* toDoc, DocObjectMap& copyMap) override;
76 
78  const Base::String& aName,
81 
82 private:
83  QString getLimitsAsString(bool first = true) const;
84  int getUserDefinedInterval(double d, bool first = true) const;
85  bool getDoubleFromString(QString& str, double& value) const;
86  bool getIntervalFromString(QString& str, double& value1, double& value2) const;
87 
88  bool _pre964 = false; // used in restore() to finish conversion
89 
90  static inline double lastLimitIgnoreValue = 99;
91 };
92 
94 DECLARE_OBJECT_FACTORY_NOIFC(Core::GeometryLimit_Factory, Core::GeometryLimit)
95 } // namespace Core
Core::CoreDocument
Definition: CoreDocument.h:269
Core::GeometryLimit::factor2
PropertyReal factor2
Definition: GeometryLimit.h:50
Core::GeometryLimit::mustbeSaved
bool mustbeSaved() const override
Return 'true' if this object must always be saved in the file.
Core::GeometryLimit::GeometryLimit
GeometryLimit()
Core::GeometryLimit::restoreProperty
void restoreProperty(Core::Property *property, const Base::String &aName, Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
Restores property from from reader in specified version.
Core::GeometryLimit::factor
PropertyReal factor
Definition: GeometryLimit.h:43
Core::GeometryLimit::textLimits
PropertyTextList textLimits
Definition: GeometryLimit.h:46
Core::DocObjectMap
std::map< Core::DocObject *, Core::DocObject * > DocObjectMap
Definition: DocObject.h:50
Core::GeometryLimit::getInterval
int getInterval(const Base::String &str, bool first=true)
DocObject.h
PropertyBoolean.h
Core::GeometryLimit::getNumberOfIntervals
int getNumberOfIntervals(bool first=true) const
Core::GeometryLimit::npkChapter
PropertyText npkChapter
Definition: GeometryLimit.h:39
PropertyTextMap.h
Core::GeometryLimit::GeometryLimitType
GeometryLimitType
Definition: GeometryLimit.h:27
Core::DocObject
Definition: DocObject.h:54
Core::GeometryLimit::restore
void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) override
Restores the PropertyContainer from reader in specified version.
Base::PersistenceVersion
Definition: Persistence.h:13
Core::GeometryLimit::userDefinedLimits2
PropertyTextMap userDefinedLimits2
Definition: GeometryLimit.h:52
Core::GeometryLimit
Definition: GeometryLimit.h:18
Core
Definition: Base.h:5
Core::GeometryLimit::limits2
PropertyRealList limits2
Definition: GeometryLimit.h:51
LX_NODE_HEADER
#define LX_NODE_HEADER()
Definition: PropertyMacros.h:7
PropertyText.h
Core::GeometryLimit::textLimits2
PropertyTextList textLimits2
Definition: GeometryLimit.h:53
Core::DECLARE_OBJECT_FACTORY_NOIFC
DECLARE_OBJECT_FACTORY_NOIFC(PropertyBoolDescriptor_Factory, PropertyBoolDescriptor)
Core::GeometryLimit::getAsStringComplete
QString getAsStringComplete() const
Core::GeometryLimit::detail
PropertyText detail
Definition: GeometryLimit.h:42
Core::GeometryLimit::getAsString
QString getAsString(bool first=true) const
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::GeometryLimit::getNPKPositionNumberForInterval
int getNPKPositionNumberForInterval(int i, bool first=true) const
Core::GeometryLimit::name
PropertyText name
Definition: GeometryLimit.h:40
PropertyInteger.h
Core::PropertyText
Definition: PropertyText.h:8
Core::PropertyTextMap
Definition: PropertyTextMap.h:8
Core::PropertyTextList
Definition: PropertyTextList.h:8
Core::GeometryLimit::indexDecimalPart
PropertyInteger indexDecimalPart
Definition: GeometryLimit.h:38
PropertyReal.h
Core::GeometryLimit::copy
Core::DocObject * copy(Core::CoreDocument *toDoc, DocObjectMap &copyMap) override
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyRealList
Definition: PropertyReal.h:43
Core::GeometryLimit::index
PropertyInteger index
Definition: GeometryLimit.h:37
Core::Property
Definition: Property.h:72
Core::DECLARE_PROPERTY_TEMPLATES
DECLARE_PROPERTY_TEMPLATES(Core::ColorSetForPED, LX_CORE_EXPORT)
Core::GeometryLimit::getInterval
int getInterval(double d, bool first=true)
Core::GeometryLimit::detail2
PropertyText detail2
Definition: GeometryLimit.h:49
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
PropertyTextList.h
Core::GeometryLimit::name2
PropertyText name2
Definition: GeometryLimit.h:47
Core::GeometryLimit::limits
PropertyRealList limits
Definition: GeometryLimit.h:44
Core::GeometryLimit::geometryLimitType
PropertyInteger geometryLimitType
Definition: GeometryLimit.h:35
Core::GeometryLimit::getIntervalAsString
QString getIntervalAsString(int i, bool first=true) const
Core::GeometryLimit::lccCompany
PropertyInteger lccCompany
Definition: GeometryLimit.h:36
Core::PropertyReal
Definition: PropertyReal.h:8
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::GeometryLimit::unit
PropertyText unit
Definition: GeometryLimit.h:41
Core::GeometryLimit::~GeometryLimit
virtual ~GeometryLimit()
Core::GeometryLimit::userDefinedLimits
PropertyTextMap userDefinedLimits
Definition: GeometryLimit.h:45
Core::PropertyInteger
Definition: PropertyInteger.h:8
Core::GeometryLimit::unit2
PropertyText unit2
Definition: GeometryLimit.h:48
Core::GeometryLimit::getKeyText
virtual QString getKeyText(bool first=true) const