Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
vtkTensorGlyphColor Class Reference

scale and orient glyph(s) according to eigenvalues and eigenvectors of symmetrical part of tensor More...

#include <vtkTensorGlyphColor.h>

+ Inheritance diagram for vtkTensorGlyphColor:

Public Types

enum  { COLOR_BY_SCALARS , COLOR_BY_EIGENVALUES }
 

Public Member Functions

 vtkTypeMacro (vtkTensorGlyphColor, vtkPolyDataAlgorithm) void PrintSelf(ostream &os
 
void SetSourceData (vtkPolyData *source)
 
vtkPolyData * GetSource ()
 
void SetSourceConnection (int id, vtkAlgorithmOutput *algOutput)
 
void SetSourceConnection (vtkAlgorithmOutput *algOutput)
 
 vtkSetMacro (Scaling, vtkTypeBool)
 
 vtkGetMacro (Scaling, vtkTypeBool)
 
 vtkBooleanMacro (Scaling, vtkTypeBool)
 
 vtkSetMacro (ScaleFactor, double)
 
 vtkGetMacro (ScaleFactor, double)
 
 vtkSetMacro (ThreeGlyphs, vtkTypeBool)
 
 vtkGetMacro (ThreeGlyphs, vtkTypeBool)
 
 vtkBooleanMacro (ThreeGlyphs, vtkTypeBool)
 
 vtkSetMacro (Symmetric, vtkTypeBool)
 
 vtkGetMacro (Symmetric, vtkTypeBool)
 
 vtkBooleanMacro (Symmetric, vtkTypeBool)
 
 vtkSetMacro (Length, double)
 
 vtkGetMacro (Length, double)
 
 vtkSetMacro (ExtractEigenvalues, vtkTypeBool)
 
 vtkBooleanMacro (ExtractEigenvalues, vtkTypeBool)
 
 vtkGetMacro (ExtractEigenvalues, vtkTypeBool)
 
 vtkSetMacro (ColorGlyphs, vtkTypeBool)
 
 vtkGetMacro (ColorGlyphs, vtkTypeBool)
 
 vtkBooleanMacro (ColorGlyphs, vtkTypeBool)
 
 vtkSetClampMacro (ColorMode, int, COLOR_BY_SCALARS, COLOR_BY_EIGENVALUES)
 
 vtkGetMacro (ColorMode, int)
 
void SetColorModeToScalars ()
 
void SetColorModeToEigenvalues ()
 
 vtkSetMacro (ClampScaling, vtkTypeBool)
 
 vtkGetMacro (ClampScaling, vtkTypeBool)
 
 vtkBooleanMacro (ClampScaling, vtkTypeBool)
 
 vtkSetMacro (MaxScaleFactor, double)
 
 vtkGetMacro (MaxScaleFactor, double)
 

Static Public Member Functions

static vtkTensorGlyphColorNew ()
 

Public Attributes

vtkIndent indent override
 

Protected Member Functions

 vtkTensorGlyphColor ()
 
 ~vtkTensorGlyphColor () override
 
 vtkTensorGlyphColor (const vtkTensorGlyphColor &)=delete
 
void operator= (const vtkTensorGlyphColor &)=delete
 
int RequestUpdateExtent (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
 
int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
 
int FillInputPortInformation (int port, vtkInformation *info) override
 

Protected Attributes

vtkTypeBool Scaling
 
double ScaleFactor
 
vtkTypeBool ExtractEigenvalues
 
vtkTypeBool ColorGlyphs
 
int ColorMode
 
vtkTypeBool ClampScaling
 
double MaxScaleFactor
 
vtkTypeBool ThreeGlyphs
 
vtkTypeBool Symmetric
 
double Length
 

Detailed Description

scale and orient glyph(s) according to eigenvalues and eigenvectors of symmetrical part of tensor

vtkTensorGlyphColor is a filter that copies a geometric representation (specified as polygonal data) to every input point. The geometric representation, or glyph, can be scaled and/or rotated according to the tensor at the input point. Scaling and rotation is controlled by the eigenvalues/eigenvectors of the symmetrical part of the tensor as follows: For each tensor, the eigenvalues (and associated eigenvectors) are sorted to determine the major, medium, and minor eigenvalues/eigenvectors. The eigenvalue decomposition only makes sense for symmetric tensors, hence the need to only consider the symmetric part of the tensor, which is 1/2 (T + T.transposed()).

If the boolean variable ThreeGlyphs is not set the major eigenvalue scales the glyph in the x-direction, the medium in the y-direction, and the minor in the z-direction. Then, the glyph is rotated so that the glyph's local x-axis lies along the major eigenvector, y-axis along the medium eigenvector, and z-axis along the minor.

If the boolean variable ThreeGlyphs is set three glyphs are produced, each of them oriented along an eigenvector and scaled according to the corresponding eigenvector.

If the boolean variable Symmetric is set each glyph is mirrored (2 or 6 glyphs will be produced)

The x-axis of the source glyph will correspond to the eigenvector on output. Point (0,0,0) in the source will be placed in the data point. Variable Length will normally correspond to the distance from the origin to the tip of the source glyph along the x-axis, but can be changed to produce other results when Symmetric is on, e.g. glyphs that do not touch or that overlap.

Please note that when Symmetric is false it will generally be better to place the source glyph from (-0.5,0,0) to (0.5,0,0), i.e. centred at the origin. When symmetric is true the placement from (0,0,0) to (1,0,0) will generally be more convenient.

A scale factor is provided to control the amount of scaling. Also, you can turn off scaling completely if desired. The boolean variable ClampScaling controls the maximum scaling (in conjunction with MaxScaleFactor.) This is useful in certain applications where singularities or large order of magnitude differences exist in the eigenvalues.

If the boolean variable ColorGlyphs is set to true the glyphs are colored. The glyphs can be colored using the input scalars (SetColorModeToScalars), which is the default, or colored using the eigenvalues (SetColorModeToEigenvalues).

Another instance variable, ExtractEigenvalues, has been provided to control extraction of eigenvalues/eigenvectors. If this boolean is false, then eigenvalues/eigenvectors are not extracted, and the columns of the tensor are taken as the eigenvectors (the norm of column, always positive, is the eigenvalue). This allows additional capability over the vtkGlyph3D object. That is, the glyph can be oriented in three directions instead of one.

Thanks:
Thanks to Jose Paulo Moitinho de Almeida for enhancements.
See also
vtkGlyph3D vtkPointLoad vtkHyperStreamline

Definition at line 89 of file vtkTensorGlyphColor.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
COLOR_BY_SCALARS 
COLOR_BY_EIGENVALUES 

Definition at line 191 of file vtkTensorGlyphColor.h.

Constructor & Destructor Documentation

◆ vtkTensorGlyphColor() [1/2]

vtkTensorGlyphColor::vtkTensorGlyphColor ( )
protected

◆ ~vtkTensorGlyphColor()

vtkTensorGlyphColor::~vtkTensorGlyphColor ( )
overrideprotecteddefault

◆ vtkTensorGlyphColor() [2/2]

vtkTensorGlyphColor::vtkTensorGlyphColor ( const vtkTensorGlyphColor & )
protecteddelete

Member Function Documentation

◆ FillInputPortInformation()

int vtkTensorGlyphColor::FillInputPortInformation ( int port,
vtkInformation * info )
overrideprotected

Definition at line 491 of file vtkTensorGlyphColor.cxx.

492{
493 if (port == 1) {
494 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
495 return 1;
496 }
497 info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
498 return 1;
499}

◆ GetSource()

vtkPolyData * vtkTensorGlyphColor::GetSource ( )

Definition at line 482 of file vtkTensorGlyphColor.cxx.

483{
484 if (this->GetNumberOfInputConnections(1) < 1) {
485 return nullptr;
486 }
487 return vtkPolyData::SafeDownCast(this->GetExecutive()->GetInputData(1, 0));
488}

Referenced by RequestData().

◆ New()

static vtkTensorGlyphColor * vtkTensorGlyphColor::New ( )
static

Construct object with scaling on and scale factor 1.0. Eigenvalues are extracted, glyphs are colored with input scalar data, and logarithmic scaling is turned off.

◆ operator=()

void vtkTensorGlyphColor::operator= ( const vtkTensorGlyphColor & )
protecteddelete

◆ RequestData()

int vtkTensorGlyphColor::RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotected

Definition at line 92 of file vtkTensorGlyphColor.cxx.

95{
96 // get the info objects
97 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
98 vtkInformation* sourceInfo = inputVector[1]->GetInformationObject(0);
99 vtkInformation* outInfo = outputVector->GetInformationObject(0);
100
101 // get the input and output
102 vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
103 vtkPolyData* source = vtkPolyData::SafeDownCast(sourceInfo->Get(vtkDataObject::DATA_OBJECT()));
104 vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
105
106 vtkDataArray* inTensors;
107 double tensor[9];
108 vtkDataArray* inScalars;
109 vtkIdType numPts, numSourcePts, numSourceCells, inPtId, i;
110 int j;
111 vtkPoints* sourcePts;
112 vtkDataArray* sourceNormals;
113 vtkCellArray *sourceCells, *cells;
114 vtkPoints* newPts;
115 vtkFloatArray* newScalars = nullptr;
116 vtkFloatArray* newNormals = nullptr;
117 double x[3], s;
118 vtkTransform* trans;
119 vtkCell* cell;
120 vtkIdList* cellPts;
121 int npts;
122 vtkIdType* pts;
123 vtkIdType ptIncr, cellId;
124 vtkIdType subIncr;
125 int numDirs, dir, eigen_dir, symmetric_dir;
126 vtkMatrix4x4* matrix;
127 double *m[3], w[3], *v[3];
128 double m0[3], m1[3], m2[3];
129 double v0[3], v1[3], v2[3];
130 double xv[3], yv[3], zv[3];
131 double maxScale;
132
133 numDirs = (this->ThreeGlyphs != 0 ? 3 : 1) * (this->Symmetric + 1);
134
135 // set up working matrices
136 m[0] = m0;
137 m[1] = m1;
138 m[2] = m2;
139 v[0] = v0;
140 v[1] = v1;
141 v[2] = v2;
142
143 vtkDebugMacro(<< "Generating tensor glyphs");
144
145 vtkPointData* outPD = output->GetPointData();
146 inTensors = this->GetInputArrayToProcess(0, inputVector);
147 inScalars = this->GetInputArrayToProcess(1, inputVector);
148 numPts = input->GetNumberOfPoints();
149
150 if ((inTensors == nullptr) || numPts < 1) {
151 vtkErrorMacro(<< "No data to glyph!");
152 return 1;
153 }
154
155 pts = new vtkIdType[source->GetMaxCellSize()];
156 trans = vtkTransform::New();
157 matrix = vtkMatrix4x4::New();
158
159 //
160 // Allocate storage for output PolyData
161 //
162 sourcePts = source->GetPoints();
163 numSourcePts = sourcePts->GetNumberOfPoints();
164 numSourceCells = source->GetNumberOfCells();
165
166 newPts = vtkPoints::New();
167 newPts->Allocate(numDirs * numPts * numSourcePts);
168
169 // Setting up for calls to PolyData::InsertNextCell()
170 if ((sourceCells = source->GetVerts())->GetNumberOfCells() > 0) {
171 cells = vtkCellArray::New();
172 cells->Allocate(numDirs * numPts * sourceCells->GetSize());
173 output->SetVerts(cells);
174 cells->Delete();
175 }
176 if ((sourceCells = this->GetSource()->GetLines())->GetNumberOfCells() > 0) {
177 cells = vtkCellArray::New();
178 cells->Allocate(numDirs * numPts * sourceCells->GetSize());
179 output->SetLines(cells);
180 cells->Delete();
181 }
182 if ((sourceCells = this->GetSource()->GetPolys())->GetNumberOfCells() > 0) {
183 cells = vtkCellArray::New();
184 cells->Allocate(numDirs * numPts * sourceCells->GetSize());
185 output->SetPolys(cells);
186 cells->Delete();
187 }
188 if ((sourceCells = this->GetSource()->GetStrips())->GetNumberOfCells() > 0) {
189 cells = vtkCellArray::New();
190 cells->Allocate(numDirs * numPts * sourceCells->GetSize());
191 output->SetStrips(cells);
192 cells->Delete();
193 }
194
195 // only copy scalar data through
196 vtkPointData* pd = this->GetSource()->GetPointData();
197 // generate scalars if eigenvalues are chosen or if scalars exist.
198 if ((this->ColorGlyphs != 0)
199 && ((this->ColorMode == COLOR_BY_EIGENVALUES)
200 || ((inScalars != nullptr) && (this->ColorMode == COLOR_BY_SCALARS))))
201 {
202 newScalars = vtkFloatArray::New();
203 newScalars->SetNumberOfComponents(4);
204 newScalars->Allocate(numDirs * numPts * numSourcePts);
205 if (this->ColorMode == COLOR_BY_EIGENVALUES) {
206 newScalars->SetName("MaxEigenvalue");
207 }
208 else {
209 newScalars->SetName(inScalars->GetName());
210 }
211 }
212 else {
213 outPD->CopyAllOff();
214 outPD->CopyScalarsOn();
215 outPD->CopyAllocate(pd, numDirs * numPts * numSourcePts);
216 }
217 if ((sourceNormals = pd->GetNormals()) != nullptr) {
218 newNormals = vtkFloatArray::New();
219 newNormals->SetNumberOfComponents(3);
220 newNormals->SetName("Normals");
221 newNormals->Allocate(numDirs * 3 * numPts * numSourcePts);
222 }
223 //
224 // First copy all topology (transformation independent)
225 //
226 for (inPtId = 0; inPtId < numPts; inPtId++) {
227 ptIncr = numDirs * inPtId * numSourcePts;
228 for (cellId = 0; cellId < numSourceCells; cellId++) {
229 cell = this->GetSource()->GetCell(cellId);
230 cellPts = cell->GetPointIds();
231 npts = (int)cellPts->GetNumberOfIds();
232 for (dir = 0; dir < numDirs; dir++) {
233 // This variable may be removed, but that
234 // will not improve readability
235 subIncr = ptIncr + dir * numSourcePts;
236 for (i = 0; i < npts; i++) {
237 pts[i] = cellPts->GetId(i) + subIncr;
238 }
239 output->InsertNextCell(cell->GetCellType(), npts, pts);
240 }
241 }
242 }
243 //
244 // Traverse all Input points, transforming glyph at Source points
245 //
246 trans->PreMultiply();
247
248 for (inPtId = 0; inPtId < numPts; inPtId++) {
249 ptIncr = numDirs * inPtId * numSourcePts;
250
251 // Translation is postponed
252 // Symmetric tensor support
253 inTensors->GetTuple(inPtId, tensor);
254 if (inTensors->GetNumberOfComponents() == 6) {
255 vtkMath::TensorFromSymmetricTensor(tensor);
256 }
257
258 // compute orientation vectors and scale factors from tensor
259 if (this->ExtractEigenvalues != 0) // extract appropriate eigenfunctions
260 {
261 // We are interested in the symmetrical part of the tensor only, since
262 // eigenvalues are real if and only if the matrice of reals is symmetrical
263 for (j = 0; j < 3; j++) {
264 for (i = 0; i < 3; i++) {
265 m[i][j] = 0.5 * (tensor[i + 3 * j] + tensor[j + 3 * i]);
266 }
267 }
268 vtkMath::Jacobi(m, w, v);
269
270 // copy eigenvectors
271 xv[0] = v[0][0];
272 xv[1] = v[1][0];
273 xv[2] = v[2][0];
274 yv[0] = v[0][1];
275 yv[1] = v[1][1];
276 yv[2] = v[2][1];
277 zv[0] = v[0][2];
278 zv[1] = v[1][2];
279 zv[2] = v[2][2];
280 }
281 else // use tensor columns as eigenvectors
282 {
283 for (i = 0; i < 3; i++) {
284 xv[i] = tensor[i];
285 yv[i] = tensor[i + 3];
286 zv[i] = tensor[i + 6];
287 }
288 w[0] = vtkMath::Normalize(xv);
289 w[1] = vtkMath::Normalize(yv);
290 w[2] = vtkMath::Normalize(zv);
291 }
292
293 // compute scale factors
294 w[0] *= this->ScaleFactor;
295 w[1] *= this->ScaleFactor;
296 w[2] *= this->ScaleFactor;
297
298 if (this->ClampScaling != 0) {
299 for (maxScale = 0.0, i = 0; i < 3; i++) {
300 if (maxScale < fabs(w[i])) {
301 maxScale = fabs(w[i]);
302 }
303 }
304 if (maxScale > this->MaxScaleFactor) {
305 maxScale = this->MaxScaleFactor / maxScale;
306 for (i = 0; i < 3; i++) {
307 w[i] *= maxScale; // preserve overall shape of glyph
308 }
309 }
310 }
311
312 // normalization is postponed
313
314 // make sure scale is okay (non-zero) and scale data
315 for (maxScale = 0.0, i = 0; i < 3; i++) {
316 if (w[i] > maxScale) {
317 maxScale = w[i];
318 }
319 }
320 if (maxScale == 0.0) {
321 maxScale = 1.0;
322 }
323 for (i = 0; i < 3; i++) {
324 if (w[i] == 0.0) {
325 w[i] = maxScale * 1.0e-06;
326 }
327 }
328
329 // Now do the real work for each "direction"
330
331 for (dir = 0; dir < numDirs; dir++) {
332 eigen_dir = dir % (this->ThreeGlyphs != 0 ? 3 : 1);
333 symmetric_dir = dir / (this->ThreeGlyphs != 0 ? 3 : 1);
334
335 // Remove previous scales ...
336 trans->Identity();
337
338 // translate Source to Input point
339 input->GetPoint(inPtId, x);
340 trans->Translate(x[0], x[1], x[2]);
341
342 // normalized eigenvectors rotate object for eigen direction 0
343 matrix->Element[0][0] = xv[0];
344 matrix->Element[0][1] = yv[0];
345 matrix->Element[0][2] = zv[0];
346 matrix->Element[1][0] = xv[1];
347 matrix->Element[1][1] = yv[1];
348 matrix->Element[1][2] = zv[1];
349 matrix->Element[2][0] = xv[2];
350 matrix->Element[2][1] = yv[2];
351 matrix->Element[2][2] = zv[2];
352 trans->Concatenate(matrix);
353
354 if (eigen_dir == 1) {
355 trans->RotateZ(90.0);
356 }
357
358 if (eigen_dir == 2) {
359 trans->RotateY(-90.0);
360 }
361
362 if (this->ThreeGlyphs != 0) {
363 trans->Scale(w[eigen_dir], this->ScaleFactor, this->ScaleFactor);
364 }
365 else {
366 trans->Scale(w[0], w[1], w[2]);
367 }
368
369 // Mirror second set to the symmetric position
370 if (symmetric_dir == 1) {
371 trans->Scale(-1., 1., 1.);
372 }
373
374 // if the eigenvalue is negative, shift to reverse direction.
375 // The && is there to ensure that we do not change the
376 // old behaviour of vtkTensorGlyphColors (which only used one dir),
377 // in case there is an oriented glyph, e.g. an arrow.
378 if (w[eigen_dir] < 0 && numDirs > 1) {
379 trans->Translate(-this->Length, 0., 0.);
380 }
381
382 // multiply points (and normals if available) by resulting
383 // matrix
384 trans->TransformPoints(sourcePts, newPts);
385
386 // Apply the transformation to a series of points,
387 // and append the results to outPts.
388 if (newNormals != nullptr) {
389 // a negative determinant means the transform turns the
390 // glyph surface inside out, and its surface normals all
391 // point inward. The following scale corrects the surface
392 // normals to point outward.
393 if (trans->GetMatrix()->Determinant() < 0) {
394 trans->Scale(-1.0, -1.0, -1.0);
395 }
396 trans->TransformNormals(sourceNormals, newNormals);
397 }
398
399 // Copy point data from source
400 if ((this->ColorGlyphs != 0) && (inScalars != nullptr)
401 && (this->ColorMode == COLOR_BY_SCALARS))
402 {
403 for (i = 0; i < numSourcePts; i++) {
404 auto st = inScalars->GetTuple(inPtId);
405 newScalars->InsertTuple4(ptIncr + i, st[0], st[1], st[2], st[3]);
406 }
407 }
408 else if ((this->ColorGlyphs != 0) && (this->ColorMode == COLOR_BY_EIGENVALUES)) {
409 // If ThreeGlyphs is false we use the first (largest)
410 // eigenvalue as scalar.
411 s = w[eigen_dir];
412 for (i = 0; i < numSourcePts; i++) {
413 newScalars->InsertTuple(ptIncr + i, &s);
414 }
415 }
416 else {
417 for (i = 0; i < numSourcePts; i++) {
418 outPD->CopyData(pd, i, ptIncr + i);
419 }
420 }
421 ptIncr += numSourcePts;
422 }
423 }
424 vtkDebugMacro(<< "Generated " << numPts << " tensor glyphs");
425 //
426 // Update output and release memory
427 //
428 delete[] pts;
429
430 output->SetPoints(newPts);
431 newPts->Delete();
432
433 if (newScalars != nullptr) {
434 int idx = outPD->AddArray(newScalars);
435 outPD->SetActiveAttribute(idx, vtkDataSetAttributes::SCALARS);
436 newScalars->Delete();
437 }
438
439 if (newNormals != nullptr) {
440 outPD->SetNormals(newNormals);
441 newNormals->Delete();
442 }
443
444 output->Squeeze();
445 trans->Delete();
446 matrix->Delete();
447
448 return 1;
449}

◆ RequestUpdateExtent()

int vtkTensorGlyphColor::RequestUpdateExtent ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotected

Definition at line 65 of file vtkTensorGlyphColor.cxx.

68{
69 // get the info objects
70 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
71 vtkInformation* sourceInfo = inputVector[1]->GetInformationObject(0);
72 vtkInformation* outInfo = outputVector->GetInformationObject(0);
73
74 if (sourceInfo != nullptr) {
75 sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), 0);
76 sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(), 1);
77 sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(), 0);
78 }
79
80 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(),
81 outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()));
82 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
83 outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()));
84 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
85 outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
86 inInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);
87
88 return 1;
89}

