<commit_before>//
// BuilderView.cpp
//
// Copyright (c) 2001-2003 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

#include "wx/wxprec.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtdata/shapelib/shapefil.h"
#include "vtdata/ElevationGrid.h"
#include "vtdata/vtLog.h"

#include "BuilderView.h"
#include "Frame.h"
#include "MenuEnum.h"
#include "Helper.h"
#include "VTBuilder_wdr.h"
// Layers
#include "ElevLayer.h"
#include "ImageLayer.h"
#include "RawLayer.h"
#include "RoadLayer.h"
#include "StructLayer.h"
#include "UtilityLayer.h"
// Dialogs
#include "DistanceDlg.h"

#include "cpl_error.h"

#define BOUNDADJUST 5

////////////////////////////////////////////////////////////////

BEGIN_EVENT_TABLE(BuilderView, vtScaledView)
EVT_LEFT_DOWN(BuilderView::OnLeftDown)	
EVT_LEFT_UP(BuilderView::OnLeftUp)
EVT_LEFT_DCLICK(BuilderView::OnLeftDoubleClick)
EVT_MIDDLE_DOWN(BuilderView::OnMiddleDown)
EVT_MIDDLE_UP(BuilderView::OnMiddleUp)
EVT_RIGHT_DOWN(BuilderView::OnRightDown)
EVT_RIGHT_UP(BuilderView::OnRightUp)
EVT_MOTION(BuilderView::OnMouseMove)

EVT_CHAR(BuilderView::OnChar)
END_EVENT_TABLE()

/////////////////////////////////////////////////////////////////

BuilderView::BuilderView(wxWindow* parent, wxWindowID id, const wxPoint& pos,
	const wxSize& size, const wxString& name) :
vtScaledView(parent, id, pos, size, name )
{
	VTLOG(" Constructing BuilderView\n");

	m_bCrossSelect = false;
	m_bShowMap = true;
	m_bShowUTMBounds = false;

	m_bMouseMoved = false;
	m_bPanning = false;
	m_bBoxing = false;
	m_iDragSide = 0;
	m_bMouseCaptured = false;

	m_ui.m_bRubber = false;
	m_ui.mode = LB_None;
	m_ui.m_bLMouseButton = m_ui.m_bMMouseButton = m_ui.m_bRMouseButton = false;
	m_ui.m_pEditingRoad = NULL;
	m_ui.m_iEditingPoint = -1;
	m_ui.m_pCurBuilding = NULL;
	m_ui.m_pCurLinear = NULL;

	// Cursors are a little messy, since support is not even across platforms
#if __WXMSW__
	m_pCursorPan = new wxCursor(_T("cursors/panhand.cur"), wxBITMAP_TYPE_CUR);
//#elif __WXMOTIF__
//	m_pCursorPan = new wxCursor("cursors/panhand.xbm", wxBITMAP_TYPE_XBM);
#else
	// the predefined "hand" cursor isn't quite correct, since it is a image
	// of a hand with a pointing finger, not a closed, grasping hand.
	m_pCursorPan = new wxCursor(wxCURSOR_HAND);
#endif

	// world map SHP file
	m_iEntities = 0;
	m_bAttemptedLoad = false;
}

BuilderView::~BuilderView()
{
//	for (int i = 0; i < m_iEntities; i++)
//		delete WMPolyDraw[i];
//	m_iEntities = 0;
	delete m_pCursorPan;
}

////////////////////////////////////////////////////////////
// Operations

void BuilderView::OnDraw(wxDC& dc)  // overridden to draw this view
{
	MainFrame *pFrame = GetMainFrame();
	if (pFrame->DrawDisabled())
		return;
<commit_msg>tweak<commit_after>//
// BuilderView.cpp
//
// Copyright (c) 2001-2003 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

#include "wx/wxprec.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtdata/shapelib/shapefil.h"
#include "vtdata/ElevationGrid.h"
#include "vtdata/vtLog.h"

#include "BuilderView.h"
#include "Frame.h"
#include "MenuEnum.h"
#include "Helper.h"
#include "VTBuilder_wdr.h"
// Layers
#include "ElevLayer.h"
#include "ImageLayer.h"
#include "RawLayer.h"
#include "RoadLayer.h"
#include "StructLayer.h"
#include "UtilityLayer.h"
// Dialogs
#include "DistanceDlg.h"

#include "cpl_error.h"

#define BOUNDADJUST 5

////////////////////////////////////////////////////////////////

BEGIN_EVENT_TABLE(BuilderView, vtScaledView)
EVT_LEFT_DOWN(BuilderView::OnLeftDown)	
EVT_LEFT_UP(BuilderView::OnLeftUp)
EVT_LEFT_DCLICK(BuilderView::OnLeftDoubleClick)
EVT_MIDDLE_DOWN(BuilderView::OnMiddleDown)
EVT_MIDDLE_UP(BuilderView::OnMiddleUp)
EVT_RIGHT_DOWN(BuilderView::OnRightDown)
EVT_RIGHT_UP(BuilderView::OnRightUp)
EVT_MOTION(BuilderView::OnMouseMove)

EVT_CHAR(BuilderView::OnChar)
END_EVENT_TABLE()

/////////////////////////////////////////////////////////////////

BuilderView::BuilderView(wxWindow* parent, wxWindowID id, const wxPoint& pos,
	const wxSize& size, const wxString& name) :
vtScaledView(parent, id, pos, size, name )
{
	VTLOG(" Constructing BuilderView\n");

	m_bCrossSelect = false;
	m_bShowMap = true;
	m_bShowUTMBounds = false;

	m_bMouseMoved = false;
	m_bPanning = false;
	m_bBoxing = false;
	m_iDragSide = 0;
	m_bMouseCaptured = false;

	m_ui.m_bRubber = false;
	m_ui.mode = LB_None;
	m_ui.m_bLMouseButton = m_ui.m_bMMouseButton = m_ui.m_bRMouseButton = false;
	m_ui.m_pEditingRoad = NULL;
	m_ui.m_iEditingPoint = -1;
	m_ui.m_pCurBuilding = NULL;
	m_ui.m_pCurLinear = NULL;

	// Cursors are a little messy, since support is not even across platforms
#if __WXMSW__
	m_pCursorPan = new wxCursor(_T("cursors/panhand.cur"), wxBITMAP_TYPE_CUR);
//#elif __WXMOTIF__
//	m_pCursorPan = new wxCursor("cursors/panhand.xbm", wxBITMAP_TYPE_XBM);
#else
	// the predefined "hand" cursor isn't quite correct, since it is a image
	// of a hand with a pointing finger, not a closed, grasping hand.
	m_pCursorPan = new wxCursor(wxCURSOR_HAND);
#endif

	// world map SHP file
	m_iEntities = 0;
	m_bAttemptedLoad = false;
}

BuilderView::~BuilderView()
{
	delete m_pCursorPan;
}

////////////////////////////////////////////////////////////
// Operations

void BuilderView::OnDraw(wxDC& dc)  // overridden to draw this view
{
	MainFrame *pFrame = GetMainFrame();
	if (pFrame->DrawDisabled())
		return;

{'fraction_non_alphanumeric': 0.18415694984268, 'fraction_numerical': 0.004812141402924301, 'mean_word_length': 3.6546080964685617, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2254976', 'n_tokens_mistral': 2081, 'n_tokens_neox': 2006, 'n_words': 419}