#include <UnitsApi.h>
Public Member Functions | |
UnitsApi (const char *filter) | |
Constructs a UnitsApi object. More... | |
UnitsApi (const std::string &filter) | |
virtual | ~UnitsApi () |
Static Public Member Functions | |
static UnitsSchemaPtr | createSchema (UnitSystem s) |
return an instance of the given enum value More... | |
static int | getDecimals () |
static const char * | getDescription (UnitSystem) |
Returns a brief description of a schema. More... | |
static UnitSystem | getSchema (void) |
return the active schema More... | |
static QString | schemaTranslate (const Base::Quantity &quant) |
static QString | schemaTranslate (const Base::Quantity &quant, double &factor, QString &unitString) |
static void | setDecimals (int) |
static void | setSchema (UnitSystem s) |
set Schema set the UnitsSchema of the Application this a represented by a class of type UnitSchema which defines a set of standard units for that schema and rules for representative strings. More... | |
static double | toDbl (PyObject *ArgObj, const Base::Unit &u=Base::Unit()) |
generate a value for a quantity with default user preferred system More... | |
static Quantity | toQuantity (PyObject *ArgObj, const Base::Unit &u=Base::Unit()) |
generate a value for a quantity with default user preferred system More... | |
Static Public Attributes | |
static double | defaultFactor = 1.0 |
static PyMethodDef | Methods [] |
set the application defaults More... | |
Static Protected Member Functions | |
static PyObject * | sGetSchema (PyObject *self, PyObject *args) |
static PyObject * | sListSchemas (PyObject *self, PyObject *args) |
static PyObject * | sParseQuantity (PyObject *self, PyObject *args) |
static PyObject * | sSchemaTranslate (PyObject *self, PyObject *args) |
static PyObject * | sSetSchema (PyObject *self, PyObject *args) |
Static Protected Attributes | |
static UnitSystem | actSystem = UnitSystem::SI1 |
static int | UserPrefDecimals = 2 |
number of decimals for floats More... | |
static UnitsSchemaPtr | UserPrefSystem |
Detailed Description
The UnitsApi.
Constructor & Destructor Documentation
◆ UnitsApi() [1/2]
UnitsApi::UnitsApi | ( | const char * | filter | ) |
Constructs a UnitsApi object.
◆ UnitsApi() [2/2]
UnitsApi::UnitsApi | ( | const std::string & | filter | ) |
◆ ~UnitsApi()
|
virtual |
Member Function Documentation
◆ createSchema()
|
static |
return an instance of the given enum value
References Base::Centimeters, Base::Imperial1, Base::ImperialBuilding, Base::ImperialCivil, Base::ImperialDecimal, Base::MmMin, Base::SI1, and Base::SI2.
Referenced by setSchema(), Gui::QuantitySpinBox::setSchema(), and sSchemaTranslate().
◆ getDecimals()
|
static |
References UserPrefDecimals.
Referenced by PartGui::DlgFilletEdges::accept(), PartGui::CircleFromThreePoints::command(), PartGui::DlgPrimitives::createPrimitive(), SpreadsheetGui::SheetModel::data(), PartGui::DlgExtrusion::DlgExtrusion(), Gui::Dialog::DlgUnitsCalculator::DlgUnitsCalculator(), TechDraw::DrawViewDimension::getDefaultFormatSpec(), Spreadsheet::Cell::getFormattedQuantity(), TechDrawGui::QGIDatumLabel::getPrecision(), Gui::LocationWidget::getUserDirection(), Gui::LocationDialog::getUserDirection(), Gui::Dialog::DlgSettingsUnitsImp::loadSettings(), MeshGui::DlgRegularSolidImp::on_createSolidButton_clicked(), Gui::PropertyEditor::PropertyItem::PropertyItem(), PartDesignGui::TaskBoxPrimitives::setPrimitive(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskDetail::setUiFromFeat(), TechDrawGui::TaskCosVertex::setUiPrimary(), TechDrawGui::TaskCenterLine::setUiPrimary(), PartGui::Picker::toPlacement(), PartGui::Location::toPlacement(), and Gui::Dialog::DlgUnitsCalculator::valueChanged().
◆ getDescription()
|
static |
Returns a brief description of a schema.
References Base::Centimeters, Base::Imperial1, Base::ImperialBuilding, Base::ImperialCivil, Base::ImperialDecimal, Base::MmMin, Base::SI1, and Base::SI2.
Referenced by Gui::Dialog::DlgSettingsUnitsImp::DlgSettingsUnitsImp(), Gui::Dialog::DlgUnitsCalculator::DlgUnitsCalculator(), and sListSchemas().
◆ getSchema()
|
static |
return the active schema
Referenced by TechDraw::DrawViewDimension::getFormatedValue(), SketcherGui::ViewProviderSketch::getPresentationString(), and TechDraw::DrawViewDimension::isMultiValueSchema().
◆ schemaTranslate() [1/2]
|
static |
◆ schemaTranslate() [2/2]
|
static |
References UserPrefSystem.
Referenced by Base::Quantity::getUserString(), Gui::View3DInventorViewer::printDimension(), and Gui::schemaTranslatePoint().
◆ setDecimals()
|
static |
References UserPrefDecimals.
Referenced by Gui::Dialog::DlgSettingsUnitsImp::saveSettings().
◆ setSchema()
|
static |
set Schema set the UnitsSchema of the Application this a represented by a class of type UnitSchema which defines a set of standard units for that schema and rules for representative strings.
References actSystem, createSchema(), Base::SI1, and UserPrefSystem.
Referenced by sSetSchema().
◆ sGetSchema()
References actSystem.
◆ sListSchemas()
References getDescription(), and Base::NumUnitSystemTypes.
◆ sParseQuantity()
References Base::Quantity::parse().
◆ sSchemaTranslate()
References createSchema(), Base::UnitsSchema::schemaTranslate(), and Base::QuantityPy::Type.
◆ sSetSchema()
References Base::NumUnitSystemTypes, and setSchema().
◆ toDbl()
|
static |
generate a value for a quantity with default user preferred system
References Base::Quantity::parse().
Referenced by Robot::WaypointPy::PyInit().
◆ toQuantity()
|
static |
generate a value for a quantity with default user preferred system
References Base::Quantity::parse().
Member Data Documentation
◆ actSystem
|
staticprotected |
Referenced by setSchema(), and sGetSchema().
◆ defaultFactor
|
static |
◆ Methods
|
static |
set the application defaults
◆ UserPrefDecimals
|
staticprotected |
number of decimals for floats
Referenced by getDecimals(), and setDecimals().
◆ UserPrefSystem
|
staticprotected |
Referenced by schemaTranslate(), and setSchema().
The documentation for this class was generated from the following files:
- src/Base/UnitsApi.h
- src/Base/UnitsApi.cpp
- src/Base/UnitsApiPy.cpp