◆ SetColorModeToEigenvalues()

void vtkTensorGlyphColor::SetColorModeToEigenvalues ( )
inline

Definition at line 211 of file vtkTensorGlyphColor.h.

211{ this->SetColorMode(COLOR_BY_EIGENVALUES); };

◆ SetColorModeToScalars()

void vtkTensorGlyphColor::SetColorModeToScalars ( )
inline

Definition at line 210 of file vtkTensorGlyphColor.h.

210{ this->SetColorMode(COLOR_BY_SCALARS); };

◆ SetSourceConnection() [1/2]

void vtkTensorGlyphColor::SetSourceConnection ( int id,
vtkAlgorithmOutput * algOutput )

Specify a source object at a specified table location. New style. Source connection is stored in port 1. This method is equivalent to SetInputConnection(1, id, outputPort).

Definition at line 452 of file vtkTensorGlyphColor.cxx.

453{
454 if (id < 0) {
455 vtkErrorMacro("Bad index " << id << " for source.");
456 return;
457 }
458
459 int numConnections = this->GetNumberOfInputConnections(1);
460 if (id < numConnections) {
461 this->SetNthInputConnection(1, id, algOutput);
462 }
463 else if (id == numConnections && (algOutput != nullptr)) {
464 this->AddInputConnection(1, algOutput);
465 }
466 else if (algOutput != nullptr) {
467 vtkWarningMacro(
468 "The source id provided is larger than the maximum "
469 "source id, using "
470 << numConnections << " instead.");
471 this->AddInputConnection(1, algOutput);
472 }
473}

