Explicitly implement constructors and destructors

The clang compiler was running into linker errors constructors of
classes with virtual methods that were inline and destructors that were
not declared at all. In this case, the compiler was not creating
everything needed by a virtual table and the link died.
This commit is contained in:
Kenneth Moreland 2016-09-08 17:08:17 -06:00
parent e931aac26b
commit 77ecfbeb78
23 changed files with 219 additions and 83 deletions

@ -146,5 +146,11 @@ void AxisAnnotation::CalculateTicks(const vtkm::Range &range,
}
}
AxisAnnotation::AxisAnnotation()
{ }
AxisAnnotation::~AxisAnnotation()
{ }
}
} // namespace vtkm::rendering

@ -40,6 +40,12 @@ protected:
int modifyTickQuantity) const;
public:
VTKM_RENDERING_EXPORT
AxisAnnotation();
VTKM_RENDERING_EXPORT
~AxisAnnotation();
VTKM_RENDERING_EXPORT
virtual void Render(const vtkm::rendering::Camera &camera,
const vtkm::rendering::WorldAnnotator &worldAnnotator,

@ -63,7 +63,7 @@ public:
AxisAnnotation2D();
VTKM_RENDERING_EXPORT
virtual ~AxisAnnotation2D();
~AxisAnnotation2D();
#if 0
VTKM_RENDERING_EXPORT

@ -58,7 +58,7 @@ public:
AxisAnnotation3D();
VTKM_RENDERING_EXPORT
virtual ~AxisAnnotation3D();
~AxisAnnotation3D();
VTKM_CONT_EXPORT
void SetMoreOrLessTickAdjustment(int offset)

@ -0,0 +1,83 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// 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.
//
// Copyright 2016 Sandia Corporation.
// Copyright 2016 UT-Battelle, LLC.
// Copyright 2016 Los Alamos National Security.
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#include <vtkm/rendering/BoundingBoxAnnotation.h>
namespace vtkm {
namespace rendering {
BoundingBoxAnnotation::BoundingBoxAnnotation()
: Color(0.5, 0.5, 0.5), Extents(-1, 1, -1, 1, -1, 1)
{
}
BoundingBoxAnnotation::~BoundingBoxAnnotation()
{
}
void BoundingBoxAnnotation::Render(const vtkm::rendering::Camera &,
const WorldAnnotator &annotator)
{
//win->SetupForWorldSpace();
vtkm::Float32 linewidth = 1.0;
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
}
}
} // namespace vtkm::rendering

@ -20,10 +20,9 @@
#ifndef vtk_m_rendering_BoundingBoxAnnotation_h
#define vtk_m_rendering_BoundingBoxAnnotation_h
#include <vtkm/cont/DataSet.h>
#include <vtkm/Bounds.h>
#include <vtkm/rendering/Camera.h>
#include <vtkm/rendering/Color.h>
#include <vtkm/rendering/Scene.h>
#include <vtkm/rendering/WorldAnnotator.h>
namespace vtkm {
@ -36,75 +35,39 @@ private:
vtkm::Bounds Extents;
public:
BoundingBoxAnnotation()
: Color(0.5, 0.5, 0.5), Extents(-1, 1, -1, 1, -1, 1)
{
}
virtual ~BoundingBoxAnnotation()
{
}
vtkm::Bounds GetExtents() const
VTKM_RENDERING_EXPORT
BoundingBoxAnnotation();
VTKM_RENDERING_EXPORT
virtual ~BoundingBoxAnnotation();
VTKM_CONT_EXPORT
const vtkm::Bounds &GetExtents() const
{
return this->Extents;
}
VTKM_CONT_EXPORT
void SetExtents(const vtkm::Bounds &extents)
{
this->Extents = extents;
}
VTKM_CONT_EXPORT
const vtkm::rendering::Color &GetColor() const
{
return this->Color;
}
VTKM_CONT_EXPORT
void SetColor(vtkm::rendering::Color c)
{
this->Color = c;
}
VTKM_RENDERING_EXPORT
virtual void Render(const vtkm::rendering::Camera &,
const WorldAnnotator &annotator)
{
//win->SetupForWorldSpace();
vtkm::Float32 linewidth = 1.0;
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Min,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Min,this->Extents.Z.Max,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Min,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Min,
linewidth, this->Color);
annotator.AddLine(this->Extents.X.Min,this->Extents.Y.Max,this->Extents.Z.Max,
this->Extents.X.Max,this->Extents.Y.Max,this->Extents.Z.Max,
linewidth, this->Color);
}
const WorldAnnotator &annotator);
};

