Skip to content

Commit

Permalink
more work on the region view.
Browse files Browse the repository at this point in the history
  • Loading branch information
vebeckner committed May 3, 2017
1 parent 7daf1a5 commit 16c07c4
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 95 deletions.
2 changes: 1 addition & 1 deletion AmrVisTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) {
#ifdef AV_PROFDATA
if(fileType == amrex::Amrvis::PROFDATA) {
cout << "]]]]: fileType is amrex::Amrvis::PROFDATA." << endl;
PrintMessage("]]]]: fileType is amrex::Amrvis::PROFDATA.");
PrintMessage("]]]]: fileType is amrex::Amrvis::PROFDATA.\n");
if(AVGlobals::GetFileCount() == 1) {
string dirName(AVGlobals::GetComlineFilename(0));
cout << "]]]]]]]]: dirName = " << dirName << endl;
Expand Down
22 changes: 19 additions & 3 deletions Palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
Array<int> palIndex(regionNames.size(), 0);
XSetForeground(display, gc, AVWhitePixel());

bool isProfPal(regionNames.find(-2) != regionNames.end());
for(std::map<int, string>::const_iterator it = regionNames.begin();
it != regionNames.end(); ++it)
{
Expand All @@ -274,8 +275,13 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
(totalColorSlots * (cftIndex - palMin) / cftRange) + palOffsetY;
XDrawString(display, palPixmap, gc, palWidth + noffX,
nameLocation, fname.c_str(), strlen(fname.c_str()));
XDrawLine(display, palPixmap, gc,
palWidth + 2, palLocation, palWidth + noffX - 4, nameLocation - 4);
if(cftIndex == -2) {
XDrawLine(display, palPixmap, gc,
palWidth + 2, nameLocation - 6, palWidth + noffX - 4, nameLocation - 4);
} else {
XDrawLine(display, palPixmap, gc,
palWidth + 2, palLocation, palWidth + noffX - 4, nameLocation - 4);
}
palIndex[count] = paletteStart + (((cftIndex - palMin) / cftRange) * colorSlots);
++count;
}
Expand All @@ -294,7 +300,17 @@ void Palette::DrawPalette(Real palMin, Real palMax, const string &numberFormat)
}
iphi = totalColorSlots - 1;
for(int i(iplo); i < iphi; ++i) {
XSetForeground(display, gc, makePixel(palIndex[ip]));
if(isProfPal) {
if(ip == 0) {
XSetForeground(display, gc, AVWhitePixel());
} else if(ip == 1) {
XSetForeground(display, gc, AVBlackPixel());
} else {
XSetForeground(display, gc, makePixel(palIndex[ip]));
}
} else {
XSetForeground(display, gc, makePixel(palIndex[ip]));
}
cy = ((totalColorSlots - 1) - i) + palOffsetY;
XDrawLine(display, palPixmap, gc, 0, cy, palWidth, cy);
}
Expand Down
7 changes: 7 additions & 0 deletions ProfApp.H
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public:
void DoFuncList(Widget, XtPointer, XtPointer);
void DoGenerateFuncList(Widget, XtPointer, XtPointer);
void GenerateFuncList(const amrex::Array<std::string> &funcs);
void DoRubberBanding(Widget, XtPointer, XtPointer);

void DetachXYPlotWin(int dir) { XYplotwin[dir] = NULL; }
XYPlotParameters *GetXYPlotParameters() const { return XYplotparameters; }
Expand Down Expand Up @@ -108,6 +109,12 @@ private:
RegionPicture *regionPicturePtr;
map<int, string> regNames;

// baggage for fast rubber banding
GC rbgc;
XEvent nextEvent;
int rWidth, rHeight, rStartX, rStartY;
Cursor cursor;

static int initialWindowHeight, initialWindowWidth;

void ProfAppInit();
Expand Down
Loading

0 comments on commit 16c07c4

Please sign in to comment.