Referenced by SetSourceConnection().

◆ SetSourceConnection() [2/2]

void vtkTensorGlyphColor::SetSourceConnection ( vtkAlgorithmOutput * algOutput)
inline

Definition at line 120 of file vtkTensorGlyphColor.h.

121 {
122 this->SetSourceConnection(0, algOutput);
123 }
void SetSourceConnection(int id, vtkAlgorithmOutput *algOutput)

◆ SetSourceData()

void vtkTensorGlyphColor::SetSourceData ( vtkPolyData * source)

Specify the geometry to copy to each point. Note that this method does not connect the pipeline. The algorithm will work on the input data as it is without updating the producer of the data. See SetSourceConnection for connecting the pipeline.

Definition at line 476 of file vtkTensorGlyphColor.cxx.

477{
478 this->SetInputData(1, source);
479}

◆ vtkBooleanMacro() [1/6]

vtkTensorGlyphColor::vtkBooleanMacro ( ClampScaling ,
vtkTypeBool  )

◆ vtkBooleanMacro() [2/6]

vtkTensorGlyphColor::vtkBooleanMacro ( ColorGlyphs ,
vtkTypeBool  )

◆ vtkBooleanMacro() [3/6]

vtkTensorGlyphColor::vtkBooleanMacro ( ExtractEigenvalues ,
vtkTypeBool  )

