Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
vtkMaskedProgrammableGlyphFilter.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include "vtkMaskPoints.h"
20 #include "vtkObjectFactory.h"
21 #include "vtkPolyData.h"
22 
24 
26 {
27  //this->SetColorModeToColorByScalar();
28  //this->SetScaleModeToScaleByVector();
30  this->MaximumNumberOfPoints = 5000;
31  this->UseMaskPoints = 1;
32 }
33 
35 {
36  if(this->MaskPoints)
37  {
38  this->MaskPoints->Delete();
39  }
40 }
41 
43 {
44  this->MaskPoints->SetInputData(input);
45  this->Superclass::SetInputData(this->MaskPoints->GetOutput());
46 }
47 
49 {
50  this->MaskPoints->SetRandomMode(mode);
51 }
52 
54 {
55  return this->MaskPoints->GetRandomMode();
56 }
57 
59  vtkInformation *request,
60  vtkInformationVector **inputVector,
61  vtkInformationVector *outputVector)
62 {
63  if (this->UseMaskPoints)
64  {
65  vtkIdType numPts = this->MaskPoints->GetPolyDataInput(0)->GetNumberOfPoints();
66  this->MaskPoints->SetMaximumNumberOfPoints(MaximumNumberOfPoints);
67  this->MaskPoints->SetOnRatio(numPts / MaximumNumberOfPoints);
68  this->Superclass::SetInputConnection(this->MaskPoints->GetOutputPort());
69  this->MaskPoints->Update();
70  }
71  else
72  {
73  this->Superclass::SetInputData(this->MaskPoints->GetInput());
74  }
75 
76  return this->Superclass::RequestData(
77  request,inputVector,outputVector);
78 }
79 
80 
81 void vtkMaskedProgrammableGlyphFilter::PrintSelf(ostream& os, vtkIndent indent)
82 {
83  this->Superclass::PrintSelf(os,indent);
84  //os << indent << "InputScalarsSelection: "
85  // << (this->InputScalarsSelection ? this->InputScalarsSelection : "(none)")
86  // << endl;
87 
88  //os << indent << "InputVectorsSelection: "
89  // << (this->InputVectorsSelection ? this->InputVectorsSelection : "(none)")
90  // << endl;
91 
92  //os << indent << "InputNormalsSelection: "
93  // << (this->InputNormalsSelection ? this->InputNormalsSelection : "(none)")
94  // << endl;
95 
96  os << indent << "MaximumNumberOfPoints: " << this->GetMaximumNumberOfPoints()
97  << endl;
98 
99  os << indent << "UseMaskPoints: " << (this->UseMaskPoints?"on":"off") << endl;
100 }
void PrintSelf(ostream &os, vtkIndent indent) override
vtkStandardNewMacro(vtkMaskedProgrammableGlyphFilter)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.