22 #include <vtkPropAssembly.h>
23 #include <vtkPointData.h>
24 #include <vtkProperty.h>
25 #include <vtkCellArray.h>
26 #include <vtkDepthSortPolyData.h>
27 #include <vtkCamera.h>
28 #include <vtkTubeFilter.h>
29 #include <vtkRibbonFilter.h>
30 #include <vtkLookupTable.h>
61 if (fiberBundle == NULL)
64 vtkSmartPointer<vtkPolyData> fiberPolyData = fiberBundle->
GetFiberPolyData();
65 if (fiberPolyData == NULL)
68 fiberPolyData->GetPointData()->AddArray(fiberBundle->
GetFiberColors());
70 this->GetDataNode()->GetOpacity(tmpopa, NULL);
71 FBXLocalStorage3D *localStorage = m_LocalStorageHandler.GetLocalStorage(renderer);
76 tubeFilter->SetInputData(fiberPolyData);
77 tubeFilter->SetNumberOfSides(m_TubeSides);
78 tubeFilter->SetRadius(m_TubeRadius);
80 fiberPolyData = tubeFilter->GetOutput();
82 else if (m_RibbonWidth>0.0)
85 tubeFilter->SetInputData(fiberPolyData);
86 tubeFilter->SetWidth(m_RibbonWidth);
88 fiberPolyData = tubeFilter->GetOutput();
94 depthSort->SetInputData( fiberPolyData );
95 depthSort->SetCamera( renderer->
GetVtkRenderer()->GetActiveCamera() );
96 depthSort->SetDirectionToFrontToBack();
98 localStorage->
m_FiberMapper->SetInputConnection(depthSort->GetOutputPort());
107 float floatProp = 1.0;
108 GetDataNode()->GetFloatProperty(
"light.ambient", floatProp);
109 localStorage->
m_FiberActor->GetProperty()->SetAmbient(floatProp);
110 GetDataNode()->GetFloatProperty(
"light.diffuse", floatProp);
111 localStorage->
m_FiberActor->GetProperty()->SetDiffuse(floatProp);
112 GetDataNode()->GetFloatProperty(
"light.specular", floatProp);
113 localStorage->
m_FiberActor->GetProperty()->SetSpecular(floatProp);
114 GetDataNode()->GetFloatProperty(
"light.specularpower", floatProp);
115 localStorage->
m_FiberActor->GetProperty()->SetSpecularPower( floatProp );
124 localStorage->
m_FiberActor->GetProperty()->SetLighting(
true);
128 localStorage->
m_FiberActor->GetProperty()->SetLighting(
false);
131 localStorage->
m_FiberMapper->SelectColorArray(
"FIBER_COLORS");
133 localStorage->
m_FiberMapper->SetScalarModeToUsePointFieldData();
138 localStorage->
m_FiberActor->GetProperty()->SetOpacity((
double) tmpopa);
139 localStorage->
m_FiberActor->GetProperty()->SetLineWidth(m_LineWidth);
150 GetDataNode()->GetVisibility(visible, renderer,
"visible");
151 if ( !visible )
return;
153 const DataNode* node = this->GetDataNode();
154 FBXLocalStorage3D* localStorage = m_LocalStorageHandler.GetLocalStorage(renderer);
158 float tubeRadius = 0;
160 if (m_TubeRadius!=tubeRadius)
162 m_TubeRadius = tubeRadius;
168 if (m_TubeSides!=tubeSides)
170 m_TubeSides = tubeSides;
176 if (m_LineWidth!=lineWidth)
178 m_LineWidth = lineWidth;
182 float ribbonWidth = 0;
184 if (m_RibbonWidth!=ribbonWidth)
186 m_RibbonWidth = ribbonWidth;
190 bool lighting =
false;
192 if (m_Lighting!=lighting)
194 m_Lighting = lighting;
203 this->CalculateTimeStep( renderer );
204 this->InternalGenerateData(renderer);
210 Superclass::SetDefaultProperties(node, renderer, overwrite);
232 return m_LocalStorageHandler.GetLocalStorage(renderer)->m_FiberAssembly;
vtkSmartPointer< vtkPropAssembly > m_FiberAssembly
itk::TimeStamp m_LastUpdateTime
Timestamp of last update of stored data.
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer=NULL, bool overwrite=false)
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer) override
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
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)
vtkSmartPointer< vtkActor > m_FiberActor
Point Actor of a 3D render window.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
const FiberBundle * GetInput()
virtual void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override
Generate the data needed for rendering into renderer.
vtkSmartPointer< vtkPolyDataMapper > m_FiberMapper
Point Mapper of a 3D render window.
The ColorProperty class RGB color property.
virtual ~FiberBundleMapper3D()
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 ...
static void SetVtkMapperImmediateModeRendering(vtkMapper *mapper)
void InternalGenerateData(mitk::BaseRenderer *renderer)
vtkSmartPointer< vtkPolyData > GetFiberPolyData() const
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
Base Class for Fiber Bundles;.
vtkSmartPointer< vtkUnsignedCharArray > GetFiberColors() const
const mitk::Color & GetColor() const
FBXLocalStorage3D()
Constructor of the local storage. Do as much actions as possible in here to avoid double executions...
virtual itk::TimeStamp GetUpdateTime3D()
vtkRenderer * GetVtkRenderer() const
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.