◆ vtkBooleanMacro() [4/6]

vtkTensorGlyphColor::vtkBooleanMacro ( Scaling ,
vtkTypeBool  )

◆ vtkBooleanMacro() [5/6]

vtkTensorGlyphColor::vtkBooleanMacro ( Symmetric ,
vtkTypeBool  )

◆ vtkBooleanMacro() [6/6]

vtkTensorGlyphColor::vtkBooleanMacro ( ThreeGlyphs ,
vtkTypeBool  )

◆ vtkGetMacro() [1/10]

vtkTensorGlyphColor::vtkGetMacro ( ClampScaling ,
vtkTypeBool  )

◆ vtkGetMacro() [2/10]

vtkTensorGlyphColor::vtkGetMacro ( ColorGlyphs ,
vtkTypeBool  )

◆ vtkGetMacro() [3/10]

vtkTensorGlyphColor::vtkGetMacro ( ColorMode ,
int  )

◆ vtkGetMacro() [4/10]

vtkTensorGlyphColor::vtkGetMacro ( ExtractEigenvalues ,
vtkTypeBool  )

◆ vtkGetMacro() [5/10]

vtkTensorGlyphColor::vtkGetMacro ( Length ,
double  )

◆ vtkGetMacro() [6/10]

vtkTensorGlyphColor::vtkGetMacro ( MaxScaleFactor ,
double  )

