Add unstructured volume rendering code.

This commit is contained in:
Dave Pugmire 2023-03-23 06:25:13 -04:00
parent 08d15f4ecf
commit 695310ae3f
22 changed files with 547 additions and 370 deletions

21
README

@ -120,4 +120,23 @@ Scene:
vtkm: vector of vtkm::rendering::Actor
vtkh: list/vector of vtkh::Renderer, batchsize, has_volume.
vtkh::Render aprox equal to vtkm::rendering::View
vtkh::Render aprox equal to vtkm::rendering::View
==============================================================================
vtkh volume render unstructured:
scene.AddRender()
scene.AddRenderer(vtkh::VolumeRenderer);
scene.Render()
// pass 2 for volume
renderer->SetComponosite(true)
renderer->SetRenders(current_batch);
renderer->Update() //does the rendering...
DoExecute()
vtkm::rendering::Mapper::RenderCells()

@ -94,6 +94,7 @@ set(sources
compositing/Compositor.cxx
compositing/DirectSendCompositor.cxx
compositing/Image.cxx
compositing/PartialCompositor.cxx
compositing/PNGEncoder.cxx
compositing/RadixKCompositor.cxx
compositing/PayloadCompositor.cxx

@ -1,50 +1,24 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-749865
//
// All rights reserved.
//
// This file is part of Rover.
//
// Please also read rover/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#ifndef rover_absorption_partial_h
#define rover_absorption_partial_h
// 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 vtkm_render_compositing_Absorbtion_Partial_h
#define vtkm_render_compositing_Absorbtion_Partial_h
#include <assert.h>
#include <vector>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
template <typename FloatType>
@ -98,7 +72,9 @@ struct AbsorptionPartial
}
};
} // namespace rover
}
}
} // vtkm::render::compositing
#endif
#endif //vtkm_render_compositing_Absorbtion_Partial_h

@ -63,7 +63,8 @@ struct Redistribute
{
vtkmdiy::DiscreteBounds sub_image_bounds(3);
m_decomposer.fill_bounds(sub_image_bounds, i);
vtkm::Bounds vtkm_sub_bounds = vtkh::DIYBoundsToVTKM(sub_image_bounds);
vtkm::Bounds vtkm_sub_bounds =
vtkm::rendering::compositing::DIYBoundsToVTKM(sub_image_bounds);
vtkmdiy::BlockID dest = proxy.out_link().target(i);
outgoing[dest].resize(local_images);
@ -140,7 +141,8 @@ DirectSendCompositor::~DirectSendCompositor() {}
void DirectSendCompositor::CompositeVolume(vtkmdiy::mpi::communicator& diy_comm,
std::vector<Image>& images)
{
vtkmdiy::DiscreteBounds global_bounds = vtkh::VTKMBoundsToDIY(images.at(0).OrigBounds);
vtkmdiy::DiscreteBounds global_bounds =
vtkm::rendering::compositing::VTKMBoundsToDIY(images.at(0).OrigBounds);
const int num_threads = 1;
const int num_blocks = diy_comm.size();

@ -1,50 +1,24 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
//============================================================================
// All rights reserved.
// See LICENSE.txt for details.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-749865
//
// All rights reserved.
//
// This file is part of Rover.
//
// Please also read rover/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#ifndef rover_emission_partial_h
#define rover_emission_partial_h
// 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 vtkm_rendering_comositing_emmsion_partial_h
#define vtkm_rendering_comositing_emmsion_partial_h
#include <assert.h>
#include <iostream>
#include <vector>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
template <typename FloatType>
@ -135,7 +109,9 @@ struct EmissionPartial
}
};
} // namespace rover
}
}
} //vtkm::rendering::compositing
#endif
#endif //vtkm_rendering_comositing_emmsion_partial_h

@ -8,19 +8,26 @@
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#include <vtkm/rendering/compositing/PartialCompositor.h>
#include <algorithm>
#include <assert.h>
#include <limits>
#include <vtkm/rendering/compositing/PartialCompositor.h>
#include <vector>
#ifdef VTKM_ENABLE_MPI
#include "vtkh_diy_partial_collect.hpp"
#include "vtkh_diy_partial_redistribute.hpp"
#include <mpi.h>
#include <vtkm/rendering/compositing/vtkm_diy_partial_collect.h>
#include <vtkm/rendering/compositing/vtkm_diy_partial_redistribute.h>
#endif
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
namespace detail
{
template <template <typename> class PartialType, typename FloatType>
@ -524,14 +531,22 @@ void PartialCompositor<PartialType>::set_comm_handle(int mpi_comm_id)
}
//Explicit function instantiations
template class VTKH_API PartialCompositor<VolumePartial<vtkm::Float32>>;
template class VTKH_API PartialCompositor<VolumePartial<vtkm::Float64>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::VolumePartial<vtkm::Float32>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::VolumePartial<vtkm::Float64>>;
template class VTKH_API PartialCompositor<AbsorptionPartial<vtkm::Float32>>;
template class VTKH_API PartialCompositor<AbsorptionPartial<vtkm::Float64>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::AbsorptionPartial<vtkm::Float32>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::AbsorptionPartial<vtkm::Float64>>;
template class VTKH_API PartialCompositor<EmissionPartial<vtkm::Float32>>;
template class VTKH_API PartialCompositor<EmissionPartial<vtkm::Float64>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::EmissionPartial<vtkm::Float32>>;
template class VTKM_RENDERING_EXPORT vtkm::rendering::compositing::PartialCompositor<
vtkm::rendering::compositing::EmissionPartial<vtkm::Float64>>;
} // namespace vtkh
}
}
} //vtkm::rendering::compositing

