Developer documentation | Axl-2.5.1

axlActorVolumeBSpline.cpp
Go to the documentation of this file.
1 /* axlActorVolumeBSpline.cpp ---
2  *
3  * Author: Anais Ducoffe
4  * Copyright (C) 2012 - Anais Ducoffe, Inria.
5  * Created:
6  * Version: $Id$
7  * Last-Updated:
8  * By:
9  * Update #:
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
20 #include "axlActorVolumeBSpline.h"
21 #include "axlControlPointsWidget.h"
22 
25 
26 #include <dtkMathSupport/dtkVector3D.h>
27 
28 #include <vtkActor.h>
29 #include <vtkVolume.h>
30 #include <vtkActorCollection.h>
31 #include <vtkCellArray.h>
32 #include <vtkCellData.h>
33 #include <vtkCommand.h>
34 #include <vtkDoubleArray.h>
35 #include <vtkLookupTable.h>
36 #include <vtkObjectFactory.h>
37 //#include <vtkPainterPolyDataMapper.h>
38 #include <vtkPoints.h>
39 #include <vtkPointData.h>
40 #include <vtkPolyData.h>
41 #include <vtkUnstructuredGrid.h>
42 #include <vtkPolyVertex.h>
43 #include <vtkPolygon.h>
44 #include <vtkPolyDataMapper.h>
45 #include <vtkDataSetMapper.h>
46 #include <vtkPolyDataNormals.h>
47 #include <vtkProperty.h>
48 #include <vtkProp.h>
49 #include <vtkHexahedron.h>
50 #include <vtkQuad.h>
51 #include <vtkTexture.h>
52 #include <vtkTetra.h>
53 #include <vtkTriangleStrip.h>
54 #include <vtkTimerLog.h>
55 #include <vtkSmartPointer.h>
56 #include <vtkStripper.h>
57 #include <vtkPointData.h>
58 #include <vtkTriangleFilter.h>
59 #include <vtkPNGReader.h>
60 #include <vtkFloatArray.h>
61 //#include <vtkOpenGLHardwareSupport.h>
62 #include <vtkOpenGLRenderWindow.h>
63 //#include <vtkPainterPolyDataMapper.h>
64 #include <vtkProperty.h>
65 #include <vtkIdList.h>
66 
67 // /////////////////////////////////////////////////////////////////
68 // axlActorVolumeBSplinePrivate
69 // /////////////////////////////////////////////////////////////////
70 
71 class axlActorVolumeBSplinePrivate
72 {
73 public:
74  axlAbstractVolumeBSpline *splineVolume;
75 };
76 
77 #if (VTK_MAJOR_VERSION <= 5)
78 vtkCxxRevisionMacro(axlActorVolumeBSpline, "$Revision: 0.0.1 $");
79 #endif
80 
82 
83 dtkAbstractData *axlActorVolumeBSpline::data(void)
84 {
85  return d->splineVolume;
86 }
87 
88 void axlActorVolumeBSpline::setData(dtkAbstractData *spline_Volume1)
89 {
90  axlAbstractVolumeBSpline *spline_Volume = dynamic_cast<axlAbstractVolumeBSpline *>(spline_Volume1);
91  // we compute here points and hexahedrons
92  d->splineVolume = spline_Volume;
93 
94  this->setPoints(vtkSmartPointer<vtkPoints>::New());
95 
96  this->setActor(vtkSmartPointer<vtkActor>::New());
97  this->setCellArray(vtkSmartPointer<vtkCellArray>::New());
98  this->setUnstructuredGrid(vtkSmartPointer<vtkUnstructuredGrid>::New());
99  this->setDataSetMapper(vtkSmartPointer<vtkDataSetMapper>::New());
100 
101  this->pointsUpdate();
102  this->UnstructuredGridUpdate();
103 
104 
105  this->getUnstructuredGrid()->SetPoints(this->getPoints());
106  // this->getUnstructuredGrid()->SetCells(VTK_HEXAHEDRON,this->getCellArray());
107  this->getUnstructuredGrid()->SetCells(VTK_QUAD,this->getCellArray());
108  // this->getUnstructuredGrid()->SetCells(VTK_TETRA,this->getCellArray());
109 
110 #if (VTK_MAJOR_VERSION <= 5)
111  this->getDataSetMapper()->SetInput(this->getUnstructuredGrid());
112 #else
113  this->getDataSetMapper()->SetInputData(this->getUnstructuredGrid());
114 #endif
115  this->getActor()->SetMapper(this->getDataSetMapper());
116 
117  this->getDataSetMapper()->ScalarVisibilityOff();
118 
119  // add sphere param
120  this->AddPart(this->getActor());
121 
122  // add the observer
123  if(!this->getObserver())
124  {
125  this->NewObserver();
126  this->setObserverData(d->splineVolume);
127  }
128 
129  QColor color = d->splineVolume->color();
130  this->getActor()->GetProperty()->SetColor(color.redF(), color.greenF(), color.blueF());
131 
132  QString shader = d->splineVolume->shader();
133  if(!shader.isEmpty())
134  this->setShader(shader);
135 
136  connect(d->splineVolume, SIGNAL(modifiedGeometry()), this, SLOT(onUpdateGeometry()));
137  connect(d->splineVolume, SIGNAL(modifiedProperty()), this, SLOT(onUpdateProperty()));
138 }
139 
140 
142 {
143  vtkSmartPointer<vtkDoubleArray> scalarArray = vtkSmartPointer<vtkDoubleArray>::New();
144  scalarArray->SetName("mapperCollorArrayDefaultField");
145  scalarArray->SetNumberOfComponents(1);
146 
147  double start_u = d->splineVolume->startParam_u();
148  double start_v = d->splineVolume->startParam_v();
149  double start_w = d->splineVolume->startParam_w();
150  double end_u = d->splineVolume->endParam_u();
151  double end_v = d->splineVolume->endParam_v();
152  double end_w = d->splineVolume->endParam_w();
153  double paramCourant_u = start_u;
154  double paramCourant_v = start_v;
155  double paramCourant_w = start_w;
156 
157  int n_u = d->splineVolume->numSamples_u();// need to be superior than 1
158  int n_v = d->splineVolume->numSamples_v();
159  int n_w = d->splineVolume->numSamples_w();
160 
161  scalarArray->SetNumberOfTuples(n_u * n_v * n_w);
162 
163  double interval_u = (double)(end_u - start_u) / (n_u - 1);
164  double interval_v = (double)(end_v - start_v) / (n_v - 1);
165  double interval_w = (double)(end_w - start_w) / (n_w - 1);
166 
167 
168  for(int k = 0; k < n_w - 1 ; k++)
169  {
170  for(int i = 0; i < n_v - 1 ; i++)
171  {
172  for(int j = 0; j < n_u - 1 ; j++)
173  {
174  scalarArray->SetTuple1(k * n_u*n_v + i * n_u + j, d->splineVolume->scalarValue(paramCourant_u, paramCourant_v, paramCourant_w));
175  paramCourant_u += interval_u;
176  }
177 
178  scalarArray->SetTuple1(k * n_u*n_v + i * n_u + (n_u - 1), d->splineVolume->scalarValue(end_u, paramCourant_v, paramCourant_w));
179  paramCourant_u = start_u;
180  paramCourant_v += interval_v;
181  }
182  scalarArray->SetTuple1(k * n_u*n_v + (n_v-1) * n_u + (n_u - 1), d->splineVolume->scalarValue(end_u,end_v, paramCourant_w));
183  paramCourant_u = start_u;
184  paramCourant_v = start_v;
185  paramCourant_w += interval_w;
186  }
187 
188  for(int j = 0; j < n_v - 1; j++)
189  {
190  for(int i = 0; i < n_u - 1; i++)
191  {
192  scalarArray->SetTuple1( n_u * n_v * (n_w -1)+ n_u * j + i, d->splineVolume->scalarValue(paramCourant_u, paramCourant_v, end_w));
193  paramCourant_u += interval_u;
194  }
195  scalarArray->SetTuple1( n_u * n_v * (n_w -1)+ n_u * j + (n_u-1), d->splineVolume->scalarValue(end_u,paramCourant_v, end_w));
196  paramCourant_u = start_u;
197  paramCourant_u += interval_u;
198  }
199 
200  paramCourant_w = start_w;
201  for(int k = 0; k < n_w ; k++)
202  {
203  for(int i = 0; i < n_u - 1; i++)
204  {
205  scalarArray->SetTuple1( n_u * n_v * k + n_u * (n_v-1) + i, d->splineVolume->scalarValue(paramCourant_u, end_v, paramCourant_w));
206  paramCourant_u += interval_u;
207  }
208 
209  paramCourant_u = start_u;
210  paramCourant_w += interval_w;
211  }
212 
213  scalarArray->SetTuple1(n_u * n_v * n_w - 1, d->splineVolume->scalarValue(end_u, end_v, end_w));
214 
215 
216  vtkSmartPointer<vtkUnstructuredGrid> data = this->getUnstructuredGrid();
217  data->GetPointData()->AddArray(scalarArray);
218  data->GetPointData()->SetActiveScalars("mapperCollorArrayDefaultField");
219 
220  vtkSmartPointer<vtkLookupTable> lookupTable = vtkSmartPointer<vtkLookupTable>::New();
221  lookupTable->SetRange(-1.0, 1.0);
222  lookupTable->SetNumberOfTableValues(d->splineVolume->stripes());
223  lookupTable->Build();
224  for(int i= 0; i < d->splineVolume->stripes(); i+=2)
225  {
226  lookupTable->SetTableValue(i , 1.0, 1.0, 1.0);
227  lookupTable->SetTableValue(i+1, 0.0, 0.0, 0.0);
228  }
229  // test to get light direction .... TO DELETE
230 
231  vtkSmartPointer<vtkDoubleArray> lightArray = vtkSmartPointer<vtkDoubleArray>::New();
232  lightArray->SetName("mapperLightDirection");
233  lightArray->SetNumberOfComponents(3);
234 
235  paramCourant_u = start_u;
236  paramCourant_v = start_v;
237 
238  lightArray->SetNumberOfTuples(n_u * n_v * n_w);
239  double *currentLight = new double[3];
240  currentLight[0] = 1.0;
241  currentLight[1] = 0.6;
242  currentLight[2] = 0.2;
243  for(int k = 0; k < n_w - 1; k++)
244  {
245  for(int j = 0; j < n_v - 1; j++)
246  {
247  for(int i = 0; i < n_u - 1; i++)
248  {
249  lightArray->SetTuple(k * n_u* n_v + j * n_u + i, currentLight);
250  }
251 
252  lightArray->SetTuple(k * n_u* n_v + j * n_u + n_u - 1, currentLight);
253  paramCourant_u = start_u;
254  paramCourant_v += interval_v;
255  }
256  lightArray->SetTuple(k * n_u* n_v + (n_v -1) * n_u + n_u - 1, currentLight);
257  paramCourant_u = start_u;
258  paramCourant_v = start_v;
259  paramCourant_w += interval_w;
260  }
261 
262  for(int j = 0; j < n_v - 1; j++)
263  {
264  for(int i = 0; i < n_u - 1; i++)
265  {
266  lightArray->SetTuple((n_w -1)* n_u* n_v + j * n_u + i, currentLight);
267  paramCourant_u += interval_u;
268  }
269  lightArray->SetTuple((n_w -1)* n_u* n_v + j * n_u + n_u -1, currentLight);
270  paramCourant_u += interval_u;
271  }
272 
273  for(int k = 0; k < n_w ; k++)
274  {
275  for(int i = 0; i < n_u - 1; i++)
276  {
277  lightArray->SetTuple(k* n_u* n_v + (n_v-1) * n_u + i, currentLight);
278  paramCourant_u += interval_u;
279  }
280 
281  paramCourant_u += start_u;
282  paramCourant_w += interval_w;
283  }
284  lightArray->SetTuple(n_w * n_u* n_v -1, currentLight);
285 
286  data = this->getUnstructuredGrid();
287  data->GetPointData()->AddArray(lightArray);
288 
289 
290  //add vertex attrib array
291  vtkSmartPointer<vtkDataSetMapper> mapper = this->getDataSetMapper();
292  vtkSmartPointer<vtkUnstructuredGrid> myUnstructuredGrid = this->getUnstructuredGrid();
293  //mapper->MapDataArrayToVertexAttribute("scalarsattrib", data->GetPointData()->GetArrayName(2), vtkDataObject::FIELD_ASSOCIATION_POINTS, -1);
294  mapper->SetLookupTable(lookupTable);
295  mapper->SetInterpolateScalarsBeforeMapping(true);
296  mapper->UseLookupTableScalarRangeOn();
297 
298 
299  this->Modified();
300 }
301 
302 
304 {
305  if(d->splineVolume)
306  {
307 
308  this->getDataSetMapper()->RemoveAllInputs();
309  this->getUnstructuredGrid()->Initialize();
310 
311  // delete current vtkPoint and vtkCellArray
312  this->getPoints()->Reset();
313  this->getCellArray()->Reset();
314 
315  this->getPoints()->Squeeze();
316  this->getCellArray()->Squeeze();
317 
318  this->pointsUpdate();
319 
320  this->UnstructuredGridUpdate();
321 
322  this->getUnstructuredGrid()->SetPoints(this->getPoints());
323  // this->getUnstructuredGrid()->SetCells(VTK_HEXAHEDRON,this->getCellArray());
324  this->getUnstructuredGrid()->SetCells(VTK_QUAD,this->getCellArray());
325  // this->getUnstructuredGrid()->SetCells(VTK_TETRA,this->getCellArray());
326 
327 #if (VTK_MAJOR_VERSION <= 5)
328  this->getDataSetMapper()->SetInput(this->getUnstructuredGrid());
329 #else
330  this->getDataSetMapper()->SetInputData(this->getUnstructuredGrid());
331 #endif
332 
333 
334  }
335 
336  if(d->splineVolume->fields().count() != 0){
337  d->splineVolume->touchField();
338  d->splineVolume->touchGeometry();
339  }
340 
341 }
342 
344 {
345  if (this->getControlPoints())
346  this->getControlPoints()->SetControlPointRadius(d->splineVolume->size());
347 
348  emit updated();
349 }
350 
352 {
353  if(d->splineVolume->rational())
354  {
355  d->splineVolume->updateRcoeff();
356  }
357  // we consider here that all memory vtk pipeline from points to unstructuredGrid are free but not deleted...
358  double start_u = d->splineVolume->startParam_u();
359  double start_v = d->splineVolume->startParam_v();
360  double start_w = d->splineVolume->startParam_w();
361  double end_u = d->splineVolume->endParam_u();
362  double end_v = d->splineVolume->endParam_v();
363  double end_w = d->splineVolume->endParam_w();
364  double paramCourant_u = start_u;
365  double paramCourant_v = start_v;
366  double paramCourant_w = start_w;
367 
368  vtkPoints *points = this->getPoints();
369 
370  int n_u = d->splineVolume->numSamples_u();// need to be superior than 1
371  int n_v = d->splineVolume->numSamples_v();
372  int n_w = d->splineVolume->numSamples_w();
373  points->SetNumberOfPoints(n_u * n_v * n_w);
374 
375  axlPoint *pointCourant = new axlPoint;
376  double interval_u = (double)(end_u - start_u) / (n_u - 1);
377  double interval_v = (double)(end_v - start_v) / (n_v - 1);
378  double interval_w = (double)(end_w - start_w) / (n_w - 1);
379 
380 
381  int ind1 = 0;
382  int ind2 = 0;
383  int ind3 = 0;
384  for(int k = 0; k < n_w - 1; k++)
385  {
386  ind1 = k * n_u * n_v;
387  for(int i = 0; i < n_v - 1; i++)
388  {
389  ind2 = i * n_u;
390  for(int j = 0; j < n_u - 1; j++)
391  {
392  ind3 = ind1 + ind2 +j;
393  d->splineVolume->eval(pointCourant, paramCourant_u, paramCourant_v, paramCourant_w);
394  points->SetPoint(ind3, pointCourant->coordinates());
395  paramCourant_u += interval_u;
396  }
397  ind3 = ind1 + ind2 + (n_u - 1);
398 
399  d->splineVolume->eval(pointCourant, end_u, paramCourant_v, paramCourant_w);
400  points->SetPoint(ind3 , pointCourant->coordinates());
401 
402  paramCourant_u = start_u;
403  paramCourant_v += interval_v;
404  }
405  ind3 = ind1 + (n_v -1)* n_u + (n_u - 1);
406 
407  d->splineVolume->eval(pointCourant, end_u, end_v, paramCourant_w);
408  points->SetPoint(ind3 , pointCourant->coordinates());
409 
410  paramCourant_u = start_u;
411  paramCourant_v = start_v;
412  paramCourant_w += interval_w;
413  }
414 
415 
416  ind1 = n_u * n_v * (n_w - 1);
417  for(int j = 0; j < n_v - 1; j++)
418  {
419  ind2 = j * n_u;
420  for(int i = 0; i < n_u - 1; i++)
421  {
422  ind3 = ind1 + ind2 + i;
423  d->splineVolume->eval(pointCourant, paramCourant_u,paramCourant_v, end_w);
424  points->SetPoint(ind3, pointCourant->coordinates());
425 
426 
427  paramCourant_u+=interval_u;
428 
429  }
430  ind3 = ind1 + ind2 + (n_u -1);
431  d->splineVolume->eval(pointCourant, end_u, paramCourant_v, end_w);
432  points->SetPoint(ind3, pointCourant->coordinates());
433 
434 
435  paramCourant_u=start_u;
436  paramCourant_v+=interval_v;
437  }
438 
439  paramCourant_w=start_w;
440 
441  ind2 = (n_v-1) * n_u;
442 
443  for(int k = 0; k < n_w-1 ; k++)
444  {
445  ind1 = n_u * n_v * k;
446  for(int i = 0; i < n_u - 1; i++)
447  {
448  ind3 = ind1 + ind2 + i;
449  d->splineVolume->eval(pointCourant, paramCourant_u,end_v, paramCourant_w);
450  points->SetPoint(ind3, pointCourant->coordinates());
451 
452 
453  paramCourant_u+=interval_u;
454 
455  }
456  ind3 = ind2 + ind1 + (n_u-1);
457  paramCourant_u=start_u;
458  paramCourant_w+=interval_w;
459  }
460  paramCourant_w = end_w;
461  ind1 = n_u * n_v * (n_w-1);
462  for(int i = 0; i < n_u - 1; i++)
463  {
464  ind3 = ind1 + ind2 + i;
465  d->splineVolume->eval(pointCourant, paramCourant_u,end_v, paramCourant_w);
466  points->SetPoint(ind3, pointCourant->coordinates());
467 
468 
469  paramCourant_u+=interval_u;
470 
471  }
472 
473  ind3 = n_u * n_v * n_w -1;
474  d->splineVolume->eval(pointCourant, end_u, end_v, end_w);
475  points->SetPoint(ind3, pointCourant->coordinates());
476 
477 
478  delete pointCourant;
479 }
480 
482 {
483  vtkSmartPointer<vtkCellArray> cellArray = this->getCellArray();
484 
485  int n_u = d->splineVolume->numSamples_u();
486  int n_v = d->splineVolume->numSamples_v();
487  int n_w = d->splineVolume->numSamples_w();
488  int ind1 = 0;
489  int ind2 = 0;
490  int ind3 = 0;
491  int ind4 = 0;
492 
493  vtkSmartPointer<vtkHexahedron> currentHexa = vtkSmartPointer<vtkHexahedron>::New();
494  currentHexa->GetPointIds()->SetNumberOfIds(8);
495 
496  vtkSmartPointer<vtkQuad> currentQuad = vtkSmartPointer<vtkQuad>::New();
497  currentQuad->GetPointIds()->SetNumberOfIds(4);
498 
499  vtkSmartPointer<vtkTetra> currentTetra = vtkSmartPointer<vtkTetra>::New();
500  currentTetra->GetPointIds()->SetNumberOfIds(4);
501 
502  for(int k = 0; k < n_w - 1; k++)
503  {
504  for(int j = 0; j < n_v - 1; j++)
505  {
506  for(int i= 0; i < n_u - 1; i++)
507  {
508 
509  ind1 = k * n_u * n_v + j * n_u + i;
510  ind2 = ind1 + n_u;
511  ind3 = ind1 + n_u * n_v;
512  ind4 = ind2 + n_u * n_v;
513 
514 
516  // // six tetrahedrons in one hexahedron.
517  // currentTetra->GetPointIds()->SetId(0, ind1+1 );
518  // currentTetra->GetPointIds()->SetId(1, ind3 );
519  // currentTetra->GetPointIds()->SetId(2,ind1 );
520  // currentTetra->GetPointIds()->SetId(3,ind2+1 );
521  // cellArray->InsertNextCell(currentTetra);
522 
523  // currentTetra->GetPointIds()->SetId(0, ind1+1 );
524  // currentTetra->GetPointIds()->SetId(1, ind3+1 );
525  // currentTetra->GetPointIds()->SetId(2, ind3 );
526  // currentTetra->GetPointIds()->SetId(3, ind2+1 );
527  // cellArray->InsertNextCell(currentTetra);
528 
529  // currentTetra->GetPointIds()->SetId(0, ind3+1 );
530  // currentTetra->GetPointIds()->SetId(1, ind4+1 );
531  // currentTetra->GetPointIds()->SetId(2, ind3 );
532  // currentTetra->GetPointIds()->SetId(3, ind2+1 );
533  // cellArray->InsertNextCell(currentTetra);
534 
535  // currentTetra->GetPointIds()->SetId(0, ind4 );
536  // currentTetra->GetPointIds()->SetId(1, ind2 );
537  // currentTetra->GetPointIds()->SetId(2, ind2+1 );
538  // currentTetra->GetPointIds()->SetId(3, ind3 );
539  // cellArray->InsertNextCell(currentTetra);
540 
541  // currentTetra->GetPointIds()->SetId(0, ind3 );
542  // currentTetra->GetPointIds()->SetId(1, ind1 );
543  // currentTetra->GetPointIds()->SetId(2, ind2+1 );
544  // currentTetra->GetPointIds()->SetId(3, ind2 );
545  // cellArray->InsertNextCell(currentTetra);
546 
547  // currentTetra->GetPointIds()->SetId(0, ind4 );
548  // currentTetra->GetPointIds()->SetId(1, ind3 );
549  // currentTetra->GetPointIds()->SetId(2, ind2+1 );
550  // currentTetra->GetPointIds()->SetId(3, ind4+1 );
551  // cellArray->InsertNextCell(currentTetra);
553  // currentHexa->GetPointIds()->SetId(0, ind1 );
554  // currentHexa->GetPointIds()->SetId(1, ind1+1);
555  // currentHexa->GetPointIds()->SetId(2, ind2+1 );
556  // currentHexa->GetPointIds()->SetId(3, ind2);
557 
558 
559  // // opposite normal knots in the same order
560  // currentHexa->GetPointIds()->SetId(4, ind3);
561  // currentHexa->GetPointIds()->SetId(5, ind3+1 );
562  // currentHexa->GetPointIds()->SetId(6, ind4+1);
563  // currentHexa->GetPointIds()->SetId(7, ind4);
564 
565  // cellArray->InsertNextCell(currentHexa);
566 
567 
569  //front face
570  if(k==0){
571  currentQuad->GetPointIds()->SetId(0, ind1 );
572  currentQuad->GetPointIds()->SetId(1, ind1+1);
573  currentQuad->GetPointIds()->SetId(2, ind2+1 );
574  currentQuad->GetPointIds()->SetId(3, ind2);
575 
576  cellArray->InsertNextCell(currentQuad);
577  }
578 
579  //bottom face
580  if(j==0){
581  currentQuad->GetPointIds()->SetId(0, ind1 );
582  currentQuad->GetPointIds()->SetId(1, ind1+1);
583  currentQuad->GetPointIds()->SetId(2, ind3+1 );
584  currentQuad->GetPointIds()->SetId(3, ind3);
585 
586  cellArray->InsertNextCell(currentQuad);
587  }
588 
589 
590  // left side
591  if(i==0){
592  currentQuad->GetPointIds()->SetId(0, ind3 );
593  currentQuad->GetPointIds()->SetId(1, ind1);
594  currentQuad->GetPointIds()->SetId(2, ind2 );
595  currentQuad->GetPointIds()->SetId(3, ind4);
596 
597  cellArray->InsertNextCell(currentQuad);
598  }
599 
600 
601  if(k< (n_w - 1)){
602  currentQuad->GetPointIds()->SetId(0, ind3 );
603  currentQuad->GetPointIds()->SetId(1, ind3+1);
604  currentQuad->GetPointIds()->SetId(2, ind4+1 );
605  currentQuad->GetPointIds()->SetId(3, ind4);
606 
607  cellArray->InsertNextCell(currentQuad);
608  }
609 
610  if(j <(n_v-1)){
611  currentQuad->GetPointIds()->SetId(0, ind2 );
612  currentQuad->GetPointIds()->SetId(1, ind2+1);
613  currentQuad->GetPointIds()->SetId(2, ind4+1 );
614  currentQuad->GetPointIds()->SetId(3, ind4);
615 
616  cellArray->InsertNextCell(currentQuad);
617  }
618 
619 
620  if(i <(n_u-1)){
621  currentQuad->GetPointIds()->SetId(0, ind3+1 );
622  currentQuad->GetPointIds()->SetId(1, ind1+1);
623  currentQuad->GetPointIds()->SetId(2, ind2+1 );
624  currentQuad->GetPointIds()->SetId(3, ind4+1);
625 
626  cellArray->InsertNextCell(currentQuad);
627  }
628 
629 
630 
631  }
632  }
633  }
634 }
635 
636 axlActorVolumeBSpline::axlActorVolumeBSpline(void) : axlActorBSpline(), d(new axlActorVolumeBSplinePrivate)
637 {
638 
639 }
640 
642 {
643  delete d;
644 
645  d = NULL;
646 }
647 
649 
651 
652 }
Class axlPoint defines 3D points.
Definition: axlPoint.h:34
vtkSmartPointer< vtkCellArray > getCellArray(void)
Definition: axlActor.cpp:307
void setDataSetMapper(vtkSmartPointer< vtkDataSetMapper > mapper)
Definition: axlActor.cpp:351
vtkCxxRevisionMacro(axlActorVolumeBSpline,"$Revision: 0.0.1 $")
void setUnstructuredGrid(vtkSmartPointer< vtkUnstructuredGrid > unstructuredGrid)
Definition: axlActor.cpp:381
virtual axlControlPointsWidget * getControlPoints(void)
double * coordinates(void) const
Returns coordinates of this point.
Definition: axlPoint.cpp:445
static axlActorVolumeBSpline * New(void)
void setCellArray(vtkSmartPointer< vtkCellArray > cellArray)
Definition: axlActor.cpp:312
virtual void setData(dtkAbstractData *spline_Volume1)
dtkAbstractData * data(void)
void updated(void)
vtkSmartPointer< vtkPoints > getPoints(void)
Definition: axlActor.cpp:275
virtual void onUpdateGeometry(void)
virtual void onSamplingChanged(void)
virtual void setShader(QString vsfile)
Definition: axlActor.cpp:517
vtkSmartPointer< vtkUnstructuredGrid > getUnstructuredGrid(void)
Definition: axlActor.cpp:376
vtkSmartPointer< vtkDataSetMapper > getDataSetMapper(void)
Definition: axlActor.cpp:347
void setActor(vtkSmartPointer< vtkActor > actor)
Definition: axlActor.cpp:322
vtkSmartPointer< vtkActor > getActor(void)
Definition: axlActor.cpp:317
virtual void onUpdateProperty(void)
axlAbstractActor * createAxlActorVolumeBSpline(void)
vtkStandardNewMacro(axlActorVolumeBSpline)
void setObserverData(dtkAbstractData *data)
Definition: axlActor.cpp:424
axlActorControlPolygonObserver * getObserver(void)
Definition: axlActor.cpp:366
void SetControlPointRadius(double cpSize)
void NewObserver(void)
Definition: axlActor.cpp:386
void setPoints(vtkSmartPointer< vtkPoints > points)
Definition: axlActor.cpp:280