Commit Graph

1914 Commits

Author SHA1 Message Date
Kenneth Moreland
c3ac545d91 Use CMakePackageConfigHelpers to create VTKmConfigVersion.cmake
This should help us be forward compatible with CMake.
2016-06-21 18:03:19 -06:00
Robert Maynard
dc542ba7e7 Merge topic 'fix_copyright_statement'
8871fe0b Add a copyright statement to the FindEGL.cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !458
2016-06-17 12:05:07 -04:00
Robert Maynard
8871fe0b0e Add a copyright statement to the FindEGL.cmake 2016-06-17 08:14:37 -04:00
Kenneth Moreland
952929a7d0 Merge branch 'msvc-rendering' into 'master'
Fix several issues concerning using rendering library with Visual Studio

Write a comment or drag your files here...

See merge request !457
2016-06-16 19:40:50 -04:00
Dave Pugmire
f427011002 Merge branch 'EGL2' into 'master'
Add support for offscreen rendering with EGL. Added new class CanvasEGL, and a test.



See merge request !455
2016-06-16 14:48:00 -04:00
Robert Maynard
8f2ec46d9c Merge topic 'DeviceAdapterCopyCheck'
bafee5dd Add a Copy benchmark
208b1ddd Add a DeviceAdapter Copy test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !456
2016-06-16 14:29:31 -04:00
Kenneth Moreland
b3314f539f Fix another stupid signed to unsigned conversion warning 2016-06-16 11:24:27 -06:00
Kenneth Moreland
5461d27948 Do not compile hello_world without GLEW
The GLEW library is optional, but without it you cannot do OpenGL
interop. The hello_world example uses OpenGL interop, but did not check
that GLEW was available. It tried to use GLEW and an error occured.
2016-06-16 11:15:23 -06:00
Kenneth Moreland
7751e2eeb8 Merge branch 'camera-corrections' into 'master'
Camera corrections



See merge request !454
2016-06-16 12:37:39 -04:00
Kenneth Moreland
0581a83aa2 Directly call python when executing expander.py
On Unix-based systems, you can directly execute a script and the system
will automatically run it through its associated interpreter. However,
on Windows this does not work. You just get an error about the script,
which is just a text file, being an invalid executable.

This was an issue when running pyexpander. Now, Python is called
directly for pyexpander.
2016-06-16 10:36:20 -06:00
John Biddiscombe
bafee5dd71 Add a Copy benchmark 2016-06-16 09:18:26 -04:00
Robert Maynard
cba9be2098 Merge topic 'detect_vs_checked_iterator_support'
1e19101e Obey VisualStudio checked iterator levels, and NULL checked iterators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !453
2016-06-16 08:59:34 -04:00
Kenneth Moreland
42cc4a0c10 Remove warning about loss of precision
Remove the ever fun loss of precision warning.
2016-06-15 18:03:20 -06:00
Kenneth Moreland
1d158346db Get raw pointer from checked iterators
In some cases on windows pointers used as iterators are wrapped in
checked iterators. This is fine for most uses, but you cannot pass them
to a C function as a pointer (as we were doing for OpenGL). This change
converts the checked iterator back to a raw pointer in this case.
2016-06-15 18:02:52 -06:00
Kenneth Moreland
dc15a6bedb Get around issue with min/max macros defined
There were a few places in the source code where
std::numeric_limits::min and max were used. There is an issue with these
methods on windows because the standard libraries there define macros
with the same name. Get around this problem by either places parentheses
so that they do not look like macros or use the vtkm::Infinity methods
instead.
2016-06-15 17:44:45 -06:00
Kenneth Moreland
a4d3dfe4a1 Include windows.h before gl.h
This is a requirement when compiling for windows.
2016-06-15 16:11:41 -06:00
Kenneth Moreland
05388ebfdf Do not use snprintf
This function is not portable to all MSVC compilers. Instead, use the
standard C++ stringstream that should be in every C++ compiler.
2016-06-15 16:06:50 -06:00
Kenneth Moreland
15d7132a2f Do not use "near" and "far" as variable names
Microsoft visual studio treats these as keywords. These keywords were
used for pointers on 16-bit architectures. That makes them pretty much
obsolete for any software written in the last 20 years, but happily they
stick around to give us confusing compile errors.
2016-06-15 14:37:18 -06:00
John Biddiscombe
208b1ddda3 Add a DeviceAdapter Copy test 2016-06-15 16:27:06 -04:00
Robert Maynard
1e19101eee Obey VisualStudio checked iterator levels, and NULL checked iterators
When compiling under VisualStudio we need to first determine if checked
iterators are enabled ( _ITERATOR_DEBUG_LEVEL ). We don't want to use the
NDEBUG key, as we could be inside a project that is in Debug mode with
disabled checked iterators.

