mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
Move global visual scene from ngpkg.cpp to mvdraw.cpp
... so it is available in Snapshot() also rename the global variables: vs -> visual_scene vscross -> visual_scene_cross
This commit is contained in:
parent
245da0ee87
commit
d6095e9364
@ -25,6 +25,8 @@ namespace netgen
|
||||
DLL_HEADER Point3d VisualScene :: center;
|
||||
DLL_HEADER double VisualScene :: rad;
|
||||
DLL_HEADER GLdouble VisualScene :: backcolor;
|
||||
DLL_HEADER VisualScene visual_scene_cross;
|
||||
DLL_HEADER VisualScene *visual_scene = &visual_scene_cross;
|
||||
|
||||
/*
|
||||
#if TOGL_MAJOR_VERSION!=2
|
||||
@ -820,7 +822,7 @@ namespace netgen
|
||||
glViewport(0,0,w,h);
|
||||
|
||||
glPushMatrix();
|
||||
GetVSSolution().DrawScene();
|
||||
visual_scene->DrawScene();
|
||||
glFinish();
|
||||
glPopMatrix();
|
||||
|
||||
|
@ -83,6 +83,8 @@ namespace netgen
|
||||
|
||||
DLL_HEADER extern void MyOpenGLText (const char * text);
|
||||
DLL_HEADER extern void Set_OpenGLText_Callback ( void (*fun) (const char * text) );
|
||||
DLL_HEADER extern VisualScene visual_scene_cross;
|
||||
DLL_HEADER extern VisualScene *visual_scene;
|
||||
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <visual.hpp>
|
||||
|
||||
namespace netgen {
|
||||
extern VisualScene *vs;
|
||||
extern VisualScene *visual_scene;
|
||||
#include "demoview.hpp"
|
||||
|
||||
|
||||
@ -422,7 +422,7 @@ namespace netgen {
|
||||
*/
|
||||
|
||||
|
||||
vs -> LookAt ( Point<3>( campos.Evaluate (time)),
|
||||
visual_scene -> LookAt ( Point<3>( campos.Evaluate (time)),
|
||||
Point<3>(campoint.Evaluate (time)),
|
||||
Point<3>( camup.Evaluate (time)) );
|
||||
|
||||
|
23
ng/ngpkg.cpp
23
ng/ngpkg.cpp
@ -103,7 +103,6 @@ namespace netgen
|
||||
|
||||
// visualization scenes, pointer vs selects which one is drawn:
|
||||
|
||||
static VisualScene vscross;
|
||||
DLL_HEADER extern VisualSceneSurfaceMeshing vssurfacemeshing;
|
||||
DLL_HEADER extern VisualSceneMeshDoctor vsmeshdoc;
|
||||
|
||||
@ -111,7 +110,8 @@ namespace netgen
|
||||
|
||||
|
||||
|
||||
VisualScene *vs = &vscross;
|
||||
DLL_HEADER extern VisualScene *visual_scene;
|
||||
DLL_HEADER extern VisualScene visual_scene_cross;
|
||||
|
||||
|
||||
|
||||
@ -1973,7 +1973,8 @@ namespace netgen
|
||||
{
|
||||
const char * vismode = vispar.selectvisual;
|
||||
// Tcl_GetVar (interp, "selectvisual", 0);
|
||||
vs = &vscross;
|
||||
VisualScene *& vs = visual_scene;
|
||||
vs = &visual_scene_cross;
|
||||
if (GetVisualizationScenes().Used(vismode))
|
||||
{
|
||||
vs = GetVisualizationScenes()[vismode];
|
||||
@ -2049,7 +2050,7 @@ namespace netgen
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
SetVisualScene (Togl_Interp(togl));
|
||||
vs->DrawScene();
|
||||
visual_scene->DrawScene();
|
||||
Set_OpenGLText_Callback (&MyOpenGLText_GUI);
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2069,7 +2070,7 @@ namespace netgen
|
||||
glPushMatrix();
|
||||
|
||||
glLoadIdentity();
|
||||
vs->DrawScene();
|
||||
visual_scene->DrawScene();
|
||||
Togl_SwapBuffers(togl);
|
||||
|
||||
glPopMatrix();
|
||||
@ -2290,7 +2291,7 @@ namespace netgen
|
||||
newy = atoi (argv[4]);
|
||||
|
||||
SetVisualScene(interp);
|
||||
vs->MouseMove (oldx, oldy, newx, newy, argv[5][0]);
|
||||
visual_scene->MouseMove (oldx, oldy, newx, newy, argv[5][0]);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2304,7 +2305,7 @@ namespace netgen
|
||||
int py = Togl_PixelScale(togl)*atoi (argv[2]);
|
||||
|
||||
SetVisualScene(interp);
|
||||
vs->MouseDblClick (px, py);
|
||||
visual_scene->MouseDblClick (px, py);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2315,7 +2316,7 @@ namespace netgen
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
SetVisualScene(interp);
|
||||
vs->BuildScene (1);
|
||||
visual_scene->BuildScene (1);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2326,7 +2327,7 @@ namespace netgen
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
SetVisualScene(interp);
|
||||
vs->BuildScene (2);
|
||||
visual_scene->BuildScene (2);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2337,7 +2338,7 @@ namespace netgen
|
||||
int argc, tcl_const char *argv[])
|
||||
{
|
||||
SetVisualScene(interp);
|
||||
vs->StandardRotation (argv[1]);
|
||||
visual_scene->StandardRotation (argv[1]);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@ -2356,7 +2357,7 @@ namespace netgen
|
||||
vec.Append(Vec3d(atof(argv[i+1]),atof(argv[i+2]),atof(argv[i+3])));
|
||||
}
|
||||
|
||||
vs->ArbitraryRotation (alpha,vec);
|
||||
visual_scene->ArbitraryRotation (alpha,vec);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user