void CDRNNode::CreateLink( COMCORE::CTCPConnection& tcpConnection ) {GUCEF_TRACE; // create a new link object CDRNPeerLinkPtr peerLink( new CDRNPeerLink( *this , tcpConnection , m_udpSocket ) ); m_peerLinkList.push_back( peerLink ); // Publish our global publicized data groups and streams CDRNPeerLinkData& dataHolder = peerLink->GetLinkData(); TDataGroupList::iterator i = m_dataGroupList.begin(); while ( i != m_dataGroupList.end() ) { dataHolder.PublicizeDataGroup( (*i).second ); ++i; } TDataStreamList::iterator n = m_dataStreamList.begin(); while ( n != m_dataStreamList.end() ) { dataHolder.PublicizeStream( (*n).second ); ++n; } // Notify that a new link has been established LinkEstablishedEventData eData( peerLink ); NotifyObservers( LinkEstablishedEvent, &eData ); }
void CMouse::SetButtonState( const Int32 contextId , const UInt32 buttonIndex , const bool pressedState ) {GUCEF_TRACE; m_buttonStates[ buttonIndex ] = pressedState; GUCEF_DEBUG_LOG( CORE::LOGLEVEL_NORMAL, "Setting state of button " + CORE::Int32ToString( buttonIndex ) + " to " + CORE::BoolToString( pressedState ) + " on mouse " + CORE::Int32ToString( m_deviceID ) ); CMouseButtonEventData eData( contextId, m_deviceID, buttonIndex, pressedState, m_xPos, m_yPos ); NotifyObservers( MouseButtonEvent, &eData ); }
void CMouse::SetMousePos( const Int32 contextId , const UInt32 xPos , const UInt32 yPos ) {GUCEF_TRACE; m_prevXPos = m_xPos; m_prevYPos = m_yPos; m_xPos = xPos; m_yPos = yPos; CMouseMovedEventData eData( contextId, m_deviceID, m_xPos, m_yPos, m_prevXPos, m_prevYPos ); NotifyObservers( MouseMovedEvent, &eData ); }
bool CGUIManager::Init( CORE::TWindowContextPtr& windowContext ) {GUCE_TRACE; if ( !m_initialized ) { GUCEF_SYSTEM_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Initializing GUI system" ); // Apply the loaded configuration (if any exists) if ( LoadConfig( m_guiConfig ) ) { if ( m_drivers.size() == 0 ) { GUCEF_ERROR_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Cannot initialize GUI system because no driver is available" ); return false; } if ( m_selectedDriverName.Length() == 0 ) { GUCEF_SYSTEM_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: No GUI driver specified in config: Using first available driver" ); m_selectedDriverName = (*m_drivers.begin()).first; } TDriverMap::iterator i = m_drivers.find( m_selectedDriverName ); if ( i != m_drivers.end() ) { GUCEF_DEBUG_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Using driver with name " + m_selectedDriverName ); CIGUIDriver* driver = (*i).second; if ( driver->LoadConfig( m_guiConfig ) ) { if ( driver->Initialize( windowContext ) ) { m_initialized = true; GUCEF_SYSTEM_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Successfully initialized the GUI system" ); TGUIInitializedEventData eData( windowContext ); NotifyObservers( GUIInitializedEvent, &eData ); return true; } else { GUCEF_ERROR_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Failed to initialize the GUI system driver" ); } } else { GUCEF_ERROR_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Failed to load the GUI system driver config" ); } } else { GUCEF_ERROR_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Failed to locate the configured GUI system driver" ); } } else { GUCEF_ERROR_LOG( GUCEF::CORE::LOGLEVEL_NORMAL, "CGUIManager: Failed to load the GUI system config" ); return false; } } return true; }
int main() { DL_Dxf dxf; DL_WriterA* dw = dxf.out("hatch.dxf", DL_Codes::AC1015); // section header: dxf.writeHeader(*dw); dw->sectionEnd(); // section tables: dw->sectionTables(); // VPORT: dxf.writeVPort(*dw); // LTYPE: dw->tableLinetypes(1); dxf.writeLinetype(*dw, DL_LinetypeData("CONTINUOUS", "Continuous", 0, 0, 0.0)); dxf.writeLinetype(*dw, DL_LinetypeData("BYLAYER", "", 0, 0, 0.0)); dxf.writeLinetype(*dw, DL_LinetypeData("BYBLOCK", "", 0, 0, 0.0)); dw->tableEnd(); // LAYER: dw->tableLayers(1); dxf.writeLayer( *dw, DL_LayerData("0", 0), DL_Attributes("", 2, 0, 100, "CONTINUOUS") ); dw->tableEnd(); // STYLE: dw->tableStyle(1); DL_StyleData style("Standard", 0, 0.0, 1.0, 0.0, 0, 2.5, "txt", ""); style.bold = false; style.italic = false; dxf.writeStyle(*dw, style); dw->tableEnd(); // VIEW: dxf.writeView(*dw); // UCS: dxf.writeUcs(*dw); // APPID: dw->tableAppid(1); dxf.writeAppid(*dw, "ACAD"); dw->tableEnd(); // DIMSTYLE: dxf.writeDimStyle(*dw, 2.5, 0.625, 0.625, 0.625, 2.5); // BLOCK_RECORD: dxf.writeBlockRecord(*dw); dw->tableEnd(); dw->sectionEnd(); // BLOCK: dw->sectionBlocks(); dxf.writeBlock(*dw, DL_BlockData("*Model_Space", 0, 0.0, 0.0, 0.0)); dxf.writeEndBlock(*dw, "*Model_Space"); dxf.writeBlock(*dw, DL_BlockData("*Paper_Space", 0, 0.0, 0.0, 0.0)); dxf.writeEndBlock(*dw, "*Paper_Space"); dxf.writeBlock(*dw, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0)); dxf.writeEndBlock(*dw, "*Paper_Space0"); dw->sectionEnd(); // ENTITIES: dw->sectionEntities(); DL_Attributes attributes("0", 2, 0, -1, "BYLAYER"); // start hatch with one loop: DL_HatchData data(1, false, 100.0, 0.0, "ESCHER", 0.0, 0.0); dxf.writeHatch1(*dw, data, attributes); // start loop: DL_HatchLoopData lData(1); dxf.writeHatchLoop1(*dw, lData); // write edge: DL_HatchEdgeData eData( 0.0, 0.0, 100.0, 0.0, M_PI*2, true ); dxf.writeHatchEdge(*dw, eData); // end loop: dxf.writeHatchLoop2(*dw, lData); // end hatch: dxf.writeHatch2(*dw, data, attributes); // end section ENTITIES: dw->sectionEnd(); dxf.writeObjects(*dw, "MY_OBJECTS"); dxf.writeObjectsEnd(*dw); dw->dxfEOF(); dw->close(); delete dw; return 0; }