2016-04-15 19:24:23 +00:00
|
|
|
//============================================================================
|
|
|
|
// 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.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Copyright 2016 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2016-04-15 19:24:23 +00:00
|
|
|
// Copyright 2016 UT-Battelle, LLC.
|
|
|
|
// Copyright 2016 Los Alamos National Security.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
2016-04-15 19:24:23 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_rendering_WorldAnnotatorGL_h
|
|
|
|
#define vtk_m_rendering_WorldAnnotatorGL_h
|
|
|
|
|
2016-06-02 19:04:01 +00:00
|
|
|
#include <vtkm/rendering/WorldAnnotator.h>
|
2016-04-15 19:24:23 +00:00
|
|
|
|
2016-09-01 16:39:15 +00:00
|
|
|
#include <vtkm/rendering/BitmapFont.h>
|
2017-09-14 21:07:06 +00:00
|
|
|
#include <vtkm/rendering/Canvas.h>
|
2016-09-01 16:39:15 +00:00
|
|
|
#include <vtkm/rendering/TextureGL.h>
|
2016-05-25 21:32:10 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace rendering
|
|
|
|
{
|
2016-04-15 19:24:23 +00:00
|
|
|
|
2016-10-19 18:09:15 +00:00
|
|
|
class VTKM_RENDERING_EXPORT WorldAnnotatorGL : public WorldAnnotator
|
2016-04-15 19:24:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-09-14 21:07:06 +00:00
|
|
|
WorldAnnotatorGL(const vtkm::rendering::Canvas* canvas);
|
|
|
|
|
2016-09-01 16:39:15 +00:00
|
|
|
~WorldAnnotatorGL();
|
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
void AddLine(const vtkm::Vec<vtkm::Float64, 3>& point0,
|
|
|
|
const vtkm::Vec<vtkm::Float64, 3>& point1,
|
|
|
|
vtkm::Float32 lineWidth,
|
|
|
|
const vtkm::rendering::Color& color,
|
2017-11-02 12:36:05 +00:00
|
|
|
bool inFront) const override;
|
2016-09-01 16:39:15 +00:00
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
void AddText(const vtkm::Vec<vtkm::Float32, 3>& origin,
|
|
|
|
const vtkm::Vec<vtkm::Float32, 3>& right,
|
|
|
|
const vtkm::Vec<vtkm::Float32, 3>& up,
|
|
|
|
vtkm::Float32 scale,
|
|
|
|
const vtkm::Vec<vtkm::Float32, 2>& anchor,
|
|
|
|
const vtkm::rendering::Color& color,
|
2017-11-02 12:36:05 +00:00
|
|
|
const std::string& text) const override;
|
2016-05-23 17:52:47 +00:00
|
|
|
|
|
|
|
private:
|
2017-09-18 21:41:28 +00:00
|
|
|
BitmapFont Font;
|
2016-06-01 17:37:03 +00:00
|
|
|
TextureGL FontTexture;
|
2016-05-23 17:52:47 +00:00
|
|
|
|
2017-05-26 17:53:28 +00:00
|
|
|
void RenderText(vtkm::Float32 scale,
|
|
|
|
vtkm::Float32 anchorx,
|
|
|
|
vtkm::Float32 anchory,
|
2016-09-01 16:39:15 +00:00
|
|
|
std::string text) const;
|
2016-04-15 19:24:23 +00:00
|
|
|
};
|
2017-05-18 14:29:41 +00:00
|
|
|
}
|
|
|
|
} //namespace vtkm::rendering
|
2016-04-15 19:24:23 +00:00
|
|
|
|
|
|
|
#endif // vtk_m_rendering_WorldAnnotatorGL_h
|