Skip to content
Open
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
8 changes: 6 additions & 2 deletions glvis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ class Session
public:
Session(bool fix_elem_orient,
bool save_coloring,
bool keep_attr,
string plot_caption,
bool headless)
{
win.data_state.fix_elem_orient = fix_elem_orient;
win.data_state.save_coloring = save_coloring;
win.data_state.keep_attr = keep_attr;
win.plot_caption = plot_caption;
win.headless = headless;
}
Expand Down Expand Up @@ -157,7 +159,7 @@ class Session
};

void GLVisServer(int portnum, bool save_stream, bool fix_elem_orient,
bool save_coloring, string plot_caption, bool secure,
bool save_coloring, bool keep_attr, string plot_caption, bool secure,
bool headless = false)
{
std::vector<Session> current_sessions;
Expand Down Expand Up @@ -310,7 +312,8 @@ void GLVisServer(int portnum, bool save_stream, bool fix_elem_orient,
while (1);
}

Session new_session(fix_elem_orient, save_coloring, plot_caption, headless);
Session new_session(fix_elem_orient, save_coloring,
keep_attr, plot_caption, headless);

constexpr int tmp_filename_size = 50;
char tmp_file[tmp_filename_size];
Expand Down Expand Up @@ -696,6 +699,7 @@ int main (int argc, char *argv[])
std::thread serverThread{GLVisServer, portnum, save_stream,
win.data_state.fix_elem_orient,
win.data_state.save_coloring,
win.data_state.keep_attr,
win.plot_caption, secure, win.headless};

// Start message loop in main thread
Expand Down
16 changes: 14 additions & 2 deletions lib/vssolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2523,9 +2523,21 @@ void VisualizationSceneSolution::PrepareBoundary()
T->Loc2.Transform(ir, eir);
GetRefinedValues(T->Elem2No, eir, vals, pointmat);
bl.glBegin(GL_LINE_STRIP);
for (j = 0; j < vals.Size(); j++)
if (drawbdr == 2)
{
bl.glVertex3d(pointmat(0, j), pointmat(1, j), vals(j));
const double val = mesh->GetBdrAttribute(i);
MySetColor(bl, val, minv, maxv);
for (j = 0; j < vals.Size(); j++)
{
bl.glVertex3d(pointmat(0, j), pointmat(1, j), val);
}
}
else
{
for (j = 0; j < vals.Size(); j++)
{
bl.glVertex3d(pointmat(0, j), pointmat(1, j), vals(j));
}
}
bl.glEnd();
}
Expand Down
10 changes: 9 additions & 1 deletion lib/vssolution3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ void VisualizationSceneSolution3d::PrepareOrderingCurve1(gl3::GlDrawable& buf,
DenseMatrix pointmat1;
Array<int> vertices1;

const auto shrink_save = shrink;
// If shrink != 1, ShrinkPoints() expects a bdr element index for its second
// parameter when dim == 3. Since in the loop below we call ShrinkPoints()
// with an element index, we temporarily set shrink to 1.
if (mesh->Dimension() == 3) { shrink = 1.0; }

int ne = mesh->GetNE();
for (int k = 0; k < ne-1; k++)
{
Expand Down Expand Up @@ -223,7 +229,7 @@ void VisualizationSceneSolution3d::PrepareOrderingCurve1(gl3::GlDrawable& buf,
double dx = xs1-xs;
double dy = ys1-ys;
double dz = zs1-zs;
double ds = sqrt(dx*dx+dy*dy+dz*dz);
double ds = hypot(dx, dy, dz); // sqrt(dx*dx+dy*dy+dz*dz);

double cval = HUGE_VAL;
if (color)
Expand All @@ -247,6 +253,8 @@ void VisualizationSceneSolution3d::PrepareOrderingCurve1(gl3::GlDrawable& buf,
}
}

if (mesh->Dimension() == 3) { shrink = shrink_save; }

if (GetMultisample() > 0)
{
SetLineWidthMS(LineWidth);
Expand Down
Loading