@ -13,14 +13,18 @@
#include <vtkm/rendering/vtkm_rendering_export.h>
#include "AbsorptionPartial.hpp"
#include "EmissionPartial.hpp"
#include "VolumePartial.hpp"
#include <iostream>
#include <vector>
#include <vtkm/Types.h>
#include <vtkm/rendering/compositing/AbsorptionPartial.h>
#include <vtkm/rendering/compositing/EmissionPartial.h>
#include <vtkm/rendering/compositing/VolumePartial.h>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
template <typename PartialType>
@ -48,6 +52,9 @@ protected:
int m_mpi_comm_id;
};
}; // namespace rover
}
}
} //vtkm::rendering::compositing
#endif //vtkm_rendering_compositing_partial_compositor_h

@ -17,13 +17,12 @@
#include <vtkm/rendering/compositing/vtkm_diy_collect.h>
#include <vtkm/rendering/compositing/vtkm_diy_utils.h>
/*
#include <diy/master.hpp>
#include <diy/mpi.hpp>
#include <diy/partners/swap.hpp>
#include <diy/reduce-operations.hpp>
#include <diy/reduce.hpp>
*/
#include <vtkm/thirdparty/diy/diy.h>
#include <vtkm/thirdparty/diy/master.h>
//#include <vtkm/thirdparty/diy/mpi.h>
#include <vtkm/thirdparty/diy/reduce-operations.h>
#include <vtkm/thirdparty/diy/reduce.h>
#include <vtkm/thirdparty/diy/swap.h>
namespace vtkm
{
@ -84,7 +83,8 @@ void reduce_images(void* b,
const int current_dim = partners.dim(round);
//create balanced set of ranges for current dim
vtkmdiy::DiscreteBounds image_bounds = vtkh::VTKMBoundsToDIY(image.Bounds);
vtkmdiy::DiscreteBounds image_bounds =
vtkm::rendering::compositing::VTKMBoundsToDIY(image.Bounds);
int range_length = image_bounds.max[current_dim] - image_bounds.min[current_dim];
int base_step = range_length / group_size;
int rem = range_length % group_size;
@ -101,8 +101,8 @@ void reduce_images(void* b,
}
assert(count == range_length);
std::vector<vtkmdiy::DiscreteBounds> subset_bounds(group_size,
vtkh::VTKMBoundsToDIY(image.Bounds));
std::vector<vtkmdiy::DiscreteBounds> subset_bounds(
group_size, vtkm::rendering::compositing::VTKMBoundsToDIY(image.Bounds));
int min_pixel = image_bounds.min[current_dim];
for (int i = 0; i < group_size; ++i)
{
@ -126,7 +126,8 @@ void reduce_images(void* b,
std::vector<ImageType> out_images(group_size);
for (int i = 0; i < group_size; ++i)
{
out_images[i].SubsetFrom(image, vtkh::DIYBoundsToVTKM(subset_bounds[i]));
out_images[i].SubsetFrom(image,
vtkm::rendering::compositing::DIYBoundsToVTKM(subset_bounds[i]));
} //for
for (int i = 0; i < group_size; ++i)
@ -150,7 +151,8 @@ RadixKCompositor::~RadixKCompositor() {}
template <typename ImageType>
void RadixKCompositor::CompositeImpl(vtkmdiy::mpi::communicator& diy_comm, ImageType& image)
{
vtkmdiy::DiscreteBounds global_bounds = vtkh::VTKMBoundsToDIY(image.OrigBounds);
vtkmdiy::DiscreteBounds global_bounds =
vtkm::rendering::compositing::VTKMBoundsToDIY(image.OrigBounds);
// tells diy to use one thread
const int num_threads = 1;

@ -8,11 +8,16 @@
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef rover_volume_block_h
#define rover_volume_block_h
#ifndef vtkm_rendering_compositing_VolumePartial_h
#define vtkm_rendering_compositing_VolumePartial_h
#include <limits>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
template <typename FloatType>
@ -87,5 +92,8 @@ struct VolumePartial
}
};
} // namespace
#endif
}
}
} //vtkm::rendering::compositing
#endif //vtkm_rendering_compositing_VolumePartial_h

