Hi, I'm not sure if these mappers were implemented with further inheritence in mind. Last year I started an alternative enhanced Surface mapper but I had to pause working on it because lack of time. It is WIP but It might help you to get started programming your own mapper. You can find it in the branch bug-15614-NewSurfaceMapper3D. Another type of mapper is the Simulation mapper in the Simulation module. It is kind of special as it uses OpenGL in VTK context for 3D rendering but it should be a good example of how to write an MITK-based mapper.
Best, Stefan ________________________________________ Von: Rostislav Khlebnikov [[email protected]] Gesendet: Donnerstag, 27. März 2014 17:46 An: [email protected] Betreff: [mitk-users] SurfaceGLMapper uses deprecated function Hi, I am trying to use the surface mappers as a base class for my own mapper. The idea is that my data is in solid modeling format, but I convert it to VTK polydata for rendering. In order not to reimplement the vtk surface mapper, I subclassed SurfaceGLMapper2D and SurfaceVtkMapper3D and supply them with a mitk::Surface when demanded. I figured that this is actually intended because both mappers have (different) mechanisms to supply a mitk::Surface and do not use GetDataNode()->GetData() directly. In 2D mapper it is a non-virtual function GetInput() which returns a protected member variable and in 3D mapper - it is a virtual function GetInput() [Which in itself is rather weird :)]. Anyway, after I supplied the correct surface, the SurfaceGLMapper2D crashed because in line 234 it called the deprecated function GetDataNode()->GetVtkTransform(timestep); which leaded to a crash. The actual reason for crash was that I didn't initialize the geometry in my data object, however, I believe that substituting this with GetInput()->GetGeometry(timestep)->GetVtkTransform(); is the correct way. So basically, I have two questions: 1) Is this subclassing a correct use of the surface mappers in this case? 2) Should I file a bug for this? Thanks, Rostislav. ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
