3 #include "vtkCellArray.h"
4 #include "vtkInformation.h"
5 #include "vtkInformationVector.h"
7 #include "vtkStreamingDemandDrivenPipeline.h"
8 #include "vtkObjectFactory.h"
9 #include "vtkDoubleArray.h"
10 #include "vtkCellData.h"
19 this->SetNumberOfInputPorts(0);
24 vtkInformation *vtkNotUsed(request),
25 vtkInformationVector **vtkNotUsed(inputVector),
26 vtkInformationVector *outputVector)
30 vtkInformation *outInfo = outputVector->GetInformationObject(0);
33 vtkPolyData *output = vtkPolyData::SafeDownCast(
34 outInfo->Get(vtkDataObject::DATA_OBJECT()));
57 vtkIdType npts; vtkIdType *pts;
59 vtkCellArray* polys = TemplateOdf->GetPolys();
60 output->SetPolys(polys);
62 int numCells = polys->GetNumberOfCells();
63 colors->Allocate(numCells);
64 polys->InitTraversal();
66 int numPoints = TemplateOdf->GetPoints()->GetNumberOfPoints();
67 newPoints->Allocate(numPoints);
69 while(polys->GetNextCell(npts,pts))
72 for(
int i=0; i<npts; i++)
74 vtkIdType pointId = pts[i];
75 val += colorOdf.GetElement(pointId);
78 colors->SetComponent(0,cellId++, 1-val);
81 for(
int j=0; j<numPoints; j++){
83 TemplateOdf->GetPoints()->GetPoint(j,p);
84 double val =
Odf.GetElement(j);
88 newPoints->InsertNextPoint(p);
90 output->SetPoints(newPoints);
91 output->GetCellData()->SetScalars(colors);
100 this->Superclass::PrintSelf(os,indent);
105 vtkInformation *vtkNotUsed(request),
106 vtkInformationVector **vtkNotUsed(inputVector),
107 vtkInformationVector *outputVector)
110 vtkInformation *outInfo = outputVector->GetInformationObject(0);
112 outInfo->Set(vtkAlgorithm::CAN_HANDLE_PIECE_REQUEST(),0);
Self MinMaxNormalize() const
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkPolyData * GetBaseMesh()
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkStandardNewMacro(vtkOdfSource)
Self MaxNormalize() const
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.