Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 266 additions & 1 deletion lib/palettes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,268 @@

using namespace std;

const int PLASIMO_Palette_Size = 256;
double PLASIMO_Palette[PLASIMO_Palette_Size][3] =
{
{0.2, 0, 0.4},
{0.2, 0, 0.423529},
{0.203922, 0, 0.447059},
{0.203922, 0, 0.470588},
{0.2, 0, 0.494118},
{0.196078, 0, 0.517647},
{0.192157, 0, 0.541176},
{0.188235, 0, 0.564706},
{0.184314, 0, 0.588235},
{0.176471, 0, 0.611765},
{0.168627, 0, 0.635294},
{0.156863, 0, 0.658824},
{0.14902, 0, 0.682353},
{0.137255, 0, 0.705882},
{0.12549, 0, 0.729412},
{0.109804, 0, 0.752941},
{0.0941176, 0, 0.776471},
{0.0784314, 0, 0.8},
{0.0627451, 0, 0.823529},
{0.0431373, 0, 0.847059},
{0.0235294, 0, 0.870588},
{0.00392157, 0, 0.894118},
{0, 0.0196078, 0.921569},
{0, 0.0392157, 0.945098},
{0, 0.0666667, 0.968627},
{0, 0.0901961, 0.992157},
{0, 0.113725, 1},
{0, 0.133333, 1},
{0, 0.152941, 1},
{0, 0.172549, 1},
{0, 0.192157, 1},
{0, 0.211765, 1},
{0, 0.235294, 1},
{0, 0.254902, 1},
{0, 0.27451, 1},
{0, 0.294118, 1},
{0, 0.313725, 1},
{0, 0.333333, 1},
{0, 0.356863, 1},
{0, 0.376471, 1},
{0, 0.396078, 1},
{0, 0.415686, 1},
{0, 0.435294, 1},
{0, 0.454902, 1},
{0, 0.478431, 1},
{0, 0.498039, 1},
{0, 0.517647, 1},
{0, 0.537255, 1},
{0, 0.556863, 1},
{0, 0.576471, 1},
{0, 0.6, 1},
{0, 0.619608, 1},
{0, 0.639216, 1},
{0, 0.658824, 1},
{0, 0.678431, 1},
{0, 0.698039, 1},
{0, 0.717647, 1},
{0, 0.741176, 1},
{0, 0.760784, 1},
{0, 0.780392, 1},
{0, 0.8, 1},
{0, 0.819608, 1},
{0, 0.839216, 1},
{0, 0.862745, 1},
{0, 0.882353, 1},
{0, 0.901961, 1},
{0, 0.921569, 1},
{0, 0.941176, 1},
{0, 0.960784, 1},
{0, 0.984314, 1},
{0, 1, 0.996078},
{0, 1, 0.976471},
{0, 1, 0.956863},
{0, 1, 0.937255},
{0, 1, 0.917647},
{0, 1, 0.894118},
{0, 1, 0.87451},
{0, 1, 0.854902},
{0, 1, 0.835294},
{0, 1, 0.815686},
{0, 1, 0.796078},
{0, 1, 0.772549},
{0, 1, 0.752941},
{0, 1, 0.733333},
{0, 1, 0.713725},
{0, 1, 0.694118},
{0, 1, 0.67451},
{0, 1, 0.65098},
{0, 1, 0.631373},
{0, 1, 0.611765},
{0, 1, 0.592157},
{0, 1, 0.572549},
{0, 1, 0.552941},
{0, 1, 0.529412},
{0, 1, 0.509804},
{0, 1, 0.490196},
{0, 1, 0.470588},
{0, 1, 0.45098},
{0, 1, 0.431373},
{0, 1, 0.407843},
{0, 1, 0.388235},
{0, 1, 0.368627},
{0, 1, 0.34902},
{0, 1, 0.329412},
{0, 1, 0.309804},
{0, 1, 0.290196},
{0, 1, 0.266667},
{0, 1, 0.247059},
{0, 1, 0.227451},
{0, 1, 0.207843},
{0, 1, 0.188235},
{0, 1, 0.168627},
{0, 1, 0.145098},
{0, 1, 0.12549},
{0, 1, 0.105882},
{0, 1, 0.0745098},
{0, 1, 0.0392157},
{0, 1, 0.00392157},
{0.0313725, 1, 0},
{0.0666667, 1, 0},
{0.101961, 1, 0},
{0.137255, 1, 0},
{0.172549, 1, 0},
{0.207843, 1, 0},
{0.243137, 1, 0},
{0.278431, 1, 0},
{0.313725, 1, 0},
{0.34902, 1, 0},
{0.384314, 1, 0},
{0.419608, 1, 0},
{0.454902, 1, 0},
{0.490196, 1, 0},
{0.52549, 1, 0},
{0.560784, 1, 0},
{0.596078, 1, 0},
{0.635294, 1, 0},
{0.670588, 1, 0},
{0.705882, 1, 0},
{0.741176, 1, 0},
{0.776471, 1, 0},
{0.803922, 1, 0},
{0.819608, 1, 0},
{0.835294, 1, 0},
{0.85098, 1, 0},
{0.866667, 1, 0},
{0.882353, 1, 0},
{0.898039, 1, 0},
{0.913725, 1, 0},
{0.929412, 1, 0},
{0.945098, 1, 0},
{0.960784, 1, 0},
{0.976471, 1, 0},
{0.992157, 1, 0},
{1, 0.992157, 0},
{1, 0.976471, 0},
{1, 0.960784, 0},
{1, 0.945098, 0},
{1, 0.929412, 0},
{1, 0.913725, 0},
{1, 0.894118, 0},
{1, 0.878431, 0},
{1, 0.862745, 0},
{1, 0.847059, 0},
{1, 0.831373, 0},
{1, 0.815686, 0},
{1, 0.8, 0},
{1, 0.784314, 0},
{1, 0.768627, 0},
{1, 0.752941, 0},
{1, 0.737255, 0},
{1, 0.721569, 0},
{1, 0.705882, 0},
{1, 0.690196, 0},
{1, 0.67451, 0},
{1, 0.658824, 0},
{1, 0.643137, 0},
{1, 0.627451, 0},
{1, 0.611765, 0},
{1, 0.596078, 0},
{1, 0.580392, 0},
{1, 0.564706, 0},
{1, 0.54902, 0},
{1, 0.533333, 0},
{1, 0.517647, 0},
{1, 0.501961, 0},
{1, 0.486275, 0},
{1, 0.470588, 0},
{1, 0.454902, 0},
{1, 0.439216, 0},
{1, 0.423529, 0},
{1, 0.407843, 0},
{1, 0.392157, 0},
{1, 0.376471, 0},
{1, 0.360784, 0},
{1, 0.345098, 0},
{1, 0.329412, 0},
{1, 0.313725, 0},
{1, 0.298039, 0},
{1, 0.282353, 0},
{1, 0.266667, 0},
{1, 0.25098, 0},
{1, 0.235294, 0},
{1, 0.219608, 0},
{1, 0.203922, 0},
{1, 0.188235, 0},
{1, 0.172549, 0},
{1, 0.156863, 0},
{1, 0.141176, 0},
{1, 0.12549, 0},
{1, 0.109804, 0},
{1, 0.0941176, 0},
{1, 0.0784314, 0},
{1, 0.0627451, 0},
{1, 0.0470588, 0},
{1, 0.0313725, 0},
{1, 0.0156863, 0},
{1, 0.00392157, 0.00392157},
{1, 0.0235294, 0.0470588},
{1, 0.0431373, 0.0901961},
{1, 0.0666667, 0.133333},
{1, 0.0862745, 0.176471},
{1, 0.105882, 0.215686},
{1, 0.129412, 0.254902},
{1, 0.14902, 0.290196},
{1, 0.168627, 0.329412},
{1, 0.192157, 0.364706},
{1, 0.211765, 0.4},
{1, 0.231373, 0.435294},
{1, 0.254902, 0.466667},
{1, 0.27451, 0.498039},
{1, 0.294118, 0.529412},
{1, 0.317647, 0.560784},
{1, 0.337255, 0.588235},
{1, 0.360784, 0.619608},
{1, 0.380392, 0.647059},
{1, 0.4, 0.670588},
{1, 0.423529, 0.698039},
{1, 0.443137, 0.721569},
{1, 0.462745, 0.745098},
{1, 0.486275, 0.764706},
{1, 0.505882, 0.788235},
{1, 0.52549, 0.807843},
{1, 0.54902, 0.827451},
{1, 0.568627, 0.843137},
{1, 0.588235, 0.862745},
{1, 0.611765, 0.878431},
{1, 0.631373, 0.894118},
{1, 0.654902, 0.909804},
{1, 0.67451, 0.921569},
{1, 0.694118, 0.933333},
{1, 0.717647, 0.945098},
{1, 0.737255, 0.956863},
{1, 0.756863, 0.964706},
{1, 0.780392, 0.972549},
{1, 0.8, 0.980392},
{1, 0.8, 0.980392}
};