@ -55,6 +55,7 @@ set(sources
AxisAnnotation3D.cxx
BitmapFont.cxx
BitmapFontFactory.cxx
BoundingBoxAnnotation.cxx
Camera.cxx
Canvas.cxx
CanvasRayTracer.cxx

@ -37,6 +37,10 @@ CanvasGL::CanvasGL(vtkm::Id width, vtkm::Id height)
{
}
CanvasGL::~CanvasGL()
{
}
void CanvasGL::Initialize()
{
// Nothing to initialize

@ -36,6 +36,9 @@ public:
CanvasGL(vtkm::Id width=1024,
vtkm::Id height=1024);
VTKM_RENDERING_EXPORT
~CanvasGL();
VTKM_RENDERING_EXPORT
void Initialize() VTKM_OVERRIDE;

@ -88,6 +88,9 @@ CanvasRayTracer::CanvasRayTracer(vtkm::Id width, vtkm::Id height)
: Canvas(width, height)
{ }
CanvasRayTracer::~CanvasRayTracer()
{ }
void CanvasRayTracer::Initialize()
{
// Nothing to initialize

@ -34,6 +34,9 @@ public:
CanvasRayTracer(vtkm::Id width=1024,
vtkm::Id height=1024);
VTKM_RENDERING_EXPORT
~CanvasRayTracer();
VTKM_RENDERING_EXPORT
void Initialize() VTKM_OVERRIDE;

@ -23,6 +23,12 @@
namespace vtkm {
namespace rendering {
ColorBarAnnotation::ColorBarAnnotation()
{ }
ColorBarAnnotation::~ColorBarAnnotation()
{ }
void ColorBarAnnotation::SetRange(const vtkm::Range &range,
vtkm::IdComponent numTicks)
{

@ -39,10 +39,11 @@ protected:
vtkm::rendering::AxisAnnotation2D Axis;
public:
VTKM_CONT_EXPORT
ColorBarAnnotation()
{
}
VTKM_RENDERING_EXPORT
ColorBarAnnotation();
VTKM_RENDERING_EXPORT
virtual ~ColorBarAnnotation();
VTKM_CONT_EXPORT
void SetColorTable(const vtkm::rendering::ColorTable &colorTable)

@ -78,6 +78,12 @@ void RenderTriangles(vtkm::Id numTri, const PtType &verts,
} // anonymous namespace
MapperGL::MapperGL()
{ }
MapperGL::~MapperGL()
{ }
void MapperGL::RenderCells(const vtkm::cont::DynamicCellSet &cellset,
const vtkm::cont::CoordinateSystem &coords,
const vtkm::cont::Field &scalarField,

@ -33,8 +33,11 @@ namespace rendering {
class MapperGL : public Mapper
{
public:
VTKM_CONT_EXPORT
MapperGL() {}
VTKM_RENDERING_EXPORT
MapperGL();
VTKM_RENDERING_EXPORT
~MapperGL();
VTKM_RENDERING_EXPORT
void RenderCells(const vtkm::cont::DynamicCellSet &cellset,

@ -80,6 +80,9 @@ MapperRayTracer::MapperRayTracer()
: Internals(new InternalsType)
{ }
MapperRayTracer::~MapperRayTracer()
{ }
void MapperRayTracer::SetCanvas(vtkm::rendering::Canvas *canvas)
{
if(canvas != nullptr)

@ -37,6 +37,9 @@ public:
VTKM_RENDERING_EXPORT
MapperRayTracer();
VTKM_RENDERING_EXPORT
~MapperRayTracer();
VTKM_RENDERING_EXPORT
void SetCanvas(vtkm::rendering::Canvas *canvas) VTKM_OVERRIDE;

@ -86,6 +86,9 @@ MapperVolume::MapperVolume()
: Internals(new InternalsType)
{ }
MapperVolume::~MapperVolume()
{ }
void MapperVolume::SetCanvas(vtkm::rendering::Canvas *canvas)
{
if(canvas != nullptr)

@ -35,6 +35,9 @@ public:
VTKM_RENDERING_EXPORT
MapperVolume();
VTKM_RENDERING_EXPORT
~MapperVolume();
VTKM_RENDERING_EXPORT
void SetCanvas(vtkm::rendering::Canvas *canvas) VTKM_OVERRIDE;

@ -23,6 +23,27 @@
namespace vtkm {
namespace rendering {
View2D::View2D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Color &backgroundColor)
: View(scene, mapper, canvas, backgroundColor)
{
}
View2D::View2D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Camera &camera,
const vtkm::rendering::Color &backgroundColor)
: View(scene, mapper, canvas, camera, backgroundColor)
{
}
View2D::~View2D()
{
}
void View2D::Paint()
{
this->GetCanvas().Activate();

@ -31,26 +31,23 @@ namespace rendering {
class View2D : public vtkm::rendering::View
{
public:
VTKM_CONT_EXPORT
VTKM_RENDERING_EXPORT
View2D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Color &backgroundColor =
vtkm::rendering::Color(0,0,0,1))
: View(scene, mapper, canvas, backgroundColor)
{
}
vtkm::rendering::Color(0,0,0,1));
VTKM_CONT_EXPORT
VTKM_RENDERING_EXPORT
View2D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Camera &camera,
const vtkm::rendering::Color &backgroundColor =
vtkm::rendering::Color(0,0,0,1))
: View(scene, mapper, canvas, camera, backgroundColor)
{
}
vtkm::rendering::Color(0,0,0,1));
VTKM_RENDERING_EXPORT
~View2D();
VTKM_RENDERING_EXPORT
void Paint() VTKM_OVERRIDE;

@ -23,6 +23,27 @@
namespace vtkm {
namespace rendering {
View3D::View3D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Color &backgroundColor)
: View(scene, mapper, canvas, backgroundColor)
{
}
View3D::View3D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Camera &camera,
const vtkm::rendering::Color &backgroundColor)
: View(scene, mapper, canvas, camera, backgroundColor)
{
}
View3D::~View3D()
{
}
void View3D::Paint()
{
this->GetCanvas().Activate();

@ -32,26 +32,23 @@ namespace rendering {
class View3D : public vtkm::rendering::View
{
public:
VTKM_CONT_EXPORT
VTKM_RENDERING_EXPORT
View3D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Color &backgroundColor =
vtkm::rendering::Color(0,0,0,1))
: View(scene, mapper, canvas, backgroundColor)
{
}
vtkm::rendering::Color(0,0,0,1));
VTKM_CONT_EXPORT
VTKM_RENDERING_EXPORT
View3D(const vtkm::rendering::Scene &scene,
const vtkm::rendering::Mapper &mapper,
const vtkm::rendering::Canvas &canvas,
const vtkm::rendering::Camera &camera,
const vtkm::rendering::Color &backgroundColor =
vtkm::rendering::Color(0,0,0,1))
: View(scene, mapper, canvas, camera, backgroundColor)
{
}
vtkm::rendering::Color(0,0,0,1));
VTKM_RENDERING_EXPORT
~View3D();
VTKM_RENDERING_EXPORT
void Paint() VTKM_OVERRIDE;