vtk-m/vtkm/rendering/TextRenderer.h

72 lines
2.3 KiB
C
Raw Normal View History

2017-09-07 16:51:41 +00:00
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
2019-04-15 23:24:21 +00:00
//
2017-09-07 16:51:41 +00:00
// 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.
//============================================================================
#ifndef vtk_m_rendering_TextRenderer_h
#define vtk_m_rendering_TextRenderer_h
#include <string>
#include <vtkm/rendering/BitmapFont.h>
#include <vtkm/rendering/Canvas.h>
#include <vtkm/rendering/Color.h>
#include <vtkm/rendering/vtkm_rendering_export.h>
namespace vtkm
{
namespace rendering
{
class TextRendererBatcher;
2017-09-07 16:51:41 +00:00
class VTKM_RENDERING_EXPORT TextRenderer
{
public:
VTKM_CONT
TextRenderer(const vtkm::rendering::Canvas* canvas,
2017-09-07 16:51:41 +00:00
const vtkm::rendering::BitmapFont& font,
const vtkm::rendering::Canvas::FontTextureType& fontTexture,
vtkm::rendering::TextRendererBatcher* textBatcher);
2017-09-07 16:51:41 +00:00
VTKM_CONT
void RenderText(const vtkm::Vec2f_32& position,
2017-09-07 16:51:41 +00:00
vtkm::Float32 scale,
vtkm::Float32 angle,
vtkm::Float32 windowAspect,
const vtkm::Vec2f_32& anchor,
2017-09-07 16:51:41 +00:00
const vtkm::rendering::Color& color,
const std::string& text);
VTKM_CONT
void RenderText(const vtkm::Vec3f_32& origin,
const vtkm::Vec3f_32& right,
const vtkm::Vec3f_32& up,
2017-09-07 16:51:41 +00:00
vtkm::Float32 scale,
const vtkm::Vec2f_32& anchor,
2017-09-07 16:51:41 +00:00
const vtkm::rendering::Color& color,
const std::string& text);
VTKM_CONT
void RenderText(const vtkm::Matrix<vtkm::Float32, 4, 4>& transform,
vtkm::Float32 scale,
const vtkm::Vec2f_32& anchor,
2017-09-07 16:51:41 +00:00
const vtkm::rendering::Color& color,
const std::string& text,
const vtkm::Float32& depth = 0.f);
2017-09-07 16:51:41 +00:00
private:
const vtkm::rendering::Canvas* Canvas;
2017-09-07 16:51:41 +00:00
vtkm::rendering::BitmapFont Font;
vtkm::rendering::Canvas::FontTextureType FontTexture;
vtkm::rendering::TextRendererBatcher* TextBatcher;
2017-09-07 16:51:41 +00:00
};
}
} // namespace vtkm::rendering
#endif // vtk_m_rendering_TextRenderer_h