#include <Quantity.h>
Public Member Functions | |
const QuantityFormat & | getFormat () const |
const Unit & | getUnit () const |
returns the unit of the quantity More... | |
QString | getUserString () const |
QString | getUserString (double &factor, QString &unitString) const |
transfer to user preferred unit/potence More... | |
QString | getUserString (UnitsSchema *schema, double &factor, QString &unitString) const |
double | getValue () 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 () const |
true if it has a number without a unit More... | |
bool | isQuantity () const |
true if it has a number and a valid unit More... | |
bool | isValid () 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 | operator- (const Quantity &p) 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 () | |
default constructor More... | |
Quantity (const Quantity &) | |
Quantity (double value, const QString &unit) | |
Quantity (double value, const Unit &unit=Unit()) | |
void | setFormat (const QuantityFormat &f) |
void | setInvalid () |
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) |
The Quantity class.
Quantity::Quantity | ( | ) |
default constructor
Referenced by operator*(), operator+(), operator-(), operator/(), parse(), and pow().
Quantity::Quantity | ( | const Quantity & | that | ) |
|
explicit |
References parse().
Base::Quantity::~Quantity | ( | ) |
Destruction.
const QuantityFormat & Base::Quantity::getFormat | ( | ) | const |
Referenced by Gui::InputField::getFormat(), Gui::InputField::getPrecision(), Sketcher::Constraint::getPresentationValue(), Gui::InputField::newInput(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Gui::InputField::selectNumber(), Gui::InputField::setFormat(), Gui::InputField::setPrecision(), Base::UnitsSchema::toLocale(), and Gui::QuantitySpinBoxPrivate::validate().
const Unit & Base::Quantity::getUnit | ( | ) | const |
returns the unit of the quantity
Referenced by App::pyFromQuantity(), Base::UnitsSchemaCentimeters::schemaTranslate(), Base::UnitsSchemaFemMilliMeterNewton::schemaTranslate(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialDecimal::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Base::UnitsSchemaImperialCivil::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaMKS::schemaTranslate(), Base::UnitsSchemaMmMin::schemaTranslate(), App::PropertyQuantity::setPyObject(), App::PropertyQuantityConstraint::setPyObject(), Gui::InputField::setUnitText(), Gui::QuantitySpinBox::setUnitText(), Gui::InputField::setValue(), Base::Unit::Unit(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
QString Base::Quantity::getUserString | ( | ) | const |
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(), SpreadsheetGui::SheetModel::data(), ConstraintItem::data(), Gui::TDragger::drag(), Gui::RDragger::drag(), PartGui::dumpLinearResults(), Gui::InputField::focusOutEvent(), TechDraw::DrawViewDimension::formatValue(), Gui::InputField::getQuantityString(), Gui::InputField::getUnitText(), Gui::InputField::keyPressEvent(), Gui::InputField::setRawText(), Gui::PropertyEditor::PropertyPlacementItem::toolTip(), Gui::PropertyEditor::PropertyVectorDistanceItem::toString(), Gui::PropertyEditor::PropertyRotationItem::toString(), Gui::PropertyEditor::PropertyPlacementItem::toString(), and Gui::InputField::wheelEvent().
QString Quantity::getUserString | ( | UnitsSchema * | schema, |
double & | factor, | ||
QString & | unitString | ||
) | const |
References Base::UnitsSchema::schemaTranslate().
double Base::Quantity::getValue | ( | ) | const |
get the Value of the quantity
Referenced by ImageGui::ImageOrientationDialog::accept(), InspectionGui::VisualInspection::accept(), PartGui::DlgFilletEdges::accept(), PartGui::OffsetWidget::accept(), PartGui::ThicknessWidget::accept(), MeshPartGui::CrossSections::apply(), Gui::QuantitySpinBox::apply(), ConstraintItem::data(), PartGui::DlgPrimitives::DlgPrimitives(), SketcherGui::PropertyConstraintListItem::event(), TechDraw::DrawViewDimension::formatValue(), FemGui::TaskFemConstraintForce::getForce(), Gui::LocationWidget::getPosition(), InspectionGui::VisualInspection::loadSettings(), MeshGui::DlgSettingsImportExport::loadSettings(), TechDraw::DrawSVGTemplate::processTemplate(), App::pyFromQuantity(), Gui::InputField::rawValue(), InspectionGui::VisualInspection::saveSettings(), MeshGui::DlgSettingsImportExport::saveSettings(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Base::UnitsSchemaImperialCivil::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaMKS::schemaTranslate(), Gui::InputField::setMaximum(), Gui::InputField::setMinimum(), App::PropertyQuantity::setPyObject(), App::PropertyQuantityConstraint::setPyObject(), Gui::InputField::setValue(), Base::UnitsSchema::toLocale(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
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::TaskFemConstraintSpring::get_normalStiffness(), FemGui::TaskFemConstraintPressure::get_Pressure(), FemGui::TaskFemConstraintSpring::get_tangentialStiffness(), FemGui::TaskFemConstraintInitialTemperature::get_temperature(), FemGui::TaskFemConstraintTemperature::get_temperature(), FemGui::TaskFemConstraintHeatflux::getAmbientTemp(), and FemGui::TaskFemConstraintHeatflux::getFilmCoef().
bool Quantity::isDimensionless | ( | ) | const |
true if it has a number without a unit
References isValid().
bool Quantity::isValid | ( | ) | const |
true if it has a number with or without a unit
Referenced by isDimensionless(), and isQuantity().
Operators.
References Quantity().
Quantity Quantity::operator* | ( | double | p | ) | const |
References Quantity().
References Quantity().
Quantity Quantity::operator- | ( | ) | const |
References Quantity().
References Quantity().
References Quantity().
Quantity Quantity::operator/ | ( | double | p | ) | const |
References Quantity().
|
static |
References Quantity().
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult::explodeCompounds(), TechDraw::DrawViewDimension::formatValue(), Gui::QuantitySpinBoxPrivate::parseString(), TechDraw::DrawSVGTemplate::processTemplate(), Quantity(), Gui::InputField::setRawText(), Gui::InputField::setUnitText(), Gui::QuantitySpinBox::setUnitText(), Base::UnitsApi::sParseQuantity(), BOPTools.GeneralFuseResult.GeneralFuseResult::splitAggregates(), Base::UnitsApi::toDouble(), Base::UnitsApi::toQuantity(), Base::Unit::Unit(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
References Quantity().
Quantity Quantity::pow | ( | double | p | ) | const |
References Quantity().
void Base::Quantity::setFormat | ( | const QuantityFormat & | f | ) |
void Quantity::setInvalid | ( | ) |
sets the quantity invalid
void Base::Quantity::setUnit | ( | const Unit & | un | ) |
set the unit of the quantity
Referenced by SketcherGui::EditDatumDialog::exec(), TechDraw::DrawViewDimension::formatValue(), Sketcher::Constraint::getPresentationValue(), TechDraw::DrawSVGTemplate::processTemplate(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskCenterLine::setUiPrimary(), Gui::InputField::setUnit(), Gui::QuantitySpinBoxPrivate::validate(), and SketcherGui::PropertyConstraintListItem::value().
void Base::Quantity::setValue | ( | double | val | ) |
set the value of the quantity
Referenced by SketcherGui::EditDatumDialog::exec(), TechDraw::DrawViewDimension::formatValue(), Sketcher::Constraint::getPresentationValue(), Gui::View3DInventorViewer::printDimension(), Gui::schemaTranslatePoint(), Gui::InputField::setMaximum(), Gui::InputField::setMinimum(), App::PropertyQuantityConstraint::setPyObject(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskCenterLine::setUiPrimary(), Gui::InputField::setValue(), Gui::QuantitySpinBox::setValue(), and SketcherGui::PropertyConstraintListItem::value().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by PartGui::DlgRevolution::getAngle().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by FemGui::TaskFemConstraintPressure::get_Pressure().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by FemGui::TaskFemConstraintTemperature::get_cflux().
|
static |
|
static |
|
static |
|
static |