2016-02-09 13:59:26 +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.
|
|
|
|
//
|
|
|
|
// Copyright 2015 Sandia Corporation.
|
|
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
|
|
// Copyright 2015 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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_rendering_RenderSurface_h
|
|
|
|
#define vtk_m_rendering_RenderSurface_h
|
|
|
|
|
|
|
|
#include <vtkm/Types.h>
|
|
|
|
#include <vtkm/rendering/View.h>
|
2016-02-10 22:06:38 +00:00
|
|
|
#include <vtkm/rendering/Color.h>
|
2016-05-18 19:29:50 +00:00
|
|
|
#include <vtkm/rendering/ColorTable.h>
|
2016-02-10 22:06:38 +00:00
|
|
|
|
2016-02-09 13:59:26 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
namespace vtkm {
|
|
|
|
namespace rendering {
|
|
|
|
|
|
|
|
class RenderSurface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VTKM_CONT_EXPORT
|
2016-05-19 22:44:41 +00:00
|
|
|
RenderSurface(std::size_t width=1024, std::size_t height=1024,
|
|
|
|
const vtkm::rendering::Color &color=vtkm::rendering::Color(0.0f,0.0f,0.0f,1.0f))
|
|
|
|
: Width(width), Height(height), BackgroundColor(color)
|
2016-02-10 22:06:38 +00:00
|
|
|
{
|
2016-05-19 22:44:41 +00:00
|
|
|
this->ColorBuffer.resize(width*height*4);
|
|
|
|
this->DepthBuffer.resize(width*height);
|
2016-02-10 22:06:38 +00:00
|
|
|
}
|
2016-02-09 13:59:26 +00:00
|
|
|
|
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
virtual void Initialize() {}
|
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
virtual void Activate() {}
|
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
virtual void Clear() {}
|
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
virtual void Finish() {}
|
|
|
|
|
2016-02-10 22:06:38 +00:00
|
|
|
VTKM_CONT_EXPORT
|
2016-04-18 20:42:59 +00:00
|
|
|
virtual void SetViewToWorldSpace(vtkm::rendering::View &, bool) {}
|
2016-02-10 22:06:38 +00:00
|
|
|
VTKM_CONT_EXPORT
|
2016-05-09 20:32:27 +00:00
|
|
|
virtual void SetViewToScreenSpace(vtkm::rendering::View &, bool) {}
|
|
|
|
VTKM_CONT_EXPORT
|
2016-04-18 20:42:59 +00:00
|
|
|
void SetViewportClipping(vtkm::rendering::View &, bool) {}
|
2016-02-10 22:06:38 +00:00
|
|
|
|
2016-02-09 13:59:26 +00:00
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
virtual void SaveAs(const std::string &) {}
|
|
|
|
|
2016-05-19 16:49:45 +00:00
|
|
|
virtual void AddLine(vtkm::Float64, vtkm::Float64,
|
|
|
|
vtkm::Float64, vtkm::Float64,
|
|
|
|
vtkm::Float32,
|
|
|
|
const vtkm::rendering::Color &) {}
|
|
|
|
virtual void AddColorBar(vtkm::Float32, vtkm::Float32,
|
|
|
|
vtkm::Float32, vtkm::Float32,
|
|
|
|
const vtkm::rendering::ColorTable &,
|
2016-05-18 19:29:50 +00:00
|
|
|
bool) {}
|
2016-05-20 21:25:50 +00:00
|
|
|
virtual void AddText(vtkm::Float32, vtkm::Float32,
|
|
|
|
vtkm::Float32,
|
|
|
|
vtkm::Float32,
|
|
|
|
vtkm::Float32,
|
|
|
|
vtkm::Float32, vtkm::Float32,
|
|
|
|
Color,
|
|
|
|
std::string) {}
|
2016-05-09 20:32:27 +00:00
|
|
|
|
2016-05-19 22:44:41 +00:00
|
|
|
std::size_t Width, Height;
|
|
|
|
vtkm::rendering::Color BackgroundColor;
|
|
|
|
std::vector<vtkm::Float32> ColorBuffer;
|
|
|
|
std::vector<vtkm::Float32> DepthBuffer;
|
2016-02-09 13:59:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}} //namespace vtkm::rendering
|
|
|
|
|
|
|
|
#endif //vtk_m_rendering_RenderSurface_h
|