18 #include <vtkPropAssembly.h>
19 #include <vtkPointData.h>
20 #include <vtkProperty.h>
21 #include <vtkCellArray.h>
22 #include <vtkColorTransferFunction.h>
23 #include <vtkPolyDataMapper.h>
24 #include <vtkPolyData.h>
50 if ( !this->IsVisible( renderer ) )
56 const DataNode *node = this->GetDataNode();
57 bool outdatedRendererGeometry = RendererGeometryIsOutdated(renderer,localStorage->
m_LastUpdateTime);
62 || outdatedRendererGeometry)
66 bool isGridActive =
false;
69 bool isGlyphActive =
false;
72 bool isPointsActive =
false;
75 bool showStartGrid =
false;
87 const DataNode *node = this->GetDataNode();
92 if (regWrapper == NULL)
98 if (outdatedFOV ||isGridActiveOutdated || isGlyphActiveOutdated || isPointsActiveOutdated || outdatedRendererGeometry)
104 mitkThrow() <<
"No reg kernel for visualization";
108 unsigned int gridFrequ =5;
110 if (!GetGeometryDescription(renderer,gridDesc, gridFrequ))
122 else if (isGlyphActive)
130 mitkThrow() <<
"No reg kernel visualization style activated.";
147 if(isColorStyleOutdated || isColorUniOutdated || isColor1Outdated ||
148 isColor2Outdated || isColor2MagOutdated || isColor3Outdated || isColor3MagOutdated ||
149 isColor4Outdated || isColor4MagOutdated || isColorInterpolateOutdated)
158 float color1[3] = {0.0,0.0,0.0};
160 float color2[3] = {0.25,0.25,0.25};
162 float color3[3] = {0.5,0.5,0.5};
164 float color4[3] = {1.0,1.0,1.0};
174 bool interpolate =
true;
183 if (!colorStyleProp || colorStyleProp->
GetValueAsId()==0)
185 float temprgb[3] = {1.0,1.0,1.0};
187 localStorage->
m_LUT->AddRGBSegment(0.0,temprgb[0],temprgb[1],temprgb[2],1.0,temprgb[0],temprgb[1],temprgb[2]);
188 localStorage->
m_LUT->Build();
193 localStorage->
m_LUT->AddRGBPoint(0.0,color1[0],color1[1],color1[2]);
194 localStorage->
m_LUT->AddRGBPoint(mag2,color2[0],color2[1],color2[2]);
195 localStorage->
m_LUT->AddRGBPoint(mag3,color3[0],color3[1],color3[2]);
196 localStorage->
m_LUT->AddRGBPoint(mag4,color4[0],color4[1],color4[2]);
199 localStorage->
m_LUT->AddRGBPoint(0.99*mag2,color1[0],color1[1],color1[2]);
200 localStorage->
m_LUT->AddRGBPoint(0.99*mag3,color2[0],color2[1],color2[2]);
201 localStorage->
m_LUT->AddRGBPoint(0.99*mag4,color3[0],color3[1],color3[2]);
205 localStorage->
m_LUT->Build();
212 if(isGridStartColorOutdated)
220 double trgb[3] = { (double) temprgb[0], (
double) temprgb[1], (double) temprgb[2] };
227 if(isGridActiveOutdated||isGlyphActiveOutdated||isPointsActiveOutdated||showStartGridOutdated)
239 else if (isGlyphActive)
253 Superclass::SetDefaultProperties(node, renderer, overwrite);
258 return m_LSH.GetLocalStorage(renderer)->m_RegAssembly;
270 m_DeformedGridActor->SetMapper(m_DeformedGridMapper);
274 m_StartGridActor->SetMapper(m_StartGridMapper);
280 m_DeformedGridData = NULL;
281 m_StartGridData = NULL;
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
vtkSmartPointer< vtkPolyData > m_StartGridData
const char *const nodeProp_RegVisGrid
MITKRegistrationWrapperMapperBase()
vtkSmartPointer< vtkActor > m_StartGridActor
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the map or the last change of one of the properties store in ...
Base of all data objects.
Organizes the rendering process.
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
const char *const nodeProp_RegVisColorInterpolate
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=NULL, bool overwrite=false)
MAPRegistrationWrapper Wrapper class to allow the handling of MatchPoint registration objects as mitk...
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
T::Pointer GetData(const std::string &name)
static void SetVtkMapperImmediateModeRendering(vtkMapper *mapper)
vtkSmartPointer< vtkPolyDataMapper > m_DeformedGridMapper
const char *const nodeProp_RegVisColorStyle
vtkSmartPointer< vtkPolyData > MITKMATCHPOINTREGISTRATION_EXPORT Generate3DDeformationGrid(const mitk::BaseGeometry *gridDesc, unsigned int gridFrequence, const map::core::RegistrationKernelBase< 3, 3 > *regKernel)
const char *const nodeProp_RegVisGridStartColor
const char *const nodeProp_RegVisColor3Value
vtkSmartPointer< vtkPolyData > m_DeformedGridData
bool PropertyIsOutdated(const mitk::DataNode *regNode, const std::string &propName, const itk::TimeStamp &reference)
vtkSmartPointer< vtkPolyDataMapper > m_StartGridMapper
bool GridIsOutdated(const mitk::DataNode *regNode, const itk::TimeStamp &reference)
vtkSmartPointer< vtkActor > m_DeformedGridActor
const char *const nodeProp_RegVisPoints
vtkSmartPointer< vtkPolyData > Generate3DDeformationGlyph(const mitk::BaseGeometry *gridDesc, const map::core::RegistrationKernelBase< 3, 3 > *regKernel)
const char *const nodeProp_RegVisColor1Value
bool GetPropertyValue(const char *propertyKey, T &value, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for GenericProperty properties (T being the type of the second parameter...
const char *const nodeProp_RegVisColor2Value
virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer)
Generate the data needed for rendering into renderer.
const char *const nodeProp_RegVisColor4Magnitude
const char *const nodeProp_RegVisColor2Magnitude
const char *const nodeProp_RegVisGridShowStart
const char * GetName() const
get the name of the Renderer
const char *const nodeProp_RegVisGlyph
RegWrapperLocalStorage()
Constructor of the local storage. Do as much actions as possible in here to avoid double executions...
vtkSmartPointer< vtkColorTransferFunction > m_LUT
const char *const nodeProp_RegVisColor4Value
const char *const nodeProp_RegVisColor3Magnitude
virtual ~MITKRegistrationWrapperMapperBase()
const char *const nodeProp_RegVisColorUni
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer)
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
vtkSmartPointer< vtkPropAssembly > m_RegAssembly
Class for nodes of the DataTree.
virtual IdType GetValueAsId() const
const map::core::RegistrationKernelBase< 3, 3 > * GetRelevantRegKernelOfNode(const mitk::DataNode *regNode)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.