1 //============================================================================
2 //  Copyright (c) Kitware, Inc.
3 //  All rights reserved.
4 //  See LICENSE.txt for details.
5 //  This software is distributed WITHOUT ANY WARRANTY; without even
6 //  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7 //  PURPOSE.  See the above copyright notice for more information.
8 //
9 //  Copyright 2015 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
10 //  Copyright 2015 UT-Battelle, LLC.
11 //  Copyright 2015 Los Alamos National Security.
12 //
13 //  Under the terms of Contract DE-NA0003525 with NTESS,
14 //  the U.S. Government retains certain rights in this software.
15 //
16 //  Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
17 //  Laboratory (LANL), the U.S. Government retains certain rights in
18 //  this software.
19 //============================================================================
20 
21 #include <vtkm/cont/DeviceAdapter.h>
22 #include <vtkm/cont/testing/MakeTestDataSet.h>
23 #include <vtkm/cont/testing/Testing.h>
24 #include <vtkm/rendering/Actor.h>
25 #include <vtkm/rendering/CanvasRayTracer.h>
26 #include <vtkm/rendering/MapperQuad.h>
27 #include <vtkm/rendering/Scene.h>
28 #include <vtkm/rendering/View3D.h>
29 #include <vtkm/rendering/testing/RenderTest.h>
30 
31 namespace
32 {
33 
RenderTests()34 void RenderTests()
35 {
36   typedef vtkm::rendering::MapperQuad M;
37   typedef vtkm::rendering::CanvasRayTracer C;
38   typedef vtkm::rendering::View3D V3;
39   typedef vtkm::rendering::View2D V2;
40 
41   vtkm::cont::testing::MakeTestDataSet maker;
42   vtkm::cont::ColorTable colorTable("inferno");
43 
44   vtkm::rendering::testing::Render<M, C, V3>(
45     maker.Make3DRegularDataSet0(), "pointvar", colorTable, "rt_reg3D.pnm");
46   vtkm::rendering::testing::Render<M, C, V3>(
47     maker.Make3DRectilinearDataSet0(), "pointvar", colorTable, "rt_rect3D.pnm");
48   vtkm::rendering::testing::Render<M, C, V3>(
49     maker.Make3DExplicitDataSet4(), "pointvar", colorTable, "rt_expl3D.pnm");
50 
51   vtkm::rendering::testing::Render<M, C, V2>(
52     maker.Make2DUniformDataSet1(), "pointvar", colorTable, "uni2D.pnm");
53 
54   //hexahedron, wedge, pyramid, tetrahedron
55   vtkm::rendering::testing::Render<M, C, V3>(
56     maker.Make3DExplicitDataSet5(), "cellvar", colorTable, "rt_hex3d.pnm");
57 }
58 
59 } //namespace
60 
UnitTestMapperQuads(int,char * [])61 int UnitTestMapperQuads(int, char* [])
62 {
63   return vtkm::cont::testing::Testing::Run(RenderTests);
64 }
65