VTKFIG
0.25.0
Easy VTK based in situ visualization
|
Go to the documentation of this file.
7 #ifndef VTKFIG_QUIVER_H
8 #define VTKFIG_QUIVER_H
10 #include <vtkPolyData.h>
11 #include <vtkDoubleArray.h>
31 static std::shared_ptr<VectorView>
New();
33 virtual std::string
SubClassName() override final {
return std::string(
"VectorView");}
132 void RTBuildVTKPipeline() override final;
133 void ServerMPSend(vtkSmartPointer<internals::Communicator> communicator) override final;
134 void ClientMPReceive(vtkSmartPointer<internals::Communicator> communicator) override final;
137 template <class DATA>
void RTBuildVTKPipeline0();
140 vtkSmartPointer<vtkPolyData> probePolyData;
141 vtkSmartPointer<vtkPolyData> seedPolyData;
150 auto probePoints = vtkSmartPointer<vtkPoints>::New();
151 if (
state.spacedim==2)
152 for (
int i=0;i<p.size();i+=2)
153 probePoints->InsertNextPoint (p[i+0],p[i+1],0);
155 if (
state.spacedim==3)
156 for (
int i=0;i<p.size();i+=3)
157 probePoints->InsertNextPoint (p[i+0],p[i+1],p[i+2]);
158 probePolyData =vtkSmartPointer<vtkPolyData>::New();
159 probePolyData->SetPoints(probePoints);
170 rgbtab.resize(tab.size()/4);
171 for (
int i=0,j=0; i<tab.size(); i+=4,j++)
173 rgbtab[j].x=tab[i+0];
174 rgbtab[j].r=tab[i+1];
175 rgbtab[j].g=tab[i+2];
176 rgbtab[j].b=tab[i+3];
186 rgbtab.resize(tab.size()/4);
187 for (
int i=0,j=0; i<tab.size(); i+=4,j++)
189 rgbtab[j].x=tab[i+0];
190 rgbtab[j].r=tab[i+1];
191 rgbtab[j].g=tab[i+2];
192 rgbtab[j].b=tab[i+3];
203 auto seedPoints = vtkSmartPointer<vtkPoints>::New();
204 if (
state.spacedim==2)
205 for (
size_t i=0;i<p.size();i+=2)
208 if (
state.spacedim==3)
209 for (
size_t i=0;i<p.size();i+=3)
213 seedPolyData =vtkSmartPointer<vtkPolyData>::New();
214 seedPolyData->SetPoints(seedPoints);
static std::shared_ptr< VectorView > New()
Smart pointer constructor.
void SetStreamLineMaximumNumberOfSteps(int l)
Set maximum number of steps.
Definition: vtkfigVectorView.h:88
void SetStreamLineWidth(double w)
Set width of stream ribbons.
Definition: vtkfigVectorView.h:97
void SetQuiverGrid(int nx, int ny)
Set quiver points on grid in domain bounding box (2D)
void ShowStreamLineColorbar(bool b)
Show color bar for stream lines.
Definition: vtkfigVectorView.h:82
void SetStreamLineRGBTable(const V &tab, int lutsize)
Set streamline RGB table from vector.
Definition: vtkfigVectorView.h:183
void ShowStreamLines(bool b)
Show stream lines (false by default)
Definition: vtkfigVectorView.h:79
void SetStreamLineMaximumIntegrationStep(double l)
Set maximum integration step for streamlines.
Definition: vtkfigVectorView.h:94
void SetStreamLineInitialIntegrationStep(double l)
Set initial integration step for streamlines.
Definition: vtkfigVectorView.h:91
void SetQuiverRGBTable(const V &tab, int lutsize)
Set quiver RGB table from vector.
Definition: vtkfigVectorView.h:167
virtual std::string SubClassName() override final
Get subclass name (for s-c communication, should be replaced by tag.
Definition: vtkfigVectorView.h:33
void SetQuiverArrowScale(double scale)
Set scaling of arrows.
Definition: vtkfigVectorView.h:40
void ShowQuiverColorbar(bool b)
Show color bar for quiver colors.
Definition: vtkfigVectorView.h:43
void SetQuiverPoints(const V &p)
Set quiver points from vector.
Definition: vtkfigVectorView.h:147
Quiver plots + streamlines for vector fields.
Definition: vtkfigVectorView.h:25
void ShowQuiver(bool b)
Show quiver plot (true by default)
Definition: vtkfigVectorView.h:37
void SetStreamLineSeedPoints(const V &p)
Set seed points for streamlines.
Definition: vtkfigVectorView.h:200
void SetStreamLineMaximumPropagation(double l)
Set length of stream lines.
Definition: vtkfigVectorView.h:85