mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
Update Rendering example to latest rendering module changes
This commit is contained in:
parent
db6d61cadb
commit
32efc36c1c
@ -75,24 +75,24 @@ void mouseMove(int x, int y)
|
|||||||
//std::cout<<"MOUSE MOVE: "<<x<<" "<<y<<std::endl;
|
//std::cout<<"MOUSE MOVE: "<<x<<" "<<y<<std::endl;
|
||||||
|
|
||||||
//Map to XY
|
//Map to XY
|
||||||
y = window->view.Height-y;
|
y = window->View.Height-y;
|
||||||
|
|
||||||
if (lastx != -1 && lasty != -1)
|
if (lastx != -1 && lasty != -1)
|
||||||
{
|
{
|
||||||
vtkm::Float32 x1 = ((lastx*2.0f)/window->view.Width) - 1.0f;
|
vtkm::Float32 x1 = ((lastx*2.0f)/window->View.Width) - 1.0f;
|
||||||
vtkm::Float32 y1 = ((lasty*2.0f)/window->view.Height) - 1.0f;
|
vtkm::Float32 y1 = ((lasty*2.0f)/window->View.Height) - 1.0f;
|
||||||
vtkm::Float32 x2 = ((x*2.0f)/window->view.Width) - 1.0f;
|
vtkm::Float32 x2 = ((x*2.0f)/window->View.Width) - 1.0f;
|
||||||
vtkm::Float32 y2 = ((y*2.0f)/window->view.Height) - 1.0f;
|
vtkm::Float32 y2 = ((y*2.0f)/window->View.Height) - 1.0f;
|
||||||
|
|
||||||
if (buttonStates[0] == GLUT_DOWN)
|
if (buttonStates[0] == GLUT_DOWN)
|
||||||
{
|
{
|
||||||
if (shiftKey)
|
if (shiftKey)
|
||||||
window->view.Pan3D(x2-x1, y2-y1);
|
window->View.Pan3D(x2-x1, y2-y1);
|
||||||
else
|
else
|
||||||
window->view.TrackballRotate(x1,y1, x2,y2);
|
window->View.TrackballRotate(x1,y1, x2,y2);
|
||||||
}
|
}
|
||||||
else if (buttonStates[1] == GLUT_DOWN)
|
else if (buttonStates[1] == GLUT_DOWN)
|
||||||
window->view.Zoom3D(y2-y1);
|
window->View.Zoom3D(y2-y1);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastx = x;
|
lastx = x;
|
||||||
@ -102,7 +102,7 @@ void mouseMove(int x, int y)
|
|||||||
|
|
||||||
|
|
||||||
// Respond to mouse button
|
// Respond to mouse button
|
||||||
void mouseCall(int button, int state, int x, int y)
|
void mouseCall(int button, int state, int vtkmNotUsed(x), int vtkmNotUsed(y))
|
||||||
{
|
{
|
||||||
int modifiers = glutGetModifiers();
|
int modifiers = glutGetModifiers();
|
||||||
shiftKey = modifiers & GLUT_ACTIVE_SHIFT;
|
shiftKey = modifiers & GLUT_ACTIVE_SHIFT;
|
||||||
@ -171,7 +171,7 @@ main(int argc, char* argv[])
|
|||||||
vtkm::rendering::SceneRendererGL<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> sceneRenderer;
|
vtkm::rendering::SceneRendererGL<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> sceneRenderer;
|
||||||
|
|
||||||
vtkm::rendering::Scene3D scene;
|
vtkm::rendering::Scene3D scene;
|
||||||
scene.plots.push_back(vtkm::rendering::Plot(ds.GetCellSet(),
|
scene.Plots.push_back(vtkm::rendering::Plot(ds.GetCellSet(),
|
||||||
ds.GetCoordinateSystem(),
|
ds.GetCoordinateSystem(),
|
||||||
ds.GetField("pointvar"),
|
ds.GetField("pointvar"),
|
||||||
vtkm::rendering::ColorTable("thermal")));
|
vtkm::rendering::ColorTable("thermal")));
|
||||||
|
Loading…
Reference in New Issue
Block a user