Hi Nil,

in our implementation, each render window has its own OpenGL context, which are 
separated from each other. So you actually can't reuse the same display list in 
all 2D views.
Diplay lists are deprecated since OpenGL 3, so there is no easy solution for 
your issue. However, there are OpenGL implementations, where you can share the 
context over different windows, e.g. see wglShareLists() [1].

Best,
Sandy

[1] 
https://www.opengl.org/discussion_boards/showthread.php/164640-wglShareLists%28%29-and-Multiple-Render-Windows



Sandy Engelhardt, MSc.
Medical and Biological Informatics E130
PhD Student

German Cancer Research Center (DKFZ)
Foundation under Public Law
Im Neuenheimer Feld 280
69120 Heidelberg
Germany
phone: +49 6221 42-2328


[email protected]<mailto:[email protected]>
www.dkfz.de/mbi<http://www.dkfz.de/mbi>

[cid:[email protected]]

Management Board: Prof. Dr. Dr. h.c. Otmar D. Wiestler, Prof. Dr. Josef Puchta
VAT-ID No.: DE143293537




Von: Nil Goyette [mailto:[email protected]]
Gesendet: Donnerstag, 2. Oktober 2014 22:25
An: Engelhardt, Sandy; [email protected]
Betreff: Re: AW: [mitk-users] 2D mapper

Hi Sandy,

thank you for your answer. It wasn't related to the local storage, but I 
managed to get it to work. I won't explain my solution because I did a huge 
hack to get this problem and I would be surprised if someone does the same.

This being said, I have a question for you, since you seem to know how the 
mapper works. I have the kind of data that is exactly the same in the 3 2D 
views. (The difference is the shader in each view.) Of course, I would want to 
create only one OpenGL display list and reuse it for the remaining 2D mapper. 
The problem is that the display list IDs don't seem to be shared between the 
views.

this->ListId = glGenLists(1);
std::cout << this->ListId << std::endl;
always prints the same ID.

So, is there a way to reuse the same display list in all 2D views?
In fact, I have the same data in all views, so I might as well ask the same 
question for all views :)

Le 2014-10-01 08:46, Engelhardt, Sandy a écrit :
Hi Nil,

you need to add a "LocalStorage", which derives from the 
mitk::Mapper::BaseLocalStorage class to your mapper's header file.
This internal class is intended for including all rendering related vtk member 
variables, such as mappers, actors etc.

To render transveral, coronal, and sagittal, each 2D mapper is called three 
times. For performance reasons, the corresponding data for each view is saved 
in the
internal helper class LocalStorage. This allows rendering n views with just 1 
mitkMapper using n vtkMapper.

Examples are provided in
Core/Code/Rendering/mitkImageVtkMapper2D.h
Core/Code/Rendering/mitkPointSetVtkMapper2D.h


The MapperSlotId is defined as enum in the mitk::BaseRenderer class:
enum StandardMapperSlot
    {
      Standard2D = 1, Standard3D = 2
    };

Best,
Sandy


Von: Nil Goyette [mailto:[email protected]]
Gesendet: Donnerstag, 25. September 2014 19:35
An: [email protected]
Betreff: [mitk-users] 2D mapper

Hi all,

I created my own 2D and 3D mapper for the FiberBundle type. My 2D mapper works 
as intended, but I can't get my 2D mapper to work for all views. It works only 
in the axial view.

auto mapper2D = MyMapper::New();
...
node->SetMapper(1, mapper2D);

Do I need to write something special to apply my mapper to the sagittal and 
frontal view?
Also, the first parameter of SetMaper (MapperSlotId) is the dimension (-1) I 
target, right?
--
[cid:[email protected]]<http://imeka.ca/>

Nil Goyette, M.Sc.
www.imeka.ca<http://imeka.ca/>




------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to