Secondly if they are enabled we need to handle the use case of NULL iterators
that get advanced by length zero. This last case is valid, but isn't supported
by the checked iterators so we need to work around it
2016-06-15 13:13:02 -04:00
Dave Pugmire
af1daf2f66 Add support for offscreen rendering with EGL. Added new class CanvasEGL, and a test. 2016-06-15 09:48:45 -04:00
Kenneth Moreland
d861c1ec60 Reset Camera pan and zoom when setting range
It is odd to set the Camera range based on bounds and still have pan and
zoom activitated. This change resets the pan and zoom in these cases.
2016-06-14 17:44:16 -06:00
Kenneth Moreland
303b4da4c8 Remove BackgroundColor from Mapper
This was supposed to be removed in an earlier commit where the
background color was consolidated to Canvas, but I missed this one.
2016-06-14 14:18:21 -06:00
Kenneth Moreland
45a73baab1 Use degrees instead of radians for rotation transforms
It is more common to use degrees when specifying a transform (thanks to
the classic OpenGL interface). Also, camera specifies the field of view in
degrees, which made rotations inconsistent. This change unifies all that.
2016-06-14 13:52:55 -06:00
Kenneth Moreland
a2fee371b3 Add vtkm::Float64 versions of Camera methods
All of the Camera math (currently) uses 32-bit floats. However, to make
it easier to use the Camera class, I've duplicated the accessor methods
to also accept 64-bit floats.
2016-06-14 13:08:10 -06:00
Kenneth Moreland
123a3da8e6 Correct near clipping plane in ResetToBounds
Make it proportional to the size of the geometry.
2016-06-14 12:50:17 -06:00
Kenneth Moreland
dfc160a155 Merge branch 'resolve-conflicting-merges' into 'master'
Resolve conflicting merges

Merge request !445 (Camera enhancements) and merge request !448
(Consolidate background color) had conflicting changes in View.h.
Although git did not pick up on the conflict because each merge modified a
different portion of View.h, the final merge with both of these resulted
in a compile error.

Basically what happened was `Consolidate background color` changed all
the View constructors to reflect changes. `Camera enhancements` added a
new constructor to View using the old construction method. The new
constructor with the old construction method caused an error.

See merge request !451
2016-06-13 13:03:03 -04:00
Kenneth Moreland
fb68755924 Merge branch 'type-conversion' into 'master'
Fix warning about type conversion

C has a feature where if you perform arithmetic on small integers (like
char and short), it will automatically promote the result to a 32 bit
integer. If you then store that back in the same type you started with
GCC will warn you that you are loosing the precision (that you didn't ask
for in the first place). This is particularly annoying in templated
code.

Anyway, fixed yet another instance of that happening.

See merge request !450
2016-06-13 12:38:46 -04:00
Kenneth Moreland
d4e5bb0aee Resolve conflicting merges
Merge request !445 (Camera enhancements) and merge request !448
(Consolidate background color) had conflicting changes in View.h.
Although git did not pick up on the conflict because each merge modified a
different portion of View.h, the final merge with both of these resulted
in a compile error.

Basically what happened was `Consolidate background color` changed all
the View constructors to reflect changes. `Camera enhancements` added a
new constructor to View using the old construction method. The new
constructor with the old construction method caused an error.
2016-06-13 09:57:19 -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
b656baeeb6 Merge branch 'parameteric-coord-precision' into 'master'
Loosen threshold on test of parametric coordinates

The UnitTestParametricCoordinates test uses a pseudorandom number
generator to create some random set of parametric coordinates, convert
to world coordinates, and then back to parametric coordinates.

This has been working fine except that the world coordinate to parametric
coordinate conversion is not extremely precise for some cell shapes. (It
would not be cost effective to make it more precise.) Because of this,
the test_equal for this comparison has a pretty high threshold.