◆ vtkGetMacro() [7/10]

vtkTensorGlyphColor::vtkGetMacro ( ScaleFactor ,
double  )

◆ vtkGetMacro() [8/10]

vtkTensorGlyphColor::vtkGetMacro ( Scaling ,
vtkTypeBool  )

◆ vtkGetMacro() [9/10]

vtkTensorGlyphColor::vtkGetMacro ( Symmetric ,
vtkTypeBool  )

◆ vtkGetMacro() [10/10]

vtkTensorGlyphColor::vtkGetMacro ( ThreeGlyphs ,
vtkTypeBool  )

◆ vtkSetClampMacro()

vtkTensorGlyphColor::vtkSetClampMacro ( ColorMode ,
int ,
COLOR_BY_SCALARS ,
COLOR_BY_EIGENVALUES  )

Set the color mode to be used for the glyphs. This can be set to use the input scalars (default) or to use the eigenvalues at the point. If ThreeGlyphs is set and the eigenvalues are chosen for coloring then each glyph is colored by the corresponding eigenvalue and if not set the color corresponding to the largest eigenvalue is chosen. The recognized values are: COLOR_BY_SCALARS = 0 (default) COLOR_BY_EIGENVALUES = 1

◆ vtkSetMacro() [1/9]

vtkTensorGlyphColor::vtkSetMacro ( ClampScaling ,
vtkTypeBool  )

