#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 () 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... | |
Color class.
|
explicit |
Defines the color as (R,G,B,A) whereas all values are in the range [0,1].
A defines the transparency.
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.
App::Color::Color | ( | const Color & | c | ) |
Copy constructor.
std::string App::Color::asCSSString | ( | ) | const |
std::string App::Color::asHexString | ( | ) | const |
returns color as hex color "#RRGGBB"
Referenced by PartGui::addLinearDimensions(), MeshPart::BrepMesh::create(), TechDraw::CosmeticEdge::Save(), TechDraw::CenterLine::Save(), TechDraw::GeomFormat::Save(), and TechDraw::LineFormat::toString().
T App::Color::asValue | ( | ) | const |
returns a template type e.g.
Qt color equivalent to FC color
Referenced by TechDrawGui::PreferencesGui::centerQColor(), TechDrawGui::PreferencesGui::dimQColor(), TechDrawGui::QGIViewPart::drawViewPart(), TechDrawGui::QGIViewPart::formatGeomFromCenterLine(), TechDrawGui::QGIViewPart::formatGeomFromCosmetic(), TechDrawGui::QGSPage::getBackgroundColor(), TechDrawGui::QGVPage::getBackgroundColor(), TechDrawGui::QGICMark::getCMarkColor(), TechDrawGui::QGIEdge::getHiddenColor(), TechDrawGui::QGIFace::getParameters(), TechDrawGui::QGITile::getTileColor(), TechDrawGui::QGTracker::getTrackerColor(), TechDrawGui::PreferencesGui::gridQColor(), TechDrawGui::TaskGeomHatch::initUi(), TechDrawGui::TaskLineDecor::initUi(), TechDrawGui::PreferencesGui::leaderQColor(), TechDrawGui::PreferencesGui::normalQColor(), TechDrawGui::QGIViewDimension::prefNormalColor(), TechDrawGui::PreferencesGui::preselectQColor(), TechDrawGui::QGIRichAnno::rectPen(), PartGui::SectionCut::SectionCut(), TechDrawGui::PreferencesGui::sectionLineQColor(), TechDrawGui::PreferencesGui::selectQColor(), TechDrawGui::TaskHatch::setUiEdit(), TechDrawGui::TaskCenterLine::setUiEdit(), TechDrawGui::TaskLeaderLine::setUiEdit(), TechDrawGui::TaskRichAnno::setUiEdit(), TechDrawGui::TaskBalloon::TaskBalloon(), TechDrawGui::TaskDimension::TaskDimension(), and Gui::PropertyEditor::PropertyMaterialListItem::toolTip().
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().
uint32_t App::Color::getPackedValue | ( | ) | const |
Returns color as a 32 bit packed unsigned int in the form 0xRRGGBBAA.
Referenced by App::ColorLegend::getPackedColor(), MeshGui::ViewProviderMesh::ViewProviderMesh(), and MeshGui::ViewProviderMeshNode::ViewProviderMeshNode().
Returns true if both colors are equal.
Therefore all components must be equal.
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().
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.
Referenced by MeshPart::BrepMesh::create(), TechDrawGui::PreferencesGui::dimColor(), Import::ExportOCAF2::ExportOCAF2(), TechDrawGui::QGSPage::getBackgroundColor(), TechDrawGui::QGVPage::getBackgroundColor(), TechDrawGui::PreferencesGui::gridColor(), Import::ImportOCAF2::ImportOCAF2(), TechDrawGui::PreferencesGui::leaderColor(), MeshCore::MeshInput::LoadOBJ(), TechDraw::Preferences::normalColor(), PartDesignGui::ViewProviderSubShapeBinder::onChanged(), 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(), and MeshGui::ViewProviderMeshCurvature::ViewProviderMeshCurvature().
void App::Color::setValue | ( | const T & | q | ) |
creates FC Color from template type, e.g.
Qt QColor
Referenced by MeshGui::ViewProviderFace::attach(), TechDrawGui::TaskRichAnno::createAnnoFeature(), TechDrawGui::TaskCenterLine::createCenterLine(), TechDrawGui::TaskHatch::createHatch(), TechDrawGui::TaskLeaderLine::createLeaderFeature(), TechDrawGui::TaskHatch::onColorChanged(), TechDrawGui::TaskLineDecor::onColorChanged(), Gui::PropertyEditor::PropertyColorItem::setValue(), Gui::PropertyEditor::PropertyMaterialItem::setValue(), Gui::PropertyEditor::PropertyMaterialListItem::setValue(), MeshGui::ViewProviderMeshCurvature::setVertexCurvatureMode(), TechDrawGui::TaskRichAnno::updateAnnoFeature(), TechDrawGui::TaskHatch::updateHatch(), TechDrawGui::TaskLeaderLine::updateLeaderFeature(), and TechDrawGui::TaskGeomHatch::updateValues().
float App::Color::a |
Referenced by SpreadsheetGui::PropertiesDialog::apply(), Import::ExportOCAF2::ExportOCAF2(), PartGui::ViewProviderPartExt::getElementColors(), Gui::ViewProviderLink::getElementColors(), Import::ImportOCAF2::ImportOCAF2(), PartGui::ViewProviderPartExt::onChanged(), PartGui::FaceColors::onSelectionChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::ViewProviderLink::setElementColors(), Gui::LinkView::setMaterial(), App::PropertyColor::setPyObject(), and PartDesignGui::ViewProviderDatum::ViewProviderDatum().
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(), PartGui::FaceColors::onSelectionChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::SoFCColorGradient::rebuildGradient(), MeshCore::MeshOutput::SaveAsymptote(), MeshCore::MeshOutput::SaveX3DContent(), Gui::SoFCColorLegend::setColorLegend(), InspectionGui::ViewProviderInspection::setDistances(), App::PropertyColor::setPyObject(), Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders(), Mod.Test.Menu.MenuCreateCases::tearDown(), and Mod.Test.Menu.MenuDeleteCases::tearDown().
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(), PartGui::FaceColors::onSelectionChanged(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Gui::SoFCColorGradient::rebuildGradient(), MeshCore::MeshOutput::SaveAsymptote(), MeshCore::MeshOutput::SaveX3DContent(), Gui::SoFCColorLegend::setColorLegend(), InspectionGui::ViewProviderInspection::setDistances(), App::PropertyColor::setPyObject(), and Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders().
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::RayFeature::execute(), App::ColorField::getColor(), App::ColorField::interpolate(), Gui::ViewProviderGeometryObject::onChanged(), MeshGui::ViewProviderMeshCurvature::onChanged(), PartGui::ViewProviderPartExt::onChanged(), PartGui::FaceColors::onSelectionChanged(), operator=(), SpreadsheetGui::PropertiesDialog::PropertiesDialog(), Points::E57Reader::read(), Gui::SoFCColorGradient::rebuildGradient(), MeshCore::MeshOutput::SaveAsymptote(), MeshCore::MeshOutput::SaveVRML(), MeshCore::MeshOutput::SaveX3DContent(), Gui::SoFCColorLegend::setColorLegend(), InspectionGui::ViewProviderInspection::setDistances(), App::PropertyColor::setPyObject(), and Gui::Dialog::DlgMaterialPropertiesImp::setViewProviders().