aDrawer->SetPointAspect(
new Prs3d_PointAspect(Aspect_TOM_POINT, Quantity_NOC_YELLOW, POINT_SIZE));
}
- SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
- QColor aQColor = aResMgr->colorValue("Viewer", "scalar_bar_text_color", Qt::black);
-
- myLabelColor = Quantity_Color(aQColor.redF(), aQColor.greenF(), aQColor.blueF(),
- Quantity_TOC_RGB);
-
SetMaterial(Graphic3d_NOM_PLASTIC);
}
{
ModelAPI_AttributeTables::ValueType aType = dataType();
DataPtr aData = myFeature->data();
+ AttributeSelectionListPtr aSelList = aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
+ std::string aTypeStr = aSelList->selectionType();
+
int aStep = myStep->id();
AttributeTablesPtr aTablesAttr = aData->tables(CollectionPlugin_Field::VALUES_ID());
int aRows = aTablesAttr->rows();
int aCols = aTablesAttr->columns();
QList<double> aFieldStepData;
- for (int k = 1; k < aRows; k++) { // Do not use default values
+ int aStart = (aTypeStr == "part")? 0:1;
+ for (int k = aStart; k < aRows; k++) { // Do not use default values
for (int j = 0; j < aCols; j++) {
ModelAPI_AttributeTables::Value aVal = aTablesAttr->value(k, j, aStep);
switch (aType) {
}
QList<double> aShapeData;
double aRangeMin = aFieldStepData.first(), aRangeMax = aFieldStepData.last();
- for (int aRow = 0; aRow < aRows - 1; aRow++) {
+ for (int aRow = 0; aRow < aRows - aStart; aRow++) {
double aNorm = 0;
int aBaseIndex = aRow * aCols;
for (int aCol = 0; aCol < aCols; aCol++) {
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 = aResMgr->integerValue("Viewer", "scalar_bar_nb_intervals", 20);
- 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();
- TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
- double aValue = aShapeData.at(i);
+ AttributeSelectionListPtr aSelList =
+ aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
+ std::string aTypeStr = aSelList->selectionType();
+ if (aTypeStr == "part") {
Quantity_Color aColor;
- if (AIS_ColorScale::FindColor(aValue, aMin, aMax, aNbIntertvals, aColor))
- SetCustomColor(aShape, aColor);
+ if (AIS_ColorScale::FindColor(aMin, aMin, aMax, 1, aColor)) {
+ SetColor(aColor);
+ }
+ }
+ else {
+ int aNbIntertvals = aResMgr->integerValue("Viewer", "scalar_bar_nb_intervals", 20);
+ for (int i = 0; i < aSelList->size(); i++) {
+ AttributeSelectionPtr aSelection = aSelList->value(i);
+ GeomShapePtr aShapePtr = aSelection->value();
+ TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
+ double aValue = aShapeData.at(i);
+ Quantity_Color aColor;
+ if (AIS_ColorScale::FindColor(aValue, aMin, aMax, aNbIntertvals, aColor))
+ SetCustomColor(aShape, aColor);
+ }
}
}
break;
{
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);