void SceneNode::draw( sf::RenderTarget& target, sf::RenderStates states ) const { states.transform *= getTransform(); DrawCurrent( target, states ); DrawChildren( target, states ); }
void TacticsInstrument_BearingCompass::Draw(wxGCDC* bdc) { wxColour c1; GetGlobalColor(_T("DASHB"), &c1); wxBrush b1(c1); bdc->SetBackground(b1); bdc->Clear(); wxSize size = GetClientSize(); m_cx = size.x / 2; int availableHeight = size.y - m_TitleHeight - 6; int width, height; bdc->GetTextExtent(_T("000"), &width, &height, 0, 0, g_pFontLabel); m_cy = m_TitleHeight + 2; m_cy += availableHeight / 2; m_radius = availableHeight / 2 *0.80; DrawLabels(bdc); DrawFrame(bdc); DrawMarkers(bdc); DrawBackground(bdc); if (!wxIsNaN(m_Bearing)){ DrawData(bdc, m_Bearing, m_BearingUnit, _T("BRG:%.f"), DIAL_POSITION_TOPLEFT); DrawData(bdc, 0, m_ToWpt, _T(""), DIAL_POSITION_TOPRIGHT); } if (!wxIsNaN(m_CurrSpeed)) DrawData(bdc, m_CurrSpeed, m_CurrSpeedUnit, _T("Curr:%.2f"), DIAL_POSITION_INSIDE); if (!wxIsNaN(m_ExtraValueDTW)) DrawData(bdc, m_ExtraValueDTW, m_ExtraValueDTWUnit, _T("DTW:%.1f"), DIAL_POSITION_BOTTOMLEFT); if (!wxIsNaN(m_CurrDir) && m_CurrDir >= 0 && m_CurrDir < 360) DrawCurrent(bdc); DrawForeground(bdc); DrawLaylines(bdc); if (!wxIsNaN(m_MainValue)) DrawData(bdc, m_MainValue, m_MainValueUnit, _T("%.0f"), DIAL_POSITION_TOPINSIDE); if (!wxIsNaN(m_predictedSog)) DrawData(bdc, m_predictedSog, getUsrSpeedUnit_Plugin(g_iDashSpeedUnit), _T("prd.SOG: ~%.1f"), DIAL_POSITION_BOTTOMRIGHT); }
void kwxLinearMeter::OnPaint(wxPaintEvent &event) { wxPaintDC dc(this); int w,h; int yPoint, rectHeight ; GetClientSize(&w,&h); ///////////////// // Create a memory DC wxMemoryDC temp_dc; temp_dc.SelectObject(*membitmap); temp_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(*m_cPassiveBar,wxSOLID)); temp_dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*m_cPassiveBar,wxSOLID)); temp_dc.Clear(); /////////////////// temp_dc.SetPen(*wxThePenList->FindOrCreatePen(*m_cBorderColour, 1, wxSOLID)); temp_dc.DrawRectangle(0, 0, w, h); temp_dc.SetPen(*wxThePenList->FindOrCreatePen(*m_cActiveBar, 1, wxSOLID)); temp_dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*m_cActiveBar,wxSOLID)); if(m_bDirOrizFlag) temp_dc.DrawRectangle(1, 1, m_nScaledVal, h - 2); else { yPoint = h - m_nScaledVal ; if (m_nScaledVal == 0 ) rectHeight = m_nScaledVal ; else { if (m_nRealVal == m_nMax) { rectHeight = m_nScaledVal; yPoint -= 1 ; } else rectHeight = m_nScaledVal - 1 ; } temp_dc.DrawRectangle(1, yPoint, w - 2, rectHeight); } if (m_bShowCurrent) DrawCurrent(temp_dc); //valore attuale if (m_bShowLimits) DrawLimits(temp_dc); //valore minimo e massimo if (m_nTagsNum > 0 ) DrawTags(temp_dc) ; // We can now draw into the memory DC... // Copy from this DC to another DC. dc.Blit(0, 0, w, h, &temp_dc, 0, 0); }
void kwxLinearReg::OnPaint(wxPaintEvent &WXUNUSED(event)) { wxPaintDC old_dc(this); int w,h; int yPoint, rectHeight ; GetClientSize(&w,&h); wxMemoryDC dc; dc.SelectObject(*m_pMembitmap); dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(*m_pPassiveBarColour,wxSOLID)); dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*m_pPassiveBarColour,wxSOLID)); dc.Clear(); /////////////////////////////////////////////////////////////////////////// dc.SetPen(*wxThePenList->FindOrCreatePen(*m_pBorderColour, 1, wxSOLID)); dc.DrawRectangle(0, 0, w, h); dc.SetPen(*wxThePenList->FindOrCreatePen(*m_pActiveBarColour, 1, wxSOLID)); dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(*m_pActiveBarColour,wxSOLID)); if((!(m_iStyle&STYLE_VERTICAL))) dc.DrawRectangle(1, 1, m_iScaledVal, h - 2); else { yPoint = h - m_iScaledVal ; if (m_iScaledVal == 0 ) rectHeight = m_iScaledVal ; else { if (m_iRealVal == m_iMax) { rectHeight = m_iScaledVal; yPoint -= 1 ; } else rectHeight = m_iScaledVal - 1 ; } dc.DrawRectangle(1, yPoint, w - 2, rectHeight); } if (m_iStyle & STYLE_METER) { DrawNeedle(dc); // draw needle } if (m_iStyle & STYLE_DRAW_CURRENT) DrawCurrent(dc); //valore attuale if (m_iStyle & STYLE_DRAW_LIMITS) DrawLimits(dc); //valore minimo e massimo if (m_iTagsCount > 0 ) DrawTags(dc) ; // draw tags // We can now draw into the memory DC... // Copy from this DC to another DC. old_dc.Blit(0, 0, w, h, &dc, 0, 0); }