const int RGB_Palette_1_Size = 5;
double RGB_Palette_1[RGB_Palette_1_Size][3] =
{
Expand Down Expand Up @@ -7310,9 +7572,10 @@ double RGB_Palette_43[RGB_Palette_43_Size][3] =
{0.12337357, 0.04004903, 0.10343270}
};

const int Num_RGB_Palettes = 43;
const int Num_RGB_Palettes = 44;
const int RGB_Palettes_Sizes[Num_RGB_Palettes] =
{
PLASIMO_Palette_Size,
RGB_Palette_1_Size, RGB_Palette_2_Size, RGB_Palette_3_Size,
RGB_Palette_4_Size, RGB_Palette_5_Size, RGB_Palette_6_Size,
RGB_Palette_7_Size, RGB_Palette_8_Size, RGB_Palette_9_Size,
Expand All @@ -7332,6 +7595,7 @@ const int RGB_Palettes_Sizes[Num_RGB_Palettes] =

double *RGB_Palettes[Num_RGB_Palettes] =
{
*PLASIMO_Palette,
*RGB_Palette_1, *RGB_Palette_2, *RGB_Palette_3, *RGB_Palette_4,
*RGB_Palette_5, *RGB_Palette_6, *RGB_Palette_7, *RGB_Palette_8,
*RGB_Palette_9, *RGB_Palette_10, *RGB_Palette_11, *RGB_Palette_12,
Expand All @@ -7348,6 +7612,7 @@ double *RGB_Palettes[Num_RGB_Palettes] =
const char *RGB_Palettes_Names[Num_RGB_Palettes] =
{
// 0123456789
"PLASIMO ",
"5-color ", "red ", "jet-like ", "coldhot ", "bone ",
"hot ", "pink ", "cool ", "summer ", "hsv ",
"copper ", "white ", "vivid ", "aluminum ", "sunrise ",
Expand Down
2 changes: 1 addition & 1 deletion lib/vssolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void VisualizationSceneSolution::Init()

VisualizationSceneScalarData::Init(); // Calls FindNewBox() !!!

palette.SetIndex(2); // use the 'jet-like' palette in 2D
palette.SetIndex(0); // use the 'PLASIMO' palette in 2D

double eps = 1e-6; // move the cutting plane a bit to avoid artifacts
CuttingPlane = new Plane(-1.0,0.0,0.0,(0.5-eps)*bb.x[0]+(0.5+eps)*bb.x[1]);
Expand Down
2 changes: 1 addition & 1 deletion lib/vssolution3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ void VisualizationSceneSolution3d::Init()

node_pos = new double[mesh->GetNV()];

palette.SetIndex(12); // use the 'vivid' palette in 3D
palette.SetIndex(0); // use the 'PLASIMO' palette in 3D

double eps = 1e-6; // move the cutting plane a bit to avoid artifacts
CuttingPlane = new Plane(-1.0,0.0,0.0,(0.5-eps)*bb.x[0]+(0.5+eps)*bb.x[1]);
Expand Down