OpenLexocad  27.1
PropertyReal.h
Go to the documentation of this file.
1 #pragma once
2 #pragma warning(disable : 4251)
3 #include <Base/StringTool.h>
4 #include <Core/Property.h>
5 #include <Core/Variant.h>
6 
7 #include <list>
8 
9 namespace Core
10 {
11 class LX_CORE_EXPORT PropertyReal : public Core::Property
12 {
14 
15 public:
16  PropertyReal(void);
17  virtual ~PropertyReal(void);
18 
19  virtual void setValue(double d);
20  virtual bool setValueFromVariant(const Core::Variant& value);
21  virtual void copyValue(Core::Property* p);
22 
23  double getValue() const;
24  Core::Variant getVariant(void) const;
25 
26  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
27  virtual bool createSQL(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version, bool data) override;
28  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
29  virtual bool isEqual(const Property*) const;
30  virtual Core::Property* copy(void) const override;
31  virtual void paste(const Core::Property& from) override;
32 
33 protected:
34  double _dValue;
35 };
36 
38 
40 //
41 // Core::PropertyRealList
42 //
43 // A list of real numbers
44 //
46 
47 class LX_CORE_EXPORT PropertyRealList : public Core::Property
48 {
50 
51 public:
52  PropertyRealList(void);
53  virtual ~PropertyRealList(void);
54 
55  virtual void setValue(const std::vector<double>& value);
56  virtual bool setValueFromVariant(const Core::Variant& value);
57  virtual void copyValue(Core::Property* p);
58 
59  const std::vector<double>& getValue() const { return _listOfReal; }
60  Core::Variant getVariant(void) const { return Core::Variant(_listOfReal); }
61 
62  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
63  inline virtual void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
64  virtual bool isEqual(const Property*) const;
65  virtual Core::Property* copy(void) const override;
66  virtual void paste(const Core::Property& from) override;
67 
68  double getValueAt(size_t index) const;
69  size_t getSize() const;
70 
71 protected:
72  std::vector<double> _listOfReal;
73 };
74 
76 //
77 // Core::PropertyLength
78 //
79 // A length property contains the value of a distance.
80 //
82 
83 class LX_CORE_EXPORT PropertyLength : public Core::PropertyReal
84 {
86 
87 public:
88  PropertyLength(void);
89  virtual ~PropertyLength(void);
90 };
91 
93 //
94 // Core::PropertyLengthMeasure
95 //
96 // A length property contains the value of a distance.
97 //
99 
100 class LX_CORE_EXPORT PropertyLengthMeasure : public Core::PropertyReal
101 {
103 
104 public:
105  PropertyLengthMeasure(void);
106  virtual ~PropertyLengthMeasure(void);
107 };
108 
110 //
111 // Core::PropertyLengthOpt
112 //
113 // An optional length property: Can contain the value of a distance.
114 //
116 
117 // DONOT USE MACRO HERE SINCE WE HAVE TO CONVERT DATA FROM
118 // AN OLDER VERSION
119 // DECLARE_OPTIONAL_PROPERTY_HEADER(Core::PropertyLengthOpt,Core::PropertyLength);
120 
121 class LX_CORE_EXPORT PropertyLengthOpt : public Core::PropertyLength
122 {
124 
125 public:
126  void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
127  inline void restore(Base::AbstractXMLReader& reader, Base::PersistenceVersion& version);
128  bool isOptional() const { return true; }
129 };
130 
132 //
133 // Core::PropertyPositiveLength
134 //
135 // A positive length property is a length property with a value greater than zero.
136 //
138 
139 class LX_CORE_EXPORT PropertyPositiveLength : public Core::PropertyReal
140 {
142 
143 public:
145  virtual ~PropertyPositiveLength(void);
146 };
147 
149 
151 //
152 // Core::PropertyPositiveLengthMeasure
153 //
154 // A positive length property is a length property with a value greater than zero.
155 //
157 
159 {
161 
162 public:
164  virtual ~PropertyPositiveLengthMeasure(void);
165 };
166 
168 //
169 // Core::PropertyPlaneAngle
170 //
171 // A plane angle property contains the value of an angle in a plane.
172 //
174 
175 class LX_CORE_EXPORT PropertyPlaneAngle : public Core::PropertyReal
176 {
178 
179 public:
180  PropertyPlaneAngle(void);
181  virtual ~PropertyPlaneAngle(void);
182 };
183 
185 
187 //
188 // Core::PropertyPositivePlaneAngle
189 //
190 // Positive plane angle property is a plane angle property that is greater than zero.
191 //
193 
194 class LX_CORE_EXPORT PropertyPositivePlaneAngle : public Core::PropertyReal
195 {
197 
198 public:
200  virtual ~PropertyPositivePlaneAngle(void);
201 };
202 
204 
206 //
207 // Core::PropertyRatio
208 //
209 // A ratio property contains the value of the relation between two physical quantities that are of the same kind.
210 //
212 
213 class LX_CORE_EXPORT PropertyRatio : public Core::PropertyReal
214 {
216 
217 public:
218  PropertyRatio(void);
219  virtual ~PropertyRatio(void);
220 };
221 
223 //
224 // Core::RatioMeasure
225 //
226 // A positive ratio property is a ratio property with a value greater than zero.
227 //
229 
230 class LX_CORE_EXPORT PropertyRatioMeasure : public Core::PropertyReal
231 {
233 
234 public:
235  PropertyRatioMeasure(void);
236  virtual ~PropertyRatioMeasure(void);
237 };
238 
240 //
241 // Core::PropertyPositiveRatioMeasure
242 //
243 // A positive ratio property is a ratio property with a value greater than zero.
244 //
246 
248 {
250 
251 public:
253  virtual ~PropertyPositiveRatioMeasure(void);
254 };
255 
257 //
258 // Core::PropertyPositiveRatio
259 //
260 // A positive ratio property is a ratio property with a value greater than zero.
261 //
263 
264 class LX_CORE_EXPORT PropertyPositiveRatio : public Core::PropertyReal
265 {
267 
268 public:
269  PropertyPositiveRatio(void);
270  virtual ~PropertyPositiveRatio(void);
271 };
272 
274 //
275 // Core::PropertyNormalisedRatio
276 //
277 // A property that contains a dimensionless measure
278 // to express ratio values ranging from 0.0 to 1.0.
279 //
281 
282 class LX_CORE_EXPORT PropertyNormalisedRatio : public Core::PropertyReal
283 {
285 
286 public:
288  virtual ~PropertyNormalisedRatio(void);
289 };
290 
292 
294 //
295 // Core::PropertyDynamicViscosity
296 //
297 // A property that contains the viscous resistance of a medium.
298 // Usually measured in Pascal second (Pa s).
299 //
301 
302 class LX_CORE_EXPORT PropertyDynamicViscosity : public Core::PropertyReal
303 {
305 
306 public:
308  virtual ~PropertyDynamicViscosity(void);
309 };
310 
312 //
313 // Core::PropertyModulusOfElasticity
314 //
315 // A property that contains the modulus of elasticity
316 // Usually measured in N/m2.
317 //
319 
320 class LX_CORE_EXPORT PropertyModulusOfElasticity : public Core::PropertyReal
321 {
323 
324 public:
326  virtual ~PropertyModulusOfElasticity(void);
327 };
328 
330 //
331 // Core::PropertyThermalExpansionCoefficient
332 //
333 // A property that contains the thermal expansion coefficient of a material,
334 // which expresses its elongation (as a ratio) per temperature difference.
335 // It is usually measured in 1/K. A positive elongation per (positive)
336 // rise of temperature is expressed by a positive value.
337 //
339 
341 {
343 
344 public:
347 };
348 
349 
351 //
352 // Core::PropertyPressure
353 //
354 // A property that contains the quantity of a medium acting on a unit area.
355 // Usually measured in Pascals (Pa, N/m2).
356 //
358 
359 class LX_CORE_EXPORT PropertyPressure : public Core::PropertyReal
360 {
362 
363 public:
364  PropertyPressure(void);
365  virtual ~PropertyPressure(void);
366 };
367 
369 //
370 // Core::PropertyThermodynamicTemperature
371 //
372 // A thermodynamic temperature property contains the value for the degree of heat of a body.
373 // Usually measured in degrees Kelvin (K).
374 //
376 
378 {
380 
381 public:
383  virtual ~PropertyThermodynamicTemperature(void);
384 };
385 
387 //
388 // Core::PropertySpecificHeatCapacity
389 //
390 // Defines the specific heat of material: The heat energy absorbed per temperature unit.
391 // Usually measured in J / kg Kelvin.
392 //
394 
396 {
398 
399 public:
401  virtual ~PropertySpecificHeatCapacity(void);
402 };
403 
405 //
406 // Core::PropertyThermalConductivity
407 //
408 // A property containing the thermal conductivity.
409 // Usually measured in Watt / m Kelvin.
410 //
412 
413 class LX_CORE_EXPORT PropertyThermalConductivity : public Core::PropertyReal
414 {
416 
417 public:
419  virtual ~PropertyThermalConductivity(void);
420 };
421 
423 //
424 // Core::PropertyIsothermalMoistureCapacity
425 //
426 // A property containing the isothermal moisture capacity.
427 // Usually measured in m3/kg.
428 //
430 
432 {
434 
435 public:
437  virtual ~PropertyIsothermalMoistureCapacity(void);
438 };
439 
441 //
442 // Core::PropertyVaporPermeability
443 //
444 // A property containing the vapor permeability.
445 // Usually measured in kg / s m Pascal.
446 //
448 
449 class LX_CORE_EXPORT PropertyVaporPermeability : public Core::PropertyReal
450 {
452 
453 public:
455  virtual ~PropertyVaporPermeability(void);
456 };
457 
459 //
460 // Core::PropertyMoistureDiffusivity
461 //
462 // A property containing the moisture diffusivity.
463 // Usually measured in m3/s.
464 //
466 
467 class LX_CORE_EXPORT PropertyMoistureDiffusivity : public Core::PropertyReal
468 {
470 
471 public:
473  virtual ~PropertyMoistureDiffusivity(void);
474 };
475 
477 //
478 // Core::PropertyMolecularWeight
479 //
480 // A property containing the molecular weight of material (typically gas).
481 // Usually measured in g/mole.
482 //
484 
485 class LX_CORE_EXPORT PropertyMolecularWeight : public Core::PropertyReal
486 {
488 
489 public:
491  virtual ~PropertyMolecularWeight(void);
492 };
493 
495 //
496 // Core::PropertyMassDensity
497 //
498 // A property containing the density of a medium.
499 // Usually measured in kg/m3.
500 //
502 
503 class LX_CORE_EXPORT PropertyMassDensity : public Core::PropertyReal
504 {
506 
507 public:
508  PropertyMassDensity(void);
509  virtual ~PropertyMassDensity(void);
510 };
511 
513 //
514 // Core::PropertyIonConcentration
515 //
516 // A property containing the particular ion concentration in a liquid, given in mg/L.
517 //
519 
520 class LX_CORE_EXPORT PropertyIonConcentration : public Core::PropertyReal
521 {
523 
524 public:
526  virtual ~PropertyIonConcentration(void);
527 };
528 
530 //
531 // Core::PropertyPHMeasure
532 //
533 // A property containing the molar hydrogen ion concentration in a liquid (usually defined as the measure of acidity).
534 //
536 
537 class LX_CORE_EXPORT PropertyPHMeasure : public Core::PropertyReal
538 {
540 
541 public:
542  PropertyPHMeasure(void);
543  virtual ~PropertyPHMeasure(void);
544 };
545 
547 //
548 // Core::PropertyHeatingValue
549 //
550 // Defines the amount of energy released (usually in MJ/kg) when a fuel is burned.
551 //
553 
554 class LX_CORE_EXPORT PropertyHeatingValue : public Core::PropertyReal
555 {
557 
558 public:
559  PropertyHeatingValue(void);
560  virtual ~PropertyHeatingValue(void);
561 };
562 
564 {
566 
567 public:
569  virtual ~PropertyThermalTransmittance(void);
570 };
571 
573 {
575 
576 public:
579 };
580 
582 {
584 
585 public:
587  virtual ~PropertyVolumetricFlowRateMeasure(void);
588 };
589 
590 
591 DECLARE_PROPERTY_FACTORY(PropertyReal_Factory, Core::PropertyReal);
592 DECLARE_PROPERTY_FACTORY(PropertyRealOpt_Factory, Core::PropertyRealOpt);
593 DECLARE_PROPERTY_FACTORY(PropertyRealList_Factory, Core::PropertyRealList);
594 DECLARE_PROPERTY_FACTORY(PropertyLength_Factory, Core::PropertyLength);
595 DECLARE_PROPERTY_FACTORY(PropertyLengthMeasure_Factory, Core::PropertyLengthMeasure);
596 DECLARE_PROPERTY_FACTORY(PropertyPositiveLength_Factory, Core::PropertyPositiveLength);
597 DECLARE_PROPERTY_FACTORY(PropertyLengthOpt_Factory, Core::PropertyLengthOpt);
598 DECLARE_PROPERTY_FACTORY(PropertyPlaneAngle_Factory, Core::PropertyPlaneAngle);
599 DECLARE_PROPERTY_FACTORY(PropertyPositivePlaneAngle_Factory, Core::PropertyPositivePlaneAngle);
600 DECLARE_PROPERTY_FACTORY(PropertyRatio_Factory, Core::PropertyRatio);
601 DECLARE_PROPERTY_FACTORY(PropertyPositiveRatio_Factory, Core::PropertyPositiveRatio);
602 DECLARE_PROPERTY_FACTORY(PropertyRatioMeasure_Factory, Core::PropertyRatioMeasure);
603 DECLARE_PROPERTY_FACTORY(PropertyPositiveRatioMeasure_Factory, Core::PropertyPositiveRatioMeasure);
604 DECLARE_PROPERTY_FACTORY(PropertyNormalisedRatio_Factory, Core::PropertyNormalisedRatio);
605 DECLARE_PROPERTY_FACTORY(PropertyDynamicViscosity_Factory, Core::PropertyDynamicViscosity);
606 DECLARE_PROPERTY_FACTORY(PropertyModulusOfElasticity_Factory, Core::PropertyModulusOfElasticity);
607 DECLARE_PROPERTY_FACTORY(PropertyThermalExpansionCoefficient_Factory, Core::PropertyThermalExpansionCoefficient);
608 DECLARE_PROPERTY_FACTORY(PropertyPressure_Factory, Core::PropertyPressure);
609 DECLARE_PROPERTY_FACTORY(PropertyThermodynamicTemperature_Factory, Core::PropertyThermodynamicTemperature);
610 DECLARE_PROPERTY_FACTORY(PropertySpecificHeatCapacity_Factory, Core::PropertySpecificHeatCapacity);
611 DECLARE_PROPERTY_FACTORY(PropertyThermalConductivity_Factory, Core::PropertyThermalConductivity);
612 DECLARE_PROPERTY_FACTORY(PropertyIsothermalMoistureCapacity_Factory, Core::PropertyIsothermalMoistureCapacity);
613 DECLARE_PROPERTY_FACTORY(PropertyVaporPermeability_Factory, Core::PropertyVaporPermeability);
614 DECLARE_PROPERTY_FACTORY(PropertyMoistureDiffusivity_Factory, Core::PropertyMoistureDiffusivity);
615 DECLARE_PROPERTY_FACTORY(PropertyMolecularWeight_Factory, Core::PropertyMolecularWeight);
616 DECLARE_PROPERTY_FACTORY(PropertyMassDensity_Factory, Core::PropertyMassDensity);
617 DECLARE_PROPERTY_FACTORY(PropertyIonConcentration_Factory, Core::PropertyIonConcentration);
618 DECLARE_PROPERTY_FACTORY(PropertyPHMeasure_Factory, Core::PropertyPHMeasure);
619 DECLARE_PROPERTY_FACTORY(PropertyHeatingValue_Factory, Core::PropertyHeatingValue);
620 DECLARE_PROPERTY_FACTORY(PropertyThermalTransmittance_Factory, Core::PropertyThermalTransmittance);
621 DECLARE_PROPERTY_FACTORY(PropertyThermalTransmittanceMeasure_Factory, Core::PropertyThermalTransmittanceMeasure);
622 DECLARE_PROPERTY_FACTORY(PropertyVolumetricFlowRateMeasure_Factory, Core::PropertyVolumetricFlowRateMeasure);
623 DECLARE_PROPERTY_FACTORY(PropertyPositiveLengthMeasure_Factory, Core::PropertyPositiveLengthMeasure);
624 } // namespace Core
Definition: PropertyReal.h:537
Definition: PropertyReal.h:194
Definition: PropertyReal.h:467
DECLARE_OPTIONAL_PROPERTY_HEADER(PropertyColorOpt, Core::PropertyColor)
Definition: PropertyReal.h:413
Definition: PropertyReal.h:282
Definition: PropertyReal.h:230
Definition: PropertyReal.h:213
Definition: PropertyReal.h:359
Definition: PropertyReal.h:554
Definition: Persistence.h:14
Definition: PropertyReal.h:449
Definition: PropertyReal.h:485
Definition: PropertyReal.h:247
Definition: PropertyReal.h:139
Definition: PropertyReal.h:503
Definition: PropertyReal.h:175
Definition: PropertyReal.h:572
Definition: PropertyReal.h:47
double _dValue
Definition: PropertyReal.h:34
LX_CORE_EXPORT Version & version
Definition: Variant.h:87
Definition: AbstractXMLReader.h:7
Definition: PropertyReal.h:431
std::vector< double > _listOfReal
Definition: PropertyReal.h:72
Definition: Base.h:12
const std::vector< double > & getValue() const
Definition: PropertyReal.h:59
Definition: PropertyReal.h:158
bool isOptional() const
Checks if this is an optional property.
Definition: PropertyReal.h:128
Definition: PropertyReal.h:11
Definition: PropertyReal.h:302
Definition: PropertyReal.h:581
Definition: PropertyReal.h:520
Definition: PropertyReal.h:100
Definition: Writer.h:16
Definition: PropertyReal.h:121
Definition: PropertyReal.h:340
Definition: Property.h:77
Definition: PropertyReal.h:563
Definition: PropertyReal.h:264
Core::Variant getVariant(void) const
Definition: PropertyReal.h:60
Definition: PropertyReal.h:377
TYPESYSTEM_HEADER()
Definition: PropertyReal.h:395
Definition: PropertyReal.h:83
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Definition: PropertyReal.h:320