#include <Quantity.h>
Public Member Functions | |
const QuantityFormat & | getFormat () const |
const Unit & | getUnit (void) const |
returns the unit of the quantity More... | |
QString | getUserString (double &factor, QString &unitString) const |
transfer to user preferred unit/potence More... | |
QString | getUserString (UnitsSchema *schema, double &factor, QString &unitString) const |
QString | getUserString (void) const |
double | getValue (void) const |
get the Value of the quantity More... | |
double | getValueAs (const Quantity &) const |
get the Value in a special unit given as quantity. More... | |
bool | isDimensionless (void) const |
true if it has a number without a unit More... | |
bool | isQuantity (void) const |
true if it has a number and a valid unit More... | |
bool | isValid (void) const |
true if it has a number with or without a unit More... | |
Quantity | operator* (const Quantity &p) const |
Operators. More... | |
Quantity | operator* (double p) const |
Quantity | operator+ (const Quantity &p) const |
Quantity & | operator+= (const Quantity &p) |
Quantity | operator- (const Quantity &p) const |
Quantity | operator- (void) const |
Quantity & | operator-= (const Quantity &p) |
Quantity | operator/ (const Quantity &p) const |
Quantity | operator/ (double p) const |
bool | operator< (const Quantity &) const |
bool | operator<= (const Quantity &) const |
Quantity & | operator= (const Quantity &) |
bool | operator== (const Quantity &) const |
bool | operator> (const Quantity &) const |
bool | operator>= (const Quantity &) const |
Quantity | pow (const Quantity &) const |
Quantity | pow (double) const |
Quantity (const Quantity &) | |
Quantity (double Value, const Unit &unit=Unit()) | |
Quantity (void) | |
default constructor More... | |
void | setFormat (const QuantityFormat &f) |
void | setInvalid (void) |
sets the quantity invalid More... | |
void | setUnit (const Unit &un) |
set the unit of the quantity More... | |
void | setValue (double val) |
set the value of the quantity More... | |
~Quantity () | |
Destruction. More... | |
Static Public Member Functions | |
static Quantity | parse (const QString &string) |
Detailed Description
The Quantity class.
Constructor & Destructor Documentation
◆ Quantity() [1/3]
Quantity::Quantity | ( | void | ) |
default constructor
Referenced by operator*(), operator+(), operator-(), operator/(), parse(), and pow().
◆ Quantity() [2/3]
Quantity::Quantity | ( | const Quantity & | that | ) |
◆ Quantity() [3/3]
◆ ~Quantity()
Base::Quantity::~Quantity | ( | ) |
Destruction.
Member Function Documentation
◆ getFormat()
const QuantityFormat& Base::Quantity::getFormat | ( | ) | const |
Referenced by Base::QuantityPy::getFormat(), Gui::InputField::getFormat(), Gui::InputField::getPrecision(), Sketcher::Constraint::getPresentationValue(), Gui::InputField::newInput(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Gui::InputField::selectNumber(), Base::QuantityPy::setFormat(), Gui::InputField::setFormat(), Gui::InputField::setPrecision(), and Base::UnitsSchema::toLocale().
◆ getUnit()
const Unit& Base::Quantity::getUnit | ( | void | ) | const |
returns the unit of the quantity
Referenced by CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), Base::QuantityPy::getValueAs(), App::pyFromQuantity(), Base::UnitPy::PyInit(), Base::QuantityPy::representation(), Base::UnitsSchemaImperialDecimal::schemaTranslate(), Base::UnitsSchemaCentimeters::schemaTranslate(), Base::UnitsSchemaMKS::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaMmMin::schemaTranslate(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Base::UnitsSchemaImperialCivil::schemaTranslate(), Sketcher::SketchObjectPy::setDatum(), App::PropertyQuantity::setPyObject(), App::PropertyQuantityConstraint::setPyObject(), Gui::QuantitySpinBox::setUnitText(), Gui::InputField::setUnitText(), Gui::InputField::setValue(), Base::Unit::Unit(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
◆ getUserString() [1/3]
QString Quantity::getUserString | ( | double & | factor, |
QString & | unitString | ||
) | const |
transfer to user preferred unit/potence
References Base::UnitsApi::schemaTranslate().
Referenced by PartGui::createLinearDimension(), Gui::PointMarker::customEvent(), ConstraintItem::data(), Gui::TDragger::drag(), Gui::RDragger::drag(), SketcherGui::ViewProviderSketch::draw(), PartGui::dumpLinearResults(), Gui::InputField::focusOutEvent(), TechDraw::DrawViewDimension::getFormatedValue(), SketcherGui::ViewProviderSketch::getPresentationString(), Gui::InputField::getQuantityString(), Gui::InputField::getUnitText(), Base::QuantityPy::getUserPreferred(), Gui::InputField::keyPressEvent(), Sketcher::SketchObjectPy::setDatum(), Gui::InputField::setRawText(), Gui::PropertyEditor::PropertyPlacementItem::toolTip(), Gui::PropertyEditor::PropertyVectorDistanceItem::toString(), Gui::PropertyEditor::PropertyPlacementItem::toString(), and Gui::InputField::wheelEvent().
◆ getUserString() [2/3]
QString Quantity::getUserString | ( | UnitsSchema * | schema, |
double & | factor, | ||
QString & | unitString | ||
) | const |
References Base::UnitsSchema::schemaTranslate().
◆ getUserString() [3/3]
QString Base::Quantity::getUserString | ( | void | ) | const |
◆ getValue()
double Base::Quantity::getValue | ( | void | ) | const |
get the Value of the quantity
Referenced by PartGui::DlgFilletEdges::accept(), CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), Gui::QuantitySpinBox::apply(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), ConstraintItem::data(), SketcherGui::PropertyConstraintListItem::event(), Sketcher::SketchObjectPy::getDatum(), Gui::LocationWidget::getPosition(), Base::QuantityPy::number_nonzero_handler(), Base::QuantityPy::number_remainder_handler(), TechDraw::DrawSVGTemplate::processTemplate(), App::pyFromQuantity(), Base::QuantityPy::representation(), Base::UnitsSchemaMKS::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Base::UnitsSchemaImperialCivil::schemaTranslate(), Sketcher::SketchObjectPy::setDatum(), Gui::InputField::setMaximum(), Gui::InputField::setMinimum(), App::PropertyQuantity::setPyObject(), App::PropertyQuantityConstraint::setPyObject(), Gui::InputField::setValue(), Base::UnitsSchema::toLocale(), Gui::Dialog::DlgUnitsCalculator::valueChanged(), and SketcherGui::ViewProviderSketch::ViewProviderSketch().
◆ getValueAs()
double Quantity::getValueAs | ( | const Quantity & | q | ) | const |
get the Value in a special unit given as quantity.
One can use one of the predifeined quantity units in this class
Referenced by FemGui::TaskFemConstraintTemperature::get_cflux(), FemGui::TaskFemConstraintPressure::get_Pressure(), FemGui::TaskFemConstraintInitialTemperature::get_temperature(), FemGui::TaskFemConstraintTemperature::get_temperature(), FemGui::TaskFemConstraintHeatflux::getAmbientTemp(), FemGui::TaskFemConstraintHeatflux::getFilmCoef(), and Sketcher::ConstraintPy::PyInit().
◆ isDimensionless()
bool Quantity::isDimensionless | ( | void | ) | const |
true if it has a number without a unit
References isValid().
◆ isQuantity()
bool Quantity::isQuantity | ( | void | ) | const |
true if it has a number and a valid unit
References isValid().
Referenced by Base::QuantityPy::getValueAs().
◆ isValid()
bool Quantity::isValid | ( | void | ) | const |
true if it has a number with or without a unit
Referenced by Base::QuantityPy::getValueAs(), isDimensionless(), and isQuantity().
◆ operator*() [1/2]
Operators.
References Quantity().
◆ operator*() [2/2]
Quantity Quantity::operator* | ( | double | p | ) | const |
References Quantity().
◆ operator+()
References Quantity().
◆ operator+=()
◆ operator-() [1/2]
References Quantity().
◆ operator-() [2/2]
Quantity Quantity::operator- | ( | void | ) | const |
References Quantity().
◆ operator-=()
◆ operator/() [1/2]
References Quantity().
◆ operator/() [2/2]
Quantity Quantity::operator/ | ( | double | p | ) | const |
References Quantity().
◆ operator<()
◆ operator<=()
◆ operator=()
◆ operator==()
◆ operator>()
◆ operator>=()
◆ parse()
|
static |
References Quantity().
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult::explodeCompounds(), Base::QuantityPy::getValueAs(), TechDraw::DrawSVGTemplate::processTemplate(), Base::QuantityPy::PyInit(), Base::UnitPy::PyInit(), Gui::InputField::setRawText(), Gui::QuantitySpinBox::setUnitText(), Gui::InputField::setUnitText(), Base::UnitsApi::sParseQuantity(), BOPTools.GeneralFuseResult.GeneralFuseResult::splitAggregates(), Base::UnitsApi::toDbl(), Base::UnitsApi::toQuantity(), Base::Unit::Unit(), Gui::QuantitySpinBoxPrivate::validateAndInterpret(), Gui::Dialog::DlgUnitsCalculator::valueChanged(), and SketcherGui::ViewProviderSketch::ViewProviderSketch().
◆ pow() [1/2]
References Quantity().
◆ pow() [2/2]
Quantity Quantity::pow | ( | double | p | ) | const |
References Quantity().
◆ setFormat()
void Base::Quantity::setFormat | ( | const QuantityFormat & | f | ) |
Referenced by Sketcher::Constraint::getPresentationValue(), PathScripts.PostUtils.GCodeHighlighter::highlightBlock(), PathScripts.PathInspect.GCodeHighlighter::highlightBlock(), Base::QuantityPy::setFormat(), Gui::InputField::setFormat(), Gui::InputField::setPrecision(), and Gui::QuantitySpinBoxPrivate::validate().
◆ setInvalid()
void Quantity::setInvalid | ( | void | ) |
sets the quantity invalid
Referenced by Base::QuantityPy::getValueAs().
◆ setUnit()
void Base::Quantity::setUnit | ( | const Unit & | un | ) |
set the unit of the quantity
Referenced by CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), SketcherGui::EditDatumDialog::exec(), Sketcher::SketchObjectPy::getDatum(), TechDraw::DrawViewDimension::getFormatedValue(), Sketcher::Constraint::getPresentationValue(), Base::QuantityPy::getValueAs(), TechDraw::DrawSVGTemplate::processTemplate(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskCenterLine::setUiPrimary(), Gui::InputField::setUnit(), Base::QuantityPy::setUnit(), and SketcherGui::PropertyConstraintListItem::value().
◆ setValue()
void Base::Quantity::setValue | ( | double | val | ) |
set the value of the quantity
Referenced by CmdSketcherConstrainRadius::activated(), CmdSketcherConstrainDiameter::activated(), CmdSketcherConstrainRadius::applyConstraint(), CmdSketcherConstrainDiameter::applyConstraint(), SketcherGui::EditDatumDialog::exec(), Sketcher::SketchObjectPy::getDatum(), TechDraw::DrawViewDimension::getFormatedValue(), Sketcher::Constraint::getPresentationValue(), Base::QuantityPy::getValueAs(), Gui::View3DInventorViewer::printDimension(), Gui::schemaTranslatePoint(), Sketcher::SketchObjectPy::setDatum(), Gui::InputField::setMaximum(), Gui::InputField::setMinimum(), App::PropertyQuantityConstraint::setPyObject(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskCenterLine::setUiPrimary(), Gui::InputField::setValue(), Base::QuantityPy::setValue(), Gui::QuantitySpinBox::setValue(), and SketcherGui::PropertyConstraintListItem::value().
Member Data Documentation
◆ Ampere
|
static |
◆ AngMinute
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
◆ AngSecond
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
◆ Bar
|
static |
◆ Calorie
|
static |
◆ Candela
|
static |
◆ CentiMetre
|
static |
◆ Coulomb
|
static |
◆ CubicFoot
|
static |
◆ DeciMetre
|
static |
◆ Degree
|
static |
Referenced by PartGui::DlgRevolution::getAngle().
◆ ElectronVolt
|
static |
◆ Farad
|
static |
◆ Foot
|
static |
◆ Gauss
|
static |
◆ GigaHertz
|
static |
◆ GigaPascal
|
static |
◆ Gon
|
static |
◆ Gram
|
static |
◆ Henry
|
static |
◆ Hertz
|
static |
◆ Hour
|
static |
◆ Hundredweights
|
static |
◆ Inch
|
static |
◆ Joule
|
static |
◆ Kelvin
|
static |
◆ KiloAmpere
|
static |
◆ KiloCalorie
|
static |
◆ KiloElectronVolt
|
static |
◆ KiloGram
|
static |
◆ KiloHertz
|
static |
◆ KiloJoule
|
static |
◆ KiloMetre
|
static |
◆ KiloNewton
|
static |
◆ KiloOhm
|
static |
◆ KiloPascal
|
static |
◆ KiloVolt
|
static |
◆ KiloWatt
|
static |
◆ KiloWattHour
|
static |
◆ KMH
|
static |
◆ KSI
|
static |
◆ Liter
|
static |
◆ MegaAmpere
|
static |
◆ MegaElectronVolt
|
static |
◆ MegaHertz
|
static |
◆ MegaNewton
|
static |
◆ MegaOhm
|
static |
◆ MegaPascal
|
static |
Referenced by FemGui::TaskFemConstraintPressure::get_Pressure().
◆ Metre
|
static |
◆ MicroFarad
|
static |
◆ MicroGram
|
static |
◆ MicroHenry
|
static |
◆ MicroKelvin
|
static |
◆ MicroMetre
|
static |
◆ MicroSiemens
|
static |
◆ Mile
|
static |
◆ MilePerHour
|
static |
◆ MilliAmpere
|
static |
◆ MilliBar
|
static |
◆ MilliFarad
|
static |
◆ MilliGram
|
static |
◆ MilliHenry
|
static |
◆ MilliJoule
|
static |
◆ MilliKelvin
|
static |
◆ MilliLiter
|
static |
◆ MilliMetre
|
static |
◆ MilliMole
|
static |
◆ MilliNewton
|
static |
◆ MilliSiemens
|
static |
◆ MilliVolt
|
static |
◆ MilliWatt
|
static |
◆ Minute
|
static |
◆ Mole
|
static |
◆ MPH
|
static |
◆ MPSI
|
static |
◆ mTorr
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
◆ NanoFarad
|
static |
◆ NanoHenry
|
static |
◆ NanoMetre
◆ Newton
|
static |
◆ NewtonMeter
|
static |
◆ Oersted
|
static |
◆ Ohm
|
static |
◆ Ounce
|
static |
◆ Pascal
|
static |
◆ PicoFarad
|
static |
◆ Pound
|
static |
◆ PoundForce
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
◆ PSI
|
static |
◆ Radian
|
static |
◆ Second
|
static |
◆ Siemens
|
static |
◆ SquareFoot
|
static |
◆ Stone
|
static |
◆ TeraHertz
|
static |
◆ Tesla
|
static |
◆ Thou
|
static |
◆ Ton
|
static |
◆ Torr
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
◆ Volt
|
static |
◆ VoltAmpere
|
static |
◆ VoltAmpereSecond
|
static |
◆ Watt
|
static |
Referenced by FemGui::TaskFemConstraintTemperature::get_cflux().
◆ WattSecond
|
static |
◆ Weber
|
static |
◆ Yard
|
static |
◆ yTorr
|
static |
Referenced by Base::QuantityPy::getCustomAttributes().
The documentation for this class was generated from the following files:
- src/Base/Quantity.h
- src/Base/Quantity.cpp