Turn on/off scalar clamping. If scalar clamping is on, the ivar MaxScaleFactor is used to control the maximum scale factor. (This is useful to prevent uncontrolled scaling near singularities.)

◆ vtkSetMacro() [2/9]

vtkTensorGlyphColor::vtkSetMacro ( ColorGlyphs ,
vtkTypeBool  )

Turn on/off coloring of glyph with input scalar data or eigenvalues. If false, or input scalar data not present, then the scalars from the source object are passed through the filter.

◆ vtkSetMacro() [3/9]

vtkTensorGlyphColor::vtkSetMacro ( ExtractEigenvalues ,
vtkTypeBool  )

Turn on/off extraction of eigenvalues from tensor.

◆ vtkSetMacro() [4/9]

vtkTensorGlyphColor::vtkSetMacro ( Length ,
double  )

Set/Get the distance, along x, from the origin to the end of the source glyph. It is used to draw the symmetric glyphs.

◆ vtkSetMacro() [5/9]

vtkTensorGlyphColor::vtkSetMacro ( MaxScaleFactor ,
double  )

Set/Get the maximum allowable scale factor. This value is compared to the combination of the scale factor times the eigenvalue. If less, the scale factor is reset to the MaxScaleFactor. The boolean ClampScaling has to be "on" for this to work.

