#include <Material.h>
Public Member Functions | |
std::string | asCSSString () const |
std::string | asHexString () const |
returns color as hex color "#RRGGBB" More... | |
template<typename T > | |
T | asValue (void) const |
returns a template type e.g. More... | |
Color (const Color &c) | |
Copy constructor. More... | |
Color (float R=0.0, float G=0.0, float B=0.0, float A=0.0) | |
Defines the color as (R,G,B,A) whereas all values are in the range [0,1]. More... | |
Color (uint32_t rgba) | |
Does basically the same as the constructor above unless that (R,G,B,A) is encoded as an unsigned int. More... | |
bool | fromHexString (const std::string &hex) |
gets color from hex color "#RRGGBB" More... | |
uint32_t | getPackedValue () const |
Returns color as a 32 bit packed unsigned int in the form 0xRRGGBBAA. More... | |
bool | operator!= (const Color &c) const |
Color & | operator= (const Color &c) |
bool | operator== (const Color &c) const |
Returns true if both colors are equal. More... | |
void | set (float R, float G, float B, float A=0.0) |
Defines the color as (R,G,B,A) whereas all values are in the range [0,1]. More... | |
Color & | setPackedValue (uint32_t rgba) |
Sets the color value as a 32 bit combined red/green/blue/alpha value. More... | |
template<typename T > | |
void | setValue (const T &q) |
creates FC Color from template type, e.g. More... | |
Public Attributes | |
float | a |
float | b |
float | g |
float | r |
color values, public accessible More... | |
Detailed Description
Color class.
Constructor & Destructor Documentation
◆ Color() [1/3]
|
explicit |
Defines the color as (R,G,B,A) whereas all values are in the range [0,1].
A defines the transparency.
◆ Color() [2/3]
App::Color::Color | ( | uint32_t | rgba | ) |
Does basically the same as the constructor above unless that (R,G,B,A) is encoded as an unsigned int.
◆ Color() [3/3]
App::Color::Color | ( | const Color & | c | ) |
Copy constructor.
Member Function Documentation
◆ asCSSString()
std::string App::Color::asCSSString | ( | ) | const |
◆ asHexString()
std::string App::Color::asHexString | ( | ) | const |
returns color as hex color "#RRGGBB"
Referenced by PartGui::addLinearDimensions(), MeshPart::Mesher::createMesh(), TechDraw::CosmeticEdge::Save(), TechDraw::CenterLine::Save(), TechDraw::GeomFormat::Save(), and TechDraw::LineFormat::toString().
◆ asValue()
T App::Color::asValue | ( | void | ) | const |
returns a template type e.g.
Qt color equivalent to FC color
Referenced by TechDrawGui::PreferencesGui::dimQColor(), TechDrawGui::QGIViewPart::drawViewPart(), TechDrawGui::QGIViewPart::formatGeomFromCenterLine(), TechDrawGui::QGIViewPart::formatGeomFromCosmetic(), TechDrawGui::QGVPage::getBackgroundColor(), TechDrawGui::QGICMark::getCMarkColor(), TechDrawGui::QGIEdge::getHiddenColor(), TechDrawGui::QGIFace::getParameters(), TechDrawGui::QGITile::getTileColor(), TechDrawGui::QGTracker::getTrackerColor(), TechDrawGui::TaskHatch::initUi(), TechDrawGui::TaskGeomHatch::initUi(), TechDrawGui::TaskLineDecor::initUi(), TechDrawGui::PreferencesGui::leaderQColor(), TechDrawGui::PreferencesGui::normalQColor(), TechDrawGui::QGIViewDimension::prefNormalColor(), TechDrawGui::PreferencesGui::preselectQColor(), TechDrawGui::QGIRichAnno::rectPen(), TechDrawGui::PreferencesGui::selectQColor(), TechDrawGui::TaskRichAnno::setUiEdit(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskLeaderLine::setUiEdit(), TechDrawGui::TaskBalloon::TaskBalloon(), and Gui::PropertyEditor::PropertyMaterialListItem::toolTip().
◆ fromHexString()
bool App::Color::fromHexString | ( | const std::string & | hex | ) |
gets color from hex color "#RRGGBB"
Referenced by PartGui::addLinearDimensions(), MeshGui::ViewProviderMesh::highlightSegments(), TechDraw::CosmeticEdge::Restore(), TechDraw::CenterLine::Restore(), and TechDraw::GeomFormat::Restore().
◆ getPackedValue()
uint32_t App::Color::getPackedValue | ( | ) | const |
Returns color as a 32 bit packed unsigned int in the form 0xRRGGBBAA.
- See also
- setPackedValue().
Referenced by App::ColorLegend::getPackedColor(), MeshGui::ViewProviderMesh::ViewProviderMesh(), MeshGui::ViewProviderMeshNode::ViewProviderMeshNode(), and SketcherGui::ViewProviderSketch::ViewProviderSketch().
◆ operator!=()
◆ operator=()
◆ operator==()
Returns true if both colors are equal.
Therefore all components must be equal.
◆ set()
void App::Color::set | ( | float | R, |
float | G, | ||
float | B, | ||
float | A = 0.0 |
||
) |
Defines the color as (R,G,B,A) whereas all values are in the range [0,1].
A defines the transparency, 0 means complete opaque and 1 invisible.
Referenced by draftguitools.gui_trackers.editTracker::move(), PartGui::ViewProviderPartExt::ViewProviderPartExt(), and PartGui::ViewProviderPartReference::ViewProviderPartReference().
◆ setPackedValue()
Color& App::Color::setPackedValue | ( | uint32_t | rgba | ) |
Sets the color value as a 32 bit combined red/green/blue/alpha value.
Each component is 8 bit wide (i.e. from 0x00 to 0xff), and the red value should be stored leftmost, like this: 0xRRGGBBAA.
- See also
- getPackedValue().
Referenced by MeshPart::Mesher::createMesh(), TechDrawGui::PreferencesGui::dimColor(), Import::ExportOCAF2::ExportOCAF2(), TechDrawGui::QGVPage::getBackgroundColor(), Import::ImportOCAF2::ImportOCAF2(), TechDrawGui::PreferencesGui::leaderColor(), MeshCore::MeshInput::LoadOBJ(), TechDraw::Preferences::normalColor(), TechDraw::DrawGeomHatch::prefGeomHatchColor(), TechDrawGui::ViewProviderViewPart::prefHighlightColor(), TechDraw::DrawHatch::prefSvgHatchColor(), TechDraw::Preferences::preselectColor(), TechDrawGui::PreferencesGui::sectionLineColor(), TechDraw::Preferences::selectColor(), App::PropertyColor::setPyObject(), TechDraw::Preferences::vertexColor(), Gui::ViewProviderLink::ViewProviderLink(), MeshGui::ViewProviderMeshCurvature::ViewProviderMeshCurvature(), and SketcherGui::ViewProviderSketch::ViewProviderSketch().
◆ setValue()
void App::Color::setValue | ( | const T & | q | ) |
creates FC Color from template type, e.g.
Qt QColor
Referenced by TechDrawGui::TaskBalloon::accept(), MeshGui::ViewProviderFace::attach(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::TaskCenterLine::createCenterLine(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), PathGui::ViewProviderPath::onChanged(), MeshGui::ViewProviderMeshCurvature::onChanged(), TechDrawGui::TaskLineDecor::onColorChanged(), Gui::PropertyEditor::PropertyColorItem::setValue(), Gui::PropertyEditor::PropertyMaterialItem::setValue(), Gui::PropertyEditor::PropertyMaterialListItem::setValue(), TechDrawGui::TaskRichAnno::updateAnnoFeature(), TechDrawGui::TaskCenterLine::updateCenterLine(), TechDrawGui::TaskLeaderLine::updateLeaderFeature(), TechDrawGui::TaskHatch::updateValues(), TechDrawGui::TaskGeomHatch::updateValues(), and SketcherGui::ViewProviderSketch::ViewProviderSketch().
Member Data Documentation
◆ a
float App::Color::a |
Referenced by SpreadsheetGui::PropertiesDialog::apply(), Import::ExportOCAF2::ExportOCAF2(), PartGui::ViewProviderPartExt::getElementColors(), Gui::ViewProviderLink::getElementColors(), Import::ImportOCAF2::ImportOCAF2(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::ViewProviderLink::setElementColors(), Gui::LinkView::setMaterial(), App::PropertyColor::setPyObject(), and PartDesignGui::ViewProviderDatum::ViewProviderDatum().
◆ b
float App::Color::b |
Referenced by PartGui::addLinearDimensions(), App::ColorLegend::addMax(), App::ColorLegend::addMin(), SpreadsheetGui::PropertiesDialog::apply(), MeshGui::ViewProviderFace::attach(), App::ColorField::getColor(), App::ColorField::interpolate(), Gui::ViewProviderGeometryObject::onChanged(), MeshGui::ViewProviderMeshCurvature::onChanged(), PartGui::ViewProviderPartExt::onChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::SoFCColorGradient::rebuildGradient(), Gui::SoFCColorLegend::setColorModel(), InspectionGui::ViewProviderInspection::setDistances(), App::PropertyColor::setPyObject(), MeshGui::ViewProviderMeshCurvature::setVertexCurvatureMode(), Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders(), Mod.Test.Menu.MenuCreateCases::tearDown(), and Mod.Test.Menu.MenuDeleteCases::tearDown().
◆ g
float App::Color::g |
Referenced by PartGui::addLinearDimensions(), App::ColorLegend::addMax(), App::ColorLegend::addMin(), SpreadsheetGui::PropertiesDialog::apply(), MeshGui::ViewProviderFace::attach(), App::ColorField::getColor(), App::ColorField::interpolate(), Gui::ViewProviderGeometryObject::onChanged(), MeshGui::ViewProviderMeshCurvature::onChanged(), PartGui::ViewProviderPartExt::onChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::SoFCColorGradient::rebuildGradient(), Gui::SoFCColorLegend::setColorModel(), InspectionGui::ViewProviderInspection::setDistances(), App::PropertyColor::setPyObject(), MeshGui::ViewProviderMeshCurvature::setVertexCurvatureMode(), and Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders().
◆ r
float App::Color::r |
color values, public accessible
Referenced by PartGui::addLinearDimensions(), App::ColorLegend::addMax(), App::ColorLegend::addMin(), SpreadsheetGui::PropertiesDialog::apply(), MeshGui::ViewProviderFace::attach(), Raytracing::LuxFeature::execute(), Raytracing::RayFeature::execute(), App::ColorField::getColor(), App::ColorField::interpolate(), Gui::ViewProviderGeometryObject::onChanged(), MeshGui::ViewProviderMeshCurvature::onChanged(), PartGui::ViewProviderPartExt::onChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::SoFCColorGradient::rebuildGradient(), MeshCore::MeshOutput::SaveVRML(), App::MaterialPy::setAmbientColor(), Gui::SoFCColorLegend::setColorModel(), App::MaterialPy::setDiffuseColor(), InspectionGui::ViewProviderInspection::setDistances(), App::MaterialPy::setEmissiveColor(), App::PropertyColor::setPyObject(), App::MaterialPy::setSpecularColor(), MeshGui::ViewProviderMeshCurvature::setVertexCurvatureMode(), and Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders().
The documentation for this class was generated from the following file:
- src/App/Material.h