From 68648863bcc757cc1ff1ec16a5753f2819c92e7f Mon Sep 17 00:00:00 2001 From: Manish Mathai Date: Mon, 24 Jul 2017 11:59:19 -0700 Subject: [PATCH 1/3] Exports Color class, adding visibility to static members Color class contains predefined colors as static members and needs to be exported for them to be accessible outside the library. --- vtkm/rendering/Color.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vtkm/rendering/Color.h b/vtkm/rendering/Color.h index 72c16b9ab..917efe7bd 100644 --- a/vtkm/rendering/Color.h +++ b/vtkm/rendering/Color.h @@ -20,6 +20,8 @@ #ifndef vtk_m_rendering_Color_h #define vtk_m_rendering_Color_h +#include + #include #include namespace vtkm @@ -33,7 +35,7 @@ namespace rendering /// Ported from EAVL. Originally created by Jeremy Meredith, Dave Pugmire, /// and Sean Ahern. /// -class Color +class VTKM_RENDERING_EXPORT Color { public: vtkm::Vec Components; From 812f11d36210f7ba23bf8cf94012aac0cd230d1d Mon Sep 17 00:00:00 2001 From: Manish Mathai Date: Mon, 24 Jul 2017 14:51:46 -0700 Subject: [PATCH 2/3] Moves class-wide visibility macro to just the static class members. `Color` class uses `VTKM_EXEC`* visibility macros on some member functions and VC++ raises an error if that is mixed with the class wide visibility macro. This commit adds the macro to each individual static member instead. --- vtkm/rendering/Color.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vtkm/rendering/Color.h b/vtkm/rendering/Color.h index 917efe7bd..19caa3a56 100644 --- a/vtkm/rendering/Color.h +++ b/vtkm/rendering/Color.h @@ -35,7 +35,7 @@ namespace rendering /// Ported from EAVL. Originally created by Jeremy Meredith, Dave Pugmire, /// and Sean Ahern. /// -class VTKM_RENDERING_EXPORT Color +class Color { public: vtkm::Vec Components; @@ -137,10 +137,11 @@ public: return out; } - static Color white, black; - static Color red, green, blue; - static Color cyan, magenta, yellow; - static Color gray10, gray20, gray30, gray40, gray50, gray60, gray70, gray80, gray90; + static VTKM_RENDERING_EXPORT Color white, black; + static VTKM_RENDERING_EXPORT Color red, green, blue; + static VTKM_RENDERING_EXPORT Color cyan, magenta, yellow; + static VTKM_RENDERING_EXPORT Color gray10, gray20, gray30, gray40, gray50, gray60, gray70, gray80, + gray90; }; } } //namespace vtkm::rendering From dd4efb511f63053e1aad1041e9238870b3ab7ce1 Mon Sep 17 00:00:00 2001 From: Manish Mathai Date: Thu, 27 Jul 2017 14:10:34 -0700 Subject: [PATCH 3/3] Uses `Color` in the unit tests for basic sanity check This commits acts as a basic sanity check for `Color` class and to ensure the symbol visility fix. --- vtkm/rendering/testing/RenderTest.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vtkm/rendering/testing/RenderTest.h b/vtkm/rendering/testing/RenderTest.h index 3878bb8ea..16461e2a3 100644 --- a/vtkm/rendering/testing/RenderTest.h +++ b/vtkm/rendering/testing/RenderTest.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -97,6 +98,7 @@ void Render(const vtkm::cont::DataSet& ds, { MapperType mapper; CanvasType canvas(512, 512); + canvas.SetBackgroundColor(vtkm::rendering::Color::white); vtkm::rendering::Scene scene; scene.AddActor(vtkm::rendering::Actor( @@ -115,6 +117,7 @@ void Render(const vtkm::cont::DataSet& ds, { MapperType mapper; CanvasType canvas(512, 512); + canvas.SetBackgroundColor(vtkm::rendering::Color::white); vtkm::rendering::Scene scene; //DRP Actor? no field? no colortable (or a constant colortable) ??