Commit 8276e35c authored by Robert Maynard's avatar Robert Maynard
Browse files

Mark classes that should not be derived from as final.

parent 2714cbe5
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
VTKM_EXEC_CONT const Vector& GetMaxPoint() const { return this->MaxPoint; } VTKM_EXEC_CONT const Vector& GetMaxPoint() const { return this->MaxPoint; }
VTKM_EXEC_CONT Scalar Value(const Vector& point) const override VTKM_EXEC_CONT Scalar Value(const Vector& point) const final
{ {
Scalar minDistance = vtkm::NegativeInfinity32(); Scalar minDistance = vtkm::NegativeInfinity32();
Scalar diff, t, dist; Scalar diff, t, dist;
...@@ -214,7 +214,7 @@ public: ...@@ -214,7 +214,7 @@ public:
} }
} }
VTKM_EXEC_CONT Vector Gradient(const Vector& point) const override VTKM_EXEC_CONT Vector Gradient(const Vector& point) const final
{ {
vtkm::IdComponent minAxis = 0; vtkm::IdComponent minAxis = 0;
Scalar dist = 0.0; Scalar dist = 0.0;
...@@ -343,7 +343,7 @@ private: ...@@ -343,7 +343,7 @@ private:
//============================================================================ //============================================================================
/// \brief Implicit function for a cylinder /// \brief Implicit function for a cylinder
class VTKM_ALWAYS_EXPORT Cylinder : public vtkm::ImplicitFunction class VTKM_ALWAYS_EXPORT Cylinder final : public vtkm::ImplicitFunction
{ {
public: public:
VTKM_EXEC_CONT Cylinder() VTKM_EXEC_CONT Cylinder()
...@@ -385,14 +385,14 @@ public: ...@@ -385,14 +385,14 @@ public:
this->Modified(); this->Modified();
} }
VTKM_EXEC_CONT Scalar Value(const Vector& point) const override VTKM_EXEC_CONT Scalar Value(const Vector& point) const final
{ {
Vector x2c = point - this->Center; Vector x2c = point - this->Center;
FloatDefault proj = vtkm::Dot(this->Axis, x2c); FloatDefault proj = vtkm::Dot(this->Axis, x2c);
return vtkm::Dot(x2c, x2c) - (proj * proj) - (this->Radius * this->Radius); return vtkm::Dot(x2c, x2c) - (proj * proj) - (this->Radius * this->Radius);
} }
VTKM_EXEC_CONT Vector Gradient(const Vector& point) const override VTKM_EXEC_CONT Vector Gradient(const Vector& point) const final
{ {
Vector x2c = point - this->Center; Vector x2c = point - this->Center;
FloatDefault t = this->Axis[0] * x2c[0] + this->Axis[1] * x2c[1] + this->Axis[2] * x2c[2]; FloatDefault t = this->Axis[0] * x2c[0] + this->Axis[1] * x2c[1] + this->Axis[2] * x2c[2];
...@@ -409,7 +409,7 @@ private: ...@@ -409,7 +409,7 @@ private:
//============================================================================ //============================================================================
/// \brief Implicit function for a frustum /// \brief Implicit function for a frustum
class VTKM_ALWAYS_EXPORT Frustum : public vtkm::ImplicitFunction class VTKM_ALWAYS_EXPORT Frustum final : public vtkm::ImplicitFunction
{ {
public: public:
Frustum() = default; Frustum() = default;
...@@ -480,7 +480,7 @@ public: ...@@ -480,7 +480,7 @@ public:
this->Modified(); this->Modified();
} }
VTKM_EXEC_CONT Scalar Value(const Vector& point) const override VTKM_EXEC_CONT Scalar Value(const Vector& point) const final
{ {
Scalar maxVal = vtkm::NegativeInfinity<Scalar>(); Scalar maxVal = vtkm::NegativeInfinity<Scalar>();
for (vtkm::Id index : { 0, 1, 2, 3, 4, 5 }) for (vtkm::Id index : { 0, 1, 2, 3, 4, 5 })
...@@ -493,7 +493,7 @@ public: ...@@ -493,7 +493,7 @@ public:
return maxVal; return maxVal;
} }
VTKM_EXEC_CONT Vector Gradient(const Vector& point) const override VTKM_EXEC_CONT Vector Gradient(const Vector& point) const final
{ {
Scalar maxVal = vtkm::NegativeInfinity<Scalar>(); Scalar maxVal = vtkm::NegativeInfinity<Scalar>();
vtkm::Id maxValIdx = 0; vtkm::Id maxValIdx = 0;
...@@ -518,7 +518,7 @@ private: ...@@ -518,7 +518,7 @@ private:
//============================================================================ //============================================================================
/// \brief Implicit function for a plane /// \brief Implicit function for a plane
class VTKM_ALWAYS_EXPORT Plane : public vtkm::ImplicitFunction class VTKM_ALWAYS_EXPORT Plane final : public vtkm::ImplicitFunction
{ {
public: public:
VTKM_EXEC_CONT Plane() VTKM_EXEC_CONT Plane()
...@@ -554,12 +554,12 @@ public: ...@@ -554,12 +554,12 @@ public:
VTKM_EXEC_CONT const Vector& GetOrigin() const { return this->Origin; } VTKM_EXEC_CONT const Vector& GetOrigin() const { return this->Origin; }
VTKM_EXEC_CONT const Vector& GetNormal() const { return this->Normal; } VTKM_EXEC_CONT const Vector& GetNormal() const { return this->Normal; }
VTKM_EXEC_CONT Scalar Value(const Vector& point) const override VTKM_EXEC_CONT Scalar Value(const Vector& point) const final
{ {
return vtkm::Dot(point - this->Origin, this->Normal); return vtkm::Dot(point - this->Origin, this->Normal);
} }
VTKM_EXEC_CONT Vector Gradient(const Vector&) const override { return this->Normal; } VTKM_EXEC_CONT Vector Gradient(const Vector&) const final { return this->Normal; }
private: private:
Vector Origin; Vector Origin;
...@@ -568,7 +568,7 @@ private: ...@@ -568,7 +568,7 @@ private:
//============================================================================ //============================================================================
/// \brief Implicit function for a sphere /// \brief Implicit function for a sphere
class VTKM_ALWAYS_EXPORT Sphere : public vtkm::ImplicitFunction class VTKM_ALWAYS_EXPORT Sphere final : public vtkm::ImplicitFunction
{ {
public: public:
VTKM_EXEC_CONT Sphere() VTKM_EXEC_CONT Sphere()
...@@ -605,12 +605,12 @@ public: ...@@ -605,12 +605,12 @@ public:
VTKM_EXEC_CONT const Vector& GetCenter() const { return this->Center; } VTKM_EXEC_CONT const Vector& GetCenter() const { return this->Center; }
VTKM_EXEC_CONT Scalar Value(const Vector& point) const override VTKM_EXEC_CONT Scalar Value(const Vector& point) const final
{ {
return vtkm::MagnitudeSquared(point - this->Center) - (this->Radius * this->Radius); return vtkm::MagnitudeSquared(point - this->Center) - (this->Radius * this->Radius);
} }
VTKM_EXEC_CONT Vector Gradient(const Vector& point) const override VTKM_EXEC_CONT Vector Gradient(const Vector& point) const final
{ {
return Scalar(2) * (point - this->Center); return Scalar(2) * (point - this->Center);
} }
......
...@@ -34,7 +34,7 @@ namespace cont ...@@ -34,7 +34,7 @@ namespace cont
{ {
template <vtkm::IdComponent DIMENSION> template <vtkm::IdComponent DIMENSION>
class VTKM_ALWAYS_EXPORT CellSetStructured : public CellSet class VTKM_ALWAYS_EXPORT CellSetStructured final : public CellSet
{ {
private: private:
using Thisclass = vtkm::cont::CellSetStructured<DIMENSION>; using Thisclass = vtkm::cont::CellSetStructured<DIMENSION>;
...@@ -55,19 +55,16 @@ public: ...@@ -55,19 +55,16 @@ public:
Thisclass& operator=(const Thisclass& src); Thisclass& operator=(const Thisclass& src);
virtual vtkm::Id GetNumberOfCells() const override { return this->Structure.GetNumberOfCells(); } vtkm::Id GetNumberOfCells() const override { return this->Structure.GetNumberOfCells(); }
virtual vtkm::Id GetNumberOfPoints() const override vtkm::Id GetNumberOfPoints() const override { return this->Structure.GetNumberOfPoints(); }
{
return this->Structure.GetNumberOfPoints();
}
virtual vtkm::Id GetNumberOfFaces() const override { return -1; } vtkm::Id GetNumberOfFaces() const override { return -1; }
virtual vtkm::Id GetNumberOfEdges() const override { return -1; } vtkm::Id GetNumberOfEdges() const override { return -1; }
// Since the entire topology is defined by by three integers, nothing to do here. // Since the entire topology is defined by by three integers, nothing to do here.
virtual void ReleaseResourcesExecution() override {} void ReleaseResourcesExecution() override {}
void SetPointDimensions(SchedulingRangeType dimensions) void SetPointDimensions(SchedulingRangeType dimensions)
{ {
...@@ -101,7 +98,7 @@ public: ...@@ -101,7 +98,7 @@ public:
typename ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType typename ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType
PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const; PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const;
virtual void PrintSummary(std::ostream& out) const; void PrintSummary(std::ostream& out) const override;
private: private:
InternalsType Structure; InternalsType Structure;
......
...@@ -29,7 +29,7 @@ namespace cont ...@@ -29,7 +29,7 @@ namespace cont
namespace internal namespace internal
{ {
template <> template <>
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda> struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda> final
: public ExecutionArrayInterfaceBasicBase : public ExecutionArrayInterfaceBasicBase
{ {
using Superclass = ExecutionArrayInterfaceBasicBase; using Superclass = ExecutionArrayInterfaceBasicBase;
......
...@@ -86,7 +86,7 @@ struct ExecutionPortalFactoryBasic<T, DeviceAdapterTagOpenMP> ...@@ -86,7 +86,7 @@ struct ExecutionPortalFactoryBasic<T, DeviceAdapterTagOpenMP>
}; };
template <> template <>
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP> struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP> final
: public ExecutionArrayInterfaceBasicShareWithControl : public ExecutionArrayInterfaceBasicShareWithControl
{ {
using Superclass = ExecutionArrayInterfaceBasicShareWithControl; using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
......
...@@ -31,7 +31,7 @@ namespace internal ...@@ -31,7 +31,7 @@ namespace internal
{ {
template <> template <>
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial> struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial> final
: public ExecutionArrayInterfaceBasicShareWithControl : public ExecutionArrayInterfaceBasicShareWithControl
{ {
using Superclass = ExecutionArrayInterfaceBasicShareWithControl; using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
......
...@@ -34,7 +34,7 @@ namespace internal ...@@ -34,7 +34,7 @@ namespace internal
{ {
template <> template <>
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagTBB> struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagTBB> final
: public ExecutionArrayInterfaceBasicShareWithControl : public ExecutionArrayInterfaceBasicShareWithControl
{ {
using Superclass = ExecutionArrayInterfaceBasicShareWithControl; using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
......
...@@ -63,7 +63,7 @@ private: ...@@ -63,7 +63,7 @@ private:
float& weight) const; float& weight) const;
}; };
class VTKM_ALWAYS_EXPORT ColorTableRGB : public ColorTableBase class VTKM_ALWAYS_EXPORT ColorTableRGB final : public ColorTableBase
{ {
public: public:
inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1, inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1,
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
float weight) const final; float weight) const final;
}; };
class VTKM_ALWAYS_EXPORT ColorTableHSV : public ColorTableBase class VTKM_ALWAYS_EXPORT ColorTableHSV final : public ColorTableBase
{ {
public: public:
inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1, inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1,
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
float weight) const final; float weight) const final;
}; };
class VTKM_ALWAYS_EXPORT ColorTableHSVWrap : public ColorTableBase class VTKM_ALWAYS_EXPORT ColorTableHSVWrap final : public ColorTableBase
{ {
public: public:
inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1, inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1,
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
float weight) const final; float weight) const final;
}; };
class VTKM_ALWAYS_EXPORT ColorTableLab : public ColorTableBase class VTKM_ALWAYS_EXPORT ColorTableLab final : public ColorTableBase
{ {
public: public:
inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1, inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1,
...@@ -95,7 +95,7 @@ public: ...@@ -95,7 +95,7 @@ public:
float weight) const final; float weight) const final;
}; };
class VTKM_ALWAYS_EXPORT ColorTableDiverging : public ColorTableBase class VTKM_ALWAYS_EXPORT ColorTableDiverging final : public ColorTableBase
{ {
public: public:
inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1, inline VTKM_EXEC vtkm::Vec<float, 3> MapThroughColorSpace(const vtkm::Vec<float, 3>& rgb1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment