20 #include <vtkPolyDataMapper.h>
22 #include <vtkPolyData.h>
23 #include <vtkPointData.h>
24 #include <vtkProperty.h>
25 #include <vtkLookupTable.h>
26 #include <vtkPoints.h>
27 #include <vtkCamera.h>
28 #include <vtkPolyLine.h>
29 #include <vtkRenderer.h>
30 #include <vtkCellArray.h>
31 #include <vtkMatrix4x4.h>
32 #include <vtkTubeFilter.h>
62 GetDataNode()->GetVisibility(visible, renderer,
"visible");
68 this->CalculateTimeStep( renderer );
71 FBXLocalStorage *localStorage = m_LocalStorageHandler.GetLocalStorage(renderer);
75 float thickness = 2.0;
76 if(!this->GetDataNode()->GetPropertyValue(
"Fiber2DSliceThickness",thickness))
77 MITK_INFO <<
"FIBER2D SLICE THICKNESS PROPERTY ERROR";
79 bool fiberfading =
false;
80 if(!this->GetDataNode()->GetPropertyValue(
"Fiber2DfadeEFX",fiberfading))
81 MITK_INFO <<
"FIBER2D SLICE FADE EFX PROPERTY ERROR";
84 this->GetDataNode()->GetOpacity(fiberOpacity, NULL);
85 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.fiberThickness",thickness);
86 node->SetIntProperty(
"shader.mitkShaderFiberClipping.fiberFadingON",fiberfading);
87 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.fiberOpacity",fiberOpacity);
90 if (fiberBundle==NULL)
94 node->GetIntProperty(
"LineWidth", lineWidth);
95 if (m_LineWidth!=lineWidth)
97 m_LineWidth = lineWidth;
103 this->UpdateShaderParameter(renderer);
104 this->GenerateDataForRenderer( renderer );
115 float planeNormal[3];
116 planeNormal[0] = planeGeo->GetNormal()[0];
117 planeNormal[1] = planeGeo->GetNormal()[1];
118 planeNormal[2] = planeGeo->GetNormal()[2];
120 float tmp1 = planeGeo->GetOrigin()[0] * planeNormal[0];
121 float tmp2 = planeGeo->GetOrigin()[1] * planeNormal[1];
122 float tmp3 = planeGeo->GetOrigin()[2] * planeNormal[2];
123 float thickness = tmp1 + tmp2 +
tmp3;
126 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.slicingPlane.w",thickness,renderer);
127 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.slicingPlane.x",planeNormal[0],renderer);
128 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.slicingPlane.y",planeNormal[1],renderer);
129 node->SetFloatProperty(
"shader.mitkShaderFiberClipping.slicingPlane.z",planeNormal[2],renderer);
138 FBXLocalStorage *localStorage = m_LocalStorageHandler.GetLocalStorage(renderer);
144 vtkSmartPointer<vtkPolyData> fiberPolyData = fiberBundle->
GetFiberPolyData();
145 if (fiberPolyData == NULL)
148 fiberPolyData->GetPointData()->AddArray(fiberBundle->
GetFiberColors());
150 localStorage->
m_FiberMapper->SetScalarModeToUsePointFieldData();
152 localStorage->
m_PointActor->GetProperty()->SetOpacity(0.999);
153 localStorage->
m_FiberMapper->SelectColorArray(
"FIBER_COLORS");
158 localStorage->
m_PointActor->GetProperty()->SetLineWidth(m_LineWidth);
161 this->ApplyShaderProperties(renderer);
171 return m_LocalStorageHandler.GetLocalStorage(renderer)->m_PointActor;
177 Superclass::SetDefaultProperties(node, renderer, overwrite);
virtual void AddDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite) const =0
Adds all parsed shader uniforms to property list of the given DataNode; used by mappers.
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
void UpdateShaderParameter(mitk::BaseRenderer *)
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=NULL, bool overwrite=false)
Organizes the rendering process.
virtual itk::TimeStamp GetUpdateTime2D()
static IShaderRepository * GetShaderRepository()
Get an IShaderRepository instance.
static void Update(vtkPolyData *)
vtkSmartPointer< vtkPolyDataMapper > m_FiberMapper
Point Mapper of a 2D render window.
mitk::FiberBundle * GetInput()
FBXLocalStorage()
Constructor of the local storage. Do as much actions as possible in here to avoid double executions...
void AddProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with ...
Management class for vtkShader XML descriptions.
vtkSmartPointer< vtkPolyData > GetFiberPolyData() const
virtual void GenerateDataForRenderer(mitk::BaseRenderer *) override
vtkSmartPointer< vtkActor > m_PointActor
Point Actor of a 2D render window.
Base Class for Fiber Bundles;.
vtkSmartPointer< vtkUnsignedCharArray > GetFiberColors() const
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
virtual ~FiberBundleMapper2D()
virtual SliceNavigationController * GetSliceNavigationController()
virtual void Update(mitk::BaseRenderer *renderer) override
Checks whether this mapper needs to update itself and generate data.
unsigned long GetCurrentWorldPlaneGeometryUpdateTime()
Get timestamp of last call of SetCurrentWorldPlaneGeometry.
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
US_USE_NAMESPACE std::string tmp1
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.