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/MapperRayTracer.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 using M = vtkm::rendering::MapperRayTracer;
37 using C = vtkm::rendering::CanvasRayTracer;
38 using V3 = vtkm::rendering::View3D;
39 using V2 = vtkm::rendering::View2D;
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 vtkm::rendering::testing::Render<M, C, V3>(
55 maker.Make3DExplicitDataSet7(), "cellvar", colorTable, "spheres.pnm");
56 }
57
58 } //namespace
59
UnitTestMapperRayTracer(int,char * [])60 int UnitTestMapperRayTracer(int, char* [])
61 {
62 return vtkm::cont::testing::Testing::Run(RenderTests);
63 }
64