@ -1,61 +1,34 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-749865
//
// All rights reserved.
//
// This file is part of Rover.
//
// Please also read rover/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#ifndef rover_blocks_h
#define rover_blocks_h
// 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.
//============================================================================
#include <diy/master.hpp>
#ifndef vtkm_rendering_compositing_vtkm_diy_partial_blocks_h
#define vtkm_rendering_compositing_vtkm_diy_partial_blocks_h
#include "AbsorptionPartial.hpp"
#include "EmissionPartial.hpp"
#include "VolumePartial.hpp"
#include <vtkm/thirdparty/diy/master.h>
namespace vtkh
#include <vtkm/rendering/compositing/AbsorptionPartial.h>
#include <vtkm/rendering/compositing/EmissionPartial.h>
#include <vtkm/rendering/compositing/VolumePartial.h>
namespace vtkm
{
namespace rendering
{
namespace compositing
{
//--------------------------------------Volume Block Structure-----------------------------------
template <typename FloatType>
struct VolumeBlock
{
typedef vtkhdiy::DiscreteBounds Bounds;
typedef vtkmdiy::DiscreteBounds Bounds;
typedef VolumePartial<FloatType> PartialType;
std::vector<VolumePartial<FloatType>>& m_partials;
VolumeBlock(std::vector<VolumePartial<FloatType>>& partials)
@ -69,7 +42,7 @@ struct VolumeBlock
template <typename FloatType>
struct AbsorptionBlock
{
typedef vtkhdiy::DiscreteBounds Bounds;
typedef vtkmdiy::DiscreteBounds Bounds;
typedef AbsorptionPartial<FloatType> PartialType;
std::vector<AbsorptionPartial<FloatType>>& m_partials;
@ -83,7 +56,7 @@ struct AbsorptionBlock
template <typename FloatType>
struct EmissionBlock
{
typedef vtkhdiy::DiscreteBounds Bounds;
typedef vtkmdiy::DiscreteBounds Bounds;
typedef EmissionPartial<FloatType> PartialType;
std::vector<EmissionPartial<FloatType>>& m_partials;
@ -100,9 +73,9 @@ struct AddBlock
typedef typename BlockType::PartialType PartialType;
typedef BlockType Block;
std::vector<PartialType>& m_partials;
const vtkhdiy::Master& m_master;
const vtkmdiy::Master& m_master;
AddBlock(vtkhdiy::Master& master, std::vector<PartialType>& partials)
AddBlock(vtkmdiy::Master& master, std::vector<PartialType>& partials)
: m_master(master)
, m_partials(partials)
{
@ -119,98 +92,107 @@ struct AddBlock
(void)local_with_ghost_bounds;
Block* block = new Block(m_partials);
LinkType* rg_link = new LinkType(link);
vtkhdiy::Master& master = const_cast<vtkhdiy::Master&>(m_master);
vtkmdiy::Master& master = const_cast<vtkmdiy::Master&>(m_master);
int lid = master.add(gid, block, rg_link);
(void)lid;
}
};
} //namespace vtkh
}
}
} //vtkm::rendering::compositing
//-------------------------------Serialization Specializations--------------------------------
namespace vtkhdiy
namespace vtkmdiy
{
template <>
struct Serialization<vtkh::AbsorptionPartial<double>>
struct Serialization<vtkm::rendering::compositing::AbsorptionPartial<double>>
{
static void save(BinaryBuffer& bb, const vtkh::AbsorptionPartial<double>& partial)
static void save(BinaryBuffer& bb,
const vtkm::rendering::compositing::AbsorptionPartial<double>& partial)
{
vtkhdiy::save(bb, partial.m_bins);
vtkhdiy::save(bb, partial.m_pixel_id);
vtkhdiy::save(bb, partial.m_depth);
vtkmdiy::save(bb, partial.m_bins);
vtkmdiy::save(bb, partial.m_pixel_id);
vtkmdiy::save(bb, partial.m_depth);
}
static void load(BinaryBuffer& bb, vtkh::AbsorptionPartial<double>& partial)
static void load(vtkmdiy::BinaryBuffer& bb,
vtkm::rendering::compositing::AbsorptionPartial<double>& partial)
{
vtkhdiy::load(bb, partial.m_bins);
vtkhdiy::load(bb, partial.m_pixel_id);
vtkhdiy::load(bb, partial.m_depth);
vtkmdiy::load(bb, partial.m_bins);
vtkmdiy::load(bb, partial.m_pixel_id);
vtkmdiy::load(bb, partial.m_depth);
}
};
template <>
struct Serialization<vtkh::AbsorptionPartial<float>>
struct Serialization<vtkm::rendering::compositing::AbsorptionPartial<float>>
{
static void save(BinaryBuffer& bb, const vtkh::AbsorptionPartial<float>& partial)
static void save(BinaryBuffer& bb,
const vtkm::rendering::compositing::AbsorptionPartial<float>& partial)
{
vtkhdiy::save(bb, partial.m_bins);
vtkhdiy::save(bb, partial.m_pixel_id);
vtkhdiy::save(bb, partial.m_depth);
vtkmdiy::save(bb, partial.m_bins);
vtkmdiy::save(bb, partial.m_pixel_id);
vtkmdiy::save(bb, partial.m_depth);
}
static void load(BinaryBuffer& bb, vtkh::AbsorptionPartial<float>& partial)
static void load(BinaryBuffer& bb,
vtkm::rendering::compositing::AbsorptionPartial<float>& partial)
{
vtkhdiy::load(bb, partial.m_bins);
vtkhdiy::load(bb, partial.m_pixel_id);
vtkhdiy::load(bb, partial.m_depth);
vtkmdiy::load(bb, partial.m_bins);
vtkmdiy::load(bb, partial.m_pixel_id);
vtkmdiy::load(bb, partial.m_depth);
}
};
template <>
struct Serialization<vtkh::EmissionPartial<double>>
struct Serialization<vtkm::rendering::compositing::EmissionPartial<double>>
{
static void save(BinaryBuffer& bb, const vtkh::EmissionPartial<double>& partial)
static void save(BinaryBuffer& bb,
const vtkm::rendering::compositing::EmissionPartial<double>& partial)
{
vtkhdiy::save(bb, partial.m_bins);
vtkhdiy::save(bb, partial.m_emission_bins);
vtkhdiy::save(bb, partial.m_pixel_id);
vtkhdiy::save(bb, partial.m_depth);
vtkmdiy::save(bb, partial.m_bins);
vtkmdiy::save(bb, partial.m_emission_bins);
vtkmdiy::save(bb, partial.m_pixel_id);
vtkmdiy::save(bb, partial.m_depth);
}
static void load(BinaryBuffer& bb, vtkh::EmissionPartial<double>& partial)
static void load(BinaryBuffer& bb, vtkm::rendering::compositing::EmissionPartial<double>& partial)
{
vtkhdiy::load(bb, partial.m_bins);
vtkhdiy::load(bb, partial.m_emission_bins);
vtkhdiy::load(bb, partial.m_pixel_id);
vtkhdiy::load(bb, partial.m_depth);
vtkmdiy::load(bb, partial.m_bins);
vtkmdiy::load(bb, partial.m_emission_bins);
vtkmdiy::load(bb, partial.m_pixel_id);
vtkmdiy::load(bb, partial.m_depth);
}
};
template <>
struct Serialization<vtkh::EmissionPartial<float>>
struct Serialization<vtkm::rendering::compositing::EmissionPartial<float>>
{
static void save(BinaryBuffer& bb, const vtkh::EmissionPartial<float>& partial)
static void save(BinaryBuffer& bb,
const vtkm::rendering::compositing::EmissionPartial<float>& partial)
{
vtkhdiy::save(bb, partial.m_bins);
vtkhdiy::save(bb, partial.m_emission_bins);
vtkhdiy::save(bb, partial.m_pixel_id);
vtkhdiy::save(bb, partial.m_depth);
vtkmdiy::save(bb, partial.m_bins);
vtkmdiy::save(bb, partial.m_emission_bins);
vtkmdiy::save(bb, partial.m_pixel_id);
vtkmdiy::save(bb, partial.m_depth);
}
static void load(BinaryBuffer& bb, vtkh::EmissionPartial<float>& partial)
static void load(BinaryBuffer& bb, vtkm::rendering::compositing::EmissionPartial<float>& partial)
{
vtkhdiy::load(bb, partial.m_bins);
vtkhdiy::load(bb, partial.m_emission_bins);
vtkhdiy::load(bb, partial.m_pixel_id);
vtkhdiy::load(bb, partial.m_depth);
vtkmdiy::load(bb, partial.m_bins);
vtkmdiy::load(bb, partial.m_emission_bins);
vtkmdiy::load(bb, partial.m_pixel_id);
vtkmdiy::load(bb, partial.m_depth);
}
};
} // namespace diy
} //vtkmdiy
#endif
#endif //vtkm_rendering_compositing_vtkm_diy_partial_blocks_h

@ -1,56 +1,32 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
//============================================================================
// All rights reserved.
// See LICENSE.txt for details.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-749865
//
// All rights reserved.
//
// This file is part of Rover.
//
// Please also read rover/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#ifndef rover_compositing_collect_h
#define rover_compositing_collect_h
// 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.
//============================================================================
#include "AbsorptionPartial.hpp"
#include "EmissionPartial.hpp"
#include "VolumePartial.hpp"
#include <diy/assigner.hpp>
#include <diy/decomposition.hpp>
#include <diy/master.hpp>
#include <diy/reduce-operations.hpp>
#ifndef vtkm_rendering_compositing_vtkm_diy_partial_collect_h
#define vtkm_rendering_compositing_vtkm_diy_partial_collect_h
namespace vtkh
#include <vtkm/rendering/compositing/AbsorptionPartial.h>
#include <vtkm/rendering/compositing/EmissionPartial.h>
#include <vtkm/rendering/compositing/VolumePartial.h>
#include <vtkm/rendering/compositing/vtkm_diy_partial_blocks.h>
#include <vtkm/thirdparty/diy/assigner.h>
#include <vtkm/thirdparty/diy/decomposition.h>
#include <vtkm/thirdparty/diy/diy.h>
#include <vtkm/thirdparty/diy/master.h>
#include <vtkm/thirdparty/diy/mpi-cast.h>
#include <vtkm/thirdparty/diy/reduce-operations.h>
namespace vtkm
{
namespace rendering
{
namespace compositing
{
//
// Collect struct sends all data to a single node.
@ -58,14 +34,14 @@ namespace vtkh
template <typename BlockType>
struct Collect
{
const vtkhdiy::RegularDecomposer<vtkhdiy::ContinuousBounds>& m_decomposer;
const vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds>& m_decomposer;
Collect(const vtkhdiy::RegularDecomposer<vtkhdiy::ContinuousBounds>& decomposer)
Collect(const vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds>& decomposer)
: m_decomposer(decomposer)
{
}
void operator()(void* v_block, const vtkhdiy::ReduceProxy& proxy) const
void operator()(void* v_block, const vtkmdiy::ReduceProxy& proxy) const
{
BlockType* block = static_cast<BlockType*>(v_block);
//
@ -76,7 +52,7 @@ struct Collect
if (proxy.in_link().size() == 0 && proxy.gid() != collection_rank)
{
int dest_gid = collection_rank;
vtkhdiy::BlockID dest = proxy.out_link().target(dest_gid);
vtkmdiy::BlockID dest = proxy.out_link().target(dest_gid);
proxy.enqueue(dest, block->m_partials);
block->m_partials.clear();
@ -116,8 +92,10 @@ void collect_detail(std::vector<typename AddBlockType::PartialType>& partials, M
{
typedef typename AddBlockType::Block Block;
vtkhdiy::mpi::communicator world(comm);
vtkhdiy::ContinuousBounds global_bounds;
vtkmdiy::mpi::communicator world(vtkmdiy::mpi::make_DIY_MPI_Comm(comm));
std::cout << __FILE__ << " " << __LINE__ << std::endl;
std::cout << " DRP: Is this the right dimension???" << std::endl;
vtkmdiy::ContinuousBounds global_bounds(1); //DRP???
global_bounds.min[0] = 0;
global_bounds.max[0] = 1;
@ -126,17 +104,17 @@ void collect_detail(std::vector<typename AddBlockType::PartialType>& partials, M
const int num_blocks = world.size();
const int magic_k = 2;
vtkhdiy::Master master(world, num_threads);
vtkmdiy::Master master(world, num_threads);
// create an assigner with one block per rank
vtkhdiy::ContiguousAssigner assigner(num_blocks, num_blocks);
vtkmdiy::ContiguousAssigner assigner(num_blocks, num_blocks);
AddBlockType create(master, partials);
const int dims = 1;
vtkhdiy::RegularDecomposer<vtkhdiy::ContinuousBounds> decomposer(dims, global_bounds, num_blocks);
vtkmdiy::RegularDecomposer<vtkmdiy::ContinuousBounds> decomposer(dims, global_bounds, num_blocks);
decomposer.decompose(world.rank(), assigner, create);
vtkhdiy::all_to_all(master, assigner, Collect<Block>(decomposer), magic_k);
vtkmdiy::all_to_all(master, assigner, Collect<Block>(decomposer), magic_k);
}
template <typename T>
@ -145,41 +123,93 @@ void collect(std::vector<T>& partials, MPI_Comm comm);
template <>
void collect<VolumePartial<float>>(std::vector<VolumePartial<float>>& partials, MPI_Comm comm)
{
collect_detail<AddBlock<VolumeBlock<float>>>(partials, comm);
collect_detail<vtkm::rendering::compositing::AddBlock<VolumeBlock<float>>>(partials, comm);
}
template <>
void collect<vtkm::rendering::compositing::VolumePartial<double>>(
std::vector<vtkm::rendering::compositing::VolumePartial<double>>& partials,
MPI_Comm comm)
{
collect_detail<
vtkm::rendering::compositing::AddBlock<vtkm::rendering::compositing::VolumeBlock<double>>>(
partials, comm);
}
template <>
void collect<VolumePartial<double>>(std::vector<VolumePartial<double>>& partials, MPI_Comm comm)
void collect<vtkm::rendering::compositing::AbsorptionPartial<double>>(
std::vector<vtkm::rendering::compositing::AbsorptionPartial<double>>& partials,
MPI_Comm comm)
{
collect_detail<AddBlock<VolumeBlock<double>>>(partials, comm);
collect_detail<
vtkm::rendering::compositing::AddBlock<vtkm::rendering::compositing::AbsorptionBlock<double>>>(
partials, comm);
}
template <>
void collect<AbsorptionPartial<double>>(std::vector<AbsorptionPartial<double>>& partials,
MPI_Comm comm)
void collect<vtkm::rendering::compositing::AbsorptionPartial<float>>(
std::vector<vtkm::rendering::compositing::AbsorptionPartial<float>>& partials,
MPI_Comm comm)
{
collect_detail<AddBlock<AbsorptionBlock<double>>>(partials, comm);
collect_detail<
vtkm::rendering::compositing::AddBlock<vtkm::rendering::compositing::AbsorptionBlock<float>>>(
partials, comm);
}
template <>
void collect<AbsorptionPartial<float>>(std::vector<AbsorptionPartial<float>>& partials,
MPI_Comm comm)
void collect<vtkm::rendering::compositing::EmissionPartial<double>>(
std::vector<vtkm::rendering::compositing::EmissionPartial<double>>& partials,
MPI_Comm comm)
{
collect_detail<AddBlock<AbsorptionBlock<float>>>(partials, comm);
collect_detail<vtkm::rendering::compositing::AddBlock<EmissionBlock<double>>>(partials, comm);
}
template <>
void collect<EmissionPartial<double>>(std::vector<EmissionPartial<double>>& partials, MPI_Comm comm)
void collect<vtkm::rendering::compositing::EmissionPartial<float>>(
std::vector<vtkm::rendering::compositing::EmissionPartial<float>>& partials,
MPI_Comm comm)
{
collect_detail<AddBlock<EmissionBlock<double>>>(partials, comm);
collect_detail<
vtkm::rendering::compositing::AddBlock<vtkm::rendering::compositing::EmissionBlock<float>>>(
partials, comm);
}
}
}
} //vtkm::rendering::compositing
#endif //vtkm_rendering_compositing_vtkm_diy_partial_collect_h
#if 0
/*
template <>
void collect<EmissionPartial<float>>(std::vector<EmissionPartial<float>>& partials, MPI_Comm comm)
void collect<vtkm::rendering::compositing::EmissionPartial<float>>(std::vector<vtkm::rendering::compositing::EmissionPartial<float>>& partials, MPI_Comm comm)
{
collect_detail<AddBlock<EmissionBlock<float>>>(partials, comm);
collect_detail<vtkm::rendering::compositing::AddBlock<vtkm::rendering::compositing::EmissionBlock<float>>>(partials, comm);
}
*/
}
* /
}
}
} // namespace rover
/*
#endif //vtkm_rendering_compositing_vtkm_diy_partial_collect_h
template <>
template <>
void colloct<EmissioiPartial<float>>(std::vector<Em ssionPartial<cloat>>& partials, MPI_Comm comm)
{
ocollect_detail < ect<::missionPa::tial<float>::AddBloct<EdissvonBlock<float>>>(tor < Emis, simm);
}al<float>>& partials, MPI_Comm comm)
{
collect_detail<vtkm::rendering::compositing::AddBlock<EmissionBlock<float>>>(partials, comm);
}
*/
#endif

@ -1,56 +1,31 @@
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) 2018, Lawrence Livermore National Security, LLC.
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-749865
//
// All rights reserved.
//
// This file is part of Rover.
//
// Please also read rover/LICENSE
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the disclaimer below.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the disclaimer (as noted below) in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of the LLNS/LLNL nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
// LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
#ifndef rover_compositing_redistribute_h
#define rover_compositing_redistribute_h
// 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 vtkm_rendering_compositing_vtkm_diy_partial_redistribute_h
#define vtkm_rendering_compositing_vtkm_diy_partial_redistribute_h
#include "vtkh_diy_partial_blocks.hpp"
#include <diy/assigner.hpp>
#include <diy/decomposition.hpp>
#include <diy/master.hpp>
#include <diy/reduce-operations.hpp>
#include <map>
#include <vtkm/rendering/compositing/vtkm_diy_partial_blocks.h>
#include <vtkm/thirdparty/diy/assigner.h>
#include <vtkm/thirdparty/diy/decomposition.h>
#include <vtkm/thirdparty/diy/master.h>
#include <vtkm/thirdparty/diy/point.h>
#include <vtkm/thirdparty/diy/reduce-operations.h>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
//
// Redistributes partial composites to the ranks that owns
// that sectoon of the image. Currently, the domain is decomposed
@ -59,14 +34,14 @@ namespace vtkh
template <typename BlockType>
struct Redistribute
{
const vtkhdiy::RegularDecomposer<vtkhdiy::DiscreteBounds>& m_decomposer;
const vtkmdiy::RegularDecomposer<vtkmdiy::DiscreteBounds>& m_decomposer;
Redistribute(const vtkhdiy::RegularDecomposer<vtkhdiy::DiscreteBounds>& decomposer)
Redistribute(const vtkmdiy::RegularDecomposer<vtkmdiy::DiscreteBounds>& decomposer)
: m_decomposer(decomposer)
{
}
void operator()(void* v_block, const vtkhdiy::ReduceProxy& proxy) const
void operator()(void* v_block, const vtkmdiy::ReduceProxy& proxy) const
{
BlockType* block = static_cast<BlockType*>(v_block);
//
@ -76,14 +51,14 @@ struct Redistribute
if (proxy.in_link().size() == 0)
{
const int size = block->m_partials.size();
std::map<vtkhdiy::BlockID, std::vector<typename BlockType::PartialType>> outgoing;
std::map<vtkmdiy::BlockID, std::vector<typename BlockType::PartialType>> outgoing;
for (int i = 0; i < size; ++i)
{
vtkhdiy::Point<int, DIY_MAX_DIM> point;
vtkmdiy::Point<int, VTKMDIY_MAX_DIM> point;
point[0] = block->m_partials[i].m_pixel_id;
int dest_gid = m_decomposer.point_to_gid(point);
vtkhdiy::BlockID dest = proxy.out_link().target(dest_gid);
vtkmdiy::BlockID dest = proxy.out_link().target(dest_gid);
outgoing[dest].push_back(block->m_partials[i]);
} //for
@ -93,7 +68,7 @@ struct Redistribute
for (int i = 0; i < proxy.out_link().size(); ++i)
{
int dest_gid = proxy.out_link().target(i).gid;
vtkhdiy::BlockID dest = proxy.out_link().target(dest_gid);
vtkmdiy::BlockID dest = proxy.out_link().target(dest_gid);
proxy.enqueue(dest, outgoing[dest]);
//outgoing[dest].clear();
}
@ -128,8 +103,10 @@ void redistribute_detail(std::vector<typename AddBlockType::PartialType>& partia
{
typedef typename AddBlockType::Block Block;
vtkhdiy::mpi::communicator world(comm);
vtkhdiy::DiscreteBounds global_bounds;
vtkmdiy::mpi::communicator world(vtkmdiy::mpi::make_DIY_MPI_Comm(comm));
std::cout << __FILE__ << " " << __LINE__ << std::endl;
std::cout << " DRP: Is this the right dimension???" << std::endl;
vtkmdiy::DiscreteBounds global_bounds(1); //DRP???
global_bounds.min[0] = domain_min_pixel;
global_bounds.max[0] = domain_max_pixel;
@ -138,16 +115,16 @@ void redistribute_detail(std::vector<typename AddBlockType::PartialType>& partia
const int num_blocks = world.size();
const int magic_k = 2;
vtkhdiy::Master master(world, num_threads);
vtkmdiy::Master master(world, num_threads);
// create an assigner with one block per rank
vtkhdiy::ContiguousAssigner assigner(num_blocks, num_blocks);
vtkmdiy::ContiguousAssigner assigner(num_blocks, num_blocks);
AddBlockType create(master, partials);
const int dims = 1;
vtkhdiy::RegularDecomposer<vtkhdiy::DiscreteBounds> decomposer(dims, global_bounds, num_blocks);
vtkmdiy::RegularDecomposer<vtkmdiy::DiscreteBounds> decomposer(dims, global_bounds, num_blocks);
decomposer.decompose(world.rank(), assigner, create);
vtkhdiy::all_to_all(master, assigner, Redistribute<Block>(decomposer), magic_k);
vtkmdiy::all_to_all(master, assigner, Redistribute<Block>(decomposer), magic_k);
}
//
@ -221,6 +198,8 @@ void redistribute<EmissionPartial<float>>(std::vector<EmissionPartial<float>>& p
partials, comm, domain_min_pixel, domain_max_pixel);
}
} //namespace rover
}
}
} //vtkm::rendering::compositing
#endif
#endif //vtkm_rendering_compositing_vtkm_diy_partial_redistribute_h

@ -1,10 +1,24 @@
#ifndef VTKH_DIY_UTILS_HPP
#define VTKH_DIY_UTILS_HPP
//============================================================================
// 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.
//============================================================================
#ifndef vtkm_rendering_compositing_vtkm_diy_utils_h
#define vtkm_rendering_compositing_vtkm_diy_utils_h
#include <vtkm/Bounds.h>
#include <vtkmdiy/decomposition.hpp>
namespace vtkh
namespace vtkm
{
namespace rendering
{
namespace compositing
{
static vtkm::Bounds DIYBoundsToVTKM(const vtkmdiy::DiscreteBounds& bounds)
@ -44,6 +58,8 @@ static vtkmdiy::DiscreteBounds VTKMBoundsToDIY(const vtkm::Bounds& bounds)
return diy_bounds;
}
} //namespace vtkh
}
}
} //vtkm::rendering::compositing
#endif
#endif //vtkm_rendering_compositing_vtkm_diy_utils_h

@ -17,6 +17,7 @@
#include <vtkm/rendering/Actor.h>
#include <vtkm/rendering/CanvasRayTracer.h>
#include <vtkm/rendering/MapperConnectivity.h>
#include <vtkm/rendering/MapperRayTracer.h>
#include <vtkm/rendering/MapperVolume.h>
#include <vtkm/rendering/MapperWireframer.h>
@ -25,6 +26,9 @@
#include <vtkm/rendering/testing/RenderTest.h>
#include <vtkm/io/VTKDataSetReader.h>
#include <vtkm/filter/clean_grid/CleanGrid.h>
namespace
{
@ -176,9 +180,10 @@ void TestRenderComposite()
*/
}
void TestVolumeRenderComposite()
void TestVolumeRenderComposite(bool unstructured)
{
using vtkm::rendering::CanvasRayTracer;
using vtkm::rendering::MapperConnectivity;
using vtkm::rendering::MapperVolume;
auto comm = vtkm::cont::EnvironmentTracker::GetCommunicator();
@ -216,22 +221,39 @@ void TestVolumeRenderComposite()
tangle.SetOrigin(pt);
vtkm::cont::DataSet ds = tangle.Execute();
if (unstructured)
{
vtkm::filter::clean_grid::CleanGrid cleanGrid;
ds = cleanGrid.Execute(ds);
}
vtkm::rendering::Actor actor(
ds.GetCellSet(), ds.GetCoordinateSystem(), ds.GetField(fieldName), colorTable);
scene.AddActor(actor);
}
vtkm::rendering::View3D view(scene, MapperVolume(), canvas, camera, bg);
view.Paint();
canvas.SaveAs("result.png");
if (unstructured)
{
vtkm::rendering::View3D view(scene, MapperConnectivity(), canvas, camera, bg);
view.Paint();
canvas.SaveAs("result-unstructured.png");
}
else
{
vtkm::rendering::View3D view(scene, MapperVolume(), canvas, camera, bg);
view.Paint();
canvas.SaveAs("result-structured.png");
}
}
void RenderTests()
{
// TestImageComposite();
//TestRenderComposite();
TestVolumeRenderComposite();
TestVolumeRenderComposite(false);
TestVolumeRenderComposite(true);
}
} //namespace

@ -120,11 +120,18 @@ vtkm_install_targets(TARGETS vtkm_diy)
if (NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(FILES
${VTKm_BINARY_INCLUDE_DIR}/${kit_dir}/Configure.h
${CMAKE_CURRENT_SOURCE_DIR}/assigner.h
${CMAKE_CURRENT_SOURCE_DIR}/decomposition.h
${CMAKE_CURRENT_SOURCE_DIR}/diy.h
${CMAKE_CURRENT_SOURCE_DIR}/environment.h
${CMAKE_CURRENT_SOURCE_DIR}/master.h
${CMAKE_CURRENT_SOURCE_DIR}/mpi-cast.h
${CMAKE_CURRENT_SOURCE_DIR}/point.h
${CMAKE_CURRENT_SOURCE_DIR}/post-include.h
${CMAKE_CURRENT_SOURCE_DIR}/pre-include.h
${CMAKE_CURRENT_SOURCE_DIR}/reduce.h
${CMAKE_CURRENT_SOURCE_DIR}/reduce-operations.h
${CMAKE_CURRENT_SOURCE_DIR}/serialization.h
${CMAKE_CURRENT_SOURCE_DIR}/swap.h
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${kit_dir}/)
endif()

19
vtkm/thirdparty/diy/assigner.h vendored Normal file

@ -0,0 +1,19 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_assigner_h
#define vtk_m_thirdparty_diy_assigner_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(assigner.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_assigner_h

19
vtkm/thirdparty/diy/decomposition.h vendored Normal file

@ -0,0 +1,19 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_decomposition_h
#define vtk_m_thirdparty_diy_decomposition_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(decomposition.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_decomposition_h

19
vtkm/thirdparty/diy/master.h vendored Normal file

@ -0,0 +1,19 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_master_h
#define vtk_m_thirdparty_diy_master_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(master.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_master_h

19
vtkm/thirdparty/diy/point.h vendored Normal file

@ -0,0 +1,19 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_point_h
#define vtk_m_thirdparty_diy_point_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(point.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_point_h

20
vtkm/thirdparty/diy/reduce-operations.h vendored Normal file

@ -0,0 +1,20 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_reduce_operations_h
#define vtk_m_thirdparty_diy_reduce_operations_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(reduce-operations.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_reduce_operations_h

20
vtkm/thirdparty/diy/reduce.h vendored Normal file

@ -0,0 +1,20 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_reduce_h
#define vtk_m_thirdparty_diy_reduce_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(reduce.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_reduce_reduce_h

19
vtkm/thirdparty/diy/swap.h vendored Normal file

@ -0,0 +1,19 @@
//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_thirdparty_diy_swap_h
#define vtk_m_thirdparty_diy_swap_h
#include "pre-include.h"
// clang-format off
#include VTKM_DIY_INCLUDE(partners/swap.hpp)
// clang-format on
#include "post-include.h"
#endif // vtk_m_thirdparty_diy_swap_h