Hello,
I don't think I have understood the modifications I have to do in the
getAssociatedObject function.
I try the second one. Here is the generic scene in my plugin.xml:
plugin.xml-------------------------------------------------------------------------------------
<service uid="genericScene"
implementation="::fwRenderVTK::VtkRenderService"
type="::fwRender::IRender" autoComChannel="yes">
<scene>
<picker id="myPicker" vtkclass="fwVtkCellPicker" />
<renderer id="default" background="0.0" />
<adaptor id="myRenderAdaptor" class="::visuVTKAdaptor::Render"
objectId="self">
<config renderer="default" picker="" />
</adaptor>
<adaptor id="myAcquisitionAdaptor"
class="::visuVTKAdaptor::Acquisition" objectId="myAcquisition">
<config renderer="default" picker="myPicker" />
</adaptor>
...
<adaptor id="kinectAdaptator" class="::opKinect::KinectInteractor"
objectId="myAcquisition" >
<config renderer="default" picker="myPicker"
acquisition="myAcquisitionAdaptor" />
</adaptor>
</scene>
-----------------------------------------------------------------------------------------------
I try here to get the AcquisitionAdaptorID in my own adaptor,
KinectInteractor. In its configuring method, I get this ID well. But
in my update method, when I want to have the true service with this
ID, It doesn't exists. That is how I verify this :
-----------------------------------------------------------------------------------------------
bool srv_exists = ::fwTools::fwID::exist(this->m_acquisitionId);
if(srv_exists){
::fwServices::IService::sptr service = ::fwServices::get(this-
>m_acquisitionId);
::visuVTKAdaptor::Acquisition::sptr acq
= ::boost::dynamic_pointer_cast< visuVTKAdaptor::Acquisition
>(service);
}
-----------------------------------------------------------------------------------------------
Why this service doesn't exist ?
Thank you :),
Guillaume.
On 1 juin, 15:45, Nicolas P <
nicola...@gmail.com> wrote:
> If i understand, you need to know which data is directly associated to the
> vtkActor you have picked. Currently, getAssociatedObject return the object
> responsible of the creation of the actor (i.e. for a vtkActor from a
> TriangularMeshAdaptor, it could be a TriangularMesh, as well as a
> Reconstruction or an Acquisition.). To have the two behaviour, you will have
> to update the getAssociatedObject method. If you're interested into writing
> a patch about that, i will gladly apply it on fw4spl.
>
> Your second solution (ID in the configuration) : it is possible if you know
> before runtime the service you are interested in. But your problem doesn't
> seems to match this case.
>
> Cheers,
> Nicolas
>
> 2011/6/1 Guillaume Stuber <
guillaume.stu...@gmail.com>