mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
Some Windows specific problems:
snprintf is incorrect pre-VS2013. There are iterator issues (see 2121a36f) far is a reserved #defined in windows *sigh*
This commit is contained in:
parent
9475a8e551
commit
cd27a71e2b
@ -20,6 +20,10 @@
|
||||
#ifndef vtk_m_rendering_AxisAnnotation3D_h
|
||||
#define vtk_m_rendering_AxisAnnotation3D_h
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/rendering/Camera.h>
|
||||
#include <vtkm/rendering/Color.h>
|
||||
|
@ -125,8 +125,8 @@ class Camera
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
vtkm::Matrix<vtkm::Float32,4,4> CreateProjectionMatrix(vtkm::Float32 size,
|
||||
vtkm::Float32 near,
|
||||
vtkm::Float32 far,
|
||||
vtkm::Float32 view_near,
|
||||
vtkm::Float32 view_far,
|
||||
vtkm::Float32 aspect) const
|
||||
{
|
||||
vtkm::Matrix<vtkm::Float32,4,4> matrix(0.f);
|
||||
@ -137,10 +137,10 @@ class Camera
|
||||
|
||||
matrix(0,0) = 2.f/(right-left);
|
||||
matrix(1,1) = 2.f/(top-bottom);
|
||||
matrix(2,2) = -2.f/(far-near);
|
||||
matrix(2, 2) = -2.f / (view_far - view_near);
|
||||
matrix(0,3) = -(right+left)/(right-left);
|
||||
matrix(1,3) = -(top+bottom)/(top-bottom);
|
||||
matrix(2,3) = -(far+near)/(far-near);
|
||||
matrix(2, 3) = -(view_far + view_near) / (view_far - view_near);
|
||||
matrix(3,3) = 1.f;
|
||||
|
||||
vtkm::Matrix<vtkm::Float32,4,4> T, Z;
|
||||
|
@ -162,11 +162,10 @@ public:
|
||||
glGetIntegerv(GL_VIEWPORT, viewport);
|
||||
VTKM_ASSERT(viewport[2] == this->GetWidth());
|
||||
VTKM_ASSERT(viewport[3] == this->GetHeight());
|
||||
|
||||
vtkm::Vec<vtkm::Float32, 4> *color_val = &(*(vtkm::cont::ArrayPortalToIteratorBegin(
|
||||
this->GetColorBuffer().GetPortalControl())));
|
||||
glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
|
||||
GL_RGBA, GL_FLOAT,
|
||||
vtkm::cont::ArrayPortalToIteratorBegin(
|
||||
this->GetColorBuffer().GetPortalControl()));
|
||||
GL_RGBA, GL_FLOAT, color_val);
|
||||
}
|
||||
VTKM_CONT_EXPORT
|
||||
virtual void RefreshDepthBuffer()
|
||||
@ -176,10 +175,13 @@ public:
|
||||
VTKM_ASSERT(viewport[2] == this->GetWidth());
|
||||
VTKM_ASSERT(viewport[3] == this->GetHeight());
|
||||
|
||||
vtkm::Float32 *depth_val = &(*(vtkm::cont::ArrayPortalToIteratorBegin(
|
||||
this->GetDepthBuffer().GetPortalControl())));
|
||||
|
||||
|
||||
glReadPixels(viewport[0], viewport[1], viewport[2], viewport[3],
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT,
|
||||
vtkm::cont::ArrayPortalToIteratorBegin(
|
||||
this->GetDepthBuffer().GetPortalControl()));
|
||||
depth_val);
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
|
Loading…
Reference in New Issue
Block a user