2016-01-20 22:40:54 +00:00
|
|
|
##============================================================================
|
|
|
|
## Copyright (c) Kitware, Inc.
|
|
|
|
## All rights reserved.
|
|
|
|
## See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
##
|
2016-01-20 22:40:54 +00:00
|
|
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
## PURPOSE. See the above copyright notice for more information.
|
|
|
|
##============================================================================
|
|
|
|
|
2018-05-04 18:58:11 +00:00
|
|
|
#unconditionally include rendering contexts so that the helper functions
|
|
|
|
#are around even if rendering isn't enabled
|
|
|
|
include(VTKmRenderingContexts)
|
|
|
|
|
2017-10-05 14:28:44 +00:00
|
|
|
if(NOT VTKm_ENABLE_RENDERING)
|
|
|
|
return()
|
|
|
|
endif()
|
2017-12-28 21:07:14 +00:00
|
|
|
|
|
|
|
# determine what context(s) for rendering we want to build
|
2018-01-17 15:23:15 +00:00
|
|
|
vtkm_option(VTKm_ENABLE_GL_CONTEXT "Enable GL context for vtkm rendering" OFF)
|
2017-12-28 21:07:14 +00:00
|
|
|
if(UNIX AND NOT APPLE)
|
2018-01-17 15:23:15 +00:00
|
|
|
vtkm_option(VTKm_ENABLE_OSMESA_CONTEXT "Enable OSMesa context for vtkm rendering" OFF)
|
|
|
|
vtkm_option(VTKm_ENABLE_EGL_CONTEXT "Enable EGL context for vtkm rendering" OFF)
|
2017-12-28 21:07:14 +00:00
|
|
|
mark_as_advanced(VTKm_ENABLE_OSMESA_CONTEXT)
|
|
|
|
mark_as_advanced(VTKm_ENABLE_EGL_CONTEXT)
|
|
|
|
endif()
|
|
|
|
if(VTKm_ENABLE_GL_CONTEXT AND VTKm_ENABLE_OSMESA_CONTEXT)
|
|
|
|
message(FATAL_ERROR "VTK-m GL and OSMesa contexts are mutually exclusive")
|
|
|
|
endif()
|
|
|
|
if(VTKm_ENABLE_GL_CONTEXT AND VTKm_ENABLE_EGL_CONTEXT)
|
|
|
|
message(FATAL_ERROR "VTK-m GL and EGL contexts are mutually exclusive")
|
|
|
|
endif()
|
|
|
|
if(VTKm_ENABLE_EGL_CONTEXT AND VTKm_ENABLE_OSMESA_CONTEXT)
|
|
|
|
message(FATAL_ERROR "VTK-m EGL and OSMesa contexts are mutually exclusive")
|
2017-10-05 14:28:44 +00:00
|
|
|
endif()
|
|
|
|
|
2016-01-20 22:40:54 +00:00
|
|
|
set(headers
|
2016-06-02 21:43:30 +00:00
|
|
|
Actor.h
|
2016-05-25 21:32:10 +00:00
|
|
|
AxisAnnotation.h
|
|
|
|
AxisAnnotation2D.h
|
|
|
|
AxisAnnotation3D.h
|
2016-06-01 20:56:30 +00:00
|
|
|
BitmapFont.h
|
|
|
|
BitmapFontFactory.h
|
2016-05-25 21:32:10 +00:00
|
|
|
BoundingBoxAnnotation.h
|
2016-06-02 19:04:01 +00:00
|
|
|
Camera.h
|
2016-06-02 22:02:17 +00:00
|
|
|
Canvas.h
|
|
|
|
CanvasRayTracer.h
|
2016-01-20 22:40:54 +00:00
|
|
|
Color.h
|
2016-05-25 21:32:10 +00:00
|
|
|
ColorBarAnnotation.h
|
2017-07-28 17:31:19 +00:00
|
|
|
ColorLegendAnnotation.h
|
2017-06-17 21:28:45 +00:00
|
|
|
ConnectivityProxy.h
|
2018-09-11 02:25:42 +00:00
|
|
|
Cylinderizer.h
|
2016-08-26 19:30:52 +00:00
|
|
|
DecodePNG.h
|
2020-04-17 10:22:30 +00:00
|
|
|
EncodePNG.h
|
2017-09-14 16:40:23 +00:00
|
|
|
LineRenderer.h
|
2016-06-01 20:56:30 +00:00
|
|
|
MatrixHelpers.h
|
2016-02-09 13:59:26 +00:00
|
|
|
Scene.h
|
2016-06-02 19:41:14 +00:00
|
|
|
Mapper.h
|
2018-09-11 02:25:42 +00:00
|
|
|
MapperCylinder.h
|
|
|
|
MapperPoint.h
|
|
|
|
MapperQuad.h
|
2016-06-02 19:41:14 +00:00
|
|
|
MapperRayTracer.h
|
|
|
|
MapperVolume.h
|
2017-06-17 21:28:45 +00:00
|
|
|
MapperConnectivity.h
|
2017-08-16 18:45:28 +00:00
|
|
|
MapperWireframer.h
|
2018-09-11 02:25:42 +00:00
|
|
|
Quadralizer.h
|
2020-02-18 03:00:09 +00:00
|
|
|
ScalarRenderer.h
|
2016-06-01 20:56:30 +00:00
|
|
|
TextAnnotation.h
|
2016-09-01 15:46:37 +00:00
|
|
|
TextAnnotationBillboard.h
|
|
|
|
TextAnnotationScreen.h
|
2017-09-07 16:51:41 +00:00
|
|
|
TextRenderer.h
|
2017-09-18 22:18:33 +00:00
|
|
|
Texture2D.h
|
2016-01-20 22:40:54 +00:00
|
|
|
Triangulator.h
|
2016-06-02 21:43:30 +00:00
|
|
|
View.h
|
2016-11-23 15:48:22 +00:00
|
|
|
View1D.h
|
2016-09-01 18:33:28 +00:00
|
|
|
View2D.h
|
|
|
|
View3D.h
|
2019-01-29 19:28:19 +00:00
|
|
|
Wireframer.h
|
2016-05-25 21:32:10 +00:00
|
|
|
WorldAnnotator.h
|
|
|
|
)
|
|
|
|
|
2016-08-25 23:54:32 +00:00
|
|
|
set(sources
|
2016-08-26 19:30:52 +00:00
|
|
|
BitmapFont.cxx
|
|
|
|
BitmapFontFactory.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
|
2016-08-26 19:52:07 +00:00
|
|
|
Camera.cxx
|
2016-11-23 18:45:03 +00:00
|
|
|
Color.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
DecodePNG.cxx
|
2020-04-17 10:22:30 +00:00
|
|
|
EncodePNG.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
raytracing/Logger.cxx
|
|
|
|
)
|
|
|
|
|
|
|
|
# This list of sources has code that uses devices and so might need to be
|
|
|
|
# compiled with a device-specific compiler (like CUDA).
|
|
|
|
set(device_sources
|
|
|
|
Actor.cxx
|
|
|
|
AxisAnnotation.cxx
|
|
|
|
AxisAnnotation2D.cxx
|
|
|
|
AxisAnnotation3D.cxx
|
|
|
|
BoundingBoxAnnotation.cxx
|
|
|
|
Canvas.cxx
|
|
|
|
CanvasRayTracer.cxx
|
2016-08-27 02:32:15 +00:00
|
|
|
ColorBarAnnotation.cxx
|
2017-07-28 17:31:19 +00:00
|
|
|
ColorLegendAnnotation.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
ConnectivityProxy.cxx
|
2017-09-14 16:40:23 +00:00
|
|
|
LineRenderer.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
Mapper.cxx
|
2018-01-15 19:49:00 +00:00
|
|
|
MapperConnectivity.cxx
|
2018-09-11 02:25:42 +00:00
|
|
|
MapperCylinder.cxx
|
|
|
|
MapperPoint.cxx
|
|
|
|
MapperQuad.cxx
|
2016-08-29 21:50:47 +00:00
|
|
|
MapperRayTracer.cxx
|
|
|
|
MapperVolume.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
MapperWireframer.cxx
|
2020-02-18 03:00:09 +00:00
|
|
|
ScalarRenderer.cxx
|
2016-08-31 23:28:41 +00:00
|
|
|
Scene.cxx
|
2016-09-01 15:46:37 +00:00
|
|
|
TextAnnotation.cxx
|
|
|
|
TextAnnotationBillboard.cxx
|
|
|
|
TextAnnotationScreen.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
TextRenderer.cxx
|
2016-09-01 18:33:28 +00:00
|
|
|
View.cxx
|
2016-11-23 15:48:22 +00:00
|
|
|
View1D.cxx
|
2016-09-01 18:33:28 +00:00
|
|
|
View2D.cxx
|
|
|
|
View3D.cxx
|
2016-09-01 16:39:15 +00:00
|
|
|
WorldAnnotator.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
|
|
|
|
internal/RunTriangulator.cxx
|
|
|
|
raytracing/BoundingVolumeHierarchy.cxx
|
|
|
|
raytracing/Camera.cxx
|
|
|
|
raytracing/ChannelBuffer.cxx
|
|
|
|
raytracing/ConnectivityTracer.cxx
|
|
|
|
raytracing/CylinderExtractor.cxx
|
|
|
|
raytracing/CylinderIntersector.cxx
|
|
|
|
raytracing/MeshConnectivityBuilder.cxx
|
|
|
|
raytracing/MeshConnectivityContainers.cxx
|
|
|
|
raytracing/QuadExtractor.cxx
|
|
|
|
raytracing/QuadIntersector.cxx
|
|
|
|
raytracing/RayTracer.cxx
|
|
|
|
raytracing/RayOperations.cxx
|
2020-02-08 04:30:55 +00:00
|
|
|
raytracing/ScalarRenderer.cxx
|
2019-04-17 17:59:49 +00:00
|
|
|
raytracing/ShapeIntersector.cxx
|
|
|
|
raytracing/SphereExtractor.cxx
|
|
|
|
raytracing/SphereIntersector.cxx
|
|
|
|
raytracing/TriangleExtractor.cxx
|
|
|
|
raytracing/TriangleIntersector.cxx
|
|
|
|
raytracing/VolumeRendererStructured.cxx
|
2016-08-25 23:54:32 +00:00
|
|
|
)
|
|
|
|
|
2017-10-05 14:28:44 +00:00
|
|
|
# Note that EGL and OSMesa Canvas depend on the GL version being built. Only
|
|
|
|
# the None backend supports not building the opengl version
|
2016-05-25 21:32:10 +00:00
|
|
|
set(opengl_headers
|
2016-06-02 22:02:17 +00:00
|
|
|
CanvasGL.h
|
2016-06-02 19:41:14 +00:00
|
|
|
MapperGL.h
|
2016-06-01 20:56:30 +00:00
|
|
|
TextureGL.h
|
2016-05-25 21:32:10 +00:00
|
|
|
WorldAnnotatorGL.h
|
|
|
|
)
|
2016-08-26 21:58:21 +00:00
|
|
|
|
|
|
|
set(opengl_sources
|
|
|
|
CanvasGL.cxx
|
2016-08-29 21:50:47 +00:00
|
|
|
MapperGL.cxx
|
2016-09-01 16:19:29 +00:00
|
|
|
TextureGL.cxx
|
2016-09-01 16:39:15 +00:00
|
|
|
WorldAnnotatorGL.cxx
|
2016-08-26 21:58:21 +00:00
|
|
|
)
|
|
|
|
|
2016-06-15 13:48:45 +00:00
|
|
|
set(egl_headers
|
|
|
|
CanvasEGL.h
|
|
|
|
)
|
2016-05-25 21:32:10 +00:00
|
|
|
|
2016-08-26 21:58:21 +00:00
|
|
|
set(egl_sources
|
|
|
|
CanvasEGL.cxx
|
|
|
|
)
|
|
|
|
|
2016-05-25 21:32:10 +00:00
|
|
|
set(osmesa_headers
|
2016-06-02 22:02:17 +00:00
|
|
|
CanvasOSMesa.h
|
2016-01-20 22:40:54 +00:00
|
|
|
)
|
|
|
|
|
2016-08-26 21:58:21 +00:00
|
|
|
set(osmesa_sources
|
|
|
|
CanvasOSMesa.cxx
|
|
|
|
)
|
|
|
|
|
2016-01-20 22:40:54 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-02-22 23:18:23 +00:00
|
|
|
vtkm_library(
|
2017-10-05 14:28:44 +00:00
|
|
|
NAME vtkm_rendering
|
2017-02-22 23:18:23 +00:00
|
|
|
SOURCES ${sources}
|
2017-10-05 14:28:44 +00:00
|
|
|
HEADERS ${headers}
|
2019-07-08 18:09:09 +00:00
|
|
|
DEVICE_SOURCES ${device_sources}
|
2017-02-22 23:18:23 +00:00
|
|
|
)
|
2016-05-25 21:32:10 +00:00
|
|
|
|
2019-01-29 19:28:19 +00:00
|
|
|
# Install all headers no matter what backend was selected
|
|
|
|
vtkm_declare_headers(${opengl_headers})
|
|
|
|
vtkm_declare_headers(${osmesa_headers})
|
|
|
|
vtkm_declare_headers(${egl_headers})
|
|
|
|
|
2017-12-28 21:07:14 +00:00
|
|
|
if(VTKm_ENABLE_GL_CONTEXT)
|
2017-10-05 14:28:44 +00:00
|
|
|
target_sources(vtkm_rendering PRIVATE ${opengl_sources})
|
2017-12-28 21:07:14 +00:00
|
|
|
elseif(VTKm_ENABLE_OSMESA_CONTEXT)
|
2017-10-05 14:28:44 +00:00
|
|
|
target_sources(vtkm_rendering PRIVATE ${opengl_sources} ${osmesa_sources})
|
2017-12-28 21:07:14 +00:00
|
|
|
elseif(VTKm_ENABLE_EGL_CONTEXT)
|
2017-10-05 14:28:44 +00:00
|
|
|
target_sources(vtkm_rendering PRIVATE ${opengl_sources} ${egl_sources})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2019-06-18 19:19:05 +00:00
|
|
|
target_link_libraries(vtkm_rendering PUBLIC vtkm_filter
|
|
|
|
PRIVATE vtkm_lodepng)
|
2017-07-08 16:14:08 +00:00
|
|
|
if(UNIX AND NOT APPLE)
|
2019-04-17 17:59:49 +00:00
|
|
|
target_link_libraries(vtkm_rendering PRIVATE rt)
|
2017-07-08 16:14:08 +00:00
|
|
|
endif()
|
|
|
|
|
2017-10-05 14:28:44 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-12-28 21:07:14 +00:00
|
|
|
target_link_libraries(vtkm_rendering PUBLIC vtkm_rendering_gl_context)
|
2018-01-02 16:06:40 +00:00
|
|
|
|
|
|
|
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
|
2017-12-28 21:07:14 +00:00
|
|
|
install(TARGETS vtkm_rendering_gl_context
|
2017-10-05 14:28:44 +00:00
|
|
|
EXPORT ${VTKm_EXPORT_NAME}
|
|
|
|
)
|
2018-01-02 16:06:40 +00:00
|
|
|
endif()
|
2017-07-08 16:14:08 +00:00
|
|
|
|
2017-10-05 14:28:44 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2016-11-23 19:14:44 +00:00
|
|
|
add_subdirectory(internal)
|
|
|
|
add_subdirectory(raytracing)
|
|
|
|
add_subdirectory(testing)
|