diff --git a/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.cpp b/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.cpp index 5bccdf5ba1..f06c2e910c 100644 --- a/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.cpp +++ b/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.cpp @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "vtkMaskedGlyph2D.h" #include "vtkMaskPoints.h" #include "vtkObjectFactory.h" #include "vtkPolyData.h" vtkStandardNewMacro(vtkMaskedGlyph2D); vtkMaskedGlyph2D::vtkMaskedGlyph2D() { this->SetColorModeToColorByScalar(); this->SetScaleModeToScaleByVector(); this->MaskPoints = vtkMaskPoints::New(); this->MaximumNumberOfPoints = 5000; this->UseMaskPoints = 1; } vtkMaskedGlyph2D::~vtkMaskedGlyph2D() { if(this->MaskPoints) { this->MaskPoints->Delete(); } } void vtkMaskedGlyph2D::SetInput(vtkDataSet *input) { - this->MaskPoints->SetInput(input); - this->Superclass::SetInput(this->MaskPoints->GetOutput()); + this->MaskPoints->SetInputData(input); + this->Superclass::SetInputData(this->MaskPoints->GetOutput()); } void vtkMaskedGlyph2D::SetRandomMode(int mode) { this->MaskPoints->SetRandomMode(mode); } int vtkMaskedGlyph2D::GetRandomMode() { return this->MaskPoints->GetRandomMode(); } -void vtkMaskedGlyph2D::Execute() +int vtkMaskedGlyph2D::RequestData(vtkInformation* info, vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec) { if (this->UseMaskPoints) { - this->Superclass::SetInput(this->MaskPoints->GetOutput()); + this->Superclass::SetInputData(this->MaskPoints->GetOutput()); vtkIdType numPts = this->MaskPoints->GetPolyDataInput(0)->GetNumberOfPoints(); this->MaskPoints->SetMaximumNumberOfPoints(MaximumNumberOfPoints); this->MaskPoints->SetOnRatio(numPts / MaximumNumberOfPoints); this->MaskPoints->Update(); } else { - this->Superclass::SetInput(this->MaskPoints->GetInput()); + this->Superclass::SetInputData(this->MaskPoints->GetInput()); } - this->Superclass::Execute(); + this->Superclass::RequestData(info, inInfoVec, outInfoVec); } void vtkMaskedGlyph2D::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); //os << indent << "InputScalarsSelection: " // << (this->InputScalarsSelection ? this->InputScalarsSelection : "(none)") // << endl; //os << indent << "InputVectorsSelection: " // << (this->InputVectorsSelection ? this->InputVectorsSelection : "(none)") // << endl; //os << indent << "InputNormalsSelection: " // << (this->InputNormalsSelection ? this->InputNormalsSelection : "(none)") // << endl; os << indent << "MaximumNumberOfPoints: " << this->GetMaximumNumberOfPoints() << endl; os << indent << "UseMaskPoints: " << (this->UseMaskPoints?"on":"off") << endl; } diff --git a/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.h b/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.h index e3314cb351..474ec67f65 100644 --- a/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.h +++ b/Modules/MitkExt/Rendering/vtkMaskedGlyph2D.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __vtkMaskedGlyph2D_h #define __vtkMaskedGlyph2D_h #include "MitkExtExports.h" #include "vtkGlyph2D.h" #include "mitkCommon.h" class vtkMaskPoints; /** * This class masked points of the input data set and glyphs * only the selected poitns. Points may be selected either by * random or by ratio. * Additionally, this class allows to set the InputScalars, * InputVectors and InputNormals by their field name in the * input dataset. */ class MitkExt_EXPORT vtkMaskedGlyph2D : public vtkGlyph2D { public: vtkTypeMacro(vtkMaskedGlyph2D,vtkGlyph2D); void PrintSelf(ostream& os, vtkIndent indent); /** * Constructor */ static vtkMaskedGlyph2D *New(); /** * Limit the number of points to glyph */ vtkSetMacro(MaximumNumberOfPoints, int); vtkGetMacro(MaximumNumberOfPoints, int); /** * Set the input to this filter. */ virtual void SetInput(vtkDataSet *input); /** * Set/get whether to mask points */ vtkSetMacro(UseMaskPoints, int); vtkGetMacro(UseMaskPoints, int); /** * Set/get flag to cause randomization of which points to mask. */ void SetRandomMode(int mode); int GetRandomMode(); ///** // * If you want to use an arbitrary scalars array, then set its name here. // * By default this in NULL and the filter will use the active scalar array. // */ //vtkGetStringMacro(InputScalarsSelection); //void SelectInputScalars(const char *fieldName) // {this->SetInputScalarsSelection(fieldName);} ///** // * If you want to use an arbitrary vectors array, then set its name here. // * By default this in NULL and the filter will use the active vector array. // */ //vtkGetStringMacro(InputVectorsSelection); //void SelectInputVectors(const char *fieldName) // {this->SetInputVectorsSelection(fieldName);} ///** // * If you want to use an arbitrary normals array, then set its name here. // * By default this in NULL and the filter will use the active normal array. // */ //vtkGetStringMacro(InputNormalsSelection); //void SelectInputNormals(const char *fieldName) // {this->SetInputNormalsSelection(fieldName);} protected: vtkMaskedGlyph2D(); ~vtkMaskedGlyph2D(); - virtual void Execute(); + virtual int RequestData(vtkInformation* info,vtkInformationVector** inInfoVec,vtkInformationVector* outInfoVec); vtkMaskPoints *MaskPoints; int MaximumNumberOfPoints; int UseMaskPoints; private: vtkMaskedGlyph2D(const vtkMaskedGlyph2D&); // Not implemented. void operator=(const vtkMaskedGlyph2D&); // Not implemented. }; #endif diff --git a/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.cpp b/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.cpp index 2a91b34bb2..b718ff4953 100644 --- a/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.cpp +++ b/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.cpp @@ -1,112 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "vtkMaskedGlyph3D.h" #include "vtkMaskPoints.h" #include "vtkObjectFactory.h" #include "vtkPolyData.h" vtkStandardNewMacro(vtkMaskedGlyph3D); vtkMaskedGlyph3D::vtkMaskedGlyph3D() { this->SetColorModeToColorByScalar(); this->SetScaleModeToScaleByVector(); this->MaskPoints = vtkMaskPoints::New(); this->MaximumNumberOfPoints = 5000; this->UseMaskPoints = 1; } vtkMaskedGlyph3D::~vtkMaskedGlyph3D() { if(this->MaskPoints) { this->MaskPoints->Delete(); } } void vtkMaskedGlyph3D::SetInput(vtkDataSet *input) { - this->MaskPoints->SetInput(input); + this->MaskPoints->SetInputData(input); this->Superclass::SetInputConnection(this->MaskPoints->GetOutputPort()); } void vtkMaskedGlyph3D::SetInputConnection(vtkAlgorithmOutput* input) { this->MaskPoints->SetInputConnection(input); this->Superclass::SetInputConnection(this->MaskPoints->GetOutputPort()); } void vtkMaskedGlyph3D::SetRandomMode(int mode) { this->MaskPoints->SetRandomMode(mode); } int vtkMaskedGlyph3D::GetRandomMode() { return this->MaskPoints->GetRandomMode(); } -void vtkMaskedGlyph3D::Execute() -{ - if (this->UseMaskPoints) - { - vtkIdType numPts = this->MaskPoints->GetPolyDataInput(0)->GetNumberOfPoints(); - this->MaskPoints->SetMaximumNumberOfPoints( MaximumNumberOfPoints ); - this->MaskPoints->SetOnRatio( numPts / MaximumNumberOfPoints ); - this->MaskPoints->Update(); - this->Superclass::SetInput(this->MaskPoints->GetOutput()); - } - else - { - this->Superclass::SetInput(this->MaskPoints->GetInput()); - } - - this->Superclass::Execute(); -} - int vtkMaskedGlyph3D::RequestData( vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) { if (this->UseMaskPoints) { - this->Superclass::SetInput(this->MaskPoints->GetOutput()); + this->Superclass::SetInputData(this->MaskPoints->GetOutput()); vtkIdType numPts = this->MaskPoints->GetPolyDataInput(0)->GetNumberOfPoints(); this->MaskPoints->SetMaximumNumberOfPoints( MaximumNumberOfPoints ); this->MaskPoints->SetOnRatio( numPts / MaximumNumberOfPoints ); this->MaskPoints->Update(); } else { - this->Superclass::SetInput(this->MaskPoints->GetInput()); + this->Superclass::SetInputData(this->MaskPoints->GetInput()); } return this->Superclass::RequestData( request,inputVector,outputVector); } void vtkMaskedGlyph3D::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os,indent); os << indent << "MaximumNumberOfPoints: " << this->GetMaximumNumberOfPoints() << endl; os << indent << "UseMaskPoints: " << (this->UseMaskPoints?"on":"off") << endl; } diff --git a/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.h b/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.h index b9734f6090..1d6bf9c79e 100644 --- a/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.h +++ b/Modules/MitkExt/Rendering/vtkMaskedGlyph3D.h @@ -1,87 +1,86 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __vtkMaskedGlyph3D_h #define __vtkMaskedGlyph3D_h #include "MitkExtExports.h" #include "vtkGlyph3D.h" #include "mitkCommon.h" class vtkMaskPoints; /** * This class masked points of the input data set and glyphs * only the selected poitns. Points may be selected either by * random or by ratio. * Additionally, this class allows to set the InputScalars, * InputVectors and InputNormals by their field name in the * input dataset. */ class MitkExt_EXPORT vtkMaskedGlyph3D : public vtkGlyph3D { public: vtkTypeMacro(vtkMaskedGlyph3D,vtkGlyph3D); void PrintSelf(ostream& os, vtkIndent indent); /** * Constructor */ static vtkMaskedGlyph3D *New(); /** * Limit the number of points to glyph */ vtkSetMacro(MaximumNumberOfPoints, int); vtkGetMacro(MaximumNumberOfPoints, int); /** * Set the input to this filter. */ virtual void SetInput(vtkDataSet *input); /** * Set/get whether to mask points */ vtkSetMacro(UseMaskPoints, int); vtkGetMacro(UseMaskPoints, int); /** * Set/get flag to cause randomization of which points to mask. */ void SetRandomMode(int mode); int GetRandomMode(); virtual void SetInputConnection(vtkAlgorithmOutput* input); protected: vtkMaskedGlyph3D(); ~vtkMaskedGlyph3D(); - virtual void Execute(); virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); vtkMaskPoints *MaskPoints; int MaximumNumberOfPoints; int UseMaskPoints; private: vtkMaskedGlyph3D(const vtkMaskedGlyph3D&); // Not implemented. void operator=(const vtkMaskedGlyph3D&); // Not implemented. }; #endif