While looking at a dashboard I happened across a failure for this test.
It turns out that one of the parametric coordinates created for the
pyramid test for seed 1465529014 was just outside of this threshold, but
otherwise correct. I raised the threshold a little to try to prevent
this error.

See merge request !449
2016-06-13 11:36:04 -04:00
Kenneth Moreland
5a473b0012 Fix warning about type conversion
C has a feature where if you perform arithmetic on small integers (like
char and short), it will automatically promote the result to a 32 bit
integer. If you then store that back in the same type you started with
GCC will warn you that you are loosing the precision (that you didn't ask
for in the first place). This is particularly annoying in templated
code.

Anyway, fixed yet another instance of that happening.
2016-06-13 09:31:48 -06:00
Kenneth Moreland
9110214e7c Update OSMesa test
In the previous commit, I removed the background color arguments from
all the constructors from the Canvas class. I had missed the fact that
this was used in UnitTestMapperOSMesa.
2016-06-13 09:23:49 -06:00
Kenneth Moreland
f1e54ab568 Merge branch 'camera-enhancements' into 'master'
Camera enhancements



See merge request !445
2016-06-13 11:02:36 -04:00
Kenneth Moreland
a778d373f1 Loosen threshold on test of parametric coordinates
The UnitTestParametricCoordinates test uses a pseudorandom number
generator to create some random set of parametric coordinates, convert
to world coordinates, and then back to parametric coordinates.

This has been working fine except that the world coordinate to parametric
coordinate conversion is not extremely precise for some cell shapes. (It
would not be cost effective to make it more precise.) Because of this,
the test_equal for this comparison has a pretty high threshold.

While looking at a dashboard I happened across a failure for this test.
It turns out that one of the parametric coordinates created for the
pyramid test for seed 1465529014 was just outside of this threshold, but
otherwise correct. I raised the threshold a little to try to prevent
this error.
2016-06-13 08:56:40 -06:00
Kenneth Moreland
5dbcb33259 Modify implementation of Transform3DPoint
The new implementation assumes that the fourth component of the
homogeneous coordinate is not changed, which is true for all common
transforms except perspective projections. This should save several math
instructions to compute the fourth component and then divide the others
by it. If needed we can make a second method that does the complete
transform.

I am hoping that this will also solve what appears to be an optimization
bug on one of the dashboards.
2016-06-11 12:27:35 -06: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
Robert Maynard
5b6c6a7c72 Merge topic 'remove_UseVTKmCUDA.cmake_debug_message'
8a9fa5d2 Remove debug message from UseVTKmCUDA.cmake

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !446
2016-06-10 17:47:24 -04:00
Robert Maynard
8a9fa5d2cd Remove debug message from UseVTKmCUDA.cmake 2016-06-10 13:33:07 -04:00
Robert Maynard
6a395f06a4 Merge topic 'disable_vtkmAssume_windows_nvcc'
a2f5278f Disable VTKM_ASSUME when inside CUDA code compiled with VisualStudio.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !444
2016-06-09 15:43:31 -04:00
Kenneth Moreland
e47db6f610 Add dolly for 3D cameras
I forgot this one when adding roll, elevation, and azimuth.
2016-06-09 13:34:29 -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
cdeeda67bb Make a shared header of 3D transformations
Affine transformations of homogeneous coordinates using 4x4 matrices are
quite common in visualization. Create a new math header file in the base
vtkm namespace that has common functions for such coordinates.

Much of this implementation was taken from the rendering matrix helpers.
2016-06-09 13:34:29 -06:00
Kenneth Moreland
d55402e998 Merge branch 'render-interface-consistency' into 'master'
Render interface consistency

These changes mostly represent changing the interface to some of
the rendering classes to be more consistent with the reset of VTK-m.
In particular, several exposed class members become private and
are accessed through methods.

There are some other changes to make the interface simpler to
use. One example is consolidating the width/height of the image
to the Canvas. (All other classes refer to the Canvas for the
width/height). Another example is removing the template from
the View class.

See merge request !442
2016-06-09 15:32:53 -04:00
Kenneth Moreland
9b34f9eccc Perform missing updates to OSMesa code
I do not have OSMesa on my main development platform, so I missed updating
some of the code when I changed the interface.

Also removed some inline statements on pure virtual functions that GCC
was complaining about.
2016-06-09 12:35:59 -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
6e6177e2a8 Restore camera view diagnostics 2016-06-09 12:08:02 -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