Skip to content

Commit

Permalink
Fixed property coloring bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
andeplane committed Nov 4, 2016
1 parent 6668da4 commit 4a439d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions atomify-lammps/LammpsWrappers/modifiers/propertymodifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PropertyModifier::PropertyModifier()

void PropertyModifier::applyColors(AtomData &atomData, const std::vector<double> &values, int groupBit) {
QVector<double> limits = {0, 0.15, 0.35, 0.65, 0.85, 1.0};
QVector<double> red = {0, 0, 0, 255./255, 255./255, 100./255};
QVector<double> red = {0, 0, 0, 255./255, 255./255, 255./255};
QVector<double> green = {0, 50./255, 255./255, 255./255, 30./255, 0};
QVector<double> blue = {100./255, 255./255, 255./255, 0, 0, 0};
m_cleanPoints.clear();
Expand Down Expand Up @@ -49,7 +49,7 @@ void PropertyModifier::applyColors(AtomData &atomData, const std::vector<double>

double scaled = (value - m_min) * oneOverRange; // between 0 and 1
for(int j=0; j<limits.size()-1; j++) {
if(limits[j] <= scaled && scaled < limits[j+1]) {
if(limits[j] <= scaled && scaled <= limits[j+1]) {
// Found the two bins including this value
double dx = limits[j+1] - limits[j];
double fraction = 1.0 - (scaled - limits[j]) / dx; // where between these two values are we
Expand Down
4 changes: 2 additions & 2 deletions atomify-lammps/qml/plotting/ColorMaps.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Item {
ColorGradientStop { position: 0.35; color: Qt.rgba(0.0, 1.0, 1.0, 1.0) }
ColorGradientStop { position: 0.65; color: Qt.rgba(1.0, 1.0, 0.0, 1.0) }
ColorGradientStop { position: 0.85; color: Qt.rgba(1.0, 0.117647059, 0.0, 1.0) }
ColorGradientStop { position: 1.00; color: Qt.rgba(0.392156863, 0.0, 0.0, 1.0) }
ColorGradientStop { position: 1.00; color: Qt.rgba(1.0, 0.0, 0.0, 1.0) }
}

property Gradient jet_: Gradient {
Expand All @@ -17,7 +17,7 @@ Item {
GradientStop { position: 0.35; color: Qt.rgba(0.0, 1.0, 1.0, 1.0) }
GradientStop { position: 0.65; color: Qt.rgba(1.0, 1.0, 0.0, 1.0) }
GradientStop { position: 0.85; color: Qt.rgba(1.0, 0.117647059, 0.0, 1.0) }
GradientStop { position: 1.00; color: Qt.rgba(0.392156863, 0.0, 0.0, 1.0) }
GradientStop { position: 1.00; color: Qt.rgba(1.0, 0.0, 0.0, 1.0) }
}

property ColorGradient magma: ColorGradient {
Expand Down

0 comments on commit 4a439d5

Please sign in to comment.