Commit Graph

38 Commits

Author SHA1 Message Date
Robert Maynard
e415f55b6f Update the examples to work with the new usage requirements 2017-01-27 10:03:53 -05:00
Dave Pugmire
4edb91ad96 Get rid of warnings in examples. 2016-11-04 16:29:07 -04:00
Mark Kim
464da87d5a Merge branch 'master' of gitlab.kitware.com:vtk/vtk-m 2016-10-12 14:40:32 -04:00
Kenneth Moreland
d1d7ac54a0 Add GLUT component to find_package(VTKm)
This makes it easier to use VTK-m with GLUT. It also makes it more
consistent with GLFW, GLEW, and other support libraries.
2016-10-03 17:34:13 -06:00
Mark Kim
5827473abb Merge branch 'master' of gitlab.kitware.com:dpugmire/vtk-m 2016-09-23 09:46:48 -04:00
Robert Maynard
4521403fd2 Examples now correctly request the optional CUDA component 2016-09-14 15:29:04 -04:00
Mark Kim
f293c5a0bc Merge branch 'glut-unittest' 2016-09-14 09:19:57 -04:00
Kenneth Moreland
22c6741152 Add View to rendering library
To get rid of some templates, I added the ability to create new
instances of mappers and canvases without knowing their type.
2016-09-07 16:48:04 -06:00
Kenneth Moreland
668f93a66b Move Mappers to rendering library
Also changed the mappers to not be templated on the device adapter.
Instead, use TryExecute to determine the device adapter at runtime.
2016-09-07 16:47:52 -06:00
Kenneth Moreland
2ea00d28f0 Examples that use Rendering now need to configure Rendering 2016-09-07 16:47:37 -06:00
Robert Maynard
f81c42b9b4 Replace NULL with nullptr where applicable. 2016-09-01 09:38:25 -04:00
Kenneth Moreland
866c617cbf Fix config issues with headers and libraries
There were a couple of places where the configure scripts did not add
either includes to VTKm_INCLUDE_DIRS or libraries to VTKm_LIBRARIES.

The biggest offender was when the examples used find_package to load the
VTK-m configuration it needed. find_package cleared out the includes and
libraries, but it did not clear out the VTKm_<COMPONENT>_FOUND
variables. Normally, these variables would not be set before
find_package is called, but in this case the examples were called after
some partial configuration. I got around this issue by clearing out all
the *_FOUND variables in VTKmConfig.cmake.
2016-08-23 14:07:38 -06:00
Robert Maynard
88ce3f23ae Examples now call find_package(VTKm)
The examples are now written so they can be copied out of the vtk-m
source and still build properly. This will help new users / developers
learn how to build projects that use VTK-m.
2016-08-22 14:03:16 -04:00
Dave Pugmire
7d5934ea22 use the matricies from the camera for the VBO rendering. 2016-08-02 13:42:47 -04:00
Kenneth Moreland
7ff20c9230 Fix includes for CUDA builds
The CMake CUDA build targets do not respect the
target_include_directories (yet?). Instead, add the necessary includes
to cuda_include_directories().
2016-06-22 12:53:23 -06:00
Kenneth Moreland
13ee8bc190 Fix several issues with making sure all includes are set
Make everything consistent with new builds.
2016-06-21 18:03:29 -06:00
Kenneth Moreland
e50d91199c Merge branch 'consolidate-background-color' into 'master'
Consolidate background color in rendering classes

Before this commit, there were three separate classes (Mapper, Canvas,
and View) that were all managing their own version of the background
color. As you can imagine, this could easily become out of sync, and in
fact if the user code did not specify the same background at least
twice, it would not work.

Fix this by consolidating the background color management to the Canvas.
This is the class most responsible for maintaining the background. All
other classes get or set the background from the Canvas.

That said, I also removed setting the background color from the
constructor in the Canvas. This background color is overridden by the
View anyway, so having it there was only confusing.

See merge request !448
2016-06-13 11:46:18 -04:00
Kenneth Moreland
72b43d7151 Consolidate background color in rendering classes
Before this commit, there were three separate classes (Mapper, Canvas,
and View) that were all managing their own version of the background
color. As you can imagine, this could easily become out of sync, and in
fact if the user code did not specify the same background at least
twice, it would not work.

Fix this by consolidating the background color management to the Canvas.
This is the class most responsible for maintaining the background. All
other classes get or set the background from the Canvas.

That said, I also removed setting the background color from the
constructor in the Canvas. This background color is overridden by the
View anyway, so having it there was only confusing.
2016-06-11 12:09:51 -06:00
Kenneth Moreland
ebfb1e7389 Make giving Camera to View optional
It is now optional to give a Camera object when constructing a View. If
a Camera is not specified, one is automatically set up by calling
ResetToBounds on the spatial bounds of the scene.

