Skip to content

Commit 9384230

Browse files
committed
Merge branch 'use_center_coords_sol_scene' into 'master'
use center coords and set center on dbl click also in solution scene See merge request ngsolve/netgen!510
2 parents 0402ca0 + e726628 commit 9384230

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

libsrc/visualization/vssolution.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,12 +795,24 @@ namespace netgen
795795
static double oldrad = 0;
796796

797797
mesh->GetBox (pmin, pmax, -1);
798-
center = Center (pmin, pmax);
798+
if(vispar.use_center_coords && zoomall == 2)
799+
{
800+
center.X() = vispar.centerx;
801+
center.Y() = vispar.centery;
802+
center.Z() = vispar.centerz;
803+
}
804+
else if(selpoint >= 1 && zoomall == 2)
805+
center = mesh->Point(selpoint);
806+
else if(vispar.centerpoint >= 1 && zoomall == 2)
807+
center = mesh->Point(vispar.centerpoint);
808+
else
809+
center = Center (pmin, pmax);
799810
rad = 0.5 * Dist (pmin, pmax);
811+
if(rad == 0) rad = 1e-6;
800812

801813
glEnable (GL_NORMALIZE);
802814

803-
if (rad > 1.5 * oldrad ||
815+
if (rad > 1.2 * oldrad ||
804816
mesh->GetMajorTimeStamp() > surfeltimestamp ||
805817
zoomall)
806818
{

0 commit comments

Comments
 (0)