Developer documentation | Axl-2.5.1

axlActorFieldSpatial.cpp
Go to the documentation of this file.
1 /* axlActorFieldSpatial.cpp ---
2  *
3  * Author: Anais Ducoffe
4  * Copyright (C) 20013- Anais Ducoffe, Inria.
5  */
6 
7 /* Commentary:
8  *
9  */
10 
11 /* Change log:
12  *
13  */
14 
16 #include "axlActorFieldSpatial.h"
17 #include "axlActor.h"
18 #include "axlActorDataDynamic.h"
19 //#include "axlActorCone.h"
20 //#include <axlCore/axlCone.h>
21 //#include <axlCore/axlPoint.h>
22 #include <vtkConeSource.h>
24 #include <axlCore/axlMesh.h>
25 
28 
29 #include <dtkCoreSupport/dtkGlobal.h>
30 
31 #include <vtkActor.h>
32 #include <vtkArrowSource.h>
33 #include <vtkCommand.h>
34 #include <vtkContourFilter.h>
35 #include <vtkDataSetMapper.h>
36 #include <vtkCellData.h>
37 #include <vtkGlyph3D.h>
38 #include <vtkHedgeHog.h>
39 #include <vtkObjectFactory.h>
40 #include <vtkPointData.h>
41 #include <vtkPolyDataMapper.h>
42 #include <vtkRenderWindowInteractor.h>
43 #include <vtkSmartPointer.h>
44 #include <vtkSphere.h>
45 #include <vtkSphereRepresentation.h>
46 #include <vtkSphereSource.h>
47 #include <vtkSphereWidget2.h>
48 #include <vtkStreamTracer.h>
49 #include <vtkTubeFilter.h>
50 #include <vtkPolyData.h>
51 #include <vtkUnstructuredGrid.h>
52 
53 #include <vtkExtractUnstructuredGrid.h>
54 
55 #include <vtkIntArray.h>
56 #include <vtkFloatArray.h>
57 #include <vtkDoubleArray.h>
58 #include <vtkDataArray.h>
59 
61 
62 // /////////////////////////////////////////////////////////////////
63 // axlActorFieldSpatialStreamObserver
64 // /////////////////////////////////////////////////////////////////
65 
66 class axlActorFieldSpatialStreamObserver : public vtkCommand
67 {
68 public:
70  {
72  }
73 
74  virtual void Execute(vtkObject *caller, unsigned long event, void *)
75  {
76 // if(event == vtkCommand::InteractionEvent) {
77 
78 // vector_stream_widget_representation->GetPolyData(vector_stream_widget_data);
79 //#if (VTK_MAJOR_VERSION <= 5)
80 // vector_stream_tracer->SetSource(vector_stream_widget_data);
81 //#else
82 // vector_stream_tracer->SetSourceData(vector_stream_widget_data);
83 //#endif
84 // vector_stream_tracer->Update();
85 // }
86  }
87 
88  vtkSmartPointer<vtkSphereRepresentation> vector_stream_widget_representation;
89  vtkSmartPointer<vtkPolyData> vector_stream_widget_data;
90  vtkSmartPointer<vtkStreamTracer> vector_stream_tracer;
91 };
92 
93 // /////////////////////////////////////////////////////////////////
94 // axlActorFieldSpatialPrivate
95 // /////////////////////////////////////////////////////////////////
96 
97 class axlActorFieldSpatialPrivate
98 {
99 public:
101  axlActor *mesh;
102  vtkDataArray *array;
103  //vtkSmartPointer<vtkPolyData> polyDataForSources;
104 
105 public:
106  bool scalar_display_as_iso;
107  int scalar_iso_count;
108  double scalar_iso_range[2];
109  vtkSmartPointer<vtkTubeFilter> scalar_iso_tube_filter;
110  double isoRadius;
111  vtkSmartPointer<vtkContourFilter> scalar_iso;
112  vtkSmartPointer<vtkPolyDataMapper> scalar_iso_mapper;
113  vtkSmartPointer<vtkActor> scalar_iso_actor;
114 
115  vtkSmartPointer<vtkPolyDataMapper> scalar_iso_color_mapper;
116  vtkSmartPointer<vtkActor> scalar_iso_color_actor;
117 
118  double scalar_color_range[2];
119  vtkSmartPointer<vtkDataSetMapper> scalar_color_mapper;
120  vtkSmartPointer<vtkActor> scalar_color_actor;
121 
122  vtkSmartPointer<vtkScalarBarActor> scalar_bar_actor;
123 
124  vtkSmartPointer<vtkHedgeHog> vector_hedgehog;
125  vtkSmartPointer<vtkPolyDataMapper> vector_hedgehog_mapper;
126  vtkSmartPointer<vtkActor> vector_hedgehog_actor;
127 
128  vtkSmartPointer<vtkArrowSource> vector_glyph_source;
129  vtkSmartPointer<vtkGlyph3D> vector_glyph;
130  vtkSmartPointer<vtkPolyDataMapper> vector_glyph_mapper;
131  vtkSmartPointer<vtkActor> vector_glyph_actor;
132 
133  vtkSmartPointer<vtkSphereWidget2> vector_stream_widget;
134  vtkSmartPointer<vtkSphereRepresentation> vector_stream_widget_representation;
135  vtkSmartPointer<vtkPolyData> vector_stream_widget_data;
136  vtkSmartPointer<vtkStreamTracer> vector_stream_tracer;
137  vtkSmartPointer<vtkTubeFilter> vector_stream_filter;
138  vtkSmartPointer<vtkPolyDataMapper> vector_stream_mapper;
139  vtkSmartPointer<vtkActor> vector_stream_actor;
140  vtkSmartPointer<axlActorFieldSpatialStreamObserver> vector_stream_observer;
141 
142  vtkSmartPointer<vtkRenderWindowInteractor> interactor;
143 };
144 
145 // /////////////////////////////////////////////////////////////////
146 // axlActorFieldSpatial
147 // /////////////////////////////////////////////////////////////////
148 
149 #if (VTK_MAJOR_VERSION <= 5)
150 vtkCxxRevisionMacro(axlActorFieldSpatial, "$Revision: 0.0.1 $");
151 #endif
152 
154 
155 dtkAbstractData *axlActorFieldSpatial::data(void)
156 {
157  return NULL;
158 }
159 
161 {
162  if(d->field){
163  return d->field;
164  }
165  return nullptr;
166 }
167 
169 {
170  if(d->mesh->fields().contains(QString("%1 magnitude").arg(d->field->objectName())))
171  return NULL;
172 
173  QString field_magnitude_name = QString("%1 magnitude").arg(d->field->objectName());
174 
175  double size = 0;// represents the number of vertices in the mesh of the parent's field;
176  if(d->mesh->getUnstructuredGrid())
177  size = d->mesh->getUnstructuredGrid()->GetNumberOfPoints();
178  else
179  size = d->mesh->getPolyData()->GetNumberOfPoints();
180  double *tuple;
181  axlFieldDiscrete *field_magnitude = new axlFieldDiscrete(field_magnitude_name, d->field->type(), axlFieldDiscrete::Scalar, d->field->support(), size);
182 
183  for(int i = 0; i < size; i++){
184  if(d->mesh->getUnstructuredGrid())
185  tuple = d->field->vector(d->mesh->getUnstructuredGrid()->GetPoint(i)[0], d->mesh->getUnstructuredGrid()->GetPoint(i)[1], d->mesh->getUnstructuredGrid()->GetPoint(i)[2]);
186  else
187  tuple = d->field->vector(d->mesh->getPolyData()->GetPoint(i)[0], d->mesh->getPolyData()->GetPoint(i)[1], d->mesh->getPolyData()->GetPoint(i)[2]);
188  field_magnitude->setScalar(i, qSqrt(tuple[0]*tuple[0]+tuple[0]*tuple[0]+tuple[0]*tuple[0]));
189  }
190  return field_magnitude;
191 }
192 
193 
194 
196 {
197  return d->mesh;
198 }
199 
200 vtkScalarBarActor *axlActorFieldSpatial::scalarBar(void){
201  return d->scalar_bar_actor;
202 }
203 
205 {
206  return d->scalar_color_range[0];
207 }
208 
210 {
211  return d->scalar_color_range[1];
212 }
213 
215 {
216  return d->scalar_iso->GetNumberOfContours();
217 }
218 
220 {
221  return d->scalar_iso_range[0];
222 }
223 
225 {
226  return d->scalar_iso_range[1];
227 }
228 
230 {
231  return d->vector_glyph->GetScaleFactor();
232 }
233 
235 {
236  return d->vector_stream_filter->GetRadius();
237 }
238 
240 {
241  d->interactor = static_cast<vtkRenderWindowInteractor *>(interactor);
242 
243  this->setup();
244 }
245 
246 
248 
249 
250  if(d->field){
251  int size = 0;
252  if(d->mesh->getUnstructuredGrid()){
253  size = d->mesh->getUnstructuredGrid()->GetNumberOfPoints();
254  }else if(d->mesh->getPolyData()){
255  size = d->mesh->getPolyData()->GetNumberOfPoints();
256  }else{
257  if(dynamic_cast<axlActorDataDynamic *>(d->mesh)){
258  axlActorDataDynamic *actorDD = dynamic_cast<axlActorDataDynamic *>(d->mesh);
259  size = dynamic_cast<axlActor *>(actorDD->outputActor())->getMapper()->GetInput()->GetNumberOfPoints();
260  d->mesh->setPolyData(dynamic_cast<axlActor *>(actorDD->outputActor())->getMapper()->GetInput());
261  //d->mesh->setPoints(d->mesh->getPolyData()->GetPoints());
262  }else{
263  size = d->mesh->getMapper()->GetInput()->GetNumberOfPoints();
264  d->mesh->setPolyData(d->mesh->getMapper()->GetInput());
265  //d->mesh->setPoints(d->mesh->getPolyData()->GetPoints());
266  }
267 
268  }
269 
270  d->array->SetNumberOfTuples(size);
271 
272 
273  double *tuple1 = NULL;
274  double tuple2 = 0;
275  for(int i = 0; i < size; i++){
276  if(d->field->kind() == axlAbstractFieldSpatial::Scalar){
277 
278  if(d->mesh->getUnstructuredGrid())
279  tuple2 = d->field->scalar(d->mesh->getUnstructuredGrid()->GetPoint(i)[0], d->mesh->getUnstructuredGrid()->GetPoint(i)[1], d->mesh->getUnstructuredGrid()->GetPoint(i)[2]);
280  else{
281  tuple2 = d->field->scalar(d->mesh->getPolyData()->GetPoint(i)[0], d->mesh->getPolyData()->GetPoint(i)[1], d->mesh->getPolyData()->GetPoint(i)[2]);
282  }
283  d->array->SetTuple1(i, tuple2);
284  d->array->Modified();
285  }
286  else if(d->field->kind() == axlAbstractFieldSpatial::Vector){
287 
288  if(d->mesh->getUnstructuredGrid())
289  tuple1 = d->field->vector(d->mesh->getUnstructuredGrid()->GetPoint(i)[0], d->mesh->getUnstructuredGrid()->GetPoint(i)[1], d->mesh->getUnstructuredGrid()->GetPoint(i)[2]);
290  else
291  tuple1 = d->field->vector(d->mesh->getPolyData()->GetPoint(i)[0], d->mesh->getPolyData()->GetPoint(i)[1], d->mesh->getPolyData()->GetPoint(i)[2]);
292  d->array->SetTuple(i, tuple1);
293  d->array->Modified();
294  }
295  else if(d->field->kind() == axlAbstractFieldSpatial::Tensor){
296 
297  if(d->mesh->getUnstructuredGrid())
298  tuple1 = d->field->tensor(d->mesh->getUnstructuredGrid()->GetPoint(i)[0], d->mesh->getUnstructuredGrid()->GetPoint(i)[1], d->mesh->getUnstructuredGrid()->GetPoint(i)[2]);
299  else
300  tuple1 = d->field->tensor(d->mesh->getPolyData()->GetPoint(i)[0], d->mesh->getPolyData()->GetPoint(i)[1], d->mesh->getPolyData()->GetPoint(i)[2]);
301  d->array->SetTuple(i, tuple1);
302  d->array->Modified();
303  }
304 
305  }
306  }
307 
308 
309  //sets the minimum and maximum values of the field.
310  d->field->setMin(this->minValue());
311  d->field->setMax(this->maxValue());
312 
313  //setRange
314  if(d->scalar_color_range && d->scalar_color_mapper){
315  this->setColRangeMin(d->field->minValue());
316  this->setColRangeMax(d->field->maxValue());
317  }
318 
319 }
320 
321 void axlActorFieldSpatial::setData(dtkAbstractData *field)
322 {
323  d->field = dynamic_cast<axlAbstractFieldSpatial *>(field);
324 
325  if(d->field){
326  axlAbstractData * parentData = dynamic_cast<axlAbstractData *>(d->field->parent());
327  if(parentData){
328  connect(parentData, SIGNAL(modifiedGeometry()), this, SLOT(update()));
329  }
330  axlAbstractData *axlData = dynamic_cast<axlAbstractData *>(d->mesh->data());
331  connect(axlData, SIGNAL(modifiedGeometry()), this, SLOT(update()));
332 
333 
334  if(d->field->type() == axlAbstractFieldSpatial::Int)
335  d->array = vtkIntArray::New();
336  else if(d->field->type() == axlAbstractFieldSpatial::Float)
337  d->array = vtkFloatArray::New();
338  else if(d->field->type() == axlAbstractFieldSpatial::Double)
339  d->array = vtkDoubleArray::New();
340 
341  axlAbstractFieldSpatial::Kind kind = d->field->kind();
342 
343  switch(kind) {
345  d->array->SetNumberOfComponents(1);
346  break;
348  d->array->SetNumberOfComponents(3);
349  break;
351  d->array->SetNumberOfComponents(9);
352  break;
353  default:
354  qDebug() << "Unsupported field kind";
355  };
356 
357  QString name = d->field->objectName();
358  d->array->SetName(qPrintable(name));
359 
360 
361 
362  this->updateArray();
363  this->setup();
364  }
365 }
366 
368 {
369  d->mesh = dynamic_cast<axlActor *>(actorfield);
370 
371  this->setup();
372 }
373 
375 {
376  d->scalar_color_range[0] = min;
377  d->scalar_color_mapper->SetScalarRange(d->scalar_color_range);
378  d->scalar_color_mapper->Update();
379 }
380 
382 {
383  d->scalar_color_range[1] = max;
384  d->scalar_color_mapper->SetScalarRange(d->scalar_color_range);
385  d->scalar_color_mapper->Update();
386 }
387 
389 {
390  d->scalar_iso_count = count;
391  d->scalar_iso->GenerateValues(d->scalar_iso_count, d->scalar_iso_range[0], d->scalar_iso_range[1]);
392  d->scalar_iso->Update();
393 
394  d->scalar_iso_tube_filter->Update();
395 }
396 
398 {
399  d->scalar_iso_range[0] = min;
400  d->scalar_iso->GenerateValues(d->scalar_iso_count, d->scalar_iso_range[0], d->scalar_iso_range[1]);
401  d->scalar_iso->Update();
402  d->scalar_iso_color_mapper->SetScalarRange(d->scalar_iso_range);
403  d->scalar_iso_color_mapper->Update();
404 
405  d->scalar_iso_tube_filter->Update();
406 }
407 
409 {
410  d->scalar_iso_range[1] = max;
411  d->scalar_iso->GenerateValues(d->scalar_iso_count, d->scalar_iso_range[0], d->scalar_iso_range[1]);
412  d->scalar_iso->Update();
413  d->scalar_iso_color_mapper->SetScalarRange(d->scalar_iso_range);
414  d->scalar_iso_color_mapper->Update();
415 
416  d->scalar_iso_tube_filter->Update();
417 }
418 
420 {
421  //compute size of controlPoints
422  double bounds[6]; d->mesh->GetBounds(bounds);
423  double side = qAbs(bounds[1]-bounds[0]);
424  side += qAbs(bounds[3]-bounds[2]);
425  side += qAbs(bounds[5]-bounds[4]);
426 
427  side /= 30;
428  //d->vector_glyph_source->SetShaftRadius(scale * side);
429  //d->vector_glyph_source->SetTipLength(200 *3 * 3.5 * scale * side);
430  //d->vector_glyph_source->SetTipRadius(3 * scale * side);
431  d->vector_glyph->SetScaleFactor(scale * side);
432  d->vector_hedgehog->SetScaleFactor(scale * side * 0.1);
433 }
434 
436 {
437  d->vector_stream_tracer->SetMaximumPropagation(propagation);
438  d->vector_stream_tracer->Update();
439 }
440 
442 {
443  d->vector_stream_filter->SetRadius(radius);
444  d->vector_stream_filter->Update();
445 }
446 
448 {
449  switch (direction) {
450  case 0:
451  d->vector_stream_tracer->SetIntegrationDirectionToForward();
452  break;
453  case 1:
454  d->vector_stream_tracer->SetIntegrationDirectionToBackward();
455  break;
456  case 2:
457  d->vector_stream_tracer->SetIntegrationDirectionToBoth();
458  break;
459  default:
460  break;
461  }
462 
463  d->vector_stream_tracer->Update();
464 }
465 
467 {
468  if(d->mesh->getUnstructuredGrid()){
469  d->mesh->getDataSetMapper()->ScalarVisibilityOn();
470  }else{
471  d->mesh->getMapper()->ScalarVisibilityOn();
472  }
473 
474  if (d->field->kind() != axlAbstractFieldSpatial::Scalar)
475  return;
476 
477  if(d->field->support() == axlAbstractFieldSpatial::Point) {
478  if(d->mesh->getUnstructuredGrid()){
479  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
480  }else{
481  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
482  }
483  }
484  if(d->field->support() == axlAbstractFieldSpatial::Cell){
485  if(d->mesh->getUnstructuredGrid()){
486  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->SetActiveScalars(qPrintable(d->field->objectName()));
487  }else{
488  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveScalars(qPrintable(d->field->objectName()));
489  }
490  }
491 
492 
493  d->scalar_color_actor->SetVisibility(1);
494  d->scalar_iso_actor->SetVisibility(0);
495  d->scalar_iso_color_actor->SetVisibility(0);
496  d->scalar_display_as_iso = false;
497  d->scalar_bar_actor->SetVisibility(1);
498 
499 }
500 
502 {
503  if(d->scalar_color_actor)
504  {
505  d->scalar_color_actor->SetVisibility(0);
506  d->scalar_iso_actor->SetVisibility(0);
507  d->scalar_iso_color_actor->SetVisibility(0);
508  d->scalar_display_as_iso = false;
509  d->scalar_bar_actor->SetVisibility(0);
510  }
511 
512  if(d->mesh->getUnstructuredGrid()){
513  d->mesh->getDataSetMapper()->ScalarVisibilityOn();
514  }
515  else{
516  d->mesh->getMapper()->ScalarVisibilityOn();
517  }
518 
519  if(d->field->support() == axlAbstractFieldSpatial::Point) {
520  if(d->mesh->getUnstructuredGrid()){
521  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars("mapperCollorArrayDefaultField");
522  } else{
523  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars("mapperCollorArrayDefaultField");
524  }
525  }
526 }
527 
529 {
530  if (d->field->kind() != axlAbstractFieldSpatial::Scalar)
531  return;
532 
533  if(d->field->support() == axlAbstractFieldSpatial::Point) {
534  if(d->mesh->getUnstructuredGrid()){
535  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
536  }
537  else{
538  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
539  }
540  }
541 
542  if(d->field->support() == axlAbstractFieldSpatial::Cell) {
543  if(d->mesh->getUnstructuredGrid()){
544  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->SetActiveScalars(qPrintable(d->field->objectName()));
545  }
546  else{
547  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveScalars(qPrintable(d->field->objectName()));
548  }
549  }
550 
551  if(d->field->support() == axlAbstractFieldSpatial::Point) {
552  if(d->mesh->getUnstructuredGrid()){
553  d->mesh->getDataSetMapper()->ScalarVisibilityOff();
554  }
555  else{
556  d->mesh->getMapper()->ScalarVisibilityOff();
557  }
558  }
559 
560  this->setIsoCount(d->scalar_iso_count);
561 
562  d->scalar_color_actor->SetVisibility(0);
563  d->scalar_iso_actor->SetVisibility(1);
564  d->scalar_iso_color_actor->SetVisibility(0);
565  d->scalar_display_as_iso = true;
566  d->scalar_bar_actor->SetVisibility(0);
567 }
568 
570 {
571  if (d->field->kind() == axlAbstractFieldSpatial::Vector ) {
572 
573  d->vector_hedgehog_actor->SetVisibility(0);
574  d->vector_glyph_actor->SetVisibility(0);
575  d->vector_stream_actor->SetVisibility(0);
576  d->vector_stream_widget->Off();
577  }
578 }
579 
581 {
582  if (d->field->kind() == axlAbstractFieldSpatial::Vector ) {
583 
584  d->vector_hedgehog_actor->SetVisibility(1);
585  d->vector_glyph_actor->SetVisibility(0);
586  d->vector_stream_actor->SetVisibility(0);
587  d->vector_stream_widget->Off();
588  }
589 }
590 
592 {
593  if (d->field->kind() == axlAbstractFieldSpatial::Vector) {
594 
595  d->vector_hedgehog_actor->SetVisibility(0);
596  d->vector_glyph_actor->SetVisibility(1);
597  d->vector_stream_actor->SetVisibility(0);
598  d->vector_stream_widget->Off();
599  }
600 }
601 
603 {
604  if (d->field->kind() == axlAbstractFieldSpatial::Vector) {
605 
606  d->vector_hedgehog_actor->SetVisibility(0);
607  d->vector_glyph_actor->SetVisibility(0);
608  d->vector_stream_actor->SetVisibility(1);
609  d->vector_stream_widget->On();
610  }
611 }
612 
614 
616 {
617  if(!d->mesh)
618  return;
619 
620  if(d->mesh->getUnstructuredGrid()){
621  d->mesh->getUnstructuredGrid()->Modified();
622 #if (VTK_MAJOR_VERSION <= 5)
623  d->mesh->getUnstructuredGrid()->Update();
624 #endif
625  }else{
626  d->mesh->getPolyData()->Modified();
627 #if (VTK_MAJOR_VERSION <= 5)
628  d->mesh->getPolyData()->Update();
629 #endif
630  }
631 
632  if(!d->field )
633  return;
634 
635  //update the value of the field.
636  this->updateArray();
637 
638  if(d->field->support() == axlAbstractFieldSpatial::Point) {
639  if(d->mesh->getUnstructuredGrid()){
640  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->RemoveArray(d->array->GetName());
641  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->AddArray(d->array);
642  }else{
643  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->RemoveArray(d->array->GetName());
644  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->AddArray(d->array);
645  }
646  if(d->field->kind() == axlAbstractFieldSpatial::Scalar){
647  //update field vtkActor(s)
648  d->scalar_iso_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
649  d->scalar_iso_actor->SetPosition(d->mesh->getActor()->GetPosition());
650  d->scalar_iso_color_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
651  d->scalar_iso_color_actor->SetPosition(d->mesh->getActor()->GetPosition());
652  d->scalar_color_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
653  d->scalar_color_actor->SetPosition(d->mesh->getActor()->GetPosition());
654 
655 
656  if(d->mesh->getUnstructuredGrid()){
657  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars(d->array->GetName());
658  }else{
659  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(d->array->GetName());
660  }
661  }else if (d->field->kind() == axlAbstractFieldSpatial::Vector){
662  //update field vtkActor(s)
663  d->vector_glyph_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
664  d->vector_glyph_actor->SetPosition(d->mesh->getActor()->GetPosition());
665  d->vector_hedgehog_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
666  d->vector_hedgehog_actor->SetPosition(d->mesh->getActor()->GetPosition());
667  d->vector_stream_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
668  d->vector_stream_actor->SetPosition(d->mesh->getActor()->GetPosition());
669 
670 
671  if(d->mesh->getUnstructuredGrid()){
672  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveVectors(d->array->GetName());
673  }else{
674  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveVectors(d->array->GetName());
675  }
676  }else if (d->field->kind() == axlAbstractFieldSpatial::Tensor){
677 
678  if(d->mesh->getUnstructuredGrid()){
679  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveTensors(d->array->GetName());
680  }else{
681  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveTensors(d->array->GetName());
682  }
683  }
684 
685  }
686 
687 
688 
689  if(d->field->support() == axlAbstractFieldSpatial::Cell) {
690  if(d->mesh->getPolyData()){
691  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->RemoveArray(d->array->GetName());
692  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->AddArray(d->array);
693  }else{
694  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->RemoveArray(d->array->GetName());
695  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->AddArray(d->array);
696  }
697  if(d->field->kind() == axlAbstractFieldSpatial::Scalar){
698  if(d->mesh->getPolyData())
699  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveScalars(d->array->GetName());
700  else
701  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->SetActiveScalars(d->array->GetName());
702  }else if (d->field->kind() == axlAbstractFieldSpatial::Vector){
703  if(d->mesh)
704  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveVectors(d->array->GetName());
705  else
706  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->SetActiveVectors(d->array->GetName());
707  }else if (d->field->kind() == axlAbstractFieldSpatial::Tensor){
708  if( d->mesh->getPolyData())
709  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveTensors(d->array->GetName());
710  else
711  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetCellData()->SetActiveTensors(d->array->GetName());
712  }
713 
714 
715  }
716 
717 }
718 
720 {
721  if(d->mesh && d->field)
722  if(d->field->support() == axlAbstractFieldSpatial::Point) {
723  if(d->field->kind() == axlAbstractFieldSpatial::Scalar)
724  if(d->mesh->getUnstructuredGrid()){
725  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
726  }else{
727  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(qPrintable(d->field->objectName()));
728  }
729  else if(d->field->kind() == axlAbstractFieldSpatial::Vector){
730  if(d->mesh->getUnstructuredGrid()){
731  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveVectors(qPrintable(d->field->objectName()));
732  }else{
733  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveVectors(qPrintable(d->field->objectName()));
734  }
735  }else if(d->field->kind() == axlAbstractFieldSpatial::Tensor){
736  if(d->mesh->getUnstructuredGrid()){
737  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveTensors(qPrintable(d->field->objectName()));
738  }else{
739  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveTensors(qPrintable(d->field->objectName()));
740  }
741  }
742  }
743 
744 
745  if(d->mesh && d->field)
746  if(d->field->support() == axlAbstractFieldSpatial::Cell) {
747  if(d->field->kind() == axlAbstractFieldSpatial::Scalar)
748  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveScalars(qPrintable(d->field->objectName()));
749  else if(d->field->kind() == axlAbstractFieldSpatial::Vector)
750  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveVectors(qPrintable(d->field->objectName()));
751  else if(d->field->kind() == axlAbstractFieldSpatial::Tensor)
752  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveTensors(qPrintable(d->field->objectName()));
753  }
754 
755 }
756 
758 {
759  return d->scalar_color_mapper;
760 }
761 
762 axlActorFieldSpatial::axlActorFieldSpatial(void) : axlAbstractActorField(), d(new axlActorFieldSpatialPrivate)
763 {
764  d->field = NULL;
765  d->mesh = NULL;
766  d->isoRadius = 0.01;
767  d->array = NULL;
768 }
769 
771 {
772  delete d;
773 
774  d = NULL;
775 }
776 
778 {
779 
780  if(!d->mesh)
781  return;
782 
783  if(!d->field) {
784  qDebug() << DTK_PRETTY_FUNCTION << "No field.";
785  return;
786  }
787 
788 
789  if(!d->interactor)
790  return;
791 
792  // -- Scalar field
793 
794  if(d->field->kind() == axlAbstractFieldSpatial::Scalar) {
795 
796  if(d->scalar_color_mapper && d->scalar_color_actor && d->scalar_iso_color_actor)
797  return;
798 
799  if(d->field->support() == axlAbstractFieldSpatial::Point) {
800  //remove first eventual array of the same name
801  if(d->mesh->getPolyData()){
802  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->RemoveArray(d->array->GetName());
803  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->AddArray(d->array);
804  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(d->array->GetName());
805  }
806  if(d->mesh->getUnstructuredGrid()){
807  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->RemoveArray(d->array->GetName());
808  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->AddArray(d->array);
809  static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid())->GetPointData()->SetActiveScalars(d->array->GetName());
810  }
811  }
812 
813  if(d->field->support() == axlAbstractFieldSpatial::Cell) {
814 
815  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->RemoveArray(d->array->GetName());
816  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->AddArray(d->array);
817  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveScalars(d->array->GetName());
818 
819  }
820 
821  // -- iso contours
822 
823  d->scalar_display_as_iso = false;
824  d->scalar_iso_count = 10;
825  d->array->GetRange(d->scalar_iso_range);
826 
827  d->scalar_iso = vtkSmartPointer<vtkContourFilter>::New();
828  if(d->mesh->getUnstructuredGrid()){
829 #if (VTK_MAJOR_VERSION <= 5)
830  d->scalar_iso->SetInput(static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid()));
831 #else
832  d->scalar_iso->SetInputData(static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid()));
833 #endif
834  }else{
835 #if (VTK_MAJOR_VERSION <= 5)
836  d->scalar_iso->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
837 #else
838  d->scalar_iso->SetInputData(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
839 #endif
840  }
841  d->scalar_iso->GenerateValues(d->scalar_iso_count, d->scalar_iso_range[0], d->scalar_iso_range[1]);
842 
843  d->scalar_iso_tube_filter = vtkSmartPointer<vtkTubeFilter>::New();
844  d->scalar_iso_tube_filter->SetRadius(d->isoRadius);
845  d->scalar_iso_tube_filter->SetNumberOfSides(8);
846 #if (VTK_MAJOR_VERSION <= 5)
847  d->scalar_iso_tube_filter->SetInput(d->scalar_iso->GetOutput());
848 #else
849  d->scalar_iso_tube_filter->SetInputData(d->scalar_iso->GetOutput());
850 #endif
851  d->scalar_iso_mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
852 #if (VTK_MAJOR_VERSION <= 5)
853  d->scalar_iso_mapper->SetInput(d->scalar_iso_tube_filter->GetOutput());
854 #else
855  d->scalar_iso_mapper->SetInputData(d->scalar_iso_tube_filter->GetOutput());
856 #endif
857 
858  d->scalar_iso_actor = vtkSmartPointer<vtkActor>::New();
859  d->scalar_iso_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
860  d->scalar_iso_actor->SetPosition(d->mesh->getActor()->GetPosition());
861  d->scalar_iso_actor->SetMapper(d->scalar_iso_mapper);
862  d->scalar_iso_actor->SetVisibility(0);
863 
864  this->AddPart(d->scalar_iso_actor);
865 
866  // -- iso color mapping
867 
868  d->scalar_iso_color_mapper = vtkPolyDataMapper::New();
869 #if (VTK_MAJOR_VERSION <= 5)
870  d->scalar_iso_color_mapper->SetInput(d->scalar_iso->GetOutput());
871 #else
872  d->scalar_iso_color_mapper->SetInputData(d->scalar_iso->GetOutput());
873 #endif
874  d->scalar_iso_color_mapper->SetColorModeToMapScalars();
875 
876  if(d->field->support() == axlAbstractFieldSpatial::Point)
877  d->scalar_iso_color_mapper->SetScalarModeToUsePointData();
878 
879  if(d->field->support() == axlAbstractFieldSpatial::Cell)
880  d->scalar_iso_color_mapper->SetScalarModeToUseCellData();
881 
882  d->scalar_iso_color_mapper->SelectColorArray(d->array->GetName());
883  d->scalar_iso_color_mapper->SetScalarVisibility(true);
884  d->scalar_iso_color_mapper->SetScalarRange(d->scalar_iso_range);
885 
886  d->scalar_iso_color_actor = vtkSmartPointer<vtkActor>::New();
887  d->scalar_iso_color_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
888  d->scalar_iso_color_actor->SetPosition(d->mesh->getActor()->GetPosition());
889  d->scalar_iso_color_actor->SetMapper(d->scalar_iso_color_mapper);
890  d->scalar_iso_color_actor->SetVisibility(0);
891 
892  this->AddPart(d->scalar_iso_color_actor);
893 
894  // -- color mapping
895 
896  d->array->GetRange(d->scalar_color_range);
897 
898  d->scalar_color_mapper = vtkDataSetMapper::New();
899 #if (VTK_MAJOR_VERSION <= 5)
900  if(d->mesh->getUnstructuredGrid())
901  d->scalar_color_mapper->SetInput(static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid()));
902  else
903  d->scalar_color_mapper->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
904 #else
905  if(d->mesh->getUnstructuredGrid())
906  d->scalar_color_mapper->SetInputData(static_cast<vtkUnstructuredGrid *>(d->mesh->getUnstructuredGrid()));
907  else
908  d->scalar_color_mapper->SetInputData(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
909 #endif
910 
911  d->scalar_color_mapper->SetColorModeToMapScalars();
912 
913  if(d->field->support() == axlAbstractFieldSpatial::Point)
914  d->scalar_color_mapper->SetScalarModeToUsePointData();
915 
916  if(d->field->support() == axlAbstractFieldSpatial::Cell)
917  d->scalar_color_mapper->SetScalarModeToUseCellData();
918 
919  d->scalar_color_mapper->SelectColorArray(d->array->GetName());
920  d->scalar_color_mapper->SetScalarVisibility(true);
921  d->scalar_color_mapper->SetScalarRange(d->scalar_color_range);
922 
923  d->scalar_color_actor = vtkSmartPointer<vtkActor>::New();
924  d->scalar_color_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
925  d->scalar_color_actor->SetPosition(d->mesh->getActor()->GetPosition());
926  d->scalar_color_actor->SetMapper(d->scalar_color_mapper);
927  d->scalar_color_actor->SetVisibility(0);
928 
929 
930  this->AddPart(d->scalar_color_actor);
931 
933  d->scalar_bar_actor = vtkSmartPointer<vtkScalarBarActor>::New();
934  d->scalar_bar_actor ->SetLookupTable(d->scalar_color_mapper->GetLookupTable());
935  d->scalar_bar_actor ->SetTitle(qPrintable(d->field->name()));
936  d->scalar_bar_actor ->SetNumberOfLabels(4);
937  d->scalar_bar_actor->SetVisibility(0);
938 
939  }
940 
941  // -- Vector field
942 
943 
944  if(d->field->kind() == axlAbstractFieldSpatial::Vector) {
945 
946  // -- Append field and its magnitude into vtkPolyData
947 
948  if(d->field->support() == axlAbstractFieldSpatial::Point) {
949 
950  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->RemoveArray(d->array->GetName());
951  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->AddArray(d->array);
952  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->SetActiveVectors(d->array->GetName());
953 
954  }
955 
956  if(d->field->support() == axlAbstractFieldSpatial::Cell) {
957  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetPointData()->RemoveArray(d->array->GetName());
958  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->AddArray(d->array);
959  static_cast<vtkPolyData *>(d->mesh->getPolyData())->GetCellData()->SetActiveVectors(d->array->GetName());
960 
961 
962  }
963 
964  // -- hedgehog
965 
966  d->vector_hedgehog = vtkSmartPointer<vtkHedgeHog>::New();
967 #if (VTK_MAJOR_VERSION <= 5)
968  d->vector_hedgehog->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
969 #else
970  d->vector_hedgehog->SetInputData(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
971 #endif
972  d->vector_hedgehog->SetVectorModeToUseVector();
973  //d->vector_hedgehog->SetScaleFactor(0.05);
974 
975  d->vector_hedgehog_mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
976  d->vector_hedgehog_mapper->SetInputConnection(d->vector_hedgehog->GetOutputPort());
977  d->vector_hedgehog_mapper->ScalarVisibilityOn();
978 
979  d->vector_hedgehog_actor = vtkSmartPointer<vtkActor>::New();
980  d->vector_hedgehog_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
981  d->vector_hedgehog_actor->SetPosition(d->mesh->getActor()->GetPosition());
982  d->vector_hedgehog_actor->SetMapper(d->vector_hedgehog_mapper);
983  d->vector_hedgehog_actor->SetVisibility(0);
984 
985 
986  this->AddPart(d->vector_hedgehog_actor);
987 
988  // -- glyphs
989 
990  d->vector_glyph_source = vtkArrowSource::New();
991 
992  d->vector_glyph = vtkSmartPointer<vtkGlyph3D>::New();
993 #if (VTK_MAJOR_VERSION <= 5)
994  d->vector_glyph->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
995  d->vector_glyph->SetSource(d->vector_glyph_source->GetOutput());
996 #else
997  d->vector_glyph->SetInputData(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
998  d->vector_glyph->SetSourceData(d->vector_glyph_source->GetOutput());
999 #endif
1000 
1001  d->vector_glyph->SetColorModeToColorByVector();
1002  d->vector_glyph->SetVectorModeToUseVector();
1003  //d->vector_glyph->SetScaleModeToScaleByVector();
1004  d->vector_glyph->SetScaleModeToDataScalingOff();
1005  //d->vector_glyph->ScalingOff();
1006  this->setGlyphScale(0.1);
1007  d->vector_glyph->OrientOn();
1008  d->vector_glyph->Update();
1009 
1010  d->vector_glyph_mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
1011  d->vector_glyph_mapper->SetInputConnection(d->vector_glyph->GetOutputPort());
1012 
1013  // vtkSmartPointer<vtkExtractUnstructuredGrid> extractor = vtkSmartPointer<vtkExtractUnstructuredGrid>::New();
1014  // extractor->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
1015 
1016  // vtkSmartPointer<vtkGlyph3DMapper> gpuGlyphMapper = vtkSmartPointer<vtkGlyph3DMapper>::New();
1017  // gpuGlyphMapper->ScalingOn();
1018  // gpuGlyphMapper->SetScaleFactor(0.1);
1019  // gpuGlyphMapper->SetSourceConnection(d->vector_glyph_source->GetOutputPort());
1020  // gpuGlyphMapper->SetInputConnection(extractor->GetOutputPort());
1021 
1022  d->vector_glyph_actor = vtkSmartPointer<vtkActor>::New();
1023  d->vector_glyph_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
1024  d->vector_glyph_actor->SetPosition(d->mesh->getActor()->GetPosition());
1025  d->vector_glyph_actor->SetMapper(d->vector_glyph_mapper);
1026  // d->vector_glyph_actor->SetMapper(gpuGlyphMapper);
1027  d->vector_glyph_actor->SetVisibility(0);
1028 
1029  this->AddPart(d->vector_glyph_actor);
1030 
1031  // -- streams
1032 
1033  d->vector_stream_widget = vtkSmartPointer<vtkSphereWidget2>::New();
1034  d->vector_stream_widget->SetInteractor(d->interactor);
1035  d->vector_stream_widget->CreateDefaultRepresentation();
1036  d->vector_stream_widget->SetTranslationEnabled(true);
1037  d->vector_stream_widget->SetScalingEnabled(true);
1038  d->vector_stream_widget->Off();
1039 
1040  d->vector_stream_widget_data = vtkPolyData::New();
1041 
1042  d->vector_stream_widget_representation = vtkSphereRepresentation::SafeDownCast(d->vector_stream_widget->GetRepresentation());
1043  d->vector_stream_widget_representation->HandleVisibilityOff();
1044  d->vector_stream_widget_representation->HandleTextOff();
1045  d->vector_stream_widget_representation->RadialLineOff();
1046  d->vector_stream_widget_representation->SetPhiResolution(64);
1047  d->vector_stream_widget_representation->SetThetaResolution(64);
1048  d->vector_stream_widget_representation->GetPolyData(d->vector_stream_widget_data);
1049 
1050  d->vector_stream_tracer = vtkStreamTracer::New();
1051 #if (VTK_MAJOR_VERSION <= 5)
1052  d->vector_stream_tracer->SetInput(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
1053  d->vector_stream_tracer->SetSource(d->vector_stream_widget_data);
1054 #else
1055  d->vector_stream_tracer->SetInputData(static_cast<vtkPolyData *>(d->mesh->getPolyData()));
1056  d->vector_stream_tracer->SetSourceData(d->vector_stream_widget_data);
1057 #endif
1058  d->vector_stream_tracer->SetMaximumPropagation(100);
1059  d->vector_stream_tracer->SetMinimumIntegrationStep(1.0e-4);
1060  d->vector_stream_tracer->SetMaximumIntegrationStep(100.0);
1061  d->vector_stream_tracer->SetIntegrationDirectionToBoth();
1062 
1063  d->vector_stream_filter = vtkTubeFilter::New();
1064 #if (VTK_MAJOR_VERSION <= 5)
1065  d->vector_stream_filter->SetInput(d->vector_stream_tracer->GetOutput());
1066 #else
1067  d->vector_stream_filter->SetInputData(d->vector_stream_tracer->GetOutput());
1068 #endif
1069  d->vector_stream_filter->SetRadius(0.01);
1070  d->vector_stream_filter->SetNumberOfSides(8);
1071 
1072  d->vector_stream_mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
1073  d->vector_stream_mapper->SetInputConnection(d->vector_stream_filter->GetOutputPort());
1074  d->vector_stream_mapper->ScalarVisibilityOn();
1075 
1076  d->vector_stream_actor = vtkSmartPointer<vtkActor>::New();
1077  d->vector_stream_actor->SetOrientation(d->mesh->getActor()->GetOrientation());
1078  d->vector_stream_actor->SetPosition(d->mesh->getActor()->GetPosition());
1079  d->vector_stream_actor->SetMapper(d->vector_stream_mapper);
1080  d->vector_stream_actor->SetVisibility(0);
1081 
1082  d->vector_stream_observer = axlActorFieldSpatialStreamObserver::New();
1083  d->vector_stream_observer->vector_stream_widget_representation = d->vector_stream_widget_representation;
1084  d->vector_stream_observer->vector_stream_widget_data = d->vector_stream_widget_data;
1085  d->vector_stream_observer->vector_stream_tracer = d->vector_stream_tracer;
1086  d->vector_stream_widget->AddObserver(vtkCommand::InteractionEvent, d->vector_stream_observer);
1087 
1088  this->AddPart(d->vector_stream_actor);
1089  }
1090 
1091 }
1092 
1094 {
1095  double field_range[2];d->array->GetRange(field_range);
1096  return field_range[0];
1097 }
1098 
1100 {
1101  double field_range[2];d->array->GetRange(field_range);
1102 
1103  return field_range[1];
1104 }
1105 
1107 {
1108  d->isoRadius = radius;
1109  d->scalar_iso_tube_filter->SetRadius(radius);
1110  d->scalar_iso_tube_filter->Update();
1111 }
void setColRangeMin(double min)
vtkSmartPointer< vtkSphereRepresentation > vector_stream_widget_representation
void setStreamDirection(int direction)
void setGlyphScale(double scale)
void setIsoRangeMin(double min)
axlAbstractField * field(void)
void setColRangeMax(double max)
void setActorField(axlAbstractActor *actor)
vtkStandardNewMacro(axlActorFieldSpatial)
axlAbstractActor * outputActor(void)
vtkScalarBarActor * scalarBar(void)
virtual void setScalar(int index, double v1)
void setStreamPropagation(double propagation)
Class axlAbstractFieldSpatial defines an API for spatial field.
Class axlAbstractField defines an API for arrays of numeric data.
axlAbstractActor * actorField(void)
Class axlFieldDiscrete defines an API for arrays of numeric data.
virtual void setData(dtkAbstractData *field)
virtual void Execute(vtkObject *caller, unsigned long event, void *)
void onIsoRadiusChanged(double radius)
vtkSmartPointer< vtkStreamTracer > vector_stream_tracer
void setInteractor(void *interactor)
void setIsoRangeMax(double max)
static axlActorFieldSpatialStreamObserver * New(void)
void setStreamRadius(double radius)
vtkSmartPointer< vtkPolyData > vector_stream_widget_data
Class axlAbstractData defines an API for all type of axel data.
vtkCxxRevisionMacro(axlActorFieldSpatial,"$Revision: 0.0.1 $")
axlAbstractField * magnitude(void)
dtkAbstractData * data(void)