3#include <vtkCellData.h>
4#include <vtkCharArray.h>
6#include <vtkDoubleArray.h>
7#include <vtkIntArray.h>
9#include <vtkPointData.h>
10#include <vtkUnsignedCharArray.h>
11#include <vtkUnstructuredGrid.h>
24 const char *fieldName,
26 arr->SetName(fieldName);
27 arr->SetNumberOfComponents(1);
28 arr->SetNumberOfTuples(nbElmnt);
30#ifndef TTK_ENABLE_KAMIKAZE
34 dbg.printErr(
"unable to allocate " + std::string{fieldName}
35 +
" the program will likely crash");
42 vtkNew<vtkIntArray>
ids{};
54 const double scalar) {
62 pointData->AddArray(
ids);
63 pointData->SetScalars(
types);
69 vtkNew<vtkIntArray>
ids{};
70 vtkNew<vtkCharArray>
reg{};
72 vtkNew<vtkUnsignedCharArray>
fromUp{};
74 std::map<ttk::ftr::idVertex, vtkIdType>
points;
86 const vtkIdType skeletonVert,
88 reg->SetTuple1(skeletonVert, r);
93 const vtkIdType skeletonCell) {
94 ids->SetTuple1(skeletonCell, a);
105 ids->SetNumberOfTuples(arcs->GetNumberOfCells());
106 arcs->GetCellData()->SetScalars(
ids);
107 reg->SetNumberOfTuples(arcs->GetNumberOfPoints());
108 arcs->GetPointData()->AddArray(
reg);
110 fromUp->SetNumberOfTuples(arcs->GetNumberOfCells());
111 arcs->GetCellData()->AddArray(
fromUp);
117 vtkNew<vtkIntArray>
ids{};
119#ifdef TTK_ENABLE_FTR_VERT_STATS
120 vtkNew<vtkIntArray> touch{};
121 vtkNew<vtkIntArray> arcActif{};
122 vtkNew<vtkIntArray> taskActif{};
128#ifdef TTK_ENABLE_FTR_VERT_STATS
130 allocArray(arcActif,
"Arc active", nbVertices);
144 ids->SetTuple1(v, curArcId);
146 int const downNodeType
151#ifdef TTK_ENABLE_FTR_VERT_STATS
152 touch->SetTuple1(v, graph.getNbTouch(v));
153 arcActif->SetTuple1(v, graph.getNbArcActive(v));
159 segmentation->GetPointData()->AddArray(
ids);
160 segmentation->GetPointData()->SetActiveScalars(
ids->GetName());
161 segmentation->GetPointData()->AddArray(
regionType);
162#ifdef TTK_ENABLE_FTR_VERT_STATS
163 segmentation->GetPointData()->AddArray(touch);
164 segmentation->GetPointData()->AddArray(arcActif);
#define TTK_FORCE_USE(x)
Force the compiler to use the function/method parameter.
#define ttkNotUsed(x)
Mark function/method parameters that are not used in the function body at all.
Minimalist debugging class.
void setDebugMsgPrefix(const std::string &prefix)
TTK FTRGraph graph skeleton.
idSuperArc getArcId(const idVertex v) const
const SuperArc & getArc(const idSuperArc id) const
const Node & getNode(const idNode id) const
bool isVisited(const idVertex v) const
idVertex getVertexIdentifier() const
ftr::NodeType getType() const
idNode getDownNodeId() const
long unsigned int idSuperArc
SuperArc index in vect_superArcs_.
SimplexId idVertex
Vertex index in scalars_.
unsigned int idNode
Node index in vect_nodes_.
const char MaskScalarFieldName[]
default name for mask scalar field
vtkNew< vtkUnsignedCharArray > fromUp
std::map< ttk::ftr::idVertex, vtkIdType > points
ArcData(const ttk::ftr::idSuperArc nbArcs)
void setPointInfo(const ttk::ftr::Graph &ttkNotUsed(graph), const ttk::ftr::idSuperArc ttkNotUsed(a), const vtkIdType skeletonVert, bool r=false)
vtkNew< vtkIntArray > ids
void addArrays(vtkUnstructuredGrid *arcs, ttk::ftr::Params ttkNotUsed(params))
vtkNew< vtkCharArray > reg
void setArcInfo(const ttk::ftr::Graph &graph, const ttk::ftr::idSuperArc a, const vtkIdType skeletonCell)
void addNode(const ttk::ftr::Graph &graph, const ttk::ftr::idNode n, const double scalar)
vtkNew< vtkDoubleArray > scalars
vtkNew< vtkIntArray > ids
vtkNew< vtkIntArray > types
void addArrays(vtkPointData *pointData, ttk::ftr::Params ttkNotUsed(params))
NodeData(const ttk::ftr::idVertex nbNodes)
void allocArray(vtkDataArray *const arr, const char *fieldName, size_t nbElmnt)
vtkNew< vtkIntArray > regionType
vtkNew< vtkIntArray > ids
void setVertexInfo(const ttk::ftr::Graph &graph, const ttk::ftr::idVertex v)
VertData(const ttk::ftr::idVertex nbVertices)
void addArrays(vtkDataSet *segmentation, ttk::ftr::Params ttkNotUsed(params))