TTK
Loading...
Searching...
No Matches
ttkCinemaImaging.h
Go to the documentation of this file.
1
25
26#pragma once
27
28// VTK Module
29#include <ttkCinemaImagingModule.h>
30
31// TTK includes
32#include <ttkAlgorithm.h>
33
34namespace ttk {
35 class CinemaImaging;
36}
37class vtkMultiBlockDataSet;
38class vtkPointSet;
39class vtkFieldData;
40class vtkImageData;
41class vtkPointData;
42class vtkCellArray;
43
44class TTKCINEMAIMAGING_EXPORT ttkCinemaImaging : public ttkAlgorithm {
45
46private:
47 int Backend{0};
48
49 int Resolution[2]{256, 256};
50
51 int ProjectionMode{0};
52
53 bool AutoFocalPoint{true};
54 bool AutoNearFar{true};
55 bool AutoHeight{true};
56
57 double FocalPoint[3]{0, 0, 0};
58 double NearFar[2]{0, 1};
59 double Height{1};
60
61 double Angle{45}; // only used for perpective view
62
63public:
66
67 // Backend
68 vtkSetMacro(Backend, int);
69 vtkGetMacro(Backend, int);
70
71 // General Settings
72 vtkSetVector2Macro(Resolution, int);
73 vtkGetVector2Macro(Resolution, int);
74
75 // Camera
76 vtkSetMacro(ProjectionMode, int);
77 vtkGetMacro(ProjectionMode, int);
78
79 vtkSetMacro(AutoFocalPoint, bool);
80 vtkGetMacro(AutoFocalPoint, bool);
81 vtkSetVector3Macro(FocalPoint, double);
82 vtkGetVector3Macro(FocalPoint, double);
83
84 vtkSetMacro(AutoNearFar, bool);
85 vtkGetMacro(AutoNearFar, bool);
86 vtkSetVector2Macro(NearFar, double);
87 vtkGetVector2Macro(NearFar, double);
88
89 vtkSetMacro(AutoHeight, bool);
90 vtkGetMacro(AutoHeight, bool);
91 vtkSetMacro(Height, double);
92 vtkGetMacro(Height, double);
93
94 // Perspective
95 vtkSetMacro(Angle, double);
96 vtkGetMacro(Angle, double);
97
98 static vtkCellArray *GetCells(vtkPointSet *pointSet);
99
100 static int Normalize(vtkDataArray *depthArray, const double nearFar[2]);
101
102 static int AddFieldDataArray(vtkFieldData *fd,
103 vtkDataArray *array,
104 int tupleIdx,
105 const std::string &name = "");
106
107 static int AddAllFieldDataArrays(vtkPointSet *inputGrid,
108 vtkImageData *image,
109 int tupleIdx);
110
111 static int ComputeDirFromFocalPoint(vtkPointSet *inputGrid);
112
113 static int EnsureGridData(vtkPointData *fd,
114 const std::string &name,
115 int nTuples,
116 const std::vector<double> &Values);
117
118 static int MapPointAndCellData(vtkImageData *outputImage,
119
120 vtkPointSet *inputObject,
121 const ttk::CinemaImaging *renderer,
122 const unsigned int *primitiveIdArray,
123 const float *barycentricCoordinates,
124 const vtkIdType *inputObjectConnectivityList);
125
126protected:
129
130 int FillInputPortInformation(int port, vtkInformation *info) override;
131 int FillOutputPortInformation(int port, vtkInformation *info) override;
132
133 int RequestData(vtkInformation *request,
134 vtkInformationVector **inputVector,
135 vtkInformationVector *outputVector) override;
136
137 int RequestDataSingle(vtkMultiBlockDataSet *collection,
138
139 vtkPointSet *object,
140 vtkPointSet *grid,
141 const std::vector<double> &defaultFocal,
142 const std::vector<double> &defaultNearFar,
143 const double defaultHeight,
144 const double defaultAngle);
145};
Baseclass of all VTK filters that wrap ttk modules.
virtual int RequestData(vtkInformation *ttkNotUsed(request), vtkInformationVector **ttkNotUsed(inputVectors), vtkInformationVector *ttkNotUsed(outputVector))
int FillInputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
int FillOutputPortInformation(int ttkNotUsed(port), vtkInformation *ttkNotUsed(info)) override
TTK VTK-filter that generates images of a vtkDataSet.
static ttkCinemaImaging * New()
~ttkCinemaImaging() override
TTK modules that generates images of a dataset.
The Topology ToolKit.