Skip to content

Commit

Permalink
Merge pull request OpenCPN#7 from jongough/boundary
Browse files Browse the repository at this point in the history
Boundary
  • Loading branch information
jongough committed Apr 8, 2015
2 parents f4ccf66 + 15541e4 commit 7c48831
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 8 deletions.
1 change: 0 additions & 1 deletion include/ocpn_draw_pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ class ocpn_draw_pi : public opencpn_plugin_113
void MenuAppend( wxMenu *menu, int id, wxString label);



int m_show_id;
int m_hide_id;
bool show;
Expand Down
8 changes: 4 additions & 4 deletions include/version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define PLUGIN_VERSION_MAJOR 0
#define PLUGIN_VERSION_MINOR 1
#define PLUGIN_VERSION_PATCH 001
#define PLUGIN_VERSION_DATE "2015-01-28"
#define PLUGIN_VERSION_MAJOR 0
#define PLUGIN_VERSION_MINOR 1
#define PLUGIN_VERSION_PATCH 001
#define PLUGIN_VERSION_DATE "2015-01-28"
50 changes: 50 additions & 0 deletions readme_ocpn_draw - compiling for windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Readme.doc
---------------

ocpn_draw_pi
--------------------------------


Compiling for Windows
------------------------------
1. Must be installed with the most current version of Opencpn V4.1 beta as it is being actively developed.
2. Must be compiled with the most recent version of opencpn.lib from V4.1 beta, placed into the "build" directory.
3. Must be compiled when on the origin/boundary branch which is the branch being worked upon currently.
====================
First from the command prompt change directory to your plugin compile directory, for me that is
cd C:\Users\Frederick\Documents\OpenCPN-Data\o-plugin

Then git clone Jon's jongough repository named ocpn_draw_pi
git clone git://github.com/jongough/ocpn_draw_pi.git ocpn_draw_pi

Then
cd ocpn_draw_pi
git fetch -all
git branch -va

Then to set up the local branch using the remote

If you want the latest code:
git checkout -b boundary origin/boundary
Result: Branch boundary set up to track remote branch boundary from origin.
Switched to a new branch 'boundary'
If you want the more stable code:
git checkout -b master origin/master
Result: Branch master set up to track remote master from origin.
Switched to a new branch 'master'



Next copy the file "opencpn.lib" from the most recent Opencpn Version 4.1
to the 'build' directory.

Then
cmake ..
cmake --build .
cmake --build . --config release

If you have NSIS installed
cpack

Then install the plugin as Debug or Release version (appropriately) into the current OpenCPN v4.1
----------
26 changes: 23 additions & 3 deletions src/ocpn_draw_pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ bool ocpn_draw_pi::MouseEventHook( wxMouseEvent &event )

// Route Creation Rubber Banding

if( nBoundary_State == 1 ) {
ocpncc1->SetCursor( *ocpncc1->pCursorPencil );
}

if( nBoundary_State >= 2 ) {
r_rband.x = event.GetX();
r_rband.y = event.GetY();
Expand Down Expand Up @@ -953,7 +957,7 @@ bool ocpn_draw_pi::MouseEventHook( wxMouseEvent &event )
}

if (bret) ocpncc1->SetCursor( *ocpncc1->pCursorPencil );

return bret;
}

Expand All @@ -964,6 +968,7 @@ void ocpn_draw_pi::SetCursorLatLon(double lat, double lon)

m_cursor_lat = lat;
m_cursor_lon = lon;

}

wxString ocpn_draw_pi::FormatDistanceAdaptive( double distance )
Expand Down Expand Up @@ -1002,6 +1007,11 @@ bool ocpn_draw_pi::RenderOverlay(wxMemoryDC *pmdc, PlugIn_ViewPort *vp)
{
m_vp = vp;
ocpnDC ocpnmdc( *pmdc );

if( nBoundary_State > 0 ) {
ocpncc1->SetCursor( *ocpncc1->pCursorPencil );
}

RenderPathLegs( ocpnmdc );
return TRUE;
}
Expand All @@ -1013,6 +1023,11 @@ bool ocpn_draw_pi::RenderOverlay(wxDC &dc, PlugIn_ViewPort *pivp)
LLBBox llbb;
llbb.SetMin( pivp->lon_min, pivp->lat_min );
llbb.SetMax( pivp->lon_max, pivp->lat_max );

if( nBoundary_State > 0 ) {
ocpncc1->SetCursor( *ocpncc1->pCursorPencil );
}

DrawAllPathsInBBox( *g_pDC, llbb );
RenderPathLegs( *g_pDC );

Expand All @@ -1027,13 +1042,17 @@ bool ocpn_draw_pi::RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *pivp)
//m_glcc = wxGLCanvas( m_parent_window );
//wxGLCanvas m_wxGLC( m_parent_window );
g_pDC = NULL;
g_pDC = new ocpnDC();
//g_pDC = new ocpnDC();

OCPNRegion region( pivp->rv_rect );
// glOCPNDrawChartCanvas *p_ODChartCanvas = (glOCPNDrawChartCanvas *)ocpncc1;
// p_ODChartCanvas->SetClipRegion( ocpncc1->GetVP(), region);

// ocpnDC *poDC = NULL;
if( nBoundary_State > 0 ) {
ocpncc1->SetCursor( *ocpncc1->pCursorPencil );
}

RenderPathLegs( *g_pDC );
//p_ODChartCanvas->SetContext( pcontext )
//m_glcc = new glChartCanvas(this);
Expand Down Expand Up @@ -1110,7 +1129,7 @@ void ocpn_draw_pi::RenderPathLegs( ocpnDC &dc )
// if( g_bShowMag )
// pathInfo << wxString::Format( wxString("%03d°(M) ", wxConvUTF8 ), (int)gFrame->GetTrueOrMag( brg ) );
// else
pathInfo << wxString::Format( wxString("%03d° ", wxConvUTF8 ), GetTrueOrMag( brg ) );
pathInfo << wxString::Format( wxString("%03d° ", wxConvUTF8 ), (int)GetTrueOrMag( brg ) );

pathInfo << wxS(" ") << FormatDistanceAdaptive( dist );

Expand Down Expand Up @@ -2005,3 +2024,4 @@ void ocpn_draw_pi::DimeControl( wxWindow* ctrl, wxColour col, wxColour window_ba
}
}
}

0 comments on commit 7c48831

Please sign in to comment.