> But in the config class, where eqOSG currently handles the Equalizer > events, we don't have access to the viewer instance, which is a > member of the pipe class. What would be the smartest design-approach > to pass the events to the viewer? > > Currently I just save the pressed key in the FrameData as a char > member and raise the event in the Pipe::updateSceneGraph() method, > which does more or less what it should, but is still a big hack. > > Any creative ideas out there?
Currently I'm also working in an adaptation of OSG to Equalizer, however I'm not using Thomas' work, I just took a look at eqOSG to get some inspiration and then decided to do it somewhat differently because I'm adapting an already existing application and I have some specific constraints and requirements. Regarding your question, I solved the synchronization problem making every osg::View process the events from all other views. First I have an special viewer that inherits from CompositeViewer. The viewer is owned by my app derived eq::Node. I don't attach the viewer to the pipe because a composite viewer can support multiple pipes/windows. I do have an EmbeddedWindow matching the eq::Window and for each channel that is created I add a osgViewer::View object to the CompositeViewer (linking the embedded window to its camera). In Config::handleEvent, as Thomas suggested, I convert Eq events into GUIEventAdapter objects and queue them in a list in the application node. At the beginning of each frame I move the queue to the framedata and at the top of Node::frameStart I take the events and do something like: viewer->getEventQueue()->appendEvents(frameData.events); This works almost straight forward. The last step is to override CompositeViewer::eventTraversal to take out the parts that don't look necessary to get things working, for example view specific event processing, and make sure that you use the events from _eventQueue for event processing in each view. I think that I must have screwed up some of the features of CompositeViewer like master/slave cameras but this is not important to me. And also I think that I have some bugs still because I haven't tried it out with more than one osgViewer::View per CompositeViewer. By the way, related to keyboard events I've realized that in X Windows Equalizer is not reporting the proper ASCII codes for non alphanumeric characters, and modifier keys like shift are not consider at all. I've compared what OSG does for this and I've found that their code is much more complex. Is this a known problem or should I fill in a bug report. Regards, Juan _______________________________________________ eq-dev mailing list [email protected] http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev http://www.equalizergraphics.com

