7 #ifndef __VISUVTKADAPTOR_SMESH_HPP__ 8 #define __VISUVTKADAPTOR_SMESH_HPP__ 10 #include "visuVTKAdaptor/config.hpp" 12 #include <fwCom/Slot.hpp> 13 #include <fwCom/Slots.hpp> 15 #include <fwRenderVTK/IAdaptor.hpp> 18 class vtkDepthSortPolyData;
20 class vtkAlgorithmOutput;
21 class vtkPolyDataNormals;
22 class vtkPlaneCollection;
23 class vtkActorCollection;
26 class vtkPolyDataMapper;
40 class VISUVTKADAPTOR_CLASS_API MeshVtkCommand;
94 VISUVTKADAPTOR_API
SMesh() noexcept;
95 VISUVTKADAPTOR_API virtual ~
SMesh() noexcept;
97 static const ::
fwServices::IService::KeyType s_MESH_INPUT;
104 VISUVTKADAPTOR_API static const ::
fwCom::Signals::SignalKeyType s_TEXTURE_APPLIED_SIG;
111 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_VISIBILITY_SLOT;
112 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_POINT_COLORS_SLOT;
113 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_CELL_COLORS_SLOT;
114 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_VERTEX_SLOT;
115 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_POINT_NORMALS_SLOT;
116 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_CELL_NORMALS_SLOT;
117 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_POINT_TEX_COORDS_SLOT;
118 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_CELL_TEX_COORDS_SLOT;
119 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_SHOW_POINT_COLORS_SLOT;
120 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_SHOW_CELL_COLORS_SLOT;
121 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_HIDE_COLORS_SLOT;
122 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_COLOR_MODE_SLOT;
123 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_NORMAL_MODE_SLOT;
124 VISUVTKADAPTOR_API static const ::
fwCom::Slots::SlotKeyType s_UPDATE_MATRIX_FIELD_SLOT;
127 VISUVTKADAPTOR_API
void updateVisibility (
bool isVisible );
130 VISUVTKADAPTOR_API
SPTR(::
fwData::Material) getMaterial() const;
131 VISUVTKADAPTOR_API
void setMaterial(
SPTR(::
fwData::Material) material);
133 VISUVTKADAPTOR_API
SPTR(::
fwData::Material) getUnclippedMaterial() const;
134 VISUVTKADAPTOR_API
void setUnclippedPartMaterial(
SPTR(::
fwData::Material) material);
136 VISUVTKADAPTOR_API
void setShowClippedPart (
bool show );
137 VISUVTKADAPTOR_API
void setClippingPlanesId( ::
fwRenderVTK::SRender::VtkObjectIdType
id );
139 VISUVTKADAPTOR_API
void setVtkClippingPlanes ( vtkPlaneCollection* planes );
140 VISUVTKADAPTOR_API
void setActorPropertyToUnclippedMaterial(
bool opt );
143 VISUVTKADAPTOR_API
void setAutoResetCamera(
bool autoResetCamera);
145 VISUVTKADAPTOR_API
bool getVisibility() const;
148 VISUVTKADAPTOR_API
void updateOptionsMode();
151 VISUVTKADAPTOR_API
void updateNormalMode(
std::uint8_t mode);
166 VISUVTKADAPTOR_API virtual
KeyConnectionsMap getAutoConnections() const override;
170 VISUVTKADAPTOR_API
void configuring() override;
171 VISUVTKADAPTOR_API
void starting() override;
172 VISUVTKADAPTOR_API
void updating() override;
173 VISUVTKADAPTOR_API
void stopping() override;
180 void updatePointColors();
184 void updateCellColors();
190 void updatePointNormals();
193 void updateCellNormals();
196 void updatePointTexCoords();
199 void updateCellTexCoords();
202 void showPointColors();
205 void showCellColors();
211 void updateColorMode(
std::uint8_t mode);
214 void updateMatrixField(::
fwData::Object::FieldsContainerType fields);
219 vtkActor* newActor();
220 void buildPipeline();
224 void setServiceOnMaterial(::
fwRenderVTK::IAdaptor::sptr &srv,
227 void removeServicesStarterCommand();
228 void createServicesStarterCommand();
230 void createTransformService();
231 void createNormalsService();
232 void removeNormalsService();
234 bool m_showClippedPart;
235 bool m_autoResetCamera;
237 vtkPolyData* m_polyData;
238 vtkPolyDataMapper* m_mapper;
241 vtkPlaneCollection* m_clippingPlanes;
242 ::
fwRenderVTK::SRender::VtkObjectIdType m_clippingPlanesId;
247 SPTR(::
fwData::Material) m_unclippedPartMaterial;
250 ::
fwRenderVTK::IAdaptor::wptr m_unclippedPartMaterialService;
253 vtkTransform* m_transform;
275 #endif // __VISUVTKADAPTOR_SMESH_HPP__
This class is a helper to define the connections of a service and its data.
TextureAppliedSignalType::sptr m_sigTextureApplied
Signal to emit when a texture must be applied on a material.
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
Namespace containing fw4spl communication tools.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
Display a fwData::Mesh in the generic scene.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
UvGenType
Type for generation of texture coordinates.
The namespace fwRenderVTK contains classes for rendering with VTK.
Contains the representation of the data objects used in the framework.
Base class for VTK adaptors.