mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional vtk::Tools methods for cloud-related meshes
- the Tools::Vertices() method for creating a vtkPolyData with the given points and a corresponding Verts for the points.
This commit is contained in:
@ -210,6 +210,19 @@ namespace Tools
|
|||||||
template<class Face>
|
template<class Face>
|
||||||
vtkSmartPointer<vtkCellArray> Faces(const UList<Face>& faces);
|
vtkSmartPointer<vtkCellArray> Faces(const UList<Face>& faces);
|
||||||
|
|
||||||
|
//- Return vtkPolyData of vertices for each point
|
||||||
|
inline vtkSmartPointer<vtkPolyData> Vertices
|
||||||
|
(
|
||||||
|
const UList<point>& pts
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return vtkPolyData of vertices for each point
|
||||||
|
inline vtkSmartPointer<vtkPolyData> Vertices
|
||||||
|
(
|
||||||
|
const UList<point>& pts,
|
||||||
|
const labelUList& addr
|
||||||
|
);
|
||||||
|
|
||||||
//- Min/Max of scalar, or mag() of non-scalars. Includes nullptr check.
|
//- Min/Max of scalar, or mag() of non-scalars. Includes nullptr check.
|
||||||
inline scalarMinMax rangeOf(vtkDataArray* data);
|
inline scalarMinMax rangeOf(vtkDataArray* data);
|
||||||
|
|
||||||
|
|||||||
@ -98,6 +98,30 @@ Foam::vtk::Tools::Points(const UList<point>& pts, const labelUList& addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline vtkSmartPointer<vtkPolyData>
|
||||||
|
Foam::vtk::Tools::Vertices(const UList<point>& pts)
|
||||||
|
{
|
||||||
|
auto vtkmesh = vtkSmartPointer<vtkPolyData>::New();
|
||||||
|
|
||||||
|
vtkmesh->SetPoints(Tools::Points(pts));
|
||||||
|
vtkmesh->SetVerts(Tools::identityVertices(pts.size()));
|
||||||
|
|
||||||
|
return vtkmesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline vtkSmartPointer<vtkPolyData>
|
||||||
|
Foam::vtk::Tools::Vertices(const UList<point>& pts, const labelUList& addr)
|
||||||
|
{
|
||||||
|
auto vtkmesh = vtkSmartPointer<vtkPolyData>::New();
|
||||||
|
|
||||||
|
vtkmesh->SetPoints(Tools::Points(pts, addr));
|
||||||
|
vtkmesh->SetVerts(Tools::identityVertices(addr.size()));
|
||||||
|
|
||||||
|
return vtkmesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalarMinMax Foam::vtk::Tools::rangeOf(vtkDataArray* data)
|
inline Foam::scalarMinMax Foam::vtk::Tools::rangeOf(vtkDataArray* data)
|
||||||
{
|
{
|
||||||
double range[2]{GREAT, -GREAT};
|
double range[2]{GREAT, -GREAT};
|
||||||
|
|||||||
Reference in New Issue
Block a user