◆ vtkSetMacro() [6/9]

vtkTensorGlyphColor::vtkSetMacro ( ScaleFactor ,
double  )

Specify scale factor to scale object by. (Scale factor always affects output even if scaling is off.)

◆ vtkSetMacro() [7/9]

vtkTensorGlyphColor::vtkSetMacro ( Scaling ,
vtkTypeBool  )

Turn on/off scaling of glyph with eigenvalues.

◆ vtkSetMacro() [8/9]

vtkTensorGlyphColor::vtkSetMacro ( Symmetric ,
vtkTypeBool  )

Turn on/off drawing a mirror of each glyph

◆ vtkSetMacro() [9/9]

vtkTensorGlyphColor::vtkSetMacro ( ThreeGlyphs ,
vtkTypeBool  )

Turn on/off drawing three glyphs

◆ vtkTypeMacro()

vtkTensorGlyphColor::vtkTypeMacro ( vtkTensorGlyphColor ,
vtkPolyDataAlgorithm  ) &

Member Data Documentation

◆ ClampScaling

vtkTypeBool vtkTensorGlyphColor::ClampScaling
protected

Definition at line 252 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ ColorGlyphs

vtkTypeBool vtkTensorGlyphColor::ColorGlyphs
protected

Definition at line 250 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ ColorMode

int vtkTensorGlyphColor::ColorMode
protected

Definition at line 251 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ ExtractEigenvalues

vtkTypeBool vtkTensorGlyphColor::ExtractEigenvalues
protected

Definition at line 249 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ Length

double vtkTensorGlyphColor::Length
protected

Definition at line 256 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ MaxScaleFactor

double vtkTensorGlyphColor::MaxScaleFactor
protected

Definition at line 253 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ override

vtkIndent indent vtkTensorGlyphColor::override

Definition at line 93 of file vtkTensorGlyphColor.h.

◆ ScaleFactor

double vtkTensorGlyphColor::ScaleFactor
protected

Definition at line 248 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ Scaling

vtkTypeBool vtkTensorGlyphColor::Scaling
protected

Definition at line 247 of file vtkTensorGlyphColor.h.

Referenced by vtkStandardNewMacro().

◆ Symmetric

vtkTypeBool vtkTensorGlyphColor::Symmetric
protected

Definition at line 255 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().

◆ ThreeGlyphs

vtkTypeBool vtkTensorGlyphColor::ThreeGlyphs
protected

Definition at line 254 of file vtkTensorGlyphColor.h.

Referenced by RequestData(), and vtkStandardNewMacro().


The documentation for this class was generated from the following files: