38 : eq::Config( parent )
51 _frameData.setOrtho( _initData.getOrtho( ));
52 _initData.setFrameDataID( _frameData.getID( ));
66 if( canvases.empty( ))
69 _currentCanvas = canvases.front();
71 _setMessage(
"Welcome to eVolve\nPress F1 for help" );
76 bool Config::mapData(
const eq::uint128_t& initDataID )
78 if( !_initData.isAttached() )
86 LBASSERT( _initData.getID() == initDataID );
99 void Config::_deregisterData()
104 _initData.setFrameDataID( co::UUID( ));
111 _frameData.spinCamera( -0.001f * _spinX, -0.001f * _spinY );
112 const lunchbox::uint128_t& version = _frameData.commit();
119 void Config::_resetMessage()
122 if( _messageTime > 0 &&
getTime() - _messageTime > 2000 )
125 _frameData.setMessage(
"" );
140 const lunchbox::UUID& viewID =
event->data.context.view.identifier;
141 _frameData.setCurrentViewID( viewID );
148 const eq::View* view = find< eq::View >( viewID );
151 for( eq::Canvases::const_iterator i = canvases.begin();
152 i != canvases.end(); ++i )
157 if( canvasLayout == layout )
159 _currentCanvas = canvas;
170 _spinY =
event->data.pointerButtonRelease.dx;
171 _spinX =
event->data.pointerButtonRelease.dy;
175 case eq::Event::CHANNEL_POINTER_MOTION:
189 _frameData.moveCamera( .0, .0,
208 bool Config::_handleKeyEvent(
const eq::KeyEvent& event )
214 _frameData.toggleBackground();
219 _frameData.toggleColorMode();
225 _frameData.toggleHelp();
238 _frameData.toggleNormalsQuality();
243 _frameData.toggleOrtho();
248 _frameData.toggleStatistics();
259 _frameData.adjustQuality( -.1f );
263 _frameData.adjustQuality( .1f );
270 if( canvases.empty( ))
273 _frameData.setCurrentViewID( eq::uint128_t( 0 ));
275 if( !_currentCanvas )
277 _currentCanvas = canvases.front();
281 eq::Canvases::const_iterator i = std::find( canvases.begin(),
284 LBASSERT( i != canvases.end( ));
287 if( i == canvases.end( ))
288 _currentCanvas = canvases.front();
298 if( !_currentCanvas && !canvases.empty( ))
299 _currentCanvas = canvases.front();
301 if( !_currentCanvas )
309 find< eq::View >( _frameData.getCurrentViewID( ));
312 LBASSERT( !views.empty( ))
316 _frameData.setCurrentViewID( views.front()->getID( ));
320 eq::Views::const_iterator i = std::find( views.begin(),
323 LBASSERT( i != views.end( ));
326 if( i == views.end( ))
327 _frameData.setCurrentViewID( eq::uint128_t( 0 ));
329 _frameData.setCurrentViewID( (*i)->getID( ));
339 void Config::_setMessage(
const std::string& message )
341 _frameData.setMessage( message );
345 void Config::_switchLayout( int32_t increment )
347 if( !_currentCanvas )
350 _frameData.setCurrentViewID( eq::uint128_t( 0 ));
354 LBASSERT( !layouts.empty( ));
356 index = ( index % layouts.size( ));
357 _currentCanvas->
useLayout( uint32_t( index ));
360 std::ostringstream stream;
364 const std::string& name = layout->
getName();
374 _setMessage( stream.str( ));
virtual uint32_t startFrame()
int32_t dx
X position change since last event.
uint32_t getLatency() const
virtual ~Config()
Destruct a config.
const Canvases & getCanvases() const
virtual bool init(const uint128_t &initID)
Initialize this configuration.
A View is a 2D area of a Layout.
int64_t getTime() const
Get the current time in milliseconds.
int32_t dy
Y position change since last event.
A layout groups one or more View, logically belonging together.
const Layouts & getLayouts() const
A canvas represents a logical 2D projection surface.
virtual void unmapObject(co::Object *object)
Unmap a mapped object.
std::vector< Layout * > Layouts
A vector of pointers to eq::Layout.
const Views & getViews() const
Get the list of views.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
virtual void deregisterObject(co::Object *object)
Deregister a distributed object.
virtual bool handleEvent(const eq::ConfigEvent *event)
Key press data in keyPress.
virtual bool handleEvent(const ConfigEvent *event)
Handle one (old) config event.
virtual bool mapObject(co::Object *object, const UUID &id, const uint128_t &version=co::VERSION_OLDEST)
Map a distributed object.
virtual EQFABRIC_INL bool useLayout(const uint32_t index)
Activate the given layout on this canvas.
virtual uint32_t startFrame(const uint128_t &frameID)
Request a new frame of rendering.
std::vector< View * > Views
A vector of pointers to eq::View.
uint32_t buttons
current state of all buttons
std::vector< Canvas * > Canvases
A vector of pointers to eq::Canvas.
Channel pointer button press data in pointerButtonPress.
uint32_t type
The event type.
KeyEvent keyPress
Key press event data.
virtual bool registerObject(co::Object *object)
Register a distributed object.
uint32_t getActiveLayoutIndex() const
EQFABRIC_INL const L * getActiveLayout() const
uint32_t button
fired button
Channel pointer button release data in pointerButtonRelease.
PointerEvent pointerMotion
Pointer motion data.
PointerEvent pointerButtonRelease
Mouse button release data.
virtual bool exit()
Exit this configuration.
const std::string & getName() const
Event for a key press or release.
uint32_t key
KeyCode for special keys, ascii code otherwise.