This makes it even easier to set up a view.
2016-06-09 13:34:29 -06:00
Kenneth Moreland
9f3e0e5952 Implement roll, elevation, and azimuth for 3D cameras
Also implement pan and zoom for 2D cameras.

Update the rendering tests to do these camera rotations. This matches
better the viewpoint used before the previous camera changes.
2016-06-09 13:34:29 -06:00
Kenneth Moreland
ca87b5f736 Make defining WorldAnnotator for View optional
Most of the time, you just match the WorldAnnotator with the canvas of
the same type. Rather than make the user specify it every time, add a
method to the canvas that creates a "good" WorldAnnotator to use with
it. Then, if a WorldAnnotator is not given to the View constructor, one
is automatically created from the Canvas.
2016-06-09 12:08:03 -06:00
Kenneth Moreland
2be7a8e032 Remove templating from View
The template parameters on vtkm::rendering::View are unnecessary. All
three of the templated classes are polymorphic (with virtual functions).
Thus, you just have to specify them at the constructor. Removing the
template parameters makes the syntax a bit cleaner and removes some
unnecessary duplication in the executable.

Removing the template does mean we cannot optimize in the future.
However, I expect us to start using more virtual methods rather than
less, so I think this is a move in the right direction.
2016-06-09 12:08:01 -06:00
Kenneth Moreland
5af7c6ff4c Hide internal parts of Canvas 2016-06-09 12:07:59 -06:00
Kenneth Moreland
55af901f60 Hide Camera private parts
With only a few exceptions for simple structures, we do not expose the
members of classes. Instead, we provide accessor methods. Do this for
Camera as well as add some helper methods.
2016-06-09 12:07:58 -06:00
Kenneth Moreland
0769b96bf3 Remove Width and Height from Camera
The width and height are maintained out of necessity by the canvas. A
second copy was maintained by the camera, which was only used for
computing the aspect ratio and similar metrics for projections.

Having to maintain the width/height in two places is a bit of a hassle
and provides the opportunity for bugs if they get out of sync. Instead,
have the width/height managed in one place (the canvas) and pass them as
parameters as necessary.
2016-06-09 12:07:56 -06:00
Kenneth Moreland
b01e8391b4 Consolidate functionality in Canvas classes
Move some of the management of the width, height, and buffers to the base
Canvas class. Also, when it makes sense, get the width and height from
the rendering system.

Also changed the color buffer to be a Vec so that you don't have to
manage array offsets by hand.

All of these changes snowballed from the observation that the glut
example did not properly enable the depth buffer.
2016-06-09 12:07:55 -06:00
Kenneth Moreland
e30607f134 Hide internal std::vector in Scene
Generally we try not to expose the implementation details of how things
are stored in objects.

Also changed some arguments that should have been declared const to
actually be const.
2016-06-09 12:07:53 -06:00
Kenneth Moreland
fa3e43fbaa Change vtkm::rendering::RenderSurface to Canvas
The word surface is more often used for something like a polygonal mesh,
so this name is quite confusing. Canvas is consistent with a
conventional name in GUI widget APIs.
2016-06-02 16:04:13 -06:00
Kenneth Moreland
eb9288cb1a Change vtkm::rendering::Window to View
The rendering classes do not actually manage windows, and window was not
descriptive of what this class was doing. We decided that the class was
mostly analogous to what we call a "view" in ParaView.
2016-06-02 15:43:40 -06:00
Kenneth Moreland
9fc86890eb Change vtkm::rendering::SceneRenderer* to Mapper*
This name was chosen to reflect the analogous name in VTK.
2016-06-02 13:41:14 -06:00
Kenneth Moreland
1934049df9 Change vtkm::rendering::View to Camera 2016-06-02 13:04:01 -06:00
Jeremy Meredith
6c8045bdc3 unifying 2d and 3d scenes 2016-06-01 13:51:37 -04:00
Kenneth Moreland
507222c489 Change rendering classes to use Range and Bounds
In addition to this being necessary to be compatible with recent
changes, it makes for cleaner declaration of these values.
2016-05-29 18:49:37 -06:00
Kenneth Moreland
32efc36c1c Update Rendering example to latest rendering module changes 2016-05-25 15:34:57 -06:00
Dave Pugmire
dc31494b59 Merge branch 'master' into annot5 2016-05-20 10:04:37 -04:00
Dave Pugmire
389a4ca2f6 remove unused file. 2016-05-18 10:48:07 -04:00
Dave Pugmire
5f9403b881 Add trackball rotation, translate and zoom ot examples/rendering, and to the view classes. 2016-05-18 10:32:02 -04:00
Dave Pugmire
72673ed952 Add glut-based rendering example.
Added a GL-based render surface.
2016-05-05 13:26:39 -04:00