コード例 #1
0
ファイル: Route.cpp プロジェクト: kheyse/OpenCPN
void Route::CalculateDCRect( wxDC& dc_route, wxRect *prect, ViewPort &VP )
{
    dc_route.ResetBoundingBox();
    dc_route.DestroyClippingRegion();

    // Draw the route in skeleton form on the dc
    // That is, draw only the route points, assuming that the segements will
    // always be fully contained within the resulting rectangle.
    // Can we prove this?
    if( m_bVisible ) {
        wxRoutePointListNode *node = pRoutePointList->GetFirst();
        while( node ) {

            RoutePoint *prp2 = node->GetData();
            bool blink_save = prp2->m_bBlink;
            prp2->m_bBlink = false;
            ocpnDC odc_route( dc_route );
            prp2->Draw( odc_route, NULL );
            prp2->m_bBlink = blink_save;

            node = node->GetNext();
        }
    }

    //  Retrieve the drawing extents
    prect->x = dc_route.MinX() - 1;
    prect->y = dc_route.MinY() - 1;
    prect->width = dc_route.MaxX() - dc_route.MinX() + 2;
    prect->height = dc_route.MaxY() - dc_route.MinY() + 2;
}
コード例 #2
0
ファイル: RoutePoint.cpp プロジェクト: NicolasJourden/OpenCPN
void RoutePoint::CalculateDCRect( wxDC& dc, wxRect *prect )
{
    dc.ResetBoundingBox();
    dc.DestroyClippingRegion();

    // Draw the mark on the dc
    ocpnDC odc( dc );
    Draw( odc, NULL );

    //  Retrieve the drawing extents
    prect->x = dc.MinX() - 1;
    prect->y = dc.MinY() - 1;
    prect->width = dc.MaxX() - dc.MinX() + 2; // Mouse Poop?
    prect->height = dc.MaxY() - dc.MinY() + 2;

}