7 #include "visuVTKAdaptor/SMesh.hpp" 9 #include "visuVTKAdaptor/SMaterial.hpp" 10 #include "visuVTKAdaptor/SMeshNormals.hpp" 11 #include "visuVTKAdaptor/STexture.hpp" 12 #include "visuVTKAdaptor/STransform.hpp" 14 #include <fwCom/Signal.hxx> 15 #include <fwCom/Slot.hpp> 16 #include <fwCom/Slot.hxx> 17 #include <fwCom/Slots.hpp> 18 #include <fwCom/Slots.hxx> 20 #include <fwData/Material.hpp> 21 #include <fwData/Mesh.hpp> 22 #include <fwData/mt/ObjectReadLock.hpp> 24 #include <fwRuntime/EConfigurationElement.hpp> 26 #include <fwServices/macros.hpp> 27 #include <fwServices/op/Add.hpp> 29 #include <fwVtkIO/helper/Mesh.hpp> 30 #include <fwVtkIO/vtk.hpp> 33 #include <vtkCamera.h> 34 #include <vtkCommand.h> 35 #include <vtkDepthSortPolyData.h> 37 #include <vtkMatrix4x4.h> 38 #include <vtkPicker.h> 39 #include <vtkPlaneCollection.h> 40 #include <vtkPolyDataMapper.h> 41 #include <vtkPolyDataNormals.h> 42 #include <vtkProperty.h> 43 #include <vtkRenderer.h> 44 #include <vtkRenderWindowInteractor.h> 45 #include <vtkTextureMapToCylinder.h> 46 #include <vtkTextureMapToPlane.h> 47 #include <vtkTextureMapToSphere.h> 48 #include <vtkTransform.h> 59 const ::fwCom::Signals::SignalKeyType SMesh::s_TEXTURE_APPLIED_SIG =
"textureApplied";
76 const ::fwServices::IService::KeyType SMesh::s_MESH_INPUT =
"mesh";
78 static const std::string s_MATRIX_FIELD_NAME =
"TransformMatrix";
85 virtual void Stop() = 0;
107 m_planeSrc->Register(
this);
108 m_planeDst->Register(
this);
109 src->AddObserver(vtkCommand::ModifiedEvent,
this);
110 this->Execute( 0, vtkCommand::ModifiedEvent, 0);
117 m_planeSrc->RemoveObserver(
this);
118 m_planeSrc->UnRegister(
this);
119 m_planeDst->UnRegister(
this);
124 virtual void Execute( vtkObject* caller,
unsigned long eventId,
void* )
126 if (eventId == vtkCommand::ModifiedEvent)
131 m_planeSrc->GetNormal(n);
132 m_planeSrc->GetOrigin(o);
136 for (
int i = 0; i < 3; i++)
142 m_planeDst->SetNormal( n );
143 m_planeDst->SetOrigin( o );
144 m_planeDst->Push( m_factor );
145 m_planeDst->Modified();
151 vtkPlane* m_planeSrc;
152 vtkPlane* m_planeDst;
163 ::visuVTKAdaptor::SMesh::sptr service,
164 vtkPlaneCollection* src,
172 vtkPlaneCollection* src,
175 m_planeCollectionSrc(src),
178 m_planeCollectionSrc->Register(
this);
179 m_planeCollectionSrc->AddObserver(vtkCommand::ModifiedEvent,
this);
180 this->Execute( 0, vtkCommand::ModifiedEvent, 0);
187 m_planeCollectionSrc->RemoveObserver(
this);
188 m_planeCollectionSrc->UnRegister(
this);
196 for( ::visuVTKAdaptor::SMesh::wptr adaptor : m_meshServices )
198 if (!adaptor.expired())
200 adaptor.lock()->stop();
201 ::fwServices::OSR::unregisterService(adaptor.lock());
204 m_meshServices.clear();
212 m_planeCallbacks.clear();
214 for( vtkPlaneCollection* planeCol : m_planeCollections )
218 m_planeCollections.clear();
220 if (!m_service.expired())
222 m_service.lock()->setActorPropertyToUnclippedMaterial(
false );
228 virtual void Execute( vtkObject* caller,
unsigned long eventId,
void* data)
230 ::visuVTKAdaptor::SMesh::sptr service;
232 if (m_service.expired())
239 if (eventId == vtkCommand::ModifiedEvent)
241 service = m_service.lock();
245 vtkPlane* plane = NULL;
246 for ( m_planeCollectionSrc->InitTraversal();
247 (plane = m_planeCollectionSrc->GetNextItem());
250 vtkPlane* newPlane = vtkPlane::New();
251 m_planeCallbacks.push_back(PlaneShifterCallback::New(plane, newPlane, m_factor));
253 vtkPlaneCollection* newCollection = vtkPlaneCollection::New();
254 newCollection->AddItem(newPlane);
256 ::fwServices::registry::ServiceFactory::sptr srvFactory =
259 ::fwServices::IService::sptr srv = srvFactory->create(
"::visuVTKAdaptor::SMesh");
260 SLM_ASSERT(
"Service of type '::visuVTKAdaptor::SMesh' cannot be instantiated.", srv);
262 ::fwRenderVTK::IAdaptor::sptr meshService = ::fwRenderVTK::IAdaptor::dynamicCast(srv);
263 SLM_ASSERT(
"Service of type '::visuVTKAdaptor::SMesh' is not an adaptor", meshService);
265 ::fwServices::OSR::registerServiceInput(service->getInput< ::
fwData::Mesh >(SMesh::s_MESH_INPUT),
266 SMesh::s_MESH_INPUT, srv);
268 ::visuVTKAdaptor::SMesh::sptr meshAdaptor = SMesh::dynamicCast(meshService);
272 config.m_type =
"::visuVTKAdaptor::SMesh";
273 config.m_globalAutoConnect =
false;
274 config.m_config = ::fwRuntime::EConfigurationElement::New(
"service");
276 objConfig.m_key = SMesh::s_MESH_INPUT;
277 objConfig.m_access = ::fwServices::IService::AccessType::INPUT;
278 objConfig.m_autoConnect =
true;
279 objConfig.m_optional =
false;
280 config.m_objects.push_back(objConfig);
282 meshAdaptor->setConfiguration(config);
283 meshAdaptor->setRenderService(service->getRenderService());
284 meshAdaptor->setRendererId(service->getRendererId());
285 meshAdaptor->setPickerId(service->getPickerId());
286 meshAdaptor->setMaterial(service->getMaterial());
287 meshAdaptor->setVtkClippingPlanes(newCollection);
288 meshAdaptor->setShowClippedPart(
false);
289 meshAdaptor->setTransformId(service->getTransformId());
291 meshAdaptor->start().wait();
292 meshAdaptor->updateVisibility(service->getVisibility());
294 m_planeCollections.push_back(newCollection);
295 m_meshServices.push_back(meshAdaptor);
300 bool hasItems = !m_meshServices.empty();
301 service->setActorPropertyToUnclippedMaterial( hasItems );
303 else if ( eventId == vtkCommand::UserEvent )
305 for( ::visuVTKAdaptor::SMesh::wptr adaptor : m_meshServices )
307 if (!adaptor.expired())
309 adaptor.lock()->updateVisibility(*(
bool*)data);
317 ::visuVTKAdaptor::SMesh::wptr m_service;
319 vtkPlaneCollection* m_planeCollectionSrc;
320 ::fwData::Mesh::sptr m_mesh;
322 std::vector< ::visuVTKAdaptor::SMesh::wptr > m_meshServices;
324 std::vector< PlaneShifterCallback* > m_planeCallbacks;
325 std::vector< vtkPlaneCollection* > m_planeCollections;
332 SMesh::SMesh() noexcept :
333 m_showClippedPart(
true),
334 m_autoResetCamera(
true),
336 m_mapper(vtkPolyDataMapper::New()),
338 m_clippingPlanes(
nullptr),
339 m_servicesStarterCallback(
nullptr),
340 m_transform(vtkTransform::New()),
343 m_unclippedPartMaterial = ::fwData::Material::New();
344 m_material = ::fwData::Material::New();
345 m_unclippedPartMaterial->diffuse()->setRGBA(
"#aaaaff44");
346 m_clippingPlanesId =
"";
348 m_sigTextureApplied = newSignal<TextureAppliedSignalType>(s_TEXTURE_APPLIED_SIG);
368 SMesh::~SMesh() noexcept
370 m_clippingPlanes =
nullptr;
375 m_transform->Delete();
376 m_transform =
nullptr;
386 m_polyData->Delete();
387 m_polyData =
nullptr;
395 this->configureParams();
397 const ConfigType config = this->getConfigTree().get_child(
"config.<xmlattr>");
399 const std::string color = config.get<std::string>(
"color",
"#ffffffff");
400 const std::string unclippedColor = config.get<std::string>(
"unclippedcolor",
"#aaaaff44");
402 m_material->diffuse()->setRGBA(color);
404 m_unclippedPartMaterial->diffuse()->setRGBA(unclippedColor);
406 const std::string autoresetcamera = config.get<std::string>(
"autoresetcamera",
"yes");
407 SLM_ASSERT(
"'autoresetcamera' must be 'yes' or 'no'", autoresetcamera ==
"yes" || autoresetcamera ==
"no");
408 m_autoResetCamera = (autoresetcamera ==
"yes");
410 const std::string uvGen = config.get<std::string>(
"uvgen",
"none");
416 else if(uvGen ==
"sphere")
420 else if(uvGen ==
"cylinder")
424 else if(uvGen ==
"plane")
430 SLM_FATAL(
"'uvgen' value must be 'none', 'sphere', 'cylinder' or 'plane', actual: " + uvGen);
433 if (config.count(
"texture"))
435 SLM_FATAL(
"'texture' is deprecated, you need to connect manually the SMesh::textureApplied signal to the " 436 "STexture::applyTexture slot.");
439 if (config.count(
"shadingMode"))
441 const std::string shading = config.get<std::string>(
"shadingMode");
442 const ::fwData::Material::ShadingType shadingMode = (shading ==
"ambient") ? ::fwData::Material::AMBIENT :
443 (shading ==
"flat") ? ::fwData::Material::FLAT :
444 (shading ==
"gouraud") ? ::fwData::Material::GOURAUD :
445 ::fwData::Material::PHONG;
446 m_material->setShadingMode(shadingMode);
449 this->setClippingPlanesId(config.get<std::string>(
"clippingplane",
""));
456 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
458 this->updateMesh( mesh );
459 this->requestRender();
468 this->buildPipeline();
470 this->requestRender();
477 this->removeAllPropFromRenderer();
478 if (this->getPicker())
480 this->removeFromPicker(m_actor);
483 this->removeNormalsService();
484 this->removeServicesStarterCommand();
486 this->unregisterServices();
488 m_connections.disconnect();
489 this->requestRender();
494 void SMesh::createTransformService()
496 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
499 ::fwData::TransformationMatrix3D::sptr fieldTransform;
507 auto prevTransformService = m_transformService.lock();
508 if (prevTransformService)
512 if (trf == fieldTransform)
517 this->unregisterService(prevTransformService);
518 m_transformService.reset();
522 vtkTransform* vtkFieldTransform = vtkTransform::New();
523 vtkFieldTransform->Identity();
526 auto transformService = this->registerService< ::visuVTKAdaptor::STransform>(
"::visuVTKAdaptor::STransform");
527 m_transformService = transformService;
528 transformService->registerInOut(fieldTransform, STransform::s_TM3D_INOUT,
true);
530 transformService->setRenderService( this->getRenderService() );
531 transformService->setRendererId( this->getRendererId() );
532 transformService->setTransform(vtkFieldTransform);
533 transformService->start();
535 m_transform->Concatenate(vtkFieldTransform);
536 m_transform->Modified();
537 vtkFieldTransform->Delete();
543 ::fwData::Material::sptr SMesh::getMaterial()
const 550 ::fwData::Material::sptr SMesh::getUnclippedMaterial()
const 552 return m_unclippedPartMaterial;
557 void SMesh::setActorPropertyToUnclippedMaterial(
bool opt)
559 ::visuVTKAdaptor::SMaterial::sptr mat;
563 SLM_ASSERT(
"Material service expired", !m_unclippedPartMaterialService.expired());
564 mat = ::visuVTKAdaptor::SMaterial::dynamicCast(m_unclippedPartMaterialService.lock());
568 SLM_ASSERT(
"Material service expired", !m_materialService.expired());
569 mat = ::visuVTKAdaptor::SMaterial::dynamicCast(m_materialService.lock());
574 m_actor->SetProperty( mat->getVtkProperty() );
575 this->setVtkPipelineModified();
580 void SMesh::setShowClippedPart(
bool show)
582 m_showClippedPart = show;
587 void SMesh::setClippingPlanesId(::fwRenderVTK::SRender::VtkObjectIdType
id)
589 m_clippingPlanesId = id;
594 void SMesh::setServiceOnMaterial(::fwRenderVTK::IAdaptor::sptr& srv, ::fwData::Material::sptr material)
599 srv = this->registerService< ::fwRenderVTK::IAdaptor>(
"::visuVTKAdaptor::SMaterial");
600 srv->registerInput(material, SMaterial::s_MATERIAL_INPUT,
true);
602 srv->setRenderService(this->getRenderService());
610 void SMesh::setMaterial(::fwData::Material::sptr material)
612 m_material = material;
617 void SMesh::setUnclippedPartMaterial(::fwData::Material::sptr material)
619 m_unclippedPartMaterial = material;
626 if (m_material->getOptionsMode() == ::fwData::Material::NORMALS)
628 this->createNormalsService();
632 this->removeNormalsService();
638 void SMesh::createNormalsService()
640 if ( m_normalsService.expired() )
642 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
646 auto service = this->registerService< ::visuVTKAdaptor::SMeshNormals >(
"::visuVTKAdaptor::SMeshNormals");
647 service->registerInput(mesh, SMeshNormals::s_MESH_INPUT,
true);
649 service->setRenderService( this->getRenderService() );
650 service->setRendererId( this->getRendererId() );
651 service->setPickerId( this->getPickerId() );
652 service->setPolyData( m_polyData );
655 m_normalsService = service;
661 void SMesh::removeNormalsService()
663 if ( !m_normalsService.expired() )
665 this->unregisterService(m_normalsService.lock());
666 m_normalsService.reset();
672 void SMesh::buildPipeline()
674 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
677 if (!m_clippingPlanesId.empty())
679 vtkObject* o = this->getVtkObject(m_clippingPlanesId);
680 vtkPlaneCollection* planes = vtkPlaneCollection::SafeDownCast(o);
681 this->setVtkClippingPlanes( planes );
684 ::fwRenderVTK::IAdaptor::sptr materialService;
685 ::fwRenderVTK::IAdaptor::sptr unclippedPartMaterialService;
687 this->setServiceOnMaterial(materialService, m_material);
688 this->setServiceOnMaterial(unclippedPartMaterialService, m_unclippedPartMaterial);
690 m_materialService = materialService;
691 m_unclippedPartMaterialService = unclippedPartMaterialService;
695 m_actor = this->newActor();
697 if(!this->getTransformId().empty())
699 vtkTransform* t = m_renderService.lock()->getOrAddVtkTransform(m_transformId);
700 m_transform->Concatenate(t);
702 m_actor->SetUserTransform(m_transform);
704 this->createTransformService();
706 this->addToRenderer(m_actor);
707 if (this->getPicker())
709 this->addToPicker(m_actor);
713 this->updateMesh( mesh );
714 this->updateOptionsMode();
716 this->setActorPropertyToUnclippedMaterial(
false);
718 this->removeServicesStarterCommand();
720 if( m_clippingPlanes && m_showClippedPart )
722 this->createServicesStarterCommand();
724 this->setVtkPipelineModified();
729 void SMesh::updateMesh( ::fwData::Mesh::csptr mesh )
733 m_polyData->Delete();
736 m_polyData = vtkPolyData::New();
743 if(m_uvgen == SPHERE)
745 vtkSmartPointer<vtkTextureMapToSphere> texCoord = vtkSmartPointer<vtkTextureMapToSphere>::New();
746 texCoord->SetInputData(m_polyData);
747 m_mapper->SetInputConnection(texCoord->GetOutputPort());
749 else if(m_uvgen == CYLINDER)
751 vtkSmartPointer<vtkTextureMapToCylinder> texCoord = vtkSmartPointer<vtkTextureMapToCylinder>::New();
752 texCoord->SetInputData(m_polyData);
753 m_mapper->SetInputConnection(texCoord->GetOutputPort());
755 else if(m_uvgen == PLANE)
757 vtkSmartPointer<vtkTextureMapToPlane> texCoord = vtkSmartPointer<vtkTextureMapToPlane>::New();
758 texCoord->SetInputData(m_polyData);
759 m_mapper->SetInputConnection(texCoord->GetOutputPort());
763 m_mapper->SetInputData(m_polyData);
766 ::fwData::Material::sptr material = this->getMaterial();
768 m_sigTextureApplied->asyncEmit(material);
770 if (m_autoResetCamera)
772 this->getRenderer()->ResetCamera();
774 this->setVtkPipelineModified();
779 vtkActor* SMesh::newActor()
781 vtkActor* actor = vtkActor::New();
783 m_mapper->SetInputData(m_polyData);
785 if (m_clippingPlanes)
787 m_mapper->SetClippingPlanes(m_clippingPlanes);
790 actor->SetMapper(m_mapper);
791 this->setVtkPipelineModified();
801 m_actor->SetVisibility( isVisible );
804 if (m_servicesStarterCallback)
806 m_servicesStarterCallback->Execute(0, vtkCommand::UserEvent, &isVisible);
808 this->setVtkPipelineModified();
809 this->requestRender();
814 bool SMesh::getVisibility()
const 816 bool visible =
false;
819 visible = m_actor->GetVisibility() == 1;
826 void SMesh::setVtkClippingPlanes(vtkPlaneCollection* planes)
828 m_clippingPlanes = planes;
833 void SMesh::createServicesStarterCommand()
835 if(!m_servicesStarterCallback)
837 ::visuVTKAdaptor::SMesh::sptr srv = ::visuVTKAdaptor::SMesh::dynamicCast(this->getSptr());
838 m_servicesStarterCallback = PlaneCollectionAdaptorStarter::New( srv, m_clippingPlanes, -1. );
844 void SMesh::removeServicesStarterCommand()
846 if(m_servicesStarterCallback)
848 m_servicesStarterCallback->Stop();
849 m_servicesStarterCallback->Delete();
850 m_servicesStarterCallback = 0;
858 m_autoResetCamera = autoResetCamera;
885 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
887 SLM_ASSERT(
"m_polyData not instanced", m_polyData);
891 this->setVtkPipelineModified();
892 this->requestRender();
899 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
901 SLM_ASSERT(
"m_polyData not instanced", m_polyData);
905 this->setVtkPipelineModified();
906 this->requestRender();
913 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
915 SLM_ASSERT(
"m_polyData not instanced", m_polyData);
920 if (m_autoResetCamera)
922 this->getRenderer()->ResetCamera();
924 this->setVtkPipelineModified();
925 this->requestRender();
932 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
936 this->setVtkPipelineModified();
937 this->requestRender();
944 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
948 this->setVtkPipelineModified();
949 this->requestRender();
956 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
960 this->setVtkPipelineModified();
961 this->requestRender();
968 ::fwData::Mesh::csptr mesh = this->getInput < ::fwData::Mesh >(s_MESH_INPUT);
972 this->setVtkPipelineModified();
973 this->requestRender();
980 m_mapper->ScalarVisibilityOn();
981 m_mapper->SetScalarModeToUsePointData();
982 this->setVtkPipelineModified();
983 this->requestRender();
990 m_mapper->ScalarVisibilityOn();
991 m_mapper->SetScalarModeToUseCellData();
992 this->setVtkPipelineModified();
993 this->requestRender();
1000 m_mapper->ScalarVisibilityOff();
1001 this->setVtkPipelineModified();
1002 this->requestRender();
1018 this->showPointColors();
1023 this->showCellColors();
1028 OSLM_ERROR(
"mode " << mode <<
" is not allowed");
1038 this->updateOptionsMode();
1039 if (!m_normalsService.expired())
1041 ::visuVTKAdaptor::SMeshNormals::sptr normalsAdaptor =
1042 ::visuVTKAdaptor::SMeshNormals::dynamicCast(m_normalsService.lock());
1043 normalsAdaptor->updateNormalMode(mode);
1051 if (fields.find(s_MATRIX_FIELD_NAME) != fields.end())
1053 this->createTransformService();
static FWVTKIO_API void updatePolyDataPointColor(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with point color of fwData::Mesh.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_SHOW_POINT_COLORS_SLOT
Slot: update mesh visibility (true = visible)
This class is a helper to define the connections of a service and its data.
void showCellColors()
Slot: used to show cell colors.
void updateColorMode(std::uint8_t mode)
Slot: used to update color mode (0: none, 1: point, 2: cell)
void hideColors()
Slot: used to hide colors.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_VISIBILITY_SLOT
Slot: update mesh visibility (true = visible)
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_NORMALS_MODIFIED_SIG
Key in m_signals map of signal m_sigPointNormalsModified.
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
static FWVTKIO_API void toVTKMesh(const ::fwData::Mesh::csptr &_mesh, vtkSmartPointer< vtkPolyData > _polyData)
Convert a ::fwData::Mesh::csptr to a vtkPolyData.
void updatePointTexCoords()
Slot: used to update point tex coords.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_MATRIX_FIELD_SLOT
Slot: update mesh visibility (true = visible)
void updateCellColors()
Slot: used to update cell colors.
A helper to lock object on read mode.
VISUVTKADAPTOR_API void configuring() override
Configure the service before starting. Apply the configuration to service.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_SHOW_CELL_COLORS_SLOT
Slot: update mesh visibility (true = visible)
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_COLOR_MODE_SLOT
Slot: update mesh visibility (true = visible)
static FWVTKIO_API void updatePolyDataPoints(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with ::fwData::Mesh::sptr points.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_CELL_COLORS_MODIFIED_SIG
Key in m_signals map of signal m_sigCellColorsModified.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_CELL_TEX_COORDS_SLOT
Slot: update mesh visibility (true = visible)
void updateMatrixField(::fwData::Object::FieldsContainerType fields)
Slot: update the matrix service if the 'TransformMatrix' field changed.
Display a fwData::Mesh in the generic scene.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_CHANGED_FIELDS_SIG
Type of signal m_sigModified.
void updateCellNormals()
Slot: used to update cell normals.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_CELL_NORMALS_MODIFIED_SIG
Key in m_signals map of signal m_sigCellNormalsModified.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_ADDED_FIELDS_SIG
Type of signal m_sigModified.
Used to store object configuration in a service.
void showPointColors()
Slot: used to show point colors.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_TEX_COORDS_MODIFIED_SIG
Key in m_signals map of signal m_sigPointTexCoorddModified.
std::map< std::string,::fwData::Object::sptr > FieldsContainerType
Type of signal m_sigModified.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_NORMAL_MODE_SLOT
Slot: update mesh visibility (true = visible)
virtual VISUVTKADAPTOR_API KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
VISUVTKADAPTOR_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_VERTEX_SLOT
Slot: update mesh visibility (true = visible)
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_POINT_NORMALS_SLOT
Slot: update mesh visibility (true = visible)
#define SLM_FATAL(message)
#define OSLM_ERROR(message)
static FWVTKIO_API void updatePolyDataCellColor(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with cell color of fwData::Mesh.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_CELL_NORMALS_SLOT
Slot: update mesh visibility (true = visible)
void updateCellTexCoords()
Slot: used to update cell tex coords.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_CELL_COLORS_SLOT
Slot: update mesh visibility (true = visible)
static FWVTKIO_API void updatePolyDataCellTexCoords(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with cell texCoords of fwData::Mesh.
void updatePointNormals()
Slot: used to update point normals.
static FWVTKIO_API void updatePolyDataCellNormals(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with cell normals of fwData::Mesh.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_CELL_TEX_COORDS_MODIFIED_SIG
Key in m_signals map of signal m_sigCellTexCoorddModified.
VISUVTKADAPTOR_API void setAutoResetCamera(bool autoResetCamera)
Active/Inactive automatic reset on camera. By default =true.
void updateVertex()
Slot: used to update mesh vertex.
VISUVTKADAPTOR_API void updateVisibility(bool isVisible)
Slot: update mesh visibility (true = visible)
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_VERTEX_MODIFIED_SIG
Key in m_signals map of signal m_sigVertexModified.
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_HIDE_COLORS_SLOT
Slot: update mesh visibility (true = visible)
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_MODIFIED_SIG
Key in m_signals map of signal m_sigModified.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_REMOVED_FIELDS_SIG
Type of signal m_sigModified.
static FWVTKIO_API void updatePolyDataPointNormals(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with point normals of fwData::Mesh.
VISUVTKADAPTOR_API void updateOptionsMode()
Creates normals adaptor if material has NORMALS, else remove normals adaptor.
VISUVTKADAPTOR_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
static FWSERVICES_API ServiceFactory::sptr getDefault()
Return the unique Instance, create it if required at first access.
static FWVTKIO_API void updatePolyDataPointTexCoords(vtkSmartPointer< vtkPolyData > polyDataDst, const ::fwData::Mesh::csptr &meshSrc)
Update a vtkPolyData with point texCoords of fwData::Mesh.
void updatePointColors()
Slot: used to update point colors.
Data holding a geometric structure composed of points, lines, triangles, quads or polygons...
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_POINT_TEX_COORDS_SLOT
Slot: update mesh visibility (true = visible)
static VISUVTKADAPTOR_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_POINT_COLORS_SLOT
Slot: update mesh visibility (true = visible)
Used to store a service configuration.
VISUVTKADAPTOR_API void updateNormalMode(std::uint8_t mode)
Used to update normal mode (0: none, 1: point, 2: cell)
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_COLORS_MODIFIED_SIG
Key in m_signals map of signal m_sigPointColorsModified.
VISUVTKADAPTOR_API void starting() override
Initialize the service activity.
Base class for VTK adaptors.