OpenLexocad  28.0
PropertyReal.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 PropertyReal : public Core::Property
8 {
10 
11 public:
12  virtual void setValue(double d);
13  virtual bool setValueFromVariant(const Core::Variant& value);
14  virtual void copyValue(Core::Property* p);
15 
16  bool maybeSetValue(double d);
17 
18  double getValue() const;
20 
21  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
22  virtual bool createSQL(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version, bool data) override;
24  virtual bool isEqual(const Property*) const;
25  virtual Core::Property* copy(void) const override;
26  virtual void paste(const Core::Property& from) override;
27 
28 protected:
29  double _dValue = 0.0;
30 };
31 
33 
35 //
36 // Core::PropertyRealList
37 //
38 // A list of real numbers
39 //
41 
42 class LX_CORE_EXPORT PropertyRealList : public Core::Property
43 {
45 
46 public:
47  virtual void setValue(const std::vector<double>& value);
48  virtual bool setValueFromVariant(const Core::Variant& value);
49  virtual void copyValue(Core::Property* p);
50 
51  const std::vector<double>& getValue() const { return _listOfReal; }
52  Core::Variant getVariant(void) const { return Core::Variant(_listOfReal); }
53 
54  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
56  virtual bool isEqual(const Property*) const;
57  virtual Core::Property* copy(void) const override;
58  virtual void paste(const Core::Property& from) override;
59 
60  double getValueAt(size_t index) const;
61  bool isEmpty() const;
62  size_t getSize() const;
63 
64 protected:
65  std::vector<double> _listOfReal;
66 };
67 
69 //
70 // Core::PropertyLength
71 //
72 // A length property contains the value of a distance.
73 //
75 
76 class LX_CORE_EXPORT PropertyLength : public Core::PropertyReal
77 {
79 };
80 
82 //
83 // Core::PropertyLengthMeasure
84 //
85 // A length property contains the value of a distance.
86 //
88 
89 class LX_CORE_EXPORT PropertyLengthMeasure : public Core::PropertyReal
90 {
92 };
93 
95 //
96 // Core::PropertyLengthOpt
97 //
98 // An optional length property: Can contain the value of a distance.
99 //
101 
102 // DONOT USE MACRO HERE SINCE WE HAVE TO CONVERT DATA FROM
103 // AN OLDER VERSION
104 // DECLARE_OPTIONAL_PROPERTY_HEADER(Core::PropertyLengthOpt,Core::PropertyLength);
105 
106 class LX_CORE_EXPORT PropertyLengthOpt : public Core::PropertyLength
107 {
109 
110 public:
111  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
113  bool isOptional() const { return true; }
114 };
115 
117 //
118 // Core::PropertyPositiveLength
119 //
120 // A positive length property is a length property with a value greater than zero.
121 //
123 
124 class LX_CORE_EXPORT PropertyPositiveLength : public Core::PropertyReal
125 {
127 };
128 
130 
132 //
133 // Core::PropertyPositiveLengthMeasure
134 //
135 // A positive length property is a length property with a value greater than zero.
136 //
138 
140 {
142 };
143 
145 //
146 // Core::PropertyPlaneAngle
147 //
148 // A plane angle property contains the value of an angle in a plane.
149 //
151 
152 class LX_CORE_EXPORT PropertyPlaneAngle : public Core::PropertyReal
153 {
155 };
156 
158 
160 //
161 // Core::PropertyPositivePlaneAngle
162 //
163 // Positive plane angle property is a plane angle property that is greater than zero.
164 //
166 
167 class LX_CORE_EXPORT PropertyPositivePlaneAngle : public Core::PropertyReal
168 {
170 };
171 
173 
175 //
176 // Core::PropertyRatio
177 //
178 // A ratio property contains the value of the relation between two physical quantities that are of the same kind.
179 //
181 
182 class LX_CORE_EXPORT PropertyRatio : public Core::PropertyReal
183 {
185 };
186 
188 //
189 // Core::RatioMeasure
190 //
191 // A positive ratio property is a ratio property with a value greater than zero.
192 //
194 
195 class LX_CORE_EXPORT PropertyRatioMeasure : public Core::PropertyReal
196 {
198 };
199 
201 //
202 // Core::PropertyPositiveRatioMeasure
203 //
204 // A positive ratio property is a ratio property with a value greater than zero.
205 //
207 
209 {
211 };
212 
214 //
215 // Core::PropertyPositiveRatio
216 //
217 // A positive ratio property is a ratio property with a value greater than zero.
218 //
220 
221 class LX_CORE_EXPORT PropertyPositiveRatio : public Core::PropertyReal
222 {
224 };
225 
227 //
228 // Core::PropertyNormalisedRatio
229 //
230 // A property that contains a dimensionless measure
231 // to express ratio values ranging from 0.0 to 1.0.
232 //
234 
235 class LX_CORE_EXPORT PropertyNormalisedRatio : public Core::PropertyReal
236 {
238 };
239 
241 
243 //
244 // Core::PropertyDynamicViscosity
245 //
246 // A property that contains the viscous resistance of a medium.
247 // Usually measured in Pascal second (Pa s).
248 //
250 
251 class LX_CORE_EXPORT PropertyDynamicViscosity : public Core::PropertyReal
252 {
254 };
255 
257 //
258 // Core::PropertyModulusOfElasticity
259 //
260 // A property that contains the modulus of elasticity
261 // Usually measured in N/m2.
262 //
264 
265 class LX_CORE_EXPORT PropertyModulusOfElasticity : public Core::PropertyReal
266 {
268 };
269 
271 //
272 // Core::PropertyThermalExpansionCoefficient
273 //
274 // A property that contains the thermal expansion coefficient of a material,
275 // which expresses its elongation (as a ratio) per temperature difference.
276 // It is usually measured in 1/K. A positive elongation per (positive)
277 // rise of temperature is expressed by a positive value.
278 //
280 
282 {
284 };
285 
286 
288 //
289 // Core::PropertyPressure
290 //
291 // A property that contains the quantity of a medium acting on a unit area.
292 // Usually measured in Pascals (Pa, N/m2).
293 //
295 
296 class LX_CORE_EXPORT PropertyPressure : public Core::PropertyReal
297 {
299 };
300 
302 //
303 // Core::PropertyThermodynamicTemperature
304 //
305 // A thermodynamic temperature property contains the value for the degree of heat of a body.
306 // Usually measured in degrees Kelvin (K).
307 //
309 
311 {
313 };
314 
316 //
317 // Core::PropertySpecificHeatCapacity
318 //
319 // Defines the specific heat of material: The heat energy absorbed per temperature unit.
320 // Usually measured in J / kg Kelvin.
321 //
323 
325 {
327 };
328 
330 //
331 // Core::PropertyThermalConductivity
332 //
333 // A property containing the thermal conductivity.
334 // Usually measured in Watt / m Kelvin.
335 //
337 
338 class LX_CORE_EXPORT PropertyThermalConductivity : public Core::PropertyReal
339 {
341 };
342 
344 //
345 // Core::PropertyIsothermalMoistureCapacity
346 //
347 // A property containing the isothermal moisture capacity.
348 // Usually measured in m3/kg.
349 //
351 
353 {
355 };
356 
358 //
359 // Core::PropertyVaporPermeability
360 //
361 // A property containing the vapor permeability.
362 // Usually measured in kg / s m Pascal.
363 //
365 
366 class LX_CORE_EXPORT PropertyVaporPermeability : public Core::PropertyReal
367 {
369 };
370 
372 //
373 // Core::PropertyMoistureDiffusivity
374 //
375 // A property containing the moisture diffusivity.
376 // Usually measured in m3/s.
377 //
379 
380 class LX_CORE_EXPORT PropertyMoistureDiffusivity : public Core::PropertyReal
381 {
383 };
384 
386 //
387 // Core::PropertyMolecularWeight
388 //
389 // A property containing the molecular weight of material (typically gas).
390 // Usually measured in g/mole.
391 //
393 
394 class LX_CORE_EXPORT PropertyMolecularWeight : public Core::PropertyReal
395 {
397 };
398 
400 //
401 // Core::PropertyMassDensity
402 //
403 // A property containing the density of a medium.
404 // Usually measured in kg/m3.
405 //
407 
408 class LX_CORE_EXPORT PropertyMassDensity : public Core::PropertyReal
409 {
411 };
412 
414 //
415 // Core::PropertyIonConcentration
416 //
417 // A property containing the particular ion concentration in a liquid, given in mg/L.
418 //
420 
421 class LX_CORE_EXPORT PropertyIonConcentration : public Core::PropertyReal
422 {
424 };
425 
427 //
428 // Core::PropertyPHMeasure
429 //
430 // A property containing the molar hydrogen ion concentration in a liquid (usually defined as the measure of acidity).
431 //
433 
434 class LX_CORE_EXPORT PropertyPHMeasure : public Core::PropertyReal
435 {
437 };
438 
440 //
441 // Core::PropertyHeatingValue
442 //
443 // Defines the amount of energy released (usually in MJ/kg) when a fuel is burned.
444 //
446 
447 class LX_CORE_EXPORT PropertyHeatingValue : public Core::PropertyReal
448 {
450 };
451 
453 {
455 };
456 
458 {
460 };
461 
463 {
465 };
466 
467 
469 DECLARE_PROPERTY_FACTORY(PropertyRealOpt_Factory, Core::PropertyRealOpt);
476 DECLARE_PROPERTY_FACTORY(PropertyPositivePlaneAngle_Factory, Core::PropertyPositivePlaneAngle);
480 DECLARE_PROPERTY_FACTORY(PropertyPositiveRatioMeasure_Factory, Core::PropertyPositiveRatioMeasure);
481 DECLARE_PROPERTY_FACTORY(PropertyNormalisedRatio_Factory, Core::PropertyNormalisedRatio);
482 DECLARE_PROPERTY_FACTORY(PropertyDynamicViscosity_Factory, Core::PropertyDynamicViscosity);
483 DECLARE_PROPERTY_FACTORY(PropertyModulusOfElasticity_Factory, Core::PropertyModulusOfElasticity);
484 DECLARE_PROPERTY_FACTORY(PropertyThermalExpansionCoefficient_Factory, Core::PropertyThermalExpansionCoefficient);
486 DECLARE_PROPERTY_FACTORY(PropertyThermodynamicTemperature_Factory, Core::PropertyThermodynamicTemperature);
487 DECLARE_PROPERTY_FACTORY(PropertySpecificHeatCapacity_Factory, Core::PropertySpecificHeatCapacity);
488 DECLARE_PROPERTY_FACTORY(PropertyThermalConductivity_Factory, Core::PropertyThermalConductivity);
489 DECLARE_PROPERTY_FACTORY(PropertyIsothermalMoistureCapacity_Factory, Core::PropertyIsothermalMoistureCapacity);
490 DECLARE_PROPERTY_FACTORY(PropertyVaporPermeability_Factory, Core::PropertyVaporPermeability);
491 DECLARE_PROPERTY_FACTORY(PropertyMoistureDiffusivity_Factory, Core::PropertyMoistureDiffusivity);
492 DECLARE_PROPERTY_FACTORY(PropertyMolecularWeight_Factory, Core::PropertyMolecularWeight);
494 DECLARE_PROPERTY_FACTORY(PropertyIonConcentration_Factory, Core::PropertyIonConcentration);
497 DECLARE_PROPERTY_FACTORY(PropertyThermalTransmittance_Factory, Core::PropertyThermalTransmittance);
498 DECLARE_PROPERTY_FACTORY(PropertyThermalTransmittanceMeasure_Factory, Core::PropertyThermalTransmittanceMeasure);
499 DECLARE_PROPERTY_FACTORY(PropertyVolumetricFlowRateMeasure_Factory, Core::PropertyVolumetricFlowRateMeasure);
500 DECLARE_PROPERTY_FACTORY(PropertyPositiveLengthMeasure_Factory, Core::PropertyPositiveLengthMeasure);
501 } // namespace Core
Core::PropertyReal::getValue
double getValue() const
Core::PropertyPositiveRatio
Definition: PropertyReal.h:222
Property.h
Core::PropertyVaporPermeability
Definition: PropertyReal.h:367
Core::PropertyPressure
Definition: PropertyReal.h:297
Core::PropertyReal::getVariant
Core::Variant getVariant(void) const
Core::PropertyReal::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::PropertyPHMeasure
Definition: PropertyReal.h:435
Core::PropertyReal::copyValue
virtual void copyValue(Core::Property *p)
Core::PropertyMassDensity
Definition: PropertyReal.h:409
Core::PropertyRealList::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyLengthOpt::save
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::PropertyRealList::setValueFromVariant
virtual bool setValueFromVariant(const Core::Variant &value)
Core::PropertyReal::createSQL
virtual bool createSQL(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version, bool data) override
This method is used to save properties or very small amounts of data to an XML document.
Core::PropertyLengthOpt
Definition: PropertyReal.h:107
Core::PropertyThermalExpansionCoefficient
Definition: PropertyReal.h:282
Core::PropertyLength
Definition: PropertyReal.h:77
Core::PropertyRealList::isEmpty
bool isEmpty() const
Core::PropertyReal::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyReal::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyThermodynamicTemperature
Definition: PropertyReal.h:311
Core::PropertyRatioMeasure
Definition: PropertyReal.h:196
Core::PropertyPlaneAngle
Definition: PropertyReal.h:153
Core::PropertyReal::setValueFromVariant
virtual bool setValueFromVariant(const Core::Variant &value)
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyReal::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
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Core::PropertyRealList::getVariant
Core::Variant getVariant(void) const
Definition: PropertyReal.h:52
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyNormalisedRatio
Definition: PropertyReal.h:236
Core::PropertyVolumetricFlowRateMeasure
Definition: PropertyReal.h:463
Core::PropertyRealList::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyRealList::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::PropertyRealList::copyValue
virtual void copyValue(Core::Property *p)
Core::PropertyHeatingValue
Definition: PropertyReal.h:448
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertySpecificHeatCapacity
Definition: PropertyReal.h:325
Core::PropertyLengthOpt::isOptional
bool isOptional() const
Checks if this is an optional property.
Definition: PropertyReal.h:113
Core::PropertyReal::maybeSetValue
bool maybeSetValue(double d)
Core::PropertyThermalTransmittance
Definition: PropertyReal.h:453
Core::PropertyDynamicViscosity
Definition: PropertyReal.h:252
Core::PropertyLengthMeasure
Definition: PropertyReal.h:90
Core::PropertyModulusOfElasticity
Definition: PropertyReal.h:266
Core::PropertyPositiveLength
Definition: PropertyReal.h:125
Core::PropertyRealList::setValue
virtual void setValue(const std::vector< double > &value)
Core::PropertyLengthOpt::restore
void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyRealList::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyRealList::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::PropertyRealList
Definition: PropertyReal.h:43
Core::PropertyIonConcentration
Definition: PropertyReal.h:422
Core::Property
Definition: Property.h:72
Core::PropertyPositivePlaneAngle
Definition: PropertyReal.h:168
Core::PropertyRatio
Definition: PropertyReal.h:183
Core::PropertyRealList::_listOfReal
std::vector< double > _listOfReal
Definition: PropertyReal.h:65
Core::PropertyPositiveRatioMeasure
Definition: PropertyReal.h:209
Core::PropertyMoistureDiffusivity
Definition: PropertyReal.h:381
Core::DECLARE_OPTIONAL_PROPERTY_HEADER
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Core::PropertyRealList::getValueAt
double getValueAt(size_t index) const
Core::PropertyReal::setValue
virtual void setValue(double d)
Core::PropertyMolecularWeight
Definition: PropertyReal.h:395
Core::PropertyReal
Definition: PropertyReal.h:8
Core::PropertyThermalTransmittanceMeasure
Definition: PropertyReal.h:458
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::PropertyRealList::getValue
const std::vector< double > & getValue() const
Definition: PropertyReal.h:51
Core::PropertyRealList::getSize
size_t getSize() const
Core::PropertyReal::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyPositiveLengthMeasure
Definition: PropertyReal.h:140
Core::PropertyIsothermalMoistureCapacity
Definition: PropertyReal.h:353
Core::PropertyThermalConductivity
Definition: PropertyReal.h:339