From 6fba7347a91c9737d5370962c0c0f3b8db22a796 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 May 2020 14:29:34 -0400 Subject: [PATCH 1/2] Mark pixel destructors as virtual to fix build error. --- vtkm/io/PixelTypes.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vtkm/io/PixelTypes.h b/vtkm/io/PixelTypes.h index 4b7ee0ab5..8a86d3c8d 100644 --- a/vtkm/io/PixelTypes.h +++ b/vtkm/io/PixelTypes.h @@ -111,6 +111,8 @@ public: /// void FillImageAtIndexWithPixel(unsigned char* imageData, const vtkm::Id index); + virtual ~BasePixel() = default; + protected: /// Takes an input imageData pointer and an index to a location in that dataset /// and fills in this->Components correctly using the provided BIT_DEPTH and @@ -144,6 +146,8 @@ public: ComponentType Diff(const Superclass& pixel) const override; vtkm::Vec4f_32 ToVec4f() const override; + virtual ~RGBPixel() = default; + protected: void print(std::ostream& os) const override { @@ -179,6 +183,8 @@ public: ComponentType Diff(const Superclass& pixel) const override; vtkm::Vec4f_32 ToVec4f() const override; + virtual ~GreyPixel() = default; + protected: void print(std::ostream& os) const override { os << "(" << (int)this->Components[0] << ")"; } }; From a55596b38c4e003a58589b2b042f96e94d77b618 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 14 May 2020 16:10:33 -0400 Subject: [PATCH 2/2] Reorder member functions. --- vtkm/io/PixelTypes.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vtkm/io/PixelTypes.h b/vtkm/io/PixelTypes.h index 8a86d3c8d..c6a7b9034 100644 --- a/vtkm/io/PixelTypes.h +++ b/vtkm/io/PixelTypes.h @@ -88,6 +88,8 @@ public: ConstructPixelFromImage(imageData, index); } + virtual ~BasePixel() = default; + /// Calculates this difference between two pixels as a single value. /// virtual ComponentType Diff(const BaseType& pixel) const = 0; @@ -111,8 +113,6 @@ public: /// void FillImageAtIndexWithPixel(unsigned char* imageData, const vtkm::Id index); - virtual ~BasePixel() = default; - protected: /// Takes an input imageData pointer and an index to a location in that dataset /// and fills in this->Components correctly using the provided BIT_DEPTH and @@ -143,11 +143,11 @@ public: { } + virtual ~RGBPixel() = default; + ComponentType Diff(const Superclass& pixel) const override; vtkm::Vec4f_32 ToVec4f() const override; - virtual ~RGBPixel() = default; - protected: void print(std::ostream& os) const override { @@ -180,11 +180,11 @@ public: { } + virtual ~GreyPixel() = default; + ComponentType Diff(const Superclass& pixel) const override; vtkm::Vec4f_32 ToVec4f() const override; - virtual ~GreyPixel() = default; - protected: void print(std::ostream& os) const override { os << "(" << (int)this->Components[0] << ")"; } };