#include "PartSet_FieldStepPrs.h"
+#include <ModuleBase_Preferences.h>
+
#include <CollectionPlugin_Field.h>
#include <ModelAPI_AttributeSelectionList.h>
#include <ModelAPI_AttributeIntArray.h>
#include <ModelAPI_AttributeStringArray.h>
+#include <SUIT_ResourceMgr.h>
+
#include <AIS_ColorScale.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_PointAspect.hxx>
std::shared_ptr<ModelAPI_ResultField> aFieldPtr(aField, emptyDeleter);
myFeature = ModelAPI_Feature::feature(aFieldPtr);
- Handle(Prs3d_Drawer) aDrawer = Attributes();
- if (aDrawer->HasOwnPointAspect()) {
- aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_POINT);
- aDrawer->PointAspect()->SetScale(POINT_SIZE);
+ if (dataType() != ModelAPI_AttributeTables::STRING) {
+ Handle(Prs3d_Drawer) aDrawer = Attributes();
+ if (aDrawer->HasOwnPointAspect()) {
+ aDrawer->PointAspect()->SetTypeOfMarker(Aspect_TOM_POINT);
+ aDrawer->PointAspect()->SetScale(POINT_SIZE);
+ }
+ else
+ aDrawer->SetPointAspect(
+ new Prs3d_PointAspect(Aspect_TOM_POINT, Quantity_NOC_YELLOW, POINT_SIZE));
}
- else
- aDrawer->SetPointAspect(
- new Prs3d_PointAspect(Aspect_TOM_POINT, Quantity_NOC_YELLOW, POINT_SIZE));
-
- myLabelColor = Quantity_Color(1, 1, 1, Quantity_TOC_RGB);
+ SetMaterial(Graphic3d_NOM_PLASTIC);
}
void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr,
const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode)
{
+ SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
+ QColor aQColor = aResMgr->colorValue("Viewer", "scalar_bar_text_color", Qt::black);
+ Quantity_Color aLabelColor = Quantity_Color(aQColor.redF(), aQColor.greenF(), aQColor.blueF(),
+ Quantity_TOC_RGB);
+
ModelAPI_AttributeTables::ValueType aType = dataType();
DataPtr aData = myFeature->data();
switch (aType) {
{
double aMin, aMax;
QList<double> aShapeData = range(aMin, aMax);
- int aNbIntertvals = 20;
+ int aNbIntertvals = aResMgr->integerValue("Viewer", "scalar_bar_nb_intervals", 20);
- AttributeSelectionListPtr aSelList = aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
+ AttributeSelectionListPtr aSelList =
+ aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
for (int i = 0; i < aSelList->size(); i++) {
AttributeSelectionPtr aSelection = aSelList->value(i);
GeomShapePtr aShapePtr = aSelection->value();
{
QList<double> aShapeData = booleanValues();
- AttributeSelectionListPtr aSelList = aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
+ AttributeSelectionListPtr aSelList =
+ aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
for (int i = 0; i < aSelList->size(); i++) {
AttributeSelectionPtr aSelection = aSelList->value(i);
GeomShapePtr aShapePtr = aSelection->value();
case ModelAPI_AttributeTables::STRING:
{
QStringList aValues = strings();
- AttributeSelectionListPtr aSelList = aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
+ AttributeSelectionListPtr aSelList =
+ aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
for (int i = 0; i < aSelList->size(); i++) {
AttributeSelectionPtr aSelection = aSelList->value(i);
Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
anAspectText3d->SetStyle(Aspect_TOST_ANNOTATION);
- anAspectText3d->SetColor(myLabelColor);
+ anAspectText3d->SetColor(aLabelColor);
aGroup->SetPrimitivesAspect(anAspectText3d);
+ int aT = aResMgr->integerValue("Viewer", "scalar_bar_text_height", 14);
QString aString = aValues.at(i);
- aGroup->Text(aString.toUtf8().constData(), aVertex, 14);
+ aGroup->Text(aString.toUtf8().constData(), aVertex, aT);
}
}
}