This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding new filters * adding the corresponding vtkh filters
- Loading branch information
Showing
10 changed files
with
232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <vtkh/filters/Tetrahedralize.hpp> | ||
#include <vtkh/vtkm_filters/vtkmTetrahedralize.hpp> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
Tetrahedralize::Tetrahedralize() | ||
{ | ||
|
||
} | ||
|
||
Tetrahedralize::~Tetrahedralize() | ||
{ | ||
|
||
} | ||
|
||
void Tetrahedralize::PreExecute() | ||
{ | ||
Filter::PreExecute(); | ||
} | ||
|
||
void Tetrahedralize::PostExecute() | ||
{ | ||
Filter::PostExecute(); | ||
} | ||
|
||
void Tetrahedralize::DoExecute() | ||
{ | ||
this->m_output = new DataSet(); | ||
const int num_domains = this->m_input->GetNumberOfDomains(); | ||
|
||
for(int i = 0; i < num_domains; ++i) | ||
{ | ||
vtkm::Id domain_id; | ||
vtkm::cont::DataSet dom; | ||
this->m_input->GetDomain(i, dom, domain_id); | ||
vtkmTetrahedralize tetter; | ||
// insert interesting stuff | ||
auto dataset = tetter.Run(dom, this->GetFieldSelection()); | ||
|
||
m_output->AddDomain(dataset, domain_id); | ||
} | ||
} | ||
|
||
std::string | ||
Tetrahedralize::GetName() const | ||
{ | ||
return "vtkh::Tetrahedralize"; | ||
} | ||
|
||
} // namespace vtkh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef VTK_H_TETRAHEDRALIZE_HPP | ||
#define VTK_H_TETRAHEDRALIZE_HPP | ||
|
||
#include <vtkh/vtkh_exports.h> | ||
#include <vtkh/vtkh.hpp> | ||
#include <vtkh/filters/Filter.hpp> | ||
#include <vtkh/DataSet.hpp> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
class VTKH_API Tetrahedralize : public Filter | ||
{ | ||
public: | ||
Tetrahedralize(); | ||
virtual ~Tetrahedralize(); | ||
std::string GetName() const override; | ||
|
||
protected: | ||
void PreExecute() override; | ||
void PostExecute() override; | ||
void DoExecute() override; | ||
}; | ||
|
||
} //namespace vtkh | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <vtkh/filters/Triangulate.hpp> | ||
#include <vtkh/vtkm_filters/vtkmTriangulate.hpp> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
Triangulate::Triangulate() | ||
{ | ||
|
||
} | ||
|
||
Triangulate::~Triangulate() | ||
{ | ||
|
||
} | ||
|
||
void Triangulate::PreExecute() | ||
{ | ||
Filter::PreExecute(); | ||
} | ||
|
||
void Triangulate::PostExecute() | ||
{ | ||
Filter::PostExecute(); | ||
} | ||
|
||
void Triangulate::DoExecute() | ||
{ | ||
this->m_output = new DataSet(); | ||
const int num_domains = this->m_input->GetNumberOfDomains(); | ||
|
||
for(int i = 0; i < num_domains; ++i) | ||
{ | ||
vtkm::Id domain_id; | ||
vtkm::cont::DataSet dom; | ||
this->m_input->GetDomain(i, dom, domain_id); | ||
vtkmTriangulate tetter; | ||
// insert interesting stuff | ||
auto dataset = tetter.Run(dom, this->GetFieldSelection()); | ||
|
||
m_output->AddDomain(dataset, domain_id); | ||
} | ||
} | ||
|
||
std::string | ||
Triangulate::GetName() const | ||
{ | ||
return "vtkh::Triangulate"; | ||
} | ||
|
||
} // namespace vtkh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef VTK_H_TRIANGULATE_HPP | ||
#define VTK_H_TRIANGULATE_HPP | ||
|
||
#include <vtkh/vtkh_exports.h> | ||
#include <vtkh/vtkh.hpp> | ||
#include <vtkh/filters/Filter.hpp> | ||
#include <vtkh/DataSet.hpp> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
class VTKH_API Triangulate : public Filter | ||
{ | ||
public: | ||
Triangulate(); | ||
virtual ~Triangulate(); | ||
std::string GetName() const override; | ||
|
||
protected: | ||
void PreExecute() override; | ||
void PostExecute() override; | ||
void DoExecute() override; | ||
}; | ||
|
||
} //namespace vtkh | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "vtkmTetrahedralize.hpp" | ||
|
||
#include <vtkm/filter/Tetrahedralize.h> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
vtkm::cont::DataSet | ||
vtkmTetrahedralize::Run(vtkm::cont::DataSet &input, | ||
vtkm::filter::FieldSelection map_fields) | ||
{ | ||
vtkm::filter::Tetrahedralize tet; | ||
tet.SetFieldsToPass(map_fields); | ||
auto output = tet.Execute(input); | ||
return output; | ||
} | ||
|
||
} // namespace vtkh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef VTK_H_VTKM_TETRAHEDRALIZE_HPP | ||
#define VTK_H_VTKM_TETRAHEDRALIZE_HPP | ||
|
||
#include <vtkm/cont/DataSet.h> | ||
#include <vtkm/filter/FieldSelection.h> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
class vtkmTetrahedralize | ||
{ | ||
public: | ||
vtkm::cont::DataSet Run(vtkm::cont::DataSet &input, | ||
vtkm::filter::FieldSelection map_fields); | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "vtkmTriangulate.hpp" | ||
|
||
#include <vtkm/filter/Triangulate.h> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
vtkm::cont::DataSet | ||
vtkmTriangulate::Run(vtkm::cont::DataSet &input, | ||
vtkm::filter::FieldSelection map_fields) | ||
{ | ||
vtkm::filter::Triangulate tri; | ||
tri.SetFieldsToPass(map_fields); | ||
auto output = tri.Execute(input); | ||
return output; | ||
} | ||
|
||
} // namespace vtkh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef VTK_H_VTKM_TRIANGULATE_HPP | ||
#define VTK_H_VTKM_TRIANGULATE_HPP | ||
|
||
#include <vtkm/cont/DataSet.h> | ||
#include <vtkm/filter/FieldSelection.h> | ||
|
||
namespace vtkh | ||
{ | ||
|
||
class vtkmTriangulate | ||
{ | ||
public: | ||
vtkm::cont::DataSet Run(vtkm::cont::DataSet &input, | ||
vtkm::filter::FieldSelection map_fields); | ||
}; | ||
} | ||
#endif |