// GISDlg.cpp : implementation file
//
# include "stdafx.h"
# include "GISDlg.h"
# include <math.h>
# include "label.h"
//#include <atlimage.h>
# include "shapedrawingoptions.h"
# include "shape.h"
# include "labelcategory.h"
# include "ScreenCapture.h"
# include "SetSaveLineID.h"
//#include "8BMapDLL_type.h"
# include <fstream>
# include <sstream>
# include <iostream>
# include "vectortoraster.h"
# include "SaveLineEditSetting.h"
# include "ModifyLinePointDlg.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CGISDlg dialog
const double DEG2RAD = 0.017453292519943295769236907684886127134428718885417 ;
DWORD LineClr [ 15 ] = { RGB ( 0 , 255 , 0 ) , RGB ( 255 , 0 , 0 ) , RGB ( 0 , 0 , 255 ) , RGB ( 128 , 128 , 0 ) , RGB ( 0 , 0 , 0 ) , RGB ( 0 , 255 , 0 ) , RGB ( 255 , 0 , 0 ) , RGB ( 0 , 0 , 255 ) , RGB ( 128 , 128 , 0 ) , RGB ( 0 , 0 , 0 ) , RGB ( 0 , 255 , 0 ) , RGB ( 255 , 0 , 0 ) , RGB ( 0 , 0 , 255 ) , RGB ( 124 , 252 , 0 /*127,255,170*/ ) , RGB ( 0 , 0 , 0 ) } ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݶ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD>
void FAR PASCAL CatchMTimerDraw ( WORD IDEvent , WORD uReserved , DWORD dwUser , DWORD dwReserved1 , DWORD dwReserve2 )
{
: : PostMessage ( g_mapHwnd , WM_SEND_DRAWUAV , FALSE , 0 ) ;
}
CGISDlg : : CGISDlg ( CWnd * pParent /*=NULL*/ )
: CBCGPDialog ( CGISDlg : : IDD , pParent )
{
EnableVisualManagerStyle ( TRUE , TRUE ) ;
//{{AFX_DATA_INIT(CGISDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_MsgHwnd = NULL ;
m_MsgID = 0 ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϢID
m_LineLoadMsgID = 0 ; //װ<> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_drawPlanFlyLine = - 1 ;
//<2F> <> γ <EFBFBD> ȶԻ<C8B6> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> ʶ
m_bHaveShowLonLatDlg = false ;
//<2F> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> ʶ
m_bHaveShowLineDesign = false ;
//2<> <32> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> ˮƽ <CBAE> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> ı <EFBFBD> ʶ
m_bHaveShowDistanceDlg = false ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = false ;
for ( int i = 0 ; i < 3 ; i + + )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID
m_flyTrackLayerID [ i ] = - 1 ;
//UAV<41> <56> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID
m_UAVFlyTrackLayerID [ i ] = - 1 ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ķ<EFBFBD> <C4B7> й켣
m_bFirstDrawUAVTrack [ i ] = false ;
m_drawTrackPtNum [ i ] = 0 ;
}
//
for ( int i = 0 ; i < MAX_PLANE_NUM_ADS ; i + + )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID
//m_flyTrackLayerID[i] = -1;
//UAV<41> <56> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID
m_UAVFlyTrackLayerID_ADS [ i ] = - 1 ;
m_bWithin100km_ADS [ i ] = false ;
}
m_iCurrentADSid = 0 ;
m_iTotalADSnum = 0 ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ߶ȵ<DFB6> <C8B5> <EFBFBD>
m_onePerWidth = 0 ;
m_onePerHeight = 0 ;
m_mapAreaHalfWidth = 0 ;
m_mapAreaHalfHeight = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬
m_bLineDesign = false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_ptNum = 18 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memset ( m_ppUavPtArray , 0 , sizeof ( double ) * 18 * 2 ) ;
memset ( m_ppUavPtArray_ADS , 0 , sizeof ( double ) * 18 * 2 ) ;
m_ptPlane [ 0 ] = CPoint ( 0 , - 13 ) ;
m_ptPlane [ 1 ] = CPoint ( 2 , - 9 ) ;
m_ptPlane [ 2 ] = CPoint ( 2 , - 6 ) ;
m_ptPlane [ 3 ] = CPoint ( 12 , 4 ) ;
m_ptPlane [ 4 ] = CPoint ( 12 , 6 ) ;
m_ptPlane [ 5 ] = CPoint ( 2 , 2 ) ;
m_ptPlane [ 6 ] = CPoint ( 1 , 10 ) ;
m_ptPlane [ 7 ] = CPoint ( 3 , 12 ) ;
m_ptPlane [ 8 ] = CPoint ( 3 , 13 ) ;
m_ptPlane [ 9 ] = CPoint ( 0 , 13 ) ;
m_ptPlane [ 10 ] = CPoint ( - 3 , 13 ) ;
m_ptPlane [ 11 ] = CPoint ( - 3 , 12 ) ;
m_ptPlane [ 12 ] = CPoint ( - 1 , 10 ) ;
m_ptPlane [ 13 ] = CPoint ( - 2 , 2 ) ;
m_ptPlane [ 14 ] = CPoint ( - 12 , 6 ) ;
m_ptPlane [ 15 ] = CPoint ( - 12 , 4 ) ;
m_ptPlane [ 16 ] = CPoint ( - 2 , - 6 ) ;
m_ptPlane [ 17 ] = CPoint ( - 2 , - 9 ) ;
m_ptPlane_ADS [ 0 ] = CPoint ( 0 , - 13 ) ;
m_ptPlane_ADS [ 1 ] = CPoint ( 2 , - 9 ) ;
m_ptPlane_ADS [ 2 ] = CPoint ( 2 , - 6 ) ;
m_ptPlane_ADS [ 3 ] = CPoint ( 12 , 4 ) ;
m_ptPlane_ADS [ 4 ] = CPoint ( 12 , 6 ) ;
m_ptPlane_ADS [ 5 ] = CPoint ( 2 , 2 ) ;
m_ptPlane_ADS [ 6 ] = CPoint ( 1 , 10 ) ;
m_ptPlane_ADS [ 7 ] = CPoint ( 3 , 12 ) ;
m_ptPlane_ADS [ 8 ] = CPoint ( 3 , 13 ) ;
m_ptPlane_ADS [ 9 ] = CPoint ( 0 , 13 ) ;
m_ptPlane_ADS [ 10 ] = CPoint ( - 3 , 13 ) ;
m_ptPlane_ADS [ 11 ] = CPoint ( - 3 , 12 ) ;
m_ptPlane_ADS [ 12 ] = CPoint ( - 1 , 10 ) ;
m_ptPlane_ADS [ 13 ] = CPoint ( - 2 , 2 ) ;
m_ptPlane_ADS [ 14 ] = CPoint ( - 12 , 6 ) ;
m_ptPlane_ADS [ 15 ] = CPoint ( - 12 , 4 ) ;
m_ptPlane_ADS [ 16 ] = CPoint ( - 2 , - 6 ) ;
m_ptPlane_ADS [ 17 ] = CPoint ( - 2 , - 9 ) ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͻ<EFBFBD> X<EFBFBD> <58> <EFBFBD> <EFBFBD>
m_leftTopX = 0 ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͻ<EFBFBD> Y<EFBFBD> <59> <EFBFBD> <EFBFBD>
m_leftTopY = 0 ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> <CDBC> ID<49> <44>
m_targetPtShapeID = 0 ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPĿ<50> <C4BF> <EFBFBD> <EFBFBD> עͼ<D7A2> <CDBC>
m_bHaveCreateTargetShp = false ;
//<2F> <> עƫ<D7A2> <C6AB> <EFBFBD> <EFBFBD>
m_labelWarpValue = 15 ;
//<2F> ܹ<EFBFBD> <DCB9> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_totalPointNum = 512 ;
//<2F> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2016.01.06
m_MaxNumofLinePt = 255 ;
// m_pNewDesignLineStruct = new tmpPT[m_MaxNumofLinePt]; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// memset(m_pNewDesignLineStruct, 0, sizeof(tmpPT)*m_MaxNumofLinePt); //<2F> <> ʼ <EFBFBD> <CABC>
m_pNewDesignLineStruct = new PtStruct [ m_MaxNumofLinePt ] ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memset ( m_pNewDesignLineStruct , 0 , sizeof ( PtStruct ) * m_MaxNumofLinePt ) ; //<2F> <> ʼ <EFBFBD> <CABC>
m_NowNumLineDesign = 0 ; //<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <C4B8> <EFBFBD>
m_lineMaxPointNum = 255 ; //һ <> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pDesignLineStruct = new PtStruct [ m_lineMaxPointNum ] ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memset ( m_pDesignLineStruct , 0 , sizeof ( PtStruct ) * m_lineMaxPointNum ) ; //<2F> <> ʼ <EFBFBD> <CABC>
m_designLinePointNum = 0 ; //<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> ͼ<EFBFBD> <CDBC> ID<49> <44> ʼ <EFBFBD> <CABC>
m_designLineLayerID = - 1 ;
m_designLineLayerID2 = - 1 ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> ID<49> <44>
m_targetDrawLayerID = - 1 ;
//<2F> <> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_tempLayerID = - 1 ;
/****************<2A> <> <EFBFBD> <EFBFBD> <<3C> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD> ><3E> <> <EFBFBD> <EFBFBD> ***********************************/
/*****by Wu 2023.09.11*******/
//ѡ <> и<EFBFBD> <D0B8> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_highLightLineLayerID = - 1 ;
//<2F> <> <EFBFBD> ε<EFBFBD> ͼ<EFBFBD> <CDBC>
m_tempTerrainPointsLayerID = - 1 ;
m_tempshpPointLayerID = - 1 ;
m_tempshpLineLayerID = - 1 ;
//<2F> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ID
circlingPointID = - 1 ;
m_lineSelectedID = - 1 ;
GLOBAL_X = 0 ;
GLOBAL_Y = 0 ;
//<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> ״̬
m_bEditLine = false ;
//<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> <EFBFBD> ʾ ״̬
//m_bShowBackLine = false;
//<2F> <> ק<EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> ־
m_dragFlag = false ;
// ѡ <> <D1A1> ģʽ
m_bSelectFeatureFlag = false ;
//
m_KTPtShpLayerID = - 1 ; //<2F> <> Ͷ<EFBFBD> <CDB6> ͼ<EFBFBD> <CDBC>
//m_pDesignKTLineDlg = NULL;
/****************/
/*****By Wu 2023.10.16********/
m_distLabelLayer = - 1 ; //<2F> ༭ʱ<E0BCAD> <CAB1> ʾ <EFBFBD> <CABE> λ<EFBFBD> Ǻ; <C7BA> <CDBE> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ر<EFBFBD> <D8B1> <EFBFBD> <EFBFBD> <EFBFBD> ʼ <EFBFBD> <CABC>
m_bPolylineMeasure = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ־
m_numPolylineMeasurePts = 0 ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_bMeasureDrag = false ; //<2F> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD> ͼ<EFBFBD> <CDBC>
m_polylineMeasureLineLayerID = - 1 ;
//<2F> <> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> ͼ<EFBFBD> <CDBC>
m_polylineMeasureLabelLayerID = - 1 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> ŵı <C5B5> עͼ<D7A2> <CDBC>
m_polylineMeasurePtLayerID [ 0 ] = - 1 ;
m_polylineMeasurePtLayerID [ 1 ] = - 1 ;
/************************************************************/
//<2F> <> ʶ<EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> ʱͼ<CAB1> <CDBC> <EFBFBD> Ͻ<EFBFBD> <CFBD> б <EFBFBD> ע
m_beTemLayerDrawing = true ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memset ( & m_curDesignPoint , 0 , sizeof ( PtStruct ) ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µĺ<C2B5> <C4BA> <EFBFBD>
m_bAddNewPoint = false ;
int i = 0 ;
int j = 0 ;
//////////////////<2F> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /////////////////////
m_totalFlyLines = 14 ; //<2F> ܵķ<DCB5> <C4B7> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> ԭ5<D4AD> <35> Ϊ14 20221121
DrawLineDataStruct m_pFlyLines [ 14 ] ; //<2F> <> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԭ5 <20> <> Ϊ12
memset ( m_pFlyLines , 0 , sizeof ( DrawLineDataStruct ) * m_totalFlyLines ) ;
m_flyLineNum = 0 ; //<2F> <> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> к<EFBFBD> <D0BA> ߱<EFBFBD> ע<EFBFBD> <D7A2>
m_flyLinesLayerID = - 1 ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Shp<68> <70> ͼ<EFBFBD> <CDBC>
m_bHaveCreateUAVShpLayer = false ;
//<2F> <> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Shp<68> <70> ͼ<EFBFBD> <CDBC> ID
m_uavShapileLayerID = - 1 ;
//<2F> <> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> Shpͼ<70> <CDBC> ID<49> <44> <EFBFBD> 飬ÿ<E9A3AC> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> ߾<EFBFBD> <DFBE> <EFBFBD> 2<EFBFBD> <32> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> 㣺1<E3A3BA> <31> ͼ<EFBFBD> <CDBC> Ϊ<EFBFBD> <CEAA> <EFBFBD> 㡢<EFBFBD> <E3A1A2> һ <EFBFBD> <D2BB> ͼ<EFBFBD> <CDBC> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> //5<> <35> Ϊ8 20221121
long m_ppPlanLineShpLayerIDArr [ 14 ] [ 2 ] ;
for ( i = 0 ; i < 14 ; i + + )
{
for ( j = 0 ; j < 2 ; j + + )
{
m_ppPlanLineShpLayerIDArr [ i ] [ j ] = - 1 ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ı <EFBFBD> ־
for ( i = 0 ; i < 14 ; i + + )
{
m_pHaveDrawLineFlag [ i ] = false ;
}
m_pLineSectDlg = NULL ;
m_pTargetDlg = NULL ;
//<2F> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD>
m_bDesignFirstPoint = true ;
m_pFlyLineDesign = NULL ;
m_pLineDesign = NULL ;
m_bShowToolBar = false ;
//<2F> <> <EFBFBD> <EFBFBD> վλ<D5BE> <CEBB>
g_gcsLon = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
g_gcsLat = 0 ; //γ <> <CEB3>
g_gcsAlt = 0 ; //<2F> ߶<EFBFBD>
memset ( & m_guidePtInfo , 0 , sizeof ( GuidePointData ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> վλ<D5BE> õ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
m_gcsPtShpLayerID = - 1 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> õ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
m_guidePtShpLayerID = - 1 ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> ༭<EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memset ( & m_curEditLinePoint , 0 , sizeof ( PtStruct ) ) ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44>
//memset(m_pTargetShapfileID, 0, sizeof(long)*MAX_TARGET_NUM);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD>
m_toolbarHeight = 0 ;
//<2F> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> εı <CEB5> ʶ
m_bAutoMove = true ;
memset ( m_pCallBackShapfileID , 0 , sizeof ( long ) * 255 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ
m_guidePointMode = 0 ;
m_bGuideMode = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ Ĭ<CABD> <C4AC> Ϊfalse
///////
m_bSetPointModel = false ; //û<> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> õ㹤<C3B5> <E3B9A4> ģʽ
m_bEndSetPoint = false ;
m_iPtSel = - 1 ;
m_bLDSetPoint = FALSE ;
m_canvasLayerID = - 1 ;
memset ( & m_infoData , 0 , sizeof ( m_infoData ) ) ;
m_targetSelID = 0 ;
m_bSelectDropPoint = false ;
m_gisManager = GISManager : : getInstance ( ) ;
for ( int i = 0 ; i < g_iDemAltPtNum ; i + + )
{
g_lDemAltLayerID [ i ] = - 1 ;
g_lDemAltDisLayerID [ i ] = - 1 ;
g_lDemPtNumLayerID [ i ] = - 1 ;
}
m_bPlotDemArea = false ;
m_bEnableShowADSB = true ;
}
CGISDlg : : ~ CGISDlg ( )
{
timeKillEvent ( TimerID_Draw ) ;
if ( m_Layer ! = NULL )
{
delete m_Layer ;
m_Layer = NULL ;
}
if ( m_pLonLatDlg ! = NULL )
{
delete m_pLonLatDlg ;
m_pLonLatDlg = NULL ;
}
if ( m_pHZDistanceDlg ! = NULL )
{
delete m_pHZDistanceDlg ;
m_pHZDistanceDlg = NULL ;
}
if ( m_pFlyLineDesign ! = NULL )
{
delete m_pFlyLineDesign ;
m_pFlyLineDesign = NULL ;
}
if ( m_pLineDesign ! = NULL )
{
delete m_pLineDesign ;
m_pLineDesign = NULL ;
}
if ( m_pDesignLineStruct ! = NULL )
{
delete [ ] m_pDesignLineStruct ;
m_pDesignLineStruct = NULL ;
}
//2016.01.06
if ( m_pNewDesignLineStruct ! = NULL )
{
delete [ ] m_pNewDesignLineStruct ;
m_pNewDesignLineStruct = NULL ;
}
if ( m_pLineSectDlg ! = NULL )
{
delete m_pLineSectDlg ;
m_pLineSectDlg = NULL ;
}
if ( m_pTargetDlg ! = NULL )
{
delete m_pTargetDlg ;
m_pTargetDlg = NULL ;
}
if ( m_gisManager ! = NULL )
{
m_gisManager - > DestroyObject ( ) ;
m_gisManager = NULL ;
}
}
void CGISDlg : : DoDataExchange ( CDataExchange * pDX )
{
CBCGPDialog : : DoDataExchange ( pDX ) ;
DDX_Control ( pDX , IDC_MAP1 , m_map ) ;
}
BEGIN_MESSAGE_MAP ( CGISDlg , CBCGPDialog )
//{{AFX_MSG_MAP(CGISDlg)
ON_WM_MOUSEMOVE ( )
// ON_WM_MOUSEWHEEL()
ON_COMMAND ( ID_ADDPOINT , OnAddpoint )
ON_MESSAGE ( WM_SET_LAYER_STATUS , OnSetLayerStatus )
ON_MESSAGE ( WM_CLOSE_LONLAT_DIALOG , OnCloseLonLatDialog )
ON_MESSAGE ( WM_CLOSE_DISTANCE_DIALOG , OnCloseShowDistanceDialog )
ON_MESSAGE ( WM_CLOSE_LINEDESIGN_DIALOG , OnCloseLineDesignDialog )
ON_MESSAGE ( WM_ADD_LINE_POINT , OnAddLinePoint ) //<2F> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD>
ON_MESSAGE ( WM_EDIT_LINE_POINT , OnEditLinePoint ) //<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD>
ON_MESSAGE ( WM_DELETE_LINE_POINT , OnDeleteLinePoint ) //ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_MESSAGE ( WM_SAVE_LINE_POINTS , OnSaveLinePoints ) //<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
ON_COMMAND ( IDT_BUTTON1 , OnAddMapData ) //<2F> <> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON2 , OnAddRasterImage ) //<2F> <> <EFBFBD> <EFBFBD> դ<EFBFBD> <D5A4> Ӱ<EFBFBD> <D3B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON3 , OnAddFlyLineData ) //<2F> <> <EFBFBD> غ<EFBFBD> <D8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON4 , OnLayerManage ) //ͼ<> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON5 , OnRemoveAllLayers ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
ON_COMMAND ( IDM_DESIGN_MYFLYLINE , OnFlyLineDesign ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2015.11.25 <09> <> <EFBFBD> κ<EFBFBD> <CEBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD>
ON_COMMAND ( IDT_BUTTON6 , OnMenuLinePtCtrlShow /*OnMapSelect*/ ) //<2F> <> ͼѡ <CDBC> <D1A1>
ON_COMMAND ( IDT_BUTTON7 , OnMapZoomIn ) //<2F> <> ͼ<EFBFBD> Ŵ<EFBFBD>
ON_COMMAND ( IDT_BUTTON8 , OnMapZoomOut ) //<2F> <> ͼ<EFBFBD> <CDBC> С
ON_COMMAND ( IDT_BUTTON9 , OnMapMove ) //<2F> <> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON10 , OnMapFullScreen ) //<2F> <> ͼȫ<CDBC> <C8AB> <EFBFBD> <EFBFBD> ʾ
ON_COMMAND ( IDT_BUTTON11 , OnEraseTrack ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON12 , OnShowLonLatInfo ) //<2F> <> ʾ <EFBFBD> <CABE> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> Ϣ
ON_COMMAND ( IDT_BUTTON13 , OnSurvey ) //<2F> <> <EFBFBD> <EFBFBD> 2<EFBFBD> <32> ֮<EFBFBD> <D6AE> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD>
ON_COMMAND ( IDT_BUTTON14 , OnShowCtrlMenu /*OnPrint*/ ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //<2F> <> ӡ<EFBFBD> <D3A1> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDT_BUTTON15 , OnZhangCW ) //<2F> <> ӡ<EFBFBD> <D3A1> <EFBFBD> <EFBFBD>
ON_NOTIFY_EX ( TTN_NEEDTEXT , 0 , OnToolTipsNotify ) //<2F> <> ť<EFBFBD> <C5A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
ON_COMMAND ( IDM_GUIDE_FLY1 , OnGuideMode1 )
ON_COMMAND ( IDM_DESIGN_MYFLYLINE , OnDesignLine )
ON_UPDATE_COMMAND_UI ( IDM_GUIDE_FLY1 , OnUpdateGuideMode1 )
ON_COMMAND ( IDM_GUIDE_FLY2 , OnGuideMode2 )
ON_UPDATE_COMMAND_UI ( IDM_GUIDE_FLY2 , OnUpdateGuideMode2 )
ON_COMMAND ( IDM_SHOW_LINE1 , OnShowLine1 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE1 , OnUpdateLineDisplay1 )
ON_COMMAND ( IDM_SHOW_LINE2 , OnShowLine2 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE2 , OnUpdateLineDisplay2 )
ON_COMMAND ( IDM_SHOW_LINE3 , OnShowLine3 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE3 , OnUpdateLineDisplay3 )
ON_COMMAND ( IDM_SHOW_LINE4 , OnShowLine4 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE4 , OnUpdateLineDisplay4 )
ON_COMMAND ( IDM_SHOW_LINE5 , OnShowLine5 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE5 , OnUpdateLineDisplay5 )
ON_COMMAND ( IDM_AUTO_MOVE , OnAutoMove )
ON_UPDATE_COMMAND_UI ( IDM_AUTO_MOVE , OnUpdateAutoMov )
ON_MESSAGE ( WM_CHECK_FLY_LINE_STATUS , OnCheckFlyLineShowStatus )
ON_COMMAND ( IDM_REMOVE_GUIDE_DRAW , OnRemoveGuidePtDraw )
ON_COMMAND ( IDM_OPEN_FLYLINE , OnAddFlyLineData )
ON_COMMAND ( ID_ENDDESIGN , OnEnddesign )
//}}AFX_MSG_MAP
ON_COMMAND ( ID_CLEARPOINT , OnClearpoint )
ON_COMMAND ( ID_EDITPOINT , OnEditpoint )
ON_COMMAND ( ID_DELPOINT , OnDelpoint )
//ON_COMMAND(IDM_BINDLINE1, &CGISDlg::OnBindline1)
ON_COMMAND ( IDM_BINDLINE2 , OnBindline2 )
ON_COMMAND ( ID_LOAD_MYLINE1 , OnLoadMyline1 )
ON_COMMAND ( IDM_BINDLINE3 , OnBindline3 )
ON_COMMAND ( IDM_BINDLINE4 , OnBindline4 )
ON_COMMAND ( IDM_BINDLINE5 , OnBindline5 )
ON_COMMAND ( IDM_LAYERMNG , OnLayermng )
ON_COMMAND ( IDM_ADDGTARGET , OnAddgtarget )
//ON_MESSAGE(MESSAGE_DRAWZK, &CGISDlg::DRAW_ZK)
// ON_WM_MOUSEHWHEEL()
ON_COMMAND ( ID_NLINEDESIGN , & CGISDlg : : OnNlinedesign )
ON_UPDATE_COMMAND_UI ( ID_NLINEDESIGN , & CGISDlg : : OnUpdateNlinedesign )
ON_COMMAND ( ID_SHOW_BACKLINE , & CGISDlg : : OnShowBackLine )
ON_UPDATE_COMMAND_UI ( ID_SHOW_BACKLINE , & CGISDlg : : OnUpdateShowBackLine )
ON_COMMAND ( ID_SHOW_HS11 , & CGISDlg : : OnShowHs11 )
ON_UPDATE_COMMAND_UI ( ID_SHOW_HS11 , & CGISDlg : : OnUpdateShowHs11 )
ON_COMMAND ( ID_BIND_HS11 , & CGISDlg : : OnBindHs11 )
ON_COMMAND ( ID_SHOW_TC12 , & CGISDlg : : OnShowTc12 )
ON_COMMAND ( ID_BIND_TC12 , & CGISDlg : : OnBindTc12 )
ON_UPDATE_COMMAND_UI ( ID_SHOW_TC12 , & CGISDlg : : OnUpdateShowTc12 )
ON_WM_SIZE ( )
ON_COMMAND ( ID_BIND_BACKLINE , & CGISDlg : : OnBindBackLine )
ON_WM_MOVE ( )
ON_MESSAGE ( WM_SEL_UAV , & CGISDlg : : OnSelUav )
ON_COMMAND ( ID_ADD_TARGET , & CGISDlg : : OnAddTarget )
ON_MESSAGE ( WM_DRAW_TARGET , & CGISDlg : : OnDrawTarget )
ON_WM_SHOWWINDOW ( )
ON_COMMAND ( ID_TARGET_DELETE , & CGISDlg : : OnTargetDelete )
ON_MESSAGE ( WM_SEND_SELECTTARGET , & CGISDlg : : OnSendSelectTarget )
ON_MESSAGE ( WM_SEND_CLOSEDEMALT , & CGISDlg : : OnSendCloseDemAlt )
ON_MESSAGE ( WM_SHOW_POINTINMAP , & CGISDlg : : OnShowPointInMap )
ON_MESSAGE ( WM_SHOW_ISVISIBLE , & CGISDlg : : OnShowPointVisible )
ON_MESSAGE ( WM_SHOW_NOTVISIBLE , & CGISDlg : : OnShowPointNotVisible )
ON_MESSAGE ( WM_SEND_CLEARSHAPE , & CGISDlg : : OnSendClearShape )
ON_MESSAGE ( WM_SHOW_VISI_REALTIME , & CGISDlg : : OnShowAreaVisible )
ON_MESSAGE ( WM_SHOW_NOTVISI_REALTIME , & CGISDlg : : OnShowAreaNotVisible )
ON_MESSAGE ( WM_SHOW_VISI_DELETE , & CGISDlg : : OnShowClearArea )
ON_MESSAGE ( WM_ADD_LINELAYER , & CGISDlg : : OnAddLineLayer )
ON_MESSAGE ( WM_DEL_LINELAYER , & CGISDlg : : OnDelLineLayer )
ON_MESSAGE ( WM_SEND_REGIONTOGIS , & CGISDlg : : OnSendRegionToGis )
ON_MESSAGE ( WM_DRAW_LINEPOINT , & CGISDlg : : OnDrawLinePoint )
ON_MESSAGE ( WM_SHOW_CRASH_REALTIME , & CGISDlg : : OnShowCrashArea )
ON_MESSAGE ( WM_SEND_DRAWFIGHT , & CGISDlg : : OnSendDrawFight )
ON_MESSAGE ( WM_SEND_DRAWDEMREGION , & CGISDlg : : OnSendDrawDemRegion )
ON_MESSAGE ( WM_SEND_MAPLOCATION , & CGISDlg : : OnZoomToLocation )
ON_COMMAND ( ID__MENU_LIGHTREGION , & CGISDlg : : OnMenuLightRegion )
ON_COMMAND ( ID_MENU_ENTRYPOINT , & CGISDlg : : OnMenuEntryPoint )
ON_COMMAND ( ID_MENU_PLOTDEMAREA , & CGISDlg : : OnMenuPlotdemArea )
ON_MESSAGE ( WM_SEND_MAPCURSORMODE , & CGISDlg : : OnSetMapCursorMode ) //<2F> <> <EFBFBD> <EFBFBD> Map CursorMode
ON_MESSAGE ( WM_SEND_DRAWMARKER , & CGISDlg : : OnDrawMarker ) //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ر<EFBFBD> <D8B1> ǵ<EFBFBD>
ON_COMMAND ( ID_MENU_CLEARGCS , & CGISDlg : : OnMenuClearGCS )
ON_COMMAND ( ID_MENU_ADSB , & CGISDlg : : OnMenuADSB )
ON_MESSAGE ( WM_SEND_DRAWUAV , & CGISDlg : : OnTimerDrawUAV ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD>
//<2F> <> <EFBFBD> ߱༭ // -----by Wu 2023.09.14
ON_COMMAND ( ID_SELECT_LINE , OnMapSelect ) //ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ON_COMMAND ( ID_EDIT_NODE , OnEditLine ) //<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD>
ON_COMMAND ( ID_EDIT_LINE , ShowModifyPointDlg ) //<2F> ĺ<DEB8> <C4BA> <EFBFBD>
ON_COMMAND ( ID_EDIT_SAVE , ShowEditSaveDlg ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ༭
/*
ON_COMMAND ( ID_MODIFY_LINEPOINT , OnMapSelect ) ; //<2F> ĺ<DEB8> <C4BA> 㺽<EFBFBD> <E3BABD>
ON_COMMAND ( ID_EDIT_SAVE , OnMapSelect ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ༭*/
/*
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 6-8
ON_COMMAND ( IDM_SHOW_LINE6 , & CGISDlg : : OnShowLine6 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE6 , & CGISDlg : : OnUpdateShowLine6 )
ON_COMMAND ( IDM_SHOW_LINE7 , & CGISDlg : : OnShowLine7 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE7 , & CGISDlg : : OnUpdateShowLine7 )
ON_COMMAND ( IDM_SHOW_LINE8 , & CGISDlg : : OnShowLine8 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE8 , & CGISDlg : : OnUpdateShowLine8 )
ON_COMMAND ( IDM_BINDLINE6 , & CGISDlg : : OnBindline6 )
ON_COMMAND ( IDM_BINDLINE7 , & CGISDlg : : OnBindline7 )
ON_COMMAND ( IDM_BINDLINE8 , & CGISDlg : : OnBindline8 )
ON_COMMAND ( IDM_SHOW_LINE9 , & CGISDlg : : OnShowLine9 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE9 , & CGISDlg : : OnUpdateShowLine9 )
ON_COMMAND ( IDM_SHOW_LINE10 , & CGISDlg : : OnShowLine10 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE10 , & CGISDlg : : OnUpdateShowLine10 )
ON_COMMAND ( IDM_BINDLINE9 , & CGISDlg : : OnBindline9 )
ON_COMMAND ( IDM_BINDLINE10 , & CGISDlg : : OnBindline10 ) */
//<2F> <> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
ON_COMMAND ( IDM_SHOW_LINE14 , & CGISDlg : : OnShowLine14 )
ON_UPDATE_COMMAND_UI ( IDM_SHOW_LINE14 , & CGISDlg : : OnUpdateShowLine14 )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CGISDlg message handlers
BOOL CGISDlg : : OnInitDialog ( )
{
CBCGPDialog : : OnInitDialog ( ) ;
SetWindowPos ( NULL , 0 , 0 , 600 , 700 , SWP_NOZORDER | SWP_NOMOVE ) ;
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CreateFloatToolBar ( ) ;
//<2F> <> <EFBFBD> ھ <EFBFBD> <DABE> <EFBFBD>
g_mapHwnd = this - > GetSafeHwnd ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD>
m_Layer = new CMapLayerManage ( ) ;
m_Layer - > Create ( IDD_DIALOG_LAYER_MANAGE ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> Ļ<EFBFBD> е <EFBFBD> GIS<49> <53> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
m_gisAreaInScreen = m_rcGISArea ;
m_gisAreaInScreen . top + = 32 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> γ <EFBFBD> ȶԻ<C8B6> <D4BB> <EFBFBD>
m_pLonLatDlg = new CLonLatDlg ( ) ;
m_pLonLatDlg - > MoveToGivenArea ( m_gisAreaInScreen ) ;
m_pLonLatDlg - > Create ( IDD_XY_DIALOG ) ;
//2<> <32> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> ˮƽ <CBAE> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pHZDistanceDlg = new CShowHZDistanceDlg ( ) ;
m_pHZDistanceDlg - > MoveToGivenArea ( m_gisAreaInScreen ) ;
m_pHZDistanceDlg - > Create ( IDD_DISTANCE_DIALOG ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD>
m_pFlyLineDesign = new CFlyLineDesign ( ) ;
m_pFlyLineDesign - > MoveToGivenArea ( m_gisAreaInScreen ) ;
m_pFlyLineDesign - > Create ( IDD_DIALOG_FLYLINE_DESIGN ) ;
// m_pLineDesign = new CLineDesign();
// m_pLineDesign->Create(IDD_DLG_LINEDESIGN);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݶԻ<DDB6> <D4BB> <EFBFBD>
m_pLineSectDlg = new CLineSectDisAZDlg ( ) ;
m_pLineSectDlg - > MoveToGivenArea ( m_gisAreaInScreen ) ;
m_pLineSectDlg - > Create ( IDD_DIALOG_LINE_SECT ) ;
m_pTargetDlg = new CTargetDlg ( ) ;
m_pTargetDlg - > Create ( IDD_DIALOG_TARGET , this ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <C7B5> Ի<EFBFBD> <D4BB> <EFBFBD>
m_dlgMarker . Create ( IDD_DIALOG_MARKER , this ) ;
m_dlgMarker . MoveToGivenArea ( m_gisAreaInScreen ) ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ߶ȵ<DFB6> <C8B5> <EFBFBD>
m_onePerWidth = 1.0 / m_rcGISArea . Width ( ) ;
m_onePerHeight = 1.0 / m_rcGISArea . Height ( ) ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ߶<EFBFBD>
m_mapAreaHalfWidth = 0.5 * m_rcGISArea . Width ( ) ;
m_mapAreaHalfHeight = 0.5 * m_rcGISArea . Height ( ) ;
//<2F> <> <EFBFBD> <EFBFBD>
m_rcgisSmallArea = m_rcGISArea ;
m_rcgisSmallArea . top = 24 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD>
m_toolbarHeight = m_rcgisSmallArea . top ;
m_ToolBar . ShowWindow ( SW_SHOW ) ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_gisManager - > m_pMapCwnd = GetDlgItem ( IDC_MAP1 ) ;
m_gisManager - > setMap ( & m_map ) ;
m_dlgLightRegion . Create ( IDD_DIALOG_LIGHTREGION , this ) ;
m_DlgDemAlt . Create ( IDD_DIALOG_DEMALT , this ) ;
//<2F> <> ý<EFBFBD> 嶨ʱ<E5B6A8> <CAB1>
timeBeginPeriod ( 0 ) ;
TimerID_Draw = timeSetEvent ( 500 , 1 , ( LPTIMECALLBACK ) CatchMTimerDraw , ( DWORD ) NULL , TIME_PERIODIC ) ;
if ( ! TimerID_Draw )
{
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> ý<EFBFBD> 嶨ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !" ) , MB_OK | MB_ICONEXCLAMATION , 0 ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
AddTianDiTuService ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
LoadTianDiTuService ( ) ;
m_map . SetScalebarVisible ( true ) ; //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return TRUE ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> Ӱ<EFBFBD> <D3B0> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
void CGISDlg : : AddTianDiTuService ( )
{
string baseurl = " http://{switch:t0,t1,t2,t3,t4,t5,t6,t7}.tianditu.gov.cn/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={zoom}&TileRow={y}&TileCol={x}&style=default&format=tiles&tk= " ;
//string baseurl_vec = "http://t0.tianditu.gov.cn/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={zoom}&TileRow={y}&TileCol={x}&style=default&format=tiles&tk=";
string key = " 53d93c1a8b3400b050817ac001bdb60e " ; //<2F> <> <EFBFBD> <EFBFBD> Key<65> <79> <EFBFBD> շ<EFBFBD> <D5B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1w<31> Ρ <EFBFBD>
//string key = "5ff7526440d3a7dab78037697c4679fa";
mapWindow : : ITiles * pTiles = m_map . GetTiles ( ) ;
mapWindow : : ITileProvidersPtr providers = pTiles - > GetProviders ( ) ;
//pTiles->ClearCache(mapWindow::tkCacheType::Disk);//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Tiles<65> <73> <EFBFBD> <EFBFBD>
//int providerId = (int)mapWindow::tkTileProvider::ProviderCustom + 1; // (1024 + 1) should be unique across application runs in case disk caching is used
int providerId = mapWindow : : tkTileProvider : : ProviderCustom ;
_bstr_t copyright = " TianDiTu,All Rights Reserved " ;
bool su = providers - > Add ( providerId , " TianDiTu " ,
( baseurl + key ) . c_str ( ) , //(_bstr_t)url.c_str(),
mapWindow : : tkTileProjection : : SphericalMercator , 0 , 18 ) ; //,"TianDiTu,All Rights Reserved"
m_map . put_ZoomBarMaxZoom ( 18 ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 18<31> <38>
//pTiles->ProviderId = providerId; //<2F> <> <EFBFBD> ǰ<EEB5B1> <C7B0> <EFBFBD> <EFBFBD>
//Tile<6C> <65> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//pTiles->put_UseCache(mapWindow::tkCacheType::Disk,true);//Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ´ <EFBFBD> <C2B4> ڴ<EFBFBD> <DAB4> <EFBFBD> ״̬
//pTiles->put_UseCache(mapWindow::tkCacheType::RAM, true);//Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ´ <EFBFBD> <C2B4> ڴ<EFBFBD> <DAB4> <EFBFBD> ״̬
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> Ƭ<EFBFBD> <C6AC> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//pTiles->put_DoCaching(mapWindow::tkCacheType::RAM, true);//Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ´ <EFBFBD> <C2B4> ڴ<EFBFBD> <DAB4> <EFBFBD> ״̬
pTiles - > put_DoCaching ( mapWindow : : tkCacheType : : Disk , true ) ; //<2F> <> <EFBFBD> <EFBFBD> Ĭ<EFBFBD> Ϲ ر<CFB9>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ھ <EFBFBD> <DABE> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> Ƶ<EFBFBD> <C6B5> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> һ <EFBFBD> <D2BB> ֻ<EFBFBD> <D6BB> ʹ <EFBFBD> <CAB9> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ݿ⡣
//pTiles->put_UseCache(mapWindow::tkCacheType::Disk, true); //Ĭ<> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ´ <EFBFBD> <C2B4> ڴ<EFBFBD> <DAB4> <EFBFBD> ״̬
pTiles - > put_DiskCacheFilename ( _bstr_t ( " ./mwtiles.db3 " ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵Ļ<CDB5> <C4BB> 棬<EFBFBD> <E6A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> ɵ<EFBFBD> <C9B5> <EFBFBD> Ƭ<EFBFBD> <C6AC> <EFBFBD> Ա<EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> Ƭ<EFBFBD> ڳ<EFBFBD> <DAB3> ռ <EFBFBD>
//pTiles->put_MaxCacheSize(mapWindow::tkCacheType::RAM, 200.0); //<2F> <> С <EFBFBD> <D0A1> MB Ϊ<> <CEAA> λ;Ĭ<> <C4AC> Ϊ 100
pTiles - > put_MaxCacheSize ( mapWindow : : tkCacheType : : Disk , 300.0 ) ; //<2F> <> С <EFBFBD> <D0A1> MB Ϊ<> <CEAA> λ;Ĭ<> <C4AC> Ϊ 100
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> Ӱ<EFBFBD> <D3B0> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
void CGISDlg : : LoadTianDiTuService ( )
{
mapWindow : : IGlobalSettingsPtr glSettingsPtr ;
glSettingsPtr . CreateInstance ( " MapWinGIS.GlobalSettings " ) ;
m_map . put_ReuseTileBuffer ( true ) ;
//m_map.SetMouseWheelSpeed(1);//Ĭ<> <C4AC> ֵΪ 0.5<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0.1 - 10.0 <20> <> Χ <EFBFBD> ڵ<EFBFBD> ֵ<EFBFBD> <D6B5> ֵ 1.0 <20> <> <EFBFBD> ر<EFBFBD> <D8B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> š<EFBFBD>
m_map . put_GrabProjectionFromData ( false ) ; //<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> Ϊ0ʱͶӰ<CDB6> ÿյ<C3BF> <D5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߵ <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> ʾ
m_map . put_Projection ( mapWindow : : tkMapProjection : : PROJECTION_WGS84 ) ;
m_map . GetTiles ( ) - > ProviderId = mapWindow : : tkTileProvider : : ProviderCustom ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_map . put_ZoomBehavior ( mapWindow : : tkZoomBehavior : : zbUseTileLevels ) ;
//m_map.put_KnownExtents(mapWindow::tkKnownExtents::keChina);
m_map . GetTiles ( ) - > Visible = true ;
if ( m_map . GetNumLayers ( ) = = 0 )
{
m_map . put_Longitude ( 100 ) ;
m_map . put_Latitude ( 37 ) ;
//m_map.put_CurrentZoom(4);
m_map . ZoomToTileLevel ( 6 ) ;
}
m_map . Redraw3 ( mapWindow : : RedrawSkipAllLayers , True ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ŵ<EFBFBD> Ŀ<EFBFBD> <C4BF> λ<EFBFBD> <CEBB>
void CGISDlg : : ZoomToLocation ( double lon , double lat )
{
m_map . put_Projection ( mapWindow : : tkMapProjection : : PROJECTION_WGS84 ) ;
m_map . GetTiles ( ) - > Visible = true ;
m_map . put_Longitude ( lon ) ;
m_map . put_Latitude ( lat ) ;
m_map . put_CurrentZoom ( 16 ) ;
m_map . Redraw3 ( mapWindow : : RedrawSkipAllLayers , True ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> ݣ<EFBFBD> <DDA3> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnAddMapData ( )
{
TCHAR s [ 10000 ] ;
s [ 0 ] = 0 ;
CFileDialog dlg ( true ) ;
dlg . m_ofn . lpstrTitle = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> " ) ;
dlg . m_ofn . lpstrFile = s ;
dlg . m_ofn . nMaxFile = sizeof ( s ) / sizeof ( TCHAR ) ;
TCHAR filter [ 500 ] = _T ( " SHAPE<EFBFBD> ļ<EFBFBD> (*.shp) \0 *.shp " ) ;
dlg . m_ofn . lpstrFilter = filter ;
dlg . m_ofn . Flags | = OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER ;
if ( dlg . DoModal ( ) = = IDCANCEL ) return ;
POSITION pos ;
pos = dlg . GetStartPosition ( ) ;
CString path ;
long count = 0 ;
while ( pos )
{
path = dlg . GetNextPathName ( pos ) ;
count + + ;
}
pos = dlg . GetStartPosition ( ) ;
while ( pos )
{
path = dlg . GetNextPathName ( pos ) ;
Openlocalfile ( path ) ;
}
// <20> <> ȡ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
CString fileName = GetSoftwareCurrentDirectory ( ) + " \\ map.ini " ;
: : WritePrivateProfileString ( " map " , " layer " , path , fileName ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> դ<EFBFBD> <D5A4> Ӱ<EFBFBD> <D3B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnAddRasterImage ( )
{
TCHAR s [ 10000 ] ;
s [ 0 ] = 0 ;
CFileDialog dlg ( true ) ;
dlg . m_ofn . lpstrTitle = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> " ) ;
dlg . m_ofn . lpstrFile = s ;
dlg . m_ofn . nMaxFile = sizeof ( s ) / sizeof ( TCHAR ) ;
//TCHAR filter[500]=_T("SHAPE<50> ļ<EFBFBD> (*.shp)\0*.shp\0IMG<4D> ļ<EFBFBD> (*.img)\0*.img\0GeoTIFF<46> ļ<EFBFBD> (*.tif)\0*.tif\0ASC<53> ļ<EFBFBD> (*.asc)\0*.asc\0<> <30> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.*)\0*.*\0");
TCHAR filter [ 500 ] = _T ( " GeoTIFF<EFBFBD> ļ<EFBFBD> (*.tif) \0 *.tif \0 <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.*)\0 *.* \0 " ) ;
dlg . m_ofn . lpstrFilter = filter ;
dlg . m_ofn . Flags | = OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER ;
if ( dlg . DoModal ( ) = = IDCANCEL ) return ;
POSITION pos ;
pos = dlg . GetStartPosition ( ) ;
CString path ;
long count = 0 ;
while ( pos )
{
path = dlg . GetNextPathName ( pos ) ;
count + + ;
}
pos = dlg . GetStartPosition ( ) ;
while ( pos )
{
path = dlg . GetNextPathName ( pos ) ;
Openlocalfile ( path ) ;
}
// <20> <> ȡ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
CString fileName = GetSoftwareCurrentDirectory ( ) + " \\ map.ini " ;
: : WritePrivateProfileString ( " map " , " layer " , path , fileName ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <F2A3ACBC> غ<EFBFBD> <D8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD>
void CGISDlg : : OnAddFlyLineData ( )
{
//δ<> <CEB4> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return ;
}
if ( m_flyLineNum > m_totalFlyLines )
{
AfxMessageBox ( _T ( " <EFBFBD> Ѽ<EFBFBD> <EFBFBD> غ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> >12<31> <32> " ) ) ;
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> Ի<EFBFBD> <D4BB> <EFBFBD>
CFileDialog dlg ( true , " .txt " , " *.txt " , OFN_HIDEREADONLY , " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.txt)| * . txt | " , NULL) ;
if ( dlg . DoModal ( ) = = IDOK )
{
//<2F> <> ȡ<EFBFBD> <C8A1> ·<EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
OnShowGivenLine ( dlg . GetPathName ( ) ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> е <EFBFBD> ͼ<EFBFBD> ķŴ<C4B7> <C5B4> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnMapZoomIn ( )
{
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_map . SetCursorMode ( 0 ) ;
m_bLDSetPoint = FALSE ;
m_bSelectFeatureFlag = false ;
}
//<2F> <> ͼ<EFBFBD> <CDBC> С
void CGISDlg : : OnMapZoomOut ( )
{
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_map . SetCursorMode ( 1 ) ;
m_bLDSetPoint = FALSE ;
m_bSelectFeatureFlag = false ;
}
//<2F> <> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
void CGISDlg : : OnMapMove ( )
{
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
if ( m_map . GetCursorMode ( ) = = mapWindow : : tkCursorMode : : cmPan )
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
}
else
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmPan ) ;
}
m_bLDSetPoint = FALSE ;
m_bSelectFeatureFlag = false ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ͼѡ <CDBC> <D1A1>
void CGISDlg : : OnMapSelect ( )
{
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmSelection ) ;
m_bLDSetPoint = FALSE ;
if ( ! m_bEditLine & & ! m_bLineDesign ) //<2F> Ǻ<EFBFBD> <C7BA> ߱༭ģʽ <C4A3> ¿<EFBFBD> ѡ
{
if ( ! m_bSelectFeatureFlag )
{
m_bSelectFeatureFlag = true ; // by Wu
}
else
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
ClearHighLightLine ( ) ;
m_bSelectFeatureFlag = false ;
}
}
else
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
//ClearHighLightLine();
//m_bSelectFeatureFlag = false;
}
}
//<2F> <> ͼȫ<CDBC> <C8AB> <EFBFBD> <EFBFBD> ʾ
void CGISDlg : : OnMapFullScreen ( )
{
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_map . ZoomToMaxExtents ( ) ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_bLDSetPoint = FALSE ;
m_bSelectFeatureFlag = false ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> 2<EFBFBD> <32> ֮<EFBFBD> <D6AE> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD>
void CGISDlg : : OnSurvey ( )
{
m_bSelectFeatureFlag = false ;
m_bSetPointModel = FALSE ;
// m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_bLDSetPoint = FALSE ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bPolylineMeasure )
{
ClearPloylineMeasure ( ) ;
m_bPolylineMeasure = false ;
m_numPolylineMeasurePts = 0 ;
m_bMeasureDrag = false ;
}
else
{
m_bPolylineMeasure = true ;
}
/*
//<2F> <> <EFBFBD> <EFBFBD>
m_pHZDistanceDlg - > ResetCoordinateData ( ) ;
if ( ! m_bHaveShowDistanceDlg )
{
m_bHaveShowDistanceDlg = true ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pHZDistanceDlg - > ShowWindow ( SW_SHOW ) ;
}
else
{
m_bHaveShowDistanceDlg = false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pHZDistanceDlg - > ShowWindow ( SW_HIDE ) ;
} */
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnEraseTrack ( )
{
EraseTrack ( 0 ) ;
EraseTrack ( 1 ) ;
EraseTrack ( 2 ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : EraseTrack ( int uavid )
{
if ( uavid < 0 | | uavid > 2 )
{
return ;
}
m_bSetPointModel = FALSE ;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_bLDSetPoint = FALSE ;
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ķ<EFBFBD> <C4B7> й켣<D0B9> <ECBCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bFirstDrawUAVTrack [ uavid ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ı <EFBFBD> <C4B1> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( m_flyTrackLayerID [ uavid ] ! = - 1 )
{
m_map . RemoveLayer ( m_flyTrackLayerID [ uavid ] ) ;
}
if ( m_UAVFlyTrackLayerID [ uavid ] ! = - 1 )
{
m_map . RemoveLayer ( m_UAVFlyTrackLayerID [ uavid ] ) ;
}
m_bFirstDrawUAVTrack [ uavid ] = false ;
m_map . Redraw ( ) ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnEraseAllTargets ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0ʱ
if ( m_targetPointNum > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> <EFBFBD> <EFBFBD> Label
m_map . ClearLabels ( m_targetDrawLayerID ) ;
m_map . ClearDrawing ( m_targetDrawLayerID ) ;
m_targetDrawLayerID = - 1 ;
m_map . Redraw ( ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ķ<EFBFBD> <C4B7> к<EFBFBD> <D0BA> 㣬<EFBFBD> <E3A3AC> <EFBFBD> Ƴ<EFBFBD> <C6B3> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ķ<EFBFBD> <C4B7> к<EFBFBD> <D0BA> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> ˻<EFBFBD> <CBBB> ĵ<EFBFBD> ǰ<EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY<64> <59> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> yaw, <20> <> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> Ϊ<EFBFBD> <CEAA> λ<EFBFBD> <CEBB>
void CGISDlg : : AddFlyPoint ( int uavId , const double dX , const double dY , const double yaw , bool control )
{
//δ<> <CEB4> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> Χ <EFBFBD> <CEA7> <EFBFBD> м<EFBFBD> <D0BC> 飬<EFBFBD> <E9A3AC> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> Ч
double fabsLon = fabs ( dX ) ;
double fabsLat = fabs ( dY ) ;
//<2F> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ݷ<EFBFBD> Χ <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> Ч
if ( ( fabsLon < = 0.000001 ) | | ( fabsLon > 180 ) | | ( fabsLat < = 0.000001 ) | | ( fabsLat > 90 ) | | ( yaw < 0 ) | | ( yaw > 360 ) )
{
return ;
}
if ( m_bAutoMove )
{
//<2F> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> Σ<EFBFBD> ʹ <EFBFBD> ɻ<EFBFBD> <C9BB> <EFBFBD> ʾ <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> м<EFBFBD>
if ( control )
{
AutomaticMoveMap ( dX , dY ) ;
}
}
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> zcw
m_drawTrackPtNum [ uavId ] + + ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ˺<EFBFBD> <CBBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 200-<2D> <> 2000 2017.07.05
if ( m_drawTrackPtNum [ uavId ] > = 100 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
EraseTrack ( uavId ) ;
m_drawTrackPtNum [ uavId ] = 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> UAV<41> ķ<EFBFBD> <C4B7> й켣
DrawUAV ( uavId , dX , dY , yaw , control ) ;
/*static int num = 0;
if ( num = = 1 )
{
DrawCanvas ( ) ;
num = 0 ;
}
num + + ; */
//ʵʱͨ<CAB1> ӷ<EFBFBD> <D3B7> <EFBFBD>
//m_dlgLightRegion.AnalysisRealTime(dY, distance, angleGU, g_gcsLon, g_gcsLat);
//m_dlgLightRegion.DrawVisiAreaRealTime(dY, distance, angleGU, g_gcsLon, g_gcsLat);
m_dlgLightRegion . DrawCrashAreaRealTime ( dY , dX , dY ) ;
//ˢ<> µ<EFBFBD> ͼ<EFBFBD> <CDBC> ÿ5֡ˢ<D6A1> <CBA2> һ <EFBFBD> Σ<EFBFBD>
m_map . Redraw ( ) ;
}
void CGISDlg : : AddFlyPoint_ADS ( const int uavNum , const int uavid , const double lon , const double lat , const double yaw , const bool control , const CString strPlaneName )
{
//δ<> <CEB4> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> Χ <EFBFBD> <CEA7> <EFBFBD> м<EFBFBD> <D0BC> 飬<EFBFBD> <E9A3AC> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> Ч
double fabsLon = fabs ( lon ) ;
double fabsLat = fabs ( lat ) ;
//<2F> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ݷ<EFBFBD> Χ <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> Ч
if ( ( fabsLon < = 0.000001 ) | | ( fabsLon > 180 ) | | ( fabsLat < = 0.000001 ) | | ( fabsLat > 90 ) | | ( yaw < 0 ) | | ( yaw > 360 ) )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> UAV<41> ķ<EFBFBD> <C4B7> й켣
DrawUAV_ADS ( uavNum , uavid , lon , lat , yaw , control , strPlaneName ) ;
//ˢ<> µ<EFBFBD> ͼ<EFBFBD> <CDBC> ÿ5֡ˢ<D6A1> <CBA2> һ <EFBFBD> Σ<EFBFBD>
m_map . Redraw ( ) ;
}
void CGISDlg : : Openlocalfile ( CString file )
{
int error = 0 ;
CString filetype = GetFileType ( file ) ;
CString filename = GetFileName ( file ) ;
filetype . MakeLower ( ) ;
if ( filetype . Compare ( " shp " ) = = 0 )
{
mapWindow : : IShapefilePtr shape ;
shape . CreateInstance ( " MapWinGIS.Shapefile " ) ;
if ( ! shape - > Open ( ( _bstr_t ) file , NULL ) )
{
error = 1 ;
}
_bstr_t pro = shape - > GetProjection ( ) ;
//<2F> <> <EFBFBD> õ<EFBFBD> ͼ<EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> ɫΪ<C9AB> <CEAA> ɫ
m_map . SetBackColor ( RGB ( 255 , 255 , 255 ) ) ;
int shpLayerPose = m_map . AddLayer ( shape , true ) ;
//<2F> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . MoveLayerBottom ( shpLayerPose ) ;
m_Layer - > AddLayerInfo ( filename , 1 ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
else if ( filetype . Compare ( " img " ) = = 0 )
{
mapWindow : : IImagePtr image ;
image . CreateInstance ( " MapWinGIS.Image " ) ;
if ( ! image - > Open ( ( _bstr_t ) file , mapWindow : : IMG_FILE , true , NULL ) )
{
error = 1 ;
}
//<2F> <> <EFBFBD> õ<EFBFBD> ͼ<EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> ɫΪ<C9AB> <CEAA> ɫ
m_map . SetBackColor ( RGB ( 255 , 255 , 255 ) ) ;
m_map . AddLayer ( image , true ) ;
m_Layer - > AddLayerInfo ( filename , 2 ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
else if ( filetype . Compare ( " tif " ) = = 0 )
{
mapWindow : : IImagePtr image ;
image . CreateInstance ( " MapWinGIS.Image " ) ;
if ( ! image - > Open ( ( _bstr_t ) file , mapWindow : : TIFF_FILE , true , NULL ) )
{
error = 1 ;
}
//<2F> <> <EFBFBD> õ<EFBFBD> ͼ<EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> ɫΪ<C9AB> <CEAA> ɫ
m_map . SetBackColor ( RGB ( 255 , 255 , 255 ) ) ;
int tiffLayerID = m_map . AddLayer ( image , true ) ;
m_Layer - > AddLayerInfo ( filename , 2 ) ;
m_map . ZoomToLayer ( tiffLayerID ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
else if ( filetype . Compare ( " asc " ) = = 0 )
{
mapWindow : : IImagePtr image ;
image . CreateInstance ( " MapWinGIS.Image " ) ;
if ( ! image - > Open ( ( _bstr_t ) file , mapWindow : : ASC_FILE , true , NULL ) )
{
error = 1 ;
}
//<2F> <> <EFBFBD> õ<EFBFBD> ͼ<EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> ɫΪ<C9AB> <CEAA> ɫ
m_map . SetBackColor ( RGB ( 255 , 255 , 255 ) ) ;
m_map . AddLayer ( image , true ) ;
m_Layer - > AddLayerInfo ( filename , 2 ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
m_bHaveAddMap = true ;
}
/*if(m_bHaveAddMap)
{
ReadTargetIni ( true ) ;
} */
if ( error = = 1 )
{
CString msg = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " + file ;
AfxMessageBox ( msg ) ;
}
m_gisManager - > m_bHaveAddMap = m_bHaveAddMap ;
}
CString CGISDlg : : GetFileType ( CString file )
{
CString type ;
long len = file . GetLength ( ) ;
int pos = file . ReverseFind ( ' . ' ) ;
type = file . Right ( len - pos - 1 ) ;
return type ;
}
CString CGISDlg : : GetFileName ( CString file )
{
CString name ;
long len = file . GetLength ( ) ;
int pos = file . ReverseFind ( ' \\ ' ) ;
name = file . Right ( len - pos - 1 ) ;
return name ;
}
//<2F> <> ʾ <EFBFBD> Ҽ<EFBFBD> <D2BC> ˵<EFBFBD>
void CGISDlg : : OnShowRMenu ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ҽ<EFBFBD> <D2BC> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
if ( ! m_bLineDesign )
{
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ݲ˵<DDB2>
CMenu menu ;
//CMenu* pMenu = GetMenu();
//if (pMenu != NULL)
//{
/*
CMenu * pSubMenu = menu . GetSubMenu ( 0 ) ;
if ( pSubMenu ! = NULL )
{
CMenu * pSubMenu2 = pSubMenu - > GetSubMenu ( 0 ) ;
if ( pSubMenu2 ! = NULL )
{
pSubMenu2 - > DeleteMenu ( IDM_SHOW_LINE14 , MF_BYCOMMAND ) ;
}
} */
//}
POINT pt ;
GetCursorPos ( & pt ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڻط<DABB> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> á<EFBFBD> <C3A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> Ӳ˵<D3B2> <CBB5> <EFBFBD> <EFBFBD> Ȼ<EFBFBD> ɫ
menu . LoadMenu ( IDR_MENU2 ) ;
//<2F> <> <EFBFBD> <EFBFBD> 1
if ( m_pHaveDrawLineFlag [ 0 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE1 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE1 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 2
if ( m_pHaveDrawLineFlag [ 1 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE2 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE2 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 3
if ( m_pHaveDrawLineFlag [ 2 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE3 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE3 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 4
if ( m_pHaveDrawLineFlag [ 3 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE4 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE4 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 5
if ( m_pHaveDrawLineFlag [ 4 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE5 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE5 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
/*
//<2F> <> <EFBFBD> <EFBFBD> 6
if ( m_pHaveDrawLineFlag [ 5 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE6 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE6 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 7
if ( m_pHaveDrawLineFlag [ 6 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE7 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE7 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 8
if ( m_pHaveDrawLineFlag [ 7 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE8 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE8 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 9
if ( m_pHaveDrawLineFlag [ 8 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE9 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE9 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 10
if ( m_pHaveDrawLineFlag [ 9 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE10 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE10 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
*/
if ( g_b981ADesktop | | g_b981APad )
{
//<2F> <> <EFBFBD> <EFBFBD> 14 <20> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 13 ] )
{
menu . CheckMenuItem ( ID_SHOW_BACKLINE , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_BACKLINE , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 11 Ӧ<> <D3A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 10 ] )
{
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 12 <20> <> <EFBFBD> <EFBFBD> Χ <EFBFBD> <CEA7>
if ( m_pHaveDrawLineFlag [ 11 ] )
{
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
}
if ( g_b981CDesktop )
{
//<2F> <> <EFBFBD> <EFBFBD> 14 <20> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 10 ] )
{
menu . CheckMenuItem ( ID_SHOW_BACKLINE , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_BACKLINE , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 6 Χ <> <CEA7>
if ( m_pHaveDrawLineFlag [ 5 ] )
{
//menu.CheckMenuItem( ID_SHOW_WEILAN, MF_BYCOMMAND | MF_CHECKED );
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
else
{
//menu.CheckMenuItem( ID_SHOW_WEILAN, MF_BYCOMMAND | MF_UNCHECKED );
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 7 Ӧ<> <D3A6>
if ( m_pHaveDrawLineFlag [ 6 ] )
{
//menu.CheckMenuItem( ID_SHOW_LINE_YINGJI, MF_BYCOMMAND | MF_CHECKED );
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
//menu.CheckMenuItem( ID_SHOW_LINE_YINGJI, MF_BYCOMMAND | MF_UNCHECKED );
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_CHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 14,<2C> <> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 13 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE14 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE14 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
}
if ( m_bAutoMove )
{
menu . CheckMenuItem ( IDM_AUTO_MOVE , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_AUTO_MOVE , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_guidePointMode = = 1 )
{
menu . CheckMenuItem ( IDM_GUIDE_FLY1 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_GUIDE_FLY1 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_guidePointMode = = 2 )
{
menu . CheckMenuItem ( IDM_GUIDE_FLY2 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_GUIDE_FLY2 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_bPlotDemArea )
{
menu . CheckMenuItem ( ID_MENU_PLOTDEMAREA , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_MENU_PLOTDEMAREA , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_bEnableShowADSB )
{
menu . CheckMenuItem ( ID_MENU_ADSB , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_MENU_ADSB , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//menu.GetSubMenu(0)->ModifyMenu(0, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);
if ( g_b981ADesktop | | g_b981APad )
{
// <20> <> ȡ<EFBFBD> Ӳ˵<D3B2>
CMenu * pSubMenu = menu . GetSubMenu ( 0 ) ; // <20> <> һ <EFBFBD> <D2BB> <EFBFBD> Ӳ˵<D3B2>
//int nn = pSubMenu->GetMenuItemCount();
if ( pSubMenu )
{
pSubMenu - > ModifyMenu ( 5 , MF_BYPOSITION | MF_DISABLED | MF_GRAYED ) ; //<2F> <> <EFBFBD> ظ̷߳<DFB3> <CCB7> <EFBFBD>
pSubMenu - > ModifyMenu ( 7 , MF_BYPOSITION | MF_DISABLED | MF_GRAYED ) ; //<2F> <> <EFBFBD> ر<EFBFBD> <D8B1> <EFBFBD>
// <20> <> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> Ӳ˵<D3B2>
CMenu * pSubSubMenu = pSubMenu - > GetSubMenu ( 2 ) ; // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ӳ˵<D3B2> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//int nn2 = pSubSubMenu->GetMenuItemCount();
if ( pSubSubMenu )
{
// <20> <> <EFBFBD> ض<EFBFBD> <D8B6> <EFBFBD> <EFBFBD> Ӳ˵<D3B2> <CBB5> ĵ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//pSubSubMenu->ModifyMenu(IDM_SHOW_LINE14, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); //<2F> <> <EFBFBD> ؿ<EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
pSubSubMenu - > RemoveMenu ( IDM_SHOW_LINE14 , MF_BYCOMMAND ) ; //<2F> <> <EFBFBD> ؿ<EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
// <20> Ķ<DEB8> <C4B6> <EFBFBD> <EFBFBD> Ӳ˵<D3B2> <CBB5> ı <EFBFBD>
pSubMenu - > ModifyMenu ( ID_BIND_BACKLINE , MF_BYCOMMAND | MF_STRING , IDR_MENU2 , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <EFBFBD> װ<EFBFBD> <EFBFBD> " ) ) ;
pSubMenu - > ModifyMenu ( ID_SHOW_BACKLINE , MF_BYCOMMAND | MF_STRING , IDR_MENU2 , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ " ) ) ;
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
menu . GetSubMenu ( 0 ) - > TrackPopupMenu ( TPM_LEFTALIGN | TPM_RIGHTBUTTON , pt . x , pt . y , this ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> ֤<EFBFBD> <D6A4> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//ʵ<> <CAB5> ԭ<EFBFBD> <D4AD> <EFBFBD> <EFBFBD> 1<EFBFBD> <31> <EFBFBD> Ȼ<EFBFBD> <C8BB> õ<EFBFBD> ͼ<EFBFBD> <CDBC> ǰ<EFBFBD> <C7B0> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
// 2<> <32> <EFBFBD> ٸ<EFBFBD> <D9B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ĵ<EFBFBD> ǰ<EFBFBD> <C7B0> <EFBFBD> ꣬<EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> ͼ
void CGISDlg : : AutomaticMoveMap ( double dX , double dY )
{
//<2F> <> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> صľ<D8B5> γ <EFBFBD> <CEB3> ֵ
double lonDegreePerPixel = 0 ;
double latDegreePerPixel = 0 ;
mapWindow : : IExtentsPtr pExtents ;
pExtents = m_map . GetExtents ( ) ;
double xMin = 0 ;
double yMin = 0 ;
double zMin = 0 ;
double xMax = 0 ;
double yMax = 0 ;
double zMax = 0 ;
pExtents - > GetBounds ( & xMin , & yMin , & zMin , & xMax , & yMax , & zMax ) ;
if ( dX < xMin | | dX > xMax | | dY < yMin | | dY > yMax )
{
lonDegreePerPixel = ( xMax - xMin ) * m_onePerWidth ;
latDegreePerPixel = ( yMax - yMin ) * m_onePerHeight ;
//<2F> <> ʾ <EFBFBD> <CABE> Χ
double xNewMin = 0 ;
double yNewMin = 0 ;
double zNewMin = 0 ;
double xNewMax = 0 ;
double yNewMax = 0 ;
double zNewMax = 0 ;
//<2F> <> <EFBFBD> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double lonIncrement = lonDegreePerPixel * m_mapAreaHalfWidth ;
//γ <> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double latIncrement = latDegreePerPixel * m_mapAreaHalfHeight ;
xNewMin = dX - lonIncrement ;
xNewMax = dX + lonIncrement ;
yNewMin = dY - latIncrement ;
yNewMax = dY + latIncrement ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> ʾ <EFBFBD> <CABE> Χ
pExtents - > SetBounds ( xNewMin , yNewMin , zNewMin , xNewMax , yNewMax , zNewMax ) ;
m_map . SetExtents ( pExtents ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> Ϣ
void CGISDlg : : OnShowLonLatInfo ( )
{
if ( ! m_bHaveShowLonLatDlg ) //δ<> <CEB4> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2B5AFB3> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
{
m_bHaveShowLonLatDlg = true ;
m_pLonLatDlg - > SetLonLatInfo ( 0 , 0 ) ;
m_pLonLatDlg - > ShowWindow ( SW_SHOW ) ;
}
else
{
m_bHaveShowLonLatDlg = false ;
m_pLonLatDlg - > ShowWindow ( SW_HIDE ) ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> :ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
void CGISDlg : : OnRemoveAllLayers ( )
{
if ( ! m_bHaveAddMap )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
OnEraseTrack ( ) ;
for ( int i = 0 ; i < MAX_PLANE_NUM_ADS ; i + + )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> ı <EFBFBD> <C4B1> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( m_UAVFlyTrackLayerID_ADS [ i ] ! = - 1 )
{
//m_map.ClearLabels(m_UAVFlyTrackLayerID_ADS[i]);
//m_map.ClearDrawing(m_UAVFlyTrackLayerID_ADS[i]);
m_map . RemoveLayer ( m_UAVFlyTrackLayerID_ADS [ i ] ) ;
m_UAVFlyTrackLayerID_ADS [ i ] = - 1 ;
m_bWithin100km_ADS [ i ] = false ;
}
}
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> <CBB5> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_drawPlanFlyLine ! = - 1 )
{
m_map . ClearDrawing ( m_drawPlanFlyLine ) ;
m_drawPlanFlyLine = - 1 ;
}
if ( m_targetDrawLayerID ! = - 1 )
{
m_map . RemoveLayer ( m_targetDrawLayerID ) ;
m_targetDrawLayerID = - 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 漰<EFBFBD> <E6BCB0> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( m_longGroundID ! = 0 )
{
ClearPointShape ( m_longGroundID ) ;
m_longGroundID = 0 ;
}
if ( m_visbleCircleLayerID > 0 )
{
m_map . GetShapefile ( m_visbleCircleLayerID ) . EditClear ( ) ;
m_visbleCircleLayerID = - 1 ;
}
if ( m_notVisibleCircleLayerID > 0 )
{
m_map . GetShapefile ( m_notVisibleCircleLayerID ) . EditClear ( ) ;
m_notVisibleCircleLayerID = - 1 ;
}
if ( m_visiRealCircleLayerID > 0 )
{
m_map . GetShapefile ( m_visiRealCircleLayerID ) . EditClear ( ) ;
m_visiRealCircleLayerID = - 1 ;
}
if ( m_notVisiRealCircleLayerID > 0 )
{
m_map . GetShapefile ( m_notVisiRealCircleLayerID ) . EditClear ( ) ;
m_notVisiRealCircleLayerID = - 1 ;
}
if ( m_RealCircleLayerID > 0 )
{
m_map . GetShapefile ( m_RealCircleLayerID ) . EditClear ( ) ;
m_RealCircleLayerID = - 1 ;
}
for ( int i = 0 ; i < 20 ; i + + )
{
if ( m_longContourLineID [ i ] > 0 )
{
m_map . GetShapefile ( m_longContourLineID [ i ] ) . EditClear ( ) ;
m_longContourLineID [ i ] = - 1 ;
}
if ( m_longContourTextID [ i ] ! = 0 )
{
ClearPointShape ( m_longContourTextID [ i ] ) ;
m_longContourTextID [ i ] = 0 ;
}
}
for ( int i = 0 ; i < 500 ; i + + )
{
if ( m_DemRegionLayerID [ i ] > 0 )
{
m_map . GetShapefile ( m_DemRegionLayerID [ i ] ) . EditClear ( ) ;
m_DemRegionLayerID [ i ] = - 1 ;
}
}
if ( m_longSelectLineID > 0 )
{
m_map . GetShapefile ( m_longSelectLineID ) . EditClear ( ) ;
m_longSelectLineID = - 1 ;
}
if ( m_longLabelPlotID ! = 0 )
{
ClearPointShape ( m_longLabelPlotID ) ;
m_longLabelPlotID = 0 ;
}
if ( m_longLinePointID ! = 0 )
{
ClearPointShape ( m_longLinePointID ) ;
m_longLinePointID = 0 ;
}
if ( m_crashAreaLayerID > 0 )
{
m_map . GetShapefile ( m_crashAreaLayerID ) . EditClear ( ) ;
m_crashAreaLayerID = - 1 ;
}
if ( m_fightRegionLayerID > 0 )
{
m_map . GetShapefile ( m_fightRegionLayerID ) . EditClear ( ) ;
m_fightRegionLayerID = - 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ̷߳<DFB3> <CCB7> <EFBFBD> ͼ<EFBFBD> <CDBC>
for ( int i = 0 ; i < g_iDemAltPtNum ; i + + )
{
m_map . RemoveLayer ( g_lDemAltLayerID [ i ] ) ;
if ( g_lDemAltDisLayerID [ i ] > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( g_lDemAltDisLayerID [ i ] ) ;
g_lDemAltDisLayerID [ i ] = - 1 ;
}
if ( g_lDemPtNumLayerID [ i ] > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( g_lDemPtNumLayerID [ i ] ) ;
g_lDemPtNumLayerID [ i ] = - 1 ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <C7B5> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
for ( int i = 0 ; i < g_iMarkerPtNum ; i + + )
{
if ( g_lMarkerLayerID [ i ] > 0 )
{
ClearPointShape ( g_lMarkerLayerID [ i ] ) ;
g_lMarkerLayerID [ i ] = 0 ;
}
}
m_designLinePointNum = 0 ;
//m_map.RemoveAllLayers();
m_map . ClearDrawing ( m_designLineLayerID ) ;
m_map . ClearDrawing ( m_designLineLayerID2 ) ;
m_map . RemoveLayer ( m_designLineLayerID ) ;
m_map . RemoveLayer ( m_designLineLayerID2 ) ;
m_map . RemoveAllLayers ( ) ;
memset ( m_pDesignLineStruct , 0 , sizeof ( PtStruct ) * m_lineMaxPointNum ) ;
m_Layer - > RemoveAll ( ) ;
m_map . Redraw ( ) ;
for ( int i = 0 ; i < 13 ; i + + )
{
m_pHaveDrawLineFlag [ i ] = false ;
}
//<2F> <> <EFBFBD> õ<EFBFBD> ͼ<EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> ɫΪ<C9AB> <CEAA> ɫ
m_map . SetBackColor ( RGB ( 0 , 0 , 0 ) ) ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> ͼ
//m_bHaveAddMap = false;
}
//<2F> <> <EFBFBD> <EFBFBD> :ͼ<> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnLayerManage ( )
{
m_Layer - > ShowWindow ( SW_SHOW ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnSetLayerStatus ( WPARAM wParam , LPARAM lParam )
{
if ( lParam = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
{
m_map . SetLayerVisible ( wParam , false ) ;
}
else if ( lParam = = 1 ) //<2F> <> ʾ ͼ<CABE> <CDBC>
{
m_map . SetLayerVisible ( wParam , true ) ;
}
return 0 ;
}
BEGIN_EVENTSINK_MAP ( CGISDlg , CBCGPDialog )
ON_EVENT ( CGISDlg , IDC_MAP1 , 1 , CGISDlg : : MouseDownMap1 , VTS_I2 VTS_I2 VTS_I4 VTS_I4 )
ON_EVENT ( CGISDlg , IDC_MAP1 , 2 , CGISDlg : : MouseUpMap1 , VTS_I2 VTS_I2 VTS_I4 VTS_I4 )
ON_EVENT ( CGISDlg , IDC_MAP1 , 3 , CGISDlg : : MouseMoveMap1 , VTS_I2 VTS_I2 VTS_I4 VTS_I4 )
ON_EVENT ( CGISDlg , IDC_MAP1 , DISPID_DBLCLICK , CGISDlg : : MouseDblClickMap1 , VTS_NONE )
END_EVENTSINK_MAP ( )
void CGISDlg : : MouseDownMap1 ( short Button , short Shift , long x , long y )
{
double dX = 0 ;
double dY = 0 ;
GLOBAL_X = x ;
GLOBAL_Y = y ;
CString str_bt ;
TRACE ( _T ( " mapWindow clicked \n " ) ) ;
// TRACE(_T(str_bt.Format("%d",Button)));
// ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> ʱ
if ( g_bSelectMarker & & ( Button = = 1 ) )
{
g_bSelectMarker = false ;
//TRACE(g_bSelectMarker);
// return;
}
if ( m_bHaveShowDistanceDlg & & ( Button = = 1 ) )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//<2F> <> <EFBFBD> õ<EFBFBD> <C3B5> ľ<EFBFBD> <C4BE> ȡ<EFBFBD> γ <EFBFBD> <CEB3>
m_pHZDistanceDlg - > SetPtCoordinate ( dX , dY ) ;
}
/***************************************<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> by Wu 2023.10.16*****************************************/
if ( m_bPolylineMeasure & & ( Button = = 1 ) )
{
if ( m_bEndMeasure )
{
ClearPloylineMeasure ( ) ;
m_bEndMeasure = false ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
m_numPolylineMeasurePts + + ;
m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 0 ] = dX ;
m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 1 ] = dY ;
if ( m_numPolylineMeasurePts = = 1 ) //<2F> <> <EFBFBD> <EFBFBD>
{
AddPointShapeLayer ( m_polylineMeasurePtLayerID [ 0 ] , dX , dY , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , _T ( " " ) , RGB ( 255 , 0 , 0 ) ) ; //<2F> <> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD>
m_bMeasureDrag = true ;
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD>
if ( m_polylineMeasureLineLayerID = = - 1 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_polylineMeasureLineLayerID , 1 , RGB ( 0 , 255 , 0 ) ) ;
}
if ( m_numPolylineMeasurePts = = 2 )
{
AddOnePoint2Shapfile ( m_polylineMeasureLineLayerID , 1 , m_posPolylineMeasurePts [ 0 ] [ 0 ] , m_posPolylineMeasurePts [ 0 ] [ 1 ] ) ;
}
AddOnePoint2Shapfile ( m_polylineMeasureLineLayerID , 1 , dX , dY ) ;
if ( m_polylineMeasurePtLayerID [ 1 ] = = - 1 )
{
CreateEmptyShapfile ( m_polylineMeasurePtLayerID [ 1 ] , 0 , RGB ( 0 , 255 , 0 ) ) ;
mapWindow : : IShapeDrawingOptionsPtr pShapeDrawingOption ;
pShapeDrawingOption . CreateInstance ( " MapWinGIS.ShapeDrawingOptions " ) ;
pShapeDrawingOption - > FillColor = RGB ( 0 , 255 , 0 ) ;
pShapeDrawingOption - > PointSize = 12 ;
pShapeDrawingOption - > PutPointType ( mapWindow : : tkPointSymbolType : : ptSymbolStandard ) ;
pShapeDrawingOption - > PutPointShape ( mapWindow : : tkPointShapeType : : ptShapeStar ) ;
( m_map . GetShapefile ( m_polylineMeasurePtLayerID [ 1 ] ) ) . SetDefaultDrawingOptions ( pShapeDrawingOption ) ;
}
//AddOnePoint2Shapfile(m_polylineMeasurePtLayerID[1],0,dX, dY);
//<2F> <> <EFBFBD> ƽ ڵ<C6BD>
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
shapePtr - > Create ( mapWindow : : SHP_POINT ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = dX ;
//γ <> <CEB3>
pintPtr - > y = dY ;
long i = m_numPolylineMeasurePts - 2 ;
shapePtr - > InsertPoint ( pintPtr , & i ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8>
( m_map . GetShapefile ( m_polylineMeasurePtLayerID [ 1 ] ) ) . EditInsertShape ( shapePtr , & i ) ;
//<2F> <> <EFBFBD> Ʋ<EFBFBD> <C6B2> <EFBFBD> ע<EFBFBD> <D7A2>
if ( m_polylineMeasureLabelLayerID ! = - 1 )
{
m_map . ClearDrawing ( m_polylineMeasureLabelLayerID ) ;
}
m_polylineMeasureLabelLayerID = m_map . NewDrawing ( 1 ) ;
DrawDistLabel ( m_polylineMeasureLabelLayerID , m_posPolylineMeasurePts , m_numPolylineMeasurePts , 1 ) ;
}
//<2F> Ҽ<EFBFBD> <D2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bPolylineMeasure & & ( Button = = 2 ) )
{
EndPolylineMessure ( ) ;
return ;
}
/*******************************************************************************************************/
/*******************************************by Wu 2023.09.14*******************************************/
//ѡ <> <D1A1> Ҫ<EFBFBD> <D2AA>
if ( m_bSelectFeatureFlag & & ( Button = = 1 ) )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
double pt [ 2 ] = { dX , dY } ;
m_lineSelectedID = IsSelectLine ( pt ) ;
ClearHighLightLine ( ) ;
if ( g_b981APad | | g_b981ADesktop )
{
if ( m_lineSelectedID = = 14 ) //<2F> <> ʱ<EFBFBD> <CAB1> <EFBFBD> λ<EFBFBD> <CEBB> պ<EFBFBD> <D5BA> <EFBFBD>
{
m_lineSelectedID = - 1 ;
return ;
}
}
if ( m_lineSelectedID > 0 )
{
m_editLineDataGroup = m_ShowedLineDataList [ m_lineSelectedID ] ;
DrawHighLightLine ( m_editLineDataGroup . linePts , m_editLineDataGroup . linePointNum ) ;
}
}
//<2F> <> <EFBFBD> ߱༭
if ( m_bEditLine & & ( Button = = 1 ) )
{
if ( m_lineSelectedID < = 0 )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
m_iPtSel = GetPtSel ( m_editLineDataGroup . pts , m_editLineDataGroup . pointNum , x , y ) ;
if ( m_iPtSel < 0 ) //ѡ <> зǽڵ㣬<DAB5> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
//m_editLineDataGroup = m_ShowedLineDataList[m_lineSelectedID];
double pt [ 2 ] = { dX , dY } ;
vector < double > lineX , lineY ;
TransformToVectorPoints ( m_editLineDataGroup , lineX , lineY ) ;
int addPointPos = topologicalAnalysis . isPointInPolyLine ( pt , lineX , lineY ) ;
if ( addPointPos = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> 㲻<EFBFBD> <E3B2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return ;
}
if ( g_b981CDesktop )
{
if ( m_lineSelectedID = = 11 )
{
if ( addPointPos > m_editLineDataGroup . linePointNum - 4 ) return ; //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 4,5,6<> <36> <EFBFBD> ߲<EFBFBD> <DFB2> ñ༭
}
}
if ( m_editLineDataGroup . pointNum > = 127 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 127<32> <37> <EFBFBD> <EFBFBD>
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD>
double linePt1 [ 2 ] = { m_editLineDataGroup . linePts [ addPointPos - 1 ] . dX , m_editLineDataGroup . linePts [ addPointPos - 1 ] . dY } ;
double linePt2 [ 2 ] = { m_editLineDataGroup . linePts [ addPointPos ] . dX , m_editLineDataGroup . linePts [ addPointPos ] . dY } ;
double targetPt [ 2 ] = { 0.0 , 0.0 } ;
topologicalAnalysis . GetPointToLineVerticalCross ( linePt1 , linePt2 , pt , targetPt ) ;
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> <EFBFBD>
AddPointInLine ( addPointPos , targetPt , m_editLineDataGroup ) ;
if ( m_distLabelLayer ! = - 1 )
{
m_map . ClearDrawing ( m_distLabelLayer ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> DZ<EFBFBD> <C7B1> <EFBFBD>
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( m_editLineDataGroup . lineID - 1 ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
DrawFlyLine ( m_editLineDataGroup ) ;
}
}
//<2F> Ҽ<EFBFBD> <D2BC> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD>
if ( m_bEditLine & & ( Button = = 2 ) )
{
double lon , lat ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & lon , & lat ) ;
int selectedPointID = GetPtSel ( m_editLineDataGroup . pts , m_editLineDataGroup . pointNum , x , y ) ;
if ( selectedPointID > = 0 )
{
if ( g_b981CDesktop )
{
if ( m_lineSelectedID = = 11 )
{
if ( selectedPointID > = m_editLineDataGroup . pointNum - 3 | | selectedPointID = = 0 ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1,4,5,6,<2C> <> <EFBFBD> <EFBFBD>
{
return ;
}
}
}
ShowModifyPointDlg ( selectedPointID ) ;
return ;
}
ShowEditSaveDlg ( ) ;
return ;
}
/***************************************************************************************************************/
//<2F> <> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ ʱ
if ( m_bLineDesign & & ( Button = = 1 ) )
{
////if (m_map.GetCursorMode()!=5) //<2F> <> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ״̬
////{
// m_map.SetCursorMode(5);
///*}*/
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
if ( m_bPtEdit ) //<2F> <> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> ༭ģʽ ʱ
{
m_iPtSel = GetPtSel ( x , y ) ;
}
if ( m_bSetPointModel ) //<2F> õ<EFBFBD>
{
if ( m_designLinePointNum > = 127 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 127<32> <37> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return ;
}
POINT pt ;
GetCursorPos ( & pt ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_curDesignPoint . nPt = m_designLinePointNum + 1 ;
//<2F> <> <EFBFBD> 㾭<EFBFBD> <E3BEAD>
m_curDesignPoint . dX = dX ;
//<2F> <> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3>
m_curDesignPoint . dY = dY ;
m_pDesignLineStruct [ m_designLinePointNum ] = m_curDesignPoint ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ż<EFBFBD> <C5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
m_designLinePointNum + + ;
m_bAddNewPoint = true ;
}
if ( m_bPtDel ) //ɾ<> <C9BE>
{
int iSel = GetPtSel ( x , y ) ;
int i = 0 ;
if ( iSel ! = - 1 )
{
for ( i = iSel ; i < m_designLinePointNum - 1 ; i + + )
{
m_pDesignLineStruct [ i ] = m_pDesignLineStruct [ i + 1 ] ;
m_pDesignLineStruct [ i ] . nPt = m_pDesignLineStruct [ i ] . nPt - 1 ;
}
m_designLinePointNum - - ;
}
}
DrawLineDesign ( ) ;
}
//<2F> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2016.01.05
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <C6A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ ʱ
if ( m_bHaveShowLineDesign & & ( Button = = 1 ) )
{
m_map . PixelToProj ( x , y , & dX , & dY ) ;
if ( m_bLDSetPoint )
{
POINT pt ;
GetCursorPos ( & pt ) ;
//<2F> <> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_CurNewDesignPt . nPt = m_NowNumLineDesign + 1 ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD>
m_CurNewDesignPt . dX = dX ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3>
m_CurNewDesignPt . dY = dY ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> ĸ߶<C4B8>
m_CurNewDesignPt . nH = 0 ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٶ<EFBFBD>
m_CurNewDesignPt . nV = 0 ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_CurNewDesignPt . ch1 = 0x02 ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> ĺ<EFBFBD> ·<EFBFBD> <C2B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_CurNewDesignPt . ch2 = 0x01 ;
m_pLineDesign - > ShowLonLat ( dX , dY ) ;
m_pNewDesignLineStruct [ m_NowNumLineDesign ] = m_CurNewDesignPt ;
m_pLineDesign - > InsertPt ( m_CurNewDesignPt ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ż<EFBFBD> <C5BC> <EFBFBD> <EFBFBD> <EFBFBD> +1
m_NowNumLineDesign + + ;
//CLineDesign dlg;
//dlg.ShowLonLat(m_curDesignPoint.dX, m_curDesignPoint.dX);
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ҽ<EFBFBD> <D2BC> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
if ( Button = = 2 & & ! m_bLineDesign )
{
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_map . ClearDrawing ( m_tempLayerID ) ;
m_map . Redraw ( ) ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ݲ˵<DDB2>
CMenu menu ;
POINT pt ;
GetCursorPos ( & pt ) ;
bool bSel = false ;
for ( int i = 0 ; i < 255 ; i + + )
{
if ( m_targets [ i ] . id < = 0 )
{
continue ;
}
double pixX = 0 ;
double pixY = 0 ;
m_map . ProjToPixel ( m_targets [ i ] . lon , m_targets [ i ] . lat , & pixX , & pixY ) ;
if ( fabs ( x - pixX ) < 5 & & fabs ( y - pixY ) < 5 )
{
bSel = true ;
m_targetSelID = m_targets [ i ] . id ;
break ;
}
}
if ( bSel )
{
menu . LoadMenu ( IDR_MENU_TARGET ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
menu . GetSubMenu ( 0 ) - > TrackPopupMenu ( TPM_LEFTALIGN | TPM_LEFTBUTTON , pt . x , pt . y , this ) ;
return ;
}
OnShowRMenu ( ) ;
/*
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڻط<DABB> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> á<EFBFBD> <C3A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> Ӳ˵<D3B2> <CBB5> <EFBFBD> <EFBFBD> Ȼ<EFBFBD> ɫ
menu . LoadMenu ( IDR_MENU2 ) ;
//<2F> <> <EFBFBD> <EFBFBD> 1
if ( m_pHaveDrawLineFlag [ 0 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE1 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE1 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 2
if ( m_pHaveDrawLineFlag [ 1 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE2 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE2 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 3
if ( m_pHaveDrawLineFlag [ 2 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE3 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE3 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 4
if ( m_pHaveDrawLineFlag [ 3 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE4 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE4 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 5
if ( m_pHaveDrawLineFlag [ 4 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE5 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE5 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 6
if ( m_pHaveDrawLineFlag [ 5 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE6 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE6 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 7
if ( m_pHaveDrawLineFlag [ 6 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE7 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE7 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 8
if ( m_pHaveDrawLineFlag [ 7 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE8 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE8 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 9
if ( m_pHaveDrawLineFlag [ 8 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE9 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE9 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 10
if ( m_pHaveDrawLineFlag [ 9 ] )
{
menu . CheckMenuItem ( IDM_SHOW_LINE10 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_SHOW_LINE10 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 14 <20> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 13 ] )
{
menu . CheckMenuItem ( ID_SHOW_PD10 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_PD10 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 11 Ӧ<> <D3A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_pHaveDrawLineFlag [ 10 ] )
{
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_HS11 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> 12 <20> <> <EFBFBD> <EFBFBD> Χ <EFBFBD> <CEA7>
if ( m_pHaveDrawLineFlag [ 11 ] )
{
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_SHOW_TC12 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_bAutoMove )
{
menu . CheckMenuItem ( IDM_AUTO_MOVE , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_AUTO_MOVE , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_guidePointMode = = 1 )
{
menu . CheckMenuItem ( IDM_GUIDE_FLY1 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_GUIDE_FLY1 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_guidePointMode = = 2 )
{
menu . CheckMenuItem ( IDM_GUIDE_FLY2 , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( IDM_GUIDE_FLY2 , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_bPlotDemArea )
{
menu . CheckMenuItem ( ID_MENU_PLOTDEMAREA , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_MENU_PLOTDEMAREA , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
if ( m_bEnableShowADSB )
{
menu . CheckMenuItem ( ID_MENU_ADSB , MF_BYCOMMAND | MF_CHECKED ) ;
}
else
{
menu . CheckMenuItem ( ID_MENU_ADSB , MF_BYCOMMAND | MF_UNCHECKED ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
menu . GetSubMenu ( 0 ) - > TrackPopupMenu ( TPM_LEFTALIGN | TPM_RIGHTBUTTON , pt . x , pt . y , this ) ;
*/
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & m_guidePtInfo . guidePtLon , & m_guidePtInfo . guidePtLat ) ;
}
if ( Button = = 2 & & m_bLineDesign ) //<2F> <> <EFBFBD> ߱༭ʱ<E0BCAD> <CAB1> ֹͣ<CDA3> ༭
{
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ߣ<EFBFBD> <EFBFBD> <D7B7> <EFBFBD> ߺ ; <DFBA> <CDBE> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2>
m_map . ClearDrawing ( m_tempLayerID ) ;
m_map . Redraw ( ) ;
CMenu tmenu ;
tmenu . LoadMenu ( IDR_FLOATINGMENU ) ;
CRect rc = CRect ( 0 , 0 , x , y ) ;
ClientToScreen ( & rc ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
tmenu . GetSubMenu ( 0 ) - > TrackPopupMenu ( TPM_LEFTALIGN | TPM_LEFTBUTTON , rc . right , rc . bottom , this ) ;
return ;
}
//<2F> <> <EFBFBD> ڵر<DAB5> <D8B1> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ѡ <EFBFBD> <D1A1> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bSelectDropPoint & & ( m_map . GetCursorMode ( ) = = 3 ) & & ( Button = = 1 ) )
{
m_bSelectDropPoint = false ;
double _ptLon = 0.0 , _ptLat = 0.0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
if ( m_pTargetDlg & & m_pTargetDlg - > GetSafeHwnd ( ) )
{
m_pTargetDlg - > ShowPointPosition ( _ptLon , _ptLat ) ;
}
}
//<2F> <> <EFBFBD> ڿ<EFBFBD> <DABF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ѡ <EFBFBD> <D1A1> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( g_bSelectDropPoint & & ( m_map . GetCursorMode ( ) = = 3 ) & & ( Button = = 1 ) )
{
g_bSelectDropPoint = false ;
double _ptLon = 0.0 , _ptLat = 0.0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> ӷ<EFBFBD> <D3B7> <EFBFBD>
if ( m_dlgLightRegion . GetSafeHwnd ( ) )
{
m_dlgLightRegion . ShowPointPosition ( _ptLon , _ptLat ) ;
m_dlgLightRegion . LosBetweenTwoPoints ( ) ;
}
}
//<2F> ̷߳<DFB3> <CCB7> <EFBFBD> ѡ <EFBFBD> <D1A1>
if ( g_bDemAnalysising & & ( Button = = 1 ) )
{
g_iDemPointNum + + ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double _ptLon = 0.0 , _ptLat = 0.0 ;
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
g_dDemPtLon [ g_iDemPointNum - 1 ] = _ptLon ;
g_dDemPtLat [ g_iDemPointNum - 1 ] = _ptLat ;
return ;
CString str ;
str . Format ( _T ( " %d " ) , g_iDemPointNum ) ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ű<EFBFBD> ע
AddTextToPointShapeLayer ( g_lDemPtNumLayerID [ g_iDemPointNum - 1 ] , _ptLon , _ptLat , str , _T ( " " ) , RGB ( 255 , 0 , 0 ) ) ;
if ( g_iDemPointNum > = g_iDemAltPtNum )
{
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> ֧<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 10<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ̷߳<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
g_bDemAnalysising = false ;
m_DlgDemAlt . DrawDemAltBetweenPts ( g_dDemPtLon , g_dDemPtLat , g_iDemPointNum ) ;
if ( m_DlgDemAlt . GetSafeHwnd ( ) )
{
m_DlgDemAlt . ShowWindow ( TRUE ) ;
}
}
}
//ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bGuideMode & & ( Button = = 1 ) )
{
m_bGuideMode = false ;
m_map . PixelToProj ( x , y , & m_guidePtInfo . guidePtLon , & m_guidePtInfo . guidePtLat ) ;
DrawGuidePoint ( m_guidePtInfo . guideMode , m_guidePtInfo . guidePtLon , m_guidePtInfo . guidePtLat ) ;
switch ( m_guidePointMode )
{
case 0 :
break ;
case 1 :
{
m_struMapOut . cmd = MapCmd_Guide1 ;
m_struMapOut . lon = m_guidePtInfo . guidePtLon ;
m_struMapOut . lat = m_guidePtInfo . guidePtLat ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
break ;
case 2 :
{
m_struMapOut . cmd = MapCmd_Guide2 ;
m_struMapOut . lon = m_guidePtInfo . guidePtLon ;
m_struMapOut . lat = m_guidePtInfo . guidePtLat ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
break ;
default :
break ;
}
}
}
void CGISDlg : : MouseDblClickMap1 ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ̷߳<DFB3> <CCB7> <EFBFBD>
if ( g_bDemAnalysising )
{
g_bDemAnalysising = false ;
m_DlgDemAlt . DrawDemAltBetweenPts ( g_dDemPtLon , g_dDemPtLat , g_iDemPointNum ) ;
if ( m_DlgDemAlt . GetSafeHwnd ( ) )
{
m_DlgDemAlt . ShowWindow ( TRUE ) ;
}
}
/*********************************by Wu 2023.09.20********************************************/
double dX = 0 ;
double dY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( GLOBAL_X , GLOBAL_Y , & dX , & dY ) ;
//˫<> <CBAB> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bEditLine )
{
int ptSelected = GetPtSel ( m_editLineDataGroup . pts , m_editLineDataGroup . pointNum , GLOBAL_X , GLOBAL_Y ) ;
if ( g_b981CDesktop )
{
if ( m_editLineDataGroup . lineID = = 11 ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1,4,5,6<> <36> <EFBFBD> <EFBFBD>
{
if ( ptSelected = = 0 | | ( ptSelected > = m_editLineDataGroup . pointNum - 3 ) )
{
return ;
}
}
}
if ( ptSelected > = 0 )
{
if ( m_distLabelLayer ! = - 1 )
{
m_map . ClearDrawing ( m_distLabelLayer ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> DZ<EFBFBD> <C7B1> <EFBFBD>
}
RemovePointInLine ( ptSelected , m_editLineDataGroup ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( m_editLineDataGroup . lineID - 1 ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
DrawFlyLine ( m_editLineDataGroup ) ;
}
}
/*********************************************************************************************/
if ( g_b981APad ) //ƽ <> <C6BD> ģʽ ˫<CABD> <CBAB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( m_bPolylineMeasure )
{
EndPolylineMessure ( ) ;
}
}
}
void CGISDlg : : MouseMoveMap1 ( short Button , short Shift , long x , long y )
{
if ( Button = = 2 )
{
return ;
}
//<2F> <> ʾ <EFBFBD> <CABE> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ(<28> <> ͼ<EFBFBD> <CDBC> λ)
if ( m_bHaveShowLonLatDlg & & m_pLonLatDlg - > GetAutoEditStatus ( ) )
{
double dX = 0 ;
double dY = 0 ;
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
m_pLonLatDlg - > SetLonLatInfo ( dX , dY ) ;
}
/*****************************************by Wu 2023.09.14*******************************************/
//<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD> ʱ
if ( m_bEditLine & & Button = = 1 )
{
double dX = 0 ;
double dY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
if ( m_iPtSel = = - 1 )
{
return ;
}
if ( g_b981CDesktop )
{
if ( m_editLineDataGroup . lineID = = 11 ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> 1,4,5,6<> <36> <EFBFBD> ñ༭
{
if ( m_iPtSel = = 0 | | ( m_iPtSel > = m_editLineDataGroup . pointNum - 3 ) )
{
return ;
}
}
}
int n_pts = m_editLineDataGroup . pointNum ;
bool isClosedLine ;
if ( m_editLineDataGroup . pts [ n_pts - 1 ] . ch1 = = 2 ) //<2F> DZպϺ <D5BA> <CFBA> <EFBFBD>
{
isClosedLine = false ;
}
else
{
isClosedLine = true ;
}
m_dragFlag = true ;
m_editLineDataGroup . pts [ m_iPtSel ] . dX = dX ;
m_editLineDataGroup . pts [ m_iPtSel ] . dY = dY ;
m_editLineDataGroup . linePts [ m_iPtSel ] . dX = dX ;
m_editLineDataGroup . linePts [ m_iPtSel ] . dY = dY ;
if ( m_iPtSel = = 0 & & isClosedLine ) //ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> Ҫͬ<D2AA> <CDAC> <EFBFBD> <EFBFBD> <DEB8> <EFBFBD> <EFBFBD> յ<EFBFBD> <D5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
int endpt = m_editLineDataGroup . linePointNum - 1 ;
m_editLineDataGroup . linePts [ endpt ] . dX = dX ;
m_editLineDataGroup . linePts [ endpt ] . dY = dY ;
}
if ( m_iPtSel = = n_pts - 1 & & ! isClosedLine ) //<2F> DZպϺ <D5BA> <CFBA> <EFBFBD> <EFBFBD> յ<EFBFBD>
{
m_editLineDataGroup . linePts [ n_pts ] . dX = dX ;
m_editLineDataGroup . linePts [ n_pts ] . dY = dY ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( m_editLineDataGroup . lineID - 1 ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
DrawFlyLine ( m_editLineDataGroup ) ;
//<2F> <> ק<EFBFBD> <D7A7> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> <CEBB>
if ( m_distLabelLayer ! = - 1 )
{
m_map . ClearDrawing ( m_distLabelLayer ) ;
}
m_distLabelLayer = m_map . NewDrawing ( 1 ) ;
if ( m_iPtSel = = 0 ) //ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
int endpt = m_editLineDataGroup . pointNum - 1 ;
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ m_iPtSel + 1 ] . dX , m_editLineDataGroup . pts [ m_iPtSel + 1 ] . dY , 0 ) ;
if ( isClosedLine )
{
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ endpt ] . dX , m_editLineDataGroup . pts [ endpt ] . dY , 0 ) ;
}
}
else if ( m_iPtSel = = m_editLineDataGroup . pointNum - 1 ) //ѡ <> <D1A1> <EFBFBD> յ<EFBFBD>
{
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ m_iPtSel - 1 ] . dX , m_editLineDataGroup . pts [ m_iPtSel - 1 ] . dY , 0 ) ;
if ( isClosedLine )
{
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ 0 ] . dX , m_editLineDataGroup . pts [ 0 ] . dY , 0 ) ;
}
}
else
{
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ m_iPtSel - 1 ] . dX , m_editLineDataGroup . pts [ m_iPtSel - 1 ] . dY , 0 ) ;
DrawDistLabelEx ( m_distLabelLayer , m_editLineDataGroup . pts [ m_iPtSel ] . dX , m_editLineDataGroup . pts [ m_iPtSel ] . dY , m_editLineDataGroup . pts [ m_iPtSel + 1 ] . dX , m_editLineDataGroup . pts [ m_iPtSel + 1 ] . dY , 0 ) ;
}
return ;
}
/*****************************************************************************************************************/
/*****************************************<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> by Wu 2023.10.16************************************************/
if ( m_bPolylineMeasure & & m_bMeasureDrag )
{
double dX = 0 ;
double dY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_map . ClearDrawing ( m_tempLayerID ) ;
//<2F> ½<EFBFBD> <C2BD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_tempLayerID = m_map . NewDrawing ( 1 ) ;
//<2F> <> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
if ( m_tempLayerID ! = - 1 )
{
m_map . DrawLineEx ( m_tempLayerID , m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 0 ] , m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 1 ] , dX , dY , 2 , RGB ( 0 , 255 , 0 ) ) ;
//<2F> <> ʾ <EFBFBD> ߶εľ<CEB5> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
DrawDistLabelEx ( m_tempLayerID , m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 0 ] , m_posPolylineMeasurePts [ m_numPolylineMeasurePts - 1 ] [ 1 ] , dX , dY ) ;
}
}
/****************************************************************************************************************/
//<2F> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ
if ( m_bHaveShowLineDesign )
{
double dX = 0 ;
double dY = 0 ;
m_map . PixelToProj ( x , y , & dX , & dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> γ <EFBFBD> <CEB3>
//m_pLineDesign->ShowLonLat(dX, dY);
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ
if ( m_bLineDesign )
{
double dX = 0 ;
double dY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & dX , & dY ) ;
if ( m_bPtEdit ) //<2F> <> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> ༭ģʽ ʱ
{
if ( m_iPtSel = = - 1 )
{
return ;
}
m_pDesignLineStruct [ m_iPtSel ] . dX = dX ;
m_pDesignLineStruct [ m_iPtSel ] . dY = dY ;
DrawLineDesign ( ) ;
return ;
//<2F> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> ѡ <EFBFBD> д<EFBFBD> <D0B4> ༭<EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
if ( BeMouseClickedLinePoint ( m_curEditLinePoint , x , y ) )
{
//<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD>
m_pFlyLineDesign - > EditPoint ( dX , dY ) ;
}
return ;
}
if ( m_bDesignFirstPoint )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԭ<EFBFBD> <D4AD> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> <CEBB>
m_pLineSectDlg - > InputPointCoordinate ( dX , dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_curDesignPoint . nPt = m_designLinePointNum + 1 ;
//<2F> <> <EFBFBD> 㾭<EFBFBD> <E3BEAD>
m_curDesignPoint . dX = dX ;
//<2F> <> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3>
m_curDesignPoint . dY = dY ;
//<2F> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD>
m_pFlyLineDesign - > AddPoint ( m_curDesignPoint ) ;
return ;
}
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʱ<EFBFBD> <CAB1> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> ͼ<EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> ±<EFBFBD> ע
if ( m_designLinePointNum > 0 & & m_beTemLayerDrawing )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԭ<EFBFBD> <D4AD> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> <CEBB>
m_pLineSectDlg - > InputPointCoordinate ( dX , dY ) ;
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_map . ClearDrawing ( m_tempLayerID ) ;
//<2F> ½<EFBFBD> <C2BD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_tempLayerID = m_map . NewDrawing ( 1 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_curDesignPoint . nPt = m_designLinePointNum + 1 ;
//<2F> <> <EFBFBD> 㾭<EFBFBD> <E3BEAD>
m_curDesignPoint . dX = dX ;
//<2F> <> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3>
m_curDesignPoint . dY = dY ;
//<2F> <> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD>
m_pFlyLineDesign - > AddPoint ( m_curDesignPoint ) ;
//<2F> <> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
if ( m_tempLayerID ! = - 1 )
{
m_map . DrawLineEx ( m_tempLayerID , m_pDesignLineStruct [ m_designLinePointNum - 1 ] . dX , m_pDesignLineStruct [ m_designLinePointNum - 1 ] . dY , dX , dY , 2 , RGB ( 0 , 255 , 0 ) ) ;
DrawDistLabelEx ( m_tempLayerID , m_pDesignLineStruct [ m_designLinePointNum - 1 ] . dX , m_pDesignLineStruct [ m_designLinePointNum - 1 ] . dY , dX , dY ) ;
}
}
}
//<2F> <> <EFBFBD> ڿ<EFBFBD> <DABF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ѡ <EFBFBD> <D1A1> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ
if ( m_bSelectDropPoint & & ( m_map . GetCursorMode ( ) = = 3 ) )
{
double _ptLon = 0.0 , _ptLat = 0.0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
if ( m_pTargetDlg & & m_pTargetDlg - > GetSafeHwnd ( ) )
{
m_pTargetDlg - > ShowPointPosition ( _ptLon , _ptLat ) ;
}
}
//<2F> <> <EFBFBD> ڿ<EFBFBD> <DABF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ѡ <EFBFBD> <D1A1> ģʽ ʱ<CABD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 괦<EFBFBD> <EAB4A6> ѡ <EFBFBD> <D1A1> ģʽ
if ( g_bSelectDropPoint & & ( m_map . GetCursorMode ( ) = = 3 ) )
{
double _ptLon = 0.0 , _ptLat = 0.0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
if ( m_dlgLightRegion . GetSafeHwnd ( ) )
{
m_dlgLightRegion . ShowPointPosition ( _ptLon , _ptLat ) ;
}
if ( m_longSelectLineID > 0 )
{
m_map . GetShapefile ( m_longSelectLineID ) . EditClear ( ) ;
}
m_gisManager - > CreateEmptyLineShapfile ( m_longSelectLineID , RGB ( 0 , 255 , 0 ) , 2 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_longSelectLineID , 1 , m_dlgLightRegion . m_dGroundLon , m_dlgLightRegion . m_dGroundLat ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_longSelectLineID , 1 , _ptLon , _ptLat ) ;
double _distance = 0.0 , _angle = 0.0 ;
CalculateTwoPtsDistanceAzimuth ( _distance , _angle , m_dlgLightRegion . m_dGroundLon , m_dlgLightRegion . m_dGroundLat , _ptLon , _ptLat , 3 ) ;
CString str ;
str . Format ( _T ( " D:%.1fkm A:%.1f<EFBFBD> <EFBFBD> " ) , _distance / 1000 , _angle ) ;
if ( m_longLabelPlotID ! = 0 )
{
ClearPointShape ( m_longLabelPlotID ) ;
m_longLabelPlotID = 0 ;
}
//<2F> <> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
AddPointShapeLayer ( m_longLabelPlotID , _ptLon , _ptLat , str , _T ( " <EFBFBD> <EFBFBD> ɫ" ) , RGB ( 255 , 0 , 0 ) ) ;
}
//<2F> ̷߳<DFB3> <CCB7> <EFBFBD> ʱ
if ( g_bDemAnalysising & & g_iDemPointNum > = 1 )
{
double lon = 0 , lat = 0 ;
m_map . PixelToProj ( x , y , & lon , & lat ) ;
double _dis = 0 ;
CalculateTwoPtsDistance ( _dis , g_dDemPtLon [ g_iDemPointNum - 1 ] , g_dDemPtLat [ g_iDemPointNum - 1 ] , lon , lat , 3 ) ;
//<2F> <> <EFBFBD> ˵<EFBFBD> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> ˫<EFBFBD> <CBAB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> ߶<EFBFBD>
if ( _dis > 30 )
{
m_map . RemoveLayer ( g_lDemAltLayerID [ g_iDemPointNum - 1 ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( g_lDemAltLayerID [ g_iDemPointNum - 1 ] , 1 , RGB ( 255 , 255 , 255 ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD>
AddOnePoint2Shapfile ( g_lDemAltLayerID [ g_iDemPointNum - 1 ] , 1 , g_dDemPtLon [ g_iDemPointNum - 1 ] , g_dDemPtLat [ g_iDemPointNum - 1 ] ) ;
AddOnePoint2Shapfile ( g_lDemAltLayerID [ g_iDemPointNum - 1 ] , 1 , lon , lat ) ;
//<2F> <> ʾ <EFBFBD> ߶εľ<CEB5> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> <EFBFBD> Ʊ<EFBFBD> ע<EFBFBD> <D7A2>
DrawLineLabel ( g_lDemAltLayerID [ g_iDemPointNum - 1 ] , g_dDemPtLon [ g_iDemPointNum - 1 ] , g_dDemPtLat [ g_iDemPointNum - 1 ] , lon , lat ) ;
}
}
//ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> ʱ
if ( g_bSelectMarker )
{
TRACE ( " g_bSelectMarker = true \n " ) ;
double _ptLon = 0.0 , _ptLat = 0.0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( x , y , & _ptLon , & _ptLat ) ;
m_dlgMarker . ShowMarkerCoordinate ( _ptLon , _ptLat ) ;
return ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ڵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> drawLayerID
// <09> <> <EFBFBD> <EFBFBD> <EFBFBD> ꣬<EFBFBD> <EAA3AC> <EFBFBD> <EFBFBD> lon, γ <> <CEB3> lat
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> strPtName
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫstrColor
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ<EFBFBD> <C9AB> ֵfontColor
void CGISDlg : : AddTextToPointShapeLayer ( long & drawLayerID , const double lon , const double lat , const CString strPtName , const CString strColor , unsigned long fontColor )
{
//<2F> жϵ<D0B6> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
if ( drawLayerID > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( drawLayerID ) ;
}
/////////////////////<2F> ½<EFBFBD> <C2BD> <EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ///////////////////////////////////
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( drawLayerID , 0 , RGB ( 0 , 255 , 0 ) ) ;
/////////////////////<2F> <> SHPͼ<50> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ///////////////////////////////
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( drawLayerID ) ) . GetLabels ( ) ;
CLabelCategory labelCategory = labesPtr . AddCategory ( strColor ) ;
labelCategory . SetFontColor ( fontColor ) ;
labelCategory . SetAlignment ( 1 ) ;
labelCategory . SetFontBold ( TRUE ) ;
labelCategory . SetFontName ( _T ( " Times New Roman " ) ) ;
labelCategory . SetFontSize ( 12 ) ;
//<2F> <> <EFBFBD> <EFBFBD> Labels
labesPtr . AddLabel ( strPtName , lon + 0.0002 , lat + 0.0002 , 0 , 0 ) ;
//<2F> <> <EFBFBD> »<EFBFBD> <C2BB> <EFBFBD>
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶εľ<CEB5> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> <CEBB> ע<EFBFBD> <D7A2> Label<65> <6C>
// drawLayerID <20> <> <EFBFBD> Ʊ<EFBFBD> ע<EFBFBD> <D7A2> ͼ<EFBFBD> <CDBC> ID
// ptLon1, ptLat1 <20> <> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> γ <EFBFBD> <CEB3>
// ptLon2, ptLat2 <20> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> γ <EFBFBD> <CEB3>
void CGISDlg : : DrawLineLabel ( long & drawLayerID , const double ptLon1 , const double ptLat1 , const double ptLon2 , const double ptLat2 )
{
double _dis , _angle ;
CalculateTwoPtsDistanceAzimuth ( _dis , _angle , ptLon1 , ptLat1 , ptLon2 , ptLat2 , 3 ) ;
CString str = _T ( " " ) ;
if ( _dis < 1000 )
{
str . Format ( _T ( " %.1fm/%.1f<EFBFBD> <EFBFBD> " ) , _dis , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm/%.1f<EFBFBD> <EFBFBD> " ) , _dis * 0.001 , _angle ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ù<EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ע
double textLon = 0 ;
double textLat = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TargetPos2LabelPos ( textLon , textLat , ( ptLon1 + ptLon2 ) / 2 , ( ptLat1 + ptLat2 ) / 2 ) ;
if ( _T ( " " ) ! = str )
{
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( drawLayerID ) ) . GetLabels ( ) ;
labesPtr . SetFontColor ( RGB ( 255 , 127 , 0 ) ) ;
labesPtr . SetFrameTransparency ( 0 ) ;
labesPtr . SetAlignment ( 1 ) ;
labesPtr . SetFontBold ( TRUE ) ;
labesPtr . SetFontName ( _T ( " Times New Roman " ) ) ;
labesPtr . SetFontSize ( 15 ) ;
labesPtr . put_FontSize2 ( 15 ) ;
labesPtr . AddLabel ( str , textLon , textLat , 0 , 0 ) ;
}
//<2F> ػ<EFBFBD>
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߶εľ<CEB5> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
void CGISDlg : : DrawDistLabelEx ( long drawLayerID , const double ptLon1 , const double ptLat1 , const double ptLon2 , const double ptLat2 , int pos )
{
double _dis , _angle ;
CalculateTwoPtsDistanceAzimuth ( _dis , _angle , ptLon1 , ptLat1 , ptLon2 , ptLat2 , 3 ) ;
CString str = _T ( " " ) ;
if ( _dis < 1000 )
{
str . Format ( _T ( " %dm;%.1f<EFBFBD> <EFBFBD> " ) , int ( _dis ) , _angle ) ;
}
else
{
if ( _dis < 1000 )
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , _dis * 0.001 , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , _dis * 0.001 , _angle ) ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ù<EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ע
double textLon = 0 ;
double textLat = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//TargetPos2LabelPos(textLon, textLat, (ptLon1 + ptLon2)/2, (ptLat1 + ptLat2)/2);
switch ( pos )
{
case - 1 : //<2F> <> <EFBFBD> ˵<EFBFBD>
TargetPos2LabelPos ( textLon , textLat , ptLon1 , ptLat1 ) ;
break ;
case 0 : //<2F> м<EFBFBD> <D0BC> ˵<EFBFBD>
TargetPos2LabelPos ( textLon , textLat , ( ptLon1 + ptLon2 ) / 2 , ( ptLat1 + ptLat2 ) / 2 ) ;
break ;
case 1 : //<2F> Ҷ˵<D2B6>
TargetPos2LabelPos ( textLon , textLat , ptLon2 , ptLat2 ) ;
break ;
}
CLabels drawLabels = m_map . GetDrawingLabels ( drawLayerID ) ;
//drawLabels.SetAvoidCollisions(false);
/*
CLabelCategory labelCategory = drawLabels . AddCategory ( _T ( " dist " ) ) ;
labelCategory . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontSize ( 12 ) ;
labelCategory . SetOffsetX ( 8 ) ;
labelCategory . SetFrameVisible ( true ) ;
labelCategory . SetFrameTransparency ( 180 ) ;
*/
drawLabels . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
//drawLabels.SetFontName(_T("Arial"));
drawLabels . SetFontColor ( RGB ( 220 , 220 , 220 ) ) ;
drawLabels . SetFontSize ( 12 ) ;
drawLabels . SetFontBold ( true ) ;
drawLabels . SetOffsetX ( 8 ) ;
drawLabels . SetFrameVisible ( true ) ;
drawLabels . SetFrameOutlineWidth ( 0 ) ;
drawLabels . SetFrameTransparency ( 150 ) ;
drawLabels . SetFrameBackColor ( RGB ( 50 , 50 , 50 ) ) ;
drawLabels . SetFrameOutlineColor ( RGB ( 50 , 50 , 50 ) ) ;
//labelCategory.SetLineOrientation(mapWindow::tkLineLabelOrientation::lorParallel);
//drawLabels.AddLabel(str,textLon,textLat,_angle-90,0);
drawLabels . AddLabel ( str , textLon , textLat , 0 , 0 ) ;
//<2F> ػ<EFBFBD>
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> :<3A> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
void CGISDlg : : DrawDistLabel ( long drawLayerID , const double pts [ ] [ 2 ] , const int ptNum , int pos )
{
double _dis , _angle ;
double dist_total = 0 ;
int i = 0 ;
for ( i = 0 ; i < ptNum - 1 ; i + + )
{
CalculateTwoPtsDistanceAzimuth ( _dis , _angle , pts [ i ] [ 0 ] , pts [ i ] [ 1 ] , pts [ i + 1 ] [ 0 ] , pts [ i + 1 ] [ 1 ] , 3 ) ;
dist_total + = _dis ;
CString str = _T ( " " ) ;
if ( i = = 0 )
{
if ( dist_total < 1000 )
{
str . Format ( _T ( " %dm;%.1f<EFBFBD> <EFBFBD> " ) , int ( dist_total ) , _angle ) ;
}
else
{
if ( _dis < 1000 )
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _angle ) ;
}
}
}
else
{
if ( dist_total < 1000 )
{
str . Format ( _T ( " %dm(+%dm);%.1f<EFBFBD> <EFBFBD> " ) , int ( dist_total ) , int ( _dis ) , _angle ) ;
}
else
{
if ( _dis < 1000 )
{
str . Format ( _T ( " %.2fkm(+%dm);%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , int ( _dis ) , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm(+%.2fkm);%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _dis * 0.001 , _angle ) ;
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ù<EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ע
double textLon = 0 ;
double textLat = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
switch ( pos )
{
case - 1 : //<2F> <> <EFBFBD> ˵<EFBFBD>
TargetPos2LabelPos ( textLon , textLat , pts [ i ] [ 0 ] , pts [ i ] [ 1 ] ) ;
break ;
case 0 : //<2F> м<EFBFBD>
TargetPos2LabelPos ( textLon , textLat , ( pts [ i ] [ 0 ] + pts [ i + 1 ] [ 0 ] ) / 2 , ( pts [ i ] [ 1 ] + pts [ i + 1 ] [ 1 ] ) / 2 ) ;
break ;
case 1 : //<2F> Ҷ˵<D2B6>
TargetPos2LabelPos ( textLon , textLat , pts [ i + 1 ] [ 0 ] , pts [ i + 1 ] [ 1 ] ) ;
break ;
}
CLabels drawLabels = m_map . GetDrawingLabels ( drawLayerID ) ;
CLabelCategory labelCategory = drawLabels . AddCategory ( _T ( " totaldist " ) ) ;
labelCategory . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontColor ( RGB ( 220 , 220 , 220 ) ) ;
labelCategory . SetFontBold ( true ) ;
labelCategory . SetFontSize ( 10 ) ;
labelCategory . SetOffsetX ( 10 ) ;
labelCategory . SetFrameTransparency ( 150 ) ;
labelCategory . SetFrameVisible ( true ) ;
labelCategory . SetFrameBackColor ( RGB ( 50 , 50 , 50 ) ) ;
labelCategory . SetFrameOutlineColor ( RGB ( 50 , 50 , 50 ) ) ;
if ( pos = = 0 )
{
drawLabels . AddLabel ( str , textLon , textLat , _angle - 90 , 0 ) ;
}
else
{
drawLabels . AddLabel ( str , textLon , textLat , 0 , 0 ) ;
}
//<2F> ػ<EFBFBD>
m_map . Redraw ( ) ;
//m_map.DrawLabelEx(drawLayerID,str,textLon,textLat,_angle);
}
}
//<2F> <> <EFBFBD> <EFBFBD> :<3A> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> ľ<EFBFBD> <C4BE> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
void CGISDlg : : DrawDistLebel ( long drawLayerID , const PtStruct * pts , const int ptNum )
{
double _dis , _angle ;
double dist_total = 0 ;
int i = 0 ;
for ( i = 0 ; i < ptNum - 1 ; i + + )
{
CalculateTwoPtsDistanceAzimuth ( _dis , _angle , pts [ i ] . dX , pts [ i ] . dY , pts [ i + 1 ] . dX , pts [ i + 1 ] . dY , 3 ) ;
dist_total + = _dis ;
CString str = _T ( " " ) ;
if ( i = = 0 )
{
if ( dist_total < 1000 )
{
str . Format ( _T ( " %dm;%.1f<EFBFBD> <EFBFBD> " ) , int ( dist_total ) , _angle ) ;
}
else
{
if ( _dis < 1000 )
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm;%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _angle ) ;
}
}
}
else
{
if ( dist_total < 1000 )
{
str . Format ( _T ( " %dm(+%dm);%.1f<EFBFBD> <EFBFBD> " ) , int ( dist_total ) , int ( _dis ) , _angle ) ;
}
else
{
if ( _dis < 1000 )
{
str . Format ( _T ( " %.2fkm(+%.dm);%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , int ( _dis ) , _angle ) ;
}
else
{
str . Format ( _T ( " %.2fkm(+%.2fkm);%.1f<EFBFBD> <EFBFBD> " ) , dist_total * 0.001 , _dis * 0.001 , _angle ) ;
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ù<EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ע
double textLon = 0 ;
double textLat = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TargetPos2LabelPos ( textLon , textLat , ( pts [ i ] . dX + pts [ i + 1 ] . dX ) / 2 , ( pts [ i ] . dY + pts [ i + 1 ] . dY ) / 2 ) ;
CLabels drawLabels = m_map . GetDrawingLabels ( drawLayerID ) ;
CLabelCategory labelCategory = drawLabels . AddCategory ( _T ( " totaldist " ) ) ;
labelCategory . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontColor ( RGB ( 220 , 220 , 220 ) ) ;
labelCategory . SetFontBold ( true ) ;
labelCategory . SetFontSize ( 12 ) ;
labelCategory . SetOffsetX ( 10 ) ;
labelCategory . SetFrameTransparency ( 150 ) ;
labelCategory . SetFrameVisible ( true ) ;
labelCategory . SetFrameBackColor ( RGB ( 50 , 50 , 50 ) ) ;
labelCategory . SetFrameOutlineColor ( RGB ( 50 , 50 , 50 ) ) ;
drawLabels . AddLabel ( str , textLon , textLat , _angle - 90 , 0 ) ;
//<2F> ػ<EFBFBD>
m_map . Redraw ( ) ;
//m_map.DrawLabelEx(drawLayerID,str,textLon,textLat,_angle);
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : ClearPloylineMeasure ( )
{
m_map . RemoveLayer ( m_polylineMeasureLineLayerID ) ;
m_map . RemoveLayer ( m_polylineMeasurePtLayerID [ 0 ] ) ;
m_map . RemoveLayer ( m_polylineMeasurePtLayerID [ 1 ] ) ;
m_map . ClearDrawing ( m_polylineMeasureLabelLayerID ) ;
m_map . ClearDrawing ( m_tempLayerID ) ;
m_polylineMeasureLineLayerID = - 1 ;
m_polylineMeasureLabelLayerID = - 1 ;
m_polylineMeasurePtLayerID [ 0 ] = - 1 ;
m_polylineMeasurePtLayerID [ 1 ] = - 1 ;
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ر<EFBFBD> <D8B1> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ȡ<EFBFBD> γ <EFBFBD> ȵ<EFBFBD> <C8B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnCloseLonLatDialog ( WPARAM wParam , LPARAM lParam )
{
OnShowLonLatInfo ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ر<EFBFBD> <D8B1> <EFBFBD> ʾ 2<CABE> <32> ֮<EFBFBD> <D6AE> <EFBFBD> ľ<EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnCloseShowDistanceDialog ( WPARAM wParam , LPARAM lParam )
{
OnSurvey ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <C6A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݶԻ<DDB6> <D4BB> <EFBFBD>
void CGISDlg : : OnFlyLineDesign ( )
{
m_tempLayerID = - 1 ;
m_designLineLayerID = - 1 ;
m_designLineLayerID2 = - 1 ;
//return;
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ص<EFBFBD> ͼ
if ( m_bHaveAddMap )
{
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬ʱ<CCAC> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bLineDesign )
{
return ;
}
else
{
m_bLineDesign = true ;
//<2F> <> <EFBFBD> Ƶ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_bDesignFirstPoint = true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е ĺ<D0B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_pFlyLineDesign - > ClearCurrentData ( ) ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD>
//m_pFlyLineDesign->ShowWindow(SW_SHOW);
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
//m_pLineSectDlg->ShowWindow(SW_SHOW);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ
m_map . SetCursorMode ( 3 ) ;
}
else
{
AfxMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> " ) ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> GIS<49> <53> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
void CGISDlg : : SetGISWindowArea ( const CRect gisArea ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ΪGIS<49> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ļ<EFBFBD> <C4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> Ļ<EFBFBD> е <EFBFBD> GIS<49> <53> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
m_rcGISArea = gisArea ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ GIS<49> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void ShowDlg ( const CRect rc , CWnd * pParent )
{
//pParent->Create(IDD_DIALOG1,pParent);
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڱ<EFBFBD> <DAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> 18<31> <38> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : CalculateUAVPolygonCoordinate ( const double dX , const double dY , const double yaw )
{
double pixelX = 0 ;
double pixelY = 0 ;
m_map . ProjToPixel ( dX , dY , & pixelX , & pixelY ) ;
// <20> <> <EFBFBD> ɻ<EFBFBD>
//<2F> <> <EFBFBD> ôź<C3B4> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD>
double sinang = sin ( yaw * DEG2RAD ) ;
double cosang = cos ( yaw * DEG2RAD ) ;
//<2F> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double rotatePixelX = 0 ;
double rotatePixelY = 0 ;
//<2F> <> <EFBFBD> 㾭<EFBFBD> <E3BEAD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> ƽ <EFBFBD> ƺ<EFBFBD> <C6BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD>
for ( int k = 0 ; k < m_ptNum ; k + + ) //<2F> <> 18<31> <38> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
rotatePixelX = pixelX + ( m_ptPlane [ k ] . x * cosang - m_ptPlane [ k ] . y * sinang ) ; //X<> <58> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
rotatePixelY = pixelY + ( m_ptPlane [ k ] . x * sinang + m_ptPlane [ k ] . y * cosang ) ; //Y<> <59> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( rotatePixelX , rotatePixelY , & m_ppUavPtArray [ k ] [ 0 ] , & m_ppUavPtArray [ k ] [ 1 ] ) ;
}
}
void CGISDlg : : CalculateUAVPolygonCoordinate_ADS ( const double dX , const double dY , const double yaw )
{
double pixelX = 0 ;
double pixelY = 0 ;
m_map . ProjToPixel ( dX , dY , & pixelX , & pixelY ) ;
// <20> <> <EFBFBD> ɻ<EFBFBD>
//<2F> <> <EFBFBD> ôź<C3B4> <C5BA> <EFBFBD> <EFBFBD> <EFBFBD>
double sinang = sin ( yaw * DEG2RAD ) ;
double cosang = cos ( yaw * DEG2RAD ) ;
//<2F> <> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
double rotatePixelX = 0 ;
double rotatePixelY = 0 ;
//<2F> <> <EFBFBD> 㾭<EFBFBD> <E3BEAD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> ƽ <EFBFBD> ƺ<EFBFBD> <C6BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD>
for ( int k = 0 ; k < m_ptNum ; k + + ) //<2F> <> 18<31> <38> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
rotatePixelX = pixelX + ( m_ptPlane_ADS [ k ] . x * cosang - m_ptPlane_ADS [ k ] . y * sinang ) ; //X<> <58> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
rotatePixelY = pixelY + ( m_ptPlane_ADS [ k ] . x * sinang + m_ptPlane_ADS [ k ] . y * cosang ) ; //Y<> <59> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( rotatePixelX , rotatePixelY , & m_ppUavPtArray_ADS [ k ] [ 0 ] , & m_ppUavPtArray_ADS [ k ] [ 1 ] ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> յ<EFBFBD> <D5B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD>
LRESULT CGISDlg : : OnCloseLineDesignDialog ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ʊ<EFBFBD> ʶΪFALSE
m_bLineDesign = false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> صı <D8B5> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD>
RemoveDesignLineData ( ) ;
//<2F> <> <EFBFBD> غ<EFBFBD> <D8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵĶԻ<C4B6> <D4BB> <EFBFBD>
m_pLineSectDlg - > ShowWindow ( SW_HIDE ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD> <C6B5> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <DDA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݺͺ <DDBA> <CDBA> ߱<EFBFBD> <DFB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : RemoveDesignLineData ( )
{
//<2F> <> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 0ʱ
if ( m_designLinePointNum > 0 )
{
m_designLinePointNum = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ı <EFBFBD> <C4B1> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
ClearDrawingInLineDesign ( ) ;
//m_map.RedrawWindow(m_designLineLayerID2);
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : ClearDrawingInLineDesign ( )
{
/////////////<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /////////////
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_map . ClearDrawing ( m_tempLayerID ) ;
m_map . ClearDrawing ( m_designLineLayerID ) ;
if ( m_designLineLayerID2 ! = - 1 )
{
m_map . RemoveLayer ( m_designLineLayerID2 ) ;
m_designLineLayerID2 = - 1 ;
}
//m_map.ClearLabels(m_designLineLayerID);
}
void CGISDlg : : MouseWheel ( short zDelta )
{
m_bSetPointModel = FALSE ;
//m_bHaveShowLineDesign = TRUE;
//m_bLDSetPoint = FALSE;
//m_bLineDesign=FALSE;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
if ( m_bHaveAddMap )
{
//<2F> <> <EFBFBD> ַŴ<D6B7> <C5B4> <EFBFBD> <EFBFBD> <EFBFBD> С
m_map . ZoomIn ( 0.0005 * zDelta ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> 㣬<EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺Ŀ<EBA3BA> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> nPt<50> <74> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY
void CGISDlg : : AddTargetPoint ( const int nPt , const double dX , const double dY )
{
//û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ
if ( ! m_bHaveAddMap )
{
return ;
}
CString str ;
str . Format ( _T ( " Target%d " ) , nPt ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ
CString strColor = _T ( " <EFBFBD> <EFBFBD> ɫ" ) ;
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_targetDrawLayerID , dX , dY , str , strColor , RGB ( 0 , 255 , 0 ) ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> ж<EFBFBD> ̬<EFBFBD> <CCAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> yaw
//˵<> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ר<EFBFBD> <D7A8> <EFBFBD> <EFBFBD> <EFBFBD> ڻ<EFBFBD> <DABB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> ͼ<EFBFBD> 㣬ÿ<E3A3AC> <C3BF> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> ϴα <CFB4> <CEB1> <EFBFBD> <EFBFBD> <EFBFBD> Shp<68> <70> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ±<EFBFBD> <C2B1> <EFBFBD>
void CGISDlg : : DrawUAV ( int uavid , const double dX , const double dY , const double yaw , bool control )
{
if ( uavid < 0 | | uavid > 2 )
{
return ;
}
//2017.03 by ZCW
/*
//<2F> <> һ <EFBFBD> α <EFBFBD> <CEB1> 溽<EFBFBD> <E6BABD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <C2BD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( ! m_bFirstDrawUAVTrack )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> 켣<EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_flyTrackLayerID , 1 , RGB ( 255 , 0 , 0 ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_UAVFlyTrackLayerID , 2 , RGB ( 255 , 0 , 0 ) ) ;
m_bFirstDrawUAVTrack = true ;
}
else
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> Ĺ켣
m_map . RemoveLayer ( m_UAVFlyTrackLayerID ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_UAVFlyTrackLayerID , 2 , RGB ( 255 , 0 , 0 ) ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> 켣<EFBFBD> <ECBCA3>
AddOnePoint2Shapfile ( m_flyTrackLayerID , 1 , dX , dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
CalculateUAVPolygonCoordinate ( dX , dY , yaw ) ;
// AddUAVPoints2Polygon(m_UAVFlyTrackLayerID);
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ˻<EFBFBD> shp
for ( int i = 0 ; i < m_ptNum ; i + + )
{
AddOnePoint2Shapfile ( m_UAVFlyTrackLayerID , 2 , m_ppUavPtArray [ i ] [ 0 ] , m_ppUavPtArray [ i ] [ 1 ] ) ;
}
*/
COLORREF color = RGB ( 255 , 255 , 0 ) ;
if ( control )
{
color = RGB ( 255 , 0 , 0 ) ;
}
//<2F> <> һ <EFBFBD> α <EFBFBD> <CEB1> 溽<EFBFBD> <E6BABD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <C2BD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( ! m_bFirstDrawUAVTrack [ uavid ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> 켣<EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_flyTrackLayerID [ uavid ] , 1 , color ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_UAVFlyTrackLayerID [ uavid ] , 2 , color ) ;
m_bFirstDrawUAVTrack [ uavid ] = true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> 켣<EFBFBD> <ECBCA3>
AddOnePoint2Shapfile ( m_flyTrackLayerID [ uavid ] , 1 , dX , dY ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
CalculateUAVPolygonCoordinate ( dX , dY , yaw ) ;
int i = 0 ;
//ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> shpͼ<70> <CDBC>
for ( i = 0 ; i < m_ptNum ; i + + )
{
( m_map . GetShapefile ( m_UAVFlyTrackLayerID [ uavid ] ) ) . EditDeleteShape ( i ) ;
}
//(m_map.GetShapefile(m_UAVFlyTrackLayerID2)).EditClear();
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ˻<EFBFBD> shp
for ( i = 0 ; i < m_ptNum ; i + + )
{
AddOnePoint2Shapfile ( m_UAVFlyTrackLayerID [ uavid ] , 2 , m_ppUavPtArray [ i ] [ 0 ] , m_ppUavPtArray [ i ] [ 1 ] ) ;
}
}
void CGISDlg : : DrawUAV_ADS ( const int uavNum , const int uavid , const double lon , const double lat , const double yaw , const bool control , const CString strPlaneName )
{
m_bWithin100km_ADS [ uavid ] = control ; //<2F> Ƿ<EFBFBD> <C7B7> <EFBFBD> 100km<6B> <6D>
m_dLon_ADS [ uavid ] = lon ;
m_dLat_ADS [ uavid ] = lat ;
m_dYaw_ADS [ uavid ] = yaw ;
m_strPlaneName_ADS [ uavid ] = strPlaneName ;
m_iTotalADSnum = uavNum ;
}
//<2F> <> <EFBFBD> <EFBFBD> ;ˢ<> ³<EFBFBD> <C2B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
//˵<> <CBB5> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ʊ<EFBFBD> עλ<D7A2> <CEBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> λ<EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD> Y<EFBFBD> <59> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƫ<EFBFBD> <EFBFBD> <EEA3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŵ<EFBFBD> <C5B4> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǻ<EFBFBD>
void CGISDlg : : OnRefreshInfo ( )
{
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ӡ<EFBFBD> <D3A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> bmp<6D> ļ<EFBFBD> <C4BC> <EFBFBD>
void CGISDlg : : OnPrint ( )
{
CRect rc ;
GetClientRect ( & rc ) ;
//m_map.MoveWindow(0,0,rc.Width(),rc.Height(),1);
CRect rcGISCopyArea = m_gisAreaInScreen ;
rcGISCopyArea . top + = m_toolbarHeight ;
CScreenCapture capture ;
capture . ScreenGISArea ( rcGISCopyArea ) ;
}
void CGISDlg : : OnShowCtrlMenu ( )
{
/*if (!m_bLineDesign)
{
return ;
}
if ( m_bLineDesign ) */ //<2F> <> <EFBFBD> ߱༭ʱ<E0BCAD> <CAB1> ֹͣ<CDA3> ༭
{
if ( m_map . GetCursorMode ( ) ! = mapWindow : : tkCursorMode : : cmNone )
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
}
//TRACE(_T("<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \n"));
////<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ա༭
//int iSel=GetPtSel(m_LBtnDownX,m_LBtnDownY);
//if (iSel!=-1)
//{
// double dPointX, dPointY;
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// m_map.PixelToProj(m_LBtnDownX, m_LBtnDownY, &dPointX, &dPointY);
// //<2F> <> <EFBFBD> õ<EFBFBD> <C3B5> ľ<EFBFBD> <C4BE> ȡ<EFBFBD> γ <EFBFBD> <CEB3>
// m_DlgLinePointAttri.SetPtCoordinate(dPointX, dPointY, iSel, m_designLinePointNum, m_pDesignLineStruct);
//}
if ( g_b981APad )
{
CMenu tmenu ;
tmenu . LoadMenu ( IDR_FLOATINGMENU ) ;
POINT pt ;
GetCursorPos ( & pt ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
tmenu . GetSubMenu ( 0 ) - > TrackPopupMenu ( TPM_LEFTALIGN | TPM_LEFTBUTTON , pt . x , pt . y , this ) ;
}
return ;
}
}
void CGISDlg : : OnMenuLinePtCtrlShow ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ҽ<EFBFBD> <D2BC> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2>
if ( g_b981APad )
{
OnShowRMenu ( ) ;
}
else
{
OnMapSelect ( ) ;
}
}
void CGISDlg : : OnZhangCW ( )
{
int i = 0 ;
}
BOOL CGISDlg : : OnToolTipsNotify ( UINT id , NMHDR * pNMHDR , LRESULT * pResult )
{
TOOLTIPTEXT * pT = ( TOOLTIPTEXT * ) pNMHDR ;
UINT nID = pNMHDR - > idFrom ;
switch ( nID )
{
case IDT_BUTTON1 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ" ;
break ;
case IDT_BUTTON2 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ" ;
break ;
case IDT_BUTTON3 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> Ӻ<EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON4 :
pT - > lpszText = " ͼ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON5 :
pT - > lpszText = " ɾ<EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> ͼ<EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON6 :
pT - > lpszText = " <EFBFBD> <EFBFBD> ͼѡ <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON7 :
pT - > lpszText = " <EFBFBD> Ŵ<EFBFBD> " ;
break ;
case IDT_BUTTON8 :
pT - > lpszText = " <EFBFBD> <EFBFBD> С " ;
break ;
case IDT_BUTTON9 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON10 :
pT - > lpszText = " ȫͼ " ;
break ;
case IDT_BUTTON11 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON12 :
pT - > lpszText = " <EFBFBD> <EFBFBD> ͼ<EFBFBD> <EFBFBD> λ" ;
break ;
case IDT_BUTTON13 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
case IDT_BUTTON14 :
pT - > lpszText = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ;
break ;
default :
pT - > lpszText = " " ;
}
return true ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ID<49> ŵ<EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
void CGISDlg : : DeleteTarget ( const int nPt )
{
//<2F> жϸ<D0B6> <CFB8> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ϸ<EFBFBD>
//if (nPt >= MAX_TARGET_NUM)
//{
// return;
//}
//int i = nPt-1;
////ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע<EFBFBD> <D7A2> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
//if (m_pTargetShapfileID[i] != 0)
//{
// //<2F> жϵ<D0B6> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
// ClearPointShape(m_pTargetShapfileID[i]);
// m_pTargetShapfileID[i] = 0;
//}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
void CGISDlg : : DeleteAllTargets ( )
{
//ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע<EFBFBD> <D7A2> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
//for (int i=0; i<MAX_TARGET_NUM; i++)
//{
// if (m_pTargetShapfileID[i] != 0)
// {
// //<2F> жϵ<D0B6> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
// ClearPointShape(m_pTargetShapfileID[i]);
// m_pTargetShapfileID[i] = 0;
// }
//}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ü<EFBFBD> <C3BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> ű<EFBFBD> עλ<D7A2> <CEBB>
//<2F> <> <EFBFBD> 룺Ŀ<EBA3BA> <C4BF> <EFBFBD> <EFBFBD> λ<EFBFBD> þ<EFBFBD> <C3BE> ȡ<EFBFBD> targetLon<6F> <6E> γ <EFBFBD> ȡ<EFBFBD> targetLat
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> עλ<D7A2> þ<EFBFBD> <C3BE> ȡ<EFBFBD> labelLon<6F> <6E> γ <EFBFBD> ȡ<EFBFBD> labelLat
void CGISDlg : : TargetPos2LabelPos ( double & labelLon , double & labelLat , const double targetLon , const double targetLat )
{
double textPixelX = 0 ;
double textPixelY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . ProjToPixel ( targetLon , targetLat , & textPixelX , & textPixelY ) ;
//y<> <79> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƫ<EFBFBD> <C6AB> <EFBFBD> <EFBFBD> ֵ
textPixelY - = m_labelWarpValue ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . PixelToProj ( textPixelX , textPixelY , & labelLon , & labelLat ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺Ŀ<EBA3BA> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> targetInfo
// <20> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID<49> <44> drawLayerID
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ID<49> <44> drawLayerID
void CGISDlg : : DrawTarget ( long & drawLayerID , const PtStruct targetInfo )
{
//û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return ;
}
//<2F> <> һ <EFBFBD> α <EFBFBD> <CEB1> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µı <C2B5> <C4B1> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( drawLayerID = = - 1 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
drawLayerID = m_map . NewDrawing ( 1 ) ;
}
CString str = _T ( " " ) ;
// <09> <> ʾ <EFBFBD> <CABE> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD>
// if (targetInfo.lineID <= 0) //<2F> <> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// {
//
str . Format ( _T ( " %d " ) , targetInfo . nPt ) ;
// }
// else //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ߺ ͺ <DFBA> <CDBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ţ<EFBFBD> <C5A3> ԡ<EFBFBD> X-XX<58> <58> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <CABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
// {
// str.Format(_T("%d-%d"), targetInfo.lineID,targetInfo.nPt);
// }
//<2F> <> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
m_map . DrawPoint ( targetInfo . dX , targetInfo . dY , 10 , RGB ( 0 , 0 , 255 ) ) ;
/* mapwinGIS 4.9.3<EFBFBD> б <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> ñ<EFBFBD> <C3B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ
m_map . LabelColor ( drawLayerID , RGB ( 0 , 255 , 0 ) ) ;
//<2F> <> <EFBFBD> ñ<EFBFBD> <C3B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֺ<EFBFBD>
m_map . LayerFont ( drawLayerID , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 20 ) ;
*/
/* mapwinGIS 4.9.3<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> */
CLabels labels = m_map . GetDrawingLabels ( drawLayerID ) ;
labels . SetFrameVisible ( false ) ;
labels . SetFontColor ( RGB ( 0 , 255 , 0 ) ) ;
labels . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labels . SetFontSize ( 20 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> ù<EFBFBD> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ע
double textLon = 0 ;
double textLat = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TargetPos2LabelPos ( textLon , textLat , targetInfo . dX , targetInfo . dY ) ;
//<2F> <> עĿ<D7A2> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD>
TRACE ( str ) ;
TRACE ( " \n " ) ;
//m_map.AddLabel(drawLayerID, str, RGB(255,255,0), textLon, textLat, 1);
m_map . DrawLabelEx ( drawLayerID , str , textLon , textLat , 0 ) ;
//<2F> ػ<EFBFBD> str
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɺ<C9BA> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> ע
LRESULT CGISDlg : : OnAddLinePoint ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ı <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
ClearDrawingInLineDesign ( ) ;
m_tempLayerID = - 1 ;
//<2F> <> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD> <EFBFBD> <EFBFBD>
m_pDesignLineStruct [ m_designLinePointNum ] = m_curDesignPoint ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ż<EFBFBD> <C5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
//m_designLinePointNum++;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawDesignLineData ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_beTemLayerDrawing = true ;
//<2F> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µĺ<C2B5> <C4BA> <EFBFBD>
m_bAddNewPoint = true ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <DDA3> <EFBFBD> ʶ<EFBFBD> <CAB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ε<EFBFBD> <CEB5> <EFBFBD> <EFBFBD> <EFBFBD>
m_pLineSectDlg - > SetLineSectStatus ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <DDA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㼰<EFBFBD> <E3BCB0> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : DrawDesignLineData ( )
{
//<2F> ½<EFBFBD> <C2BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_designLineLayerID2 ! = - 1 )
{
m_map . RemoveLayer ( m_designLineLayerID2 ) ;
m_designLineLayerID2 = - 1 ;
}
m_map . ClearDrawing ( m_designLineLayerID ) ;
m_designLineLayerID = m_map . NewDrawing ( 1 ) ;
long index = m_map . GetLayerPosition ( m_designLineLayerID ) ;
//BOOL b= m_map.MoveLayerUp(index);
int i = 0 ;
//<2F> <> <EFBFBD> ƺ<EFBFBD> <C6BA> 㼰<EFBFBD> <E3BCB0> <EFBFBD> <EFBFBD> ע
for ( i = 0 ; i < m_designLinePointNum ; i + + )
{
DrawTarget ( m_designLineLayerID , m_pDesignLineStruct [ i ] ) ;
}
if ( m_designLinePointNum > 1 )
{
CreateEmptyShapfile ( m_designLineLayerID2 , 1 , RGB ( 0 , 255 , 0 ) ) ;
AddPoints2Shapfile ( m_designLineLayerID2 , 1 , m_pDesignLineStruct , m_designLinePointNum ) ;
DrawDistLebel ( m_designLineLayerID , m_pDesignLineStruct , m_designLinePointNum ) ;
}
//<2F> <> <EFBFBD> ƺ<EFBFBD> <C6BA> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/*for (i=0; i<m_designLinePointNum-1; i++)
{
m_map . DrawLineEx ( m_designLineLayerID , m_pDesignLineStruct [ i ] . dX , m_pDesignLineStruct [ i ] . dY ,
m_pDesignLineStruct [ i + 1 ] . dX , m_pDesignLineStruct [ i + 1 ] . dY , 2 , RGB ( 0 , 255 , 0 ) ) ;
} */
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ༭<EFBFBD> <E0BCAD> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> ע
LRESULT CGISDlg : : OnEditLinePoint ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
PtStruct ptEdit ;
memcpy ( & ptEdit , ( PtStruct * ) wParam , sizeof ( PtStruct ) ) ;
if ( lParam = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݱ༭
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_beTemLayerDrawing = true ;
}
else if ( lParam = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ༭ģʽ
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_beTemLayerDrawing = false ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݸ<EFBFBD> <DDB8> <EFBFBD>
m_pDesignLineStruct [ ptEdit . nPt - 1 ] = ptEdit ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ı <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
ClearDrawingInLineDesign ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawDesignLineData ( ) ;
//<2F> <> ǰ<EFBFBD> <C7B0> <EFBFBD> ༭<EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
memcpy ( & m_curEditLinePoint , & ptEdit , sizeof ( PtStruct ) ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> ע
LRESULT CGISDlg : : OnDeleteLinePoint ( WPARAM wParam , LPARAM lParam )
{
//ɾ<> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD>
int deletePtID = ( int ) wParam ;
if ( ( deletePtID > ( m_designLinePointNum - 1 ) ) | | ( deletePtID < 0 ) )
{
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> <C4B5> ţ<EFBFBD> <C5A3> <EFBFBD> <EFBFBD> º<EFBFBD> <C2BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD>
for ( int i = deletePtID ; i < m_designLinePointNum - 1 ; i + + )
{
m_pDesignLineStruct [ i ] = m_pDesignLineStruct [ i + 1 ] ;
m_pDesignLineStruct [ i ] . nPt - - ;
}
//<2F> ܵĺ<DCB5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȥ1
m_designLinePointNum - - ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ı <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
ClearDrawingInLineDesign ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawDesignLineData ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_beTemLayerDrawing = true ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> 溽<EFBFBD> ߣ<EFBFBD> <DFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> ע
LRESULT CGISDlg : : OnSaveLinePoints ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ʊ<EFBFBD> ʶΪFALSE
m_bLineDesign = false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> صı <D8B5> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD>
RemoveDesignLineData ( ) ;
//<2F> <> <EFBFBD> غ<EFBFBD> <D8BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵĶԻ<C4B6> <D4BB> <EFBFBD>
m_pLineSectDlg - > ShowWindow ( SW_HIDE ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> յ<EFBFBD> shpfileͼ<65> <CDBC>
//<2F> <> <EFBFBD> 룺ʸ<EBA3BA> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> shpType<70> <65> 0Ϊ<30> <CEAA> <EFBFBD> <EFBFBD> ͼ<EFBFBD> 㣻1Ϊ<31> <CEAA> ͼ<EFBFBD> 㣻2Ϊ<32> <CEAA> ͼ<EFBFBD> 㣩
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫdrawColor
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44> shpLayerID<49> <44>
void CGISDlg : : CreateEmptyShapfile ( long & shpLayerID , const int shpType , const unsigned long drawColor )
{
long fieldIndex = 0 ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> <CDBC>
mapWindow : : IShapefilePtr targetPtShape ;
targetPtShape . CreateInstance ( " MapWinGIS.Shapefile " ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> յ<EFBFBD> ͼ<EFBFBD> <CDBC>
if ( shpType = = 0 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
targetPtShape - > CreateNewWithShapeID ( _T ( " " ) , mapWindow : : SHP_POINT ) ;
}
else if ( shpType = = 1 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
targetPtShape - > CreateNewWithShapeID ( _T ( " " ) , mapWindow : : SHP_POLYLINE ) ;
}
else if ( shpType = = 2 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
targetPtShape - > CreateNewWithShapeID ( _T ( " " ) , mapWindow : : SHP_POLYGON ) ;
}
else
{
shpLayerID = - 1 ;
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> field<6C> <64> <EFBFBD> <EFBFBD> 1
mapWindow : : IFieldPtr fieldPtr1 ;
fieldPtr1 . CreateInstance ( " MapWinGIS.Field " ) ;
fieldPtr1 - > Key = ( _bstr_t ) ( " X " ) ;
fieldPtr1 - > Type = mapWindow : : DOUBLE_FIELD ;
targetPtShape - > EditInsertField ( fieldPtr1 , & fieldIndex , NULL ) ;
//<2F> <> <EFBFBD> <EFBFBD> field<6C> <64> <EFBFBD> <EFBFBD> 2
mapWindow : : IFieldPtr fieldPtr2 ;
fieldPtr2 . CreateInstance ( " MapWinGIS.Field " ) ;
fieldPtr2 - > Key = ( _bstr_t ) ( " Y " ) ;
fieldPtr2 - > Type = mapWindow : : DOUBLE_FIELD ;
targetPtShape - > EditInsertField ( fieldPtr2 , & fieldIndex , NULL ) ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
shpLayerID = m_map . AddLayer ( targetPtShape , true ) ;
mapWindow : : IShapeDrawingOptionsPtr pShapeDrawingOption ;
pShapeDrawingOption . CreateInstance ( " MapWinGIS.ShapeDrawingOptions " ) ;
if ( shpType = = 0 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
pShapeDrawingOption - > FillColor = drawColor ;
pShapeDrawingOption - > PointSize = 20 ;
//pShapeDrawingOption->SetDefaultPointSymbol(mapWindow::tkDefaultPointSymbol::dpsDiamond);
//pShapeDrawingOption->PutFillColor(drawColor);
//pShapeDrawingOption->PutPointSize(18);
pShapeDrawingOption - > PutPointType ( mapWindow : : tkPointSymbolType : : ptSymbolStandard ) ;
pShapeDrawingOption - > PutPointShape ( mapWindow : : tkPointShapeType : : ptShapeStar ) ;
//m_map.SetShapeLayerPointType(shpLayerID, mapWindow::ptDiamond);
//m_map.SetShapeLayerStippleColor(shpLayerID, drawColor);
}
else if ( shpType = = 1 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
pShapeDrawingOption - > LineColor = drawColor ;
pShapeDrawingOption - > LineWidth = 2 ;
}
else if ( shpType = = 2 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
pShapeDrawingOption - > FillColor = drawColor ;
}
( m_map . GetShapefile ( shpLayerID ) ) . SetDefaultDrawingOptions ( pShapeDrawingOption ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> shpfile<6C> <65> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺ʸ<EBA3BA> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44> shpLayerID
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD> pts<74> <73> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ptNum
void CGISDlg : : AddPoints2PointShapfile ( const long shpLayerID , const PtStruct * pts , const int ptNum )
{
for ( long i = 0 ; i < ptNum ; i + + )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
shapePtr - > Create ( mapWindow : : SHP_POINT ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = pts [ i ] . dX ;
//γ <> <CEB3>
pintPtr - > y = pts [ i ] . dY ;
shapePtr - > InsertPoint ( pintPtr , & i ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & i ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> shpfile<6C> <65> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺ʸ<EBA3BA> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44> shpLayerID
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD> pts<74> <73> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ptNum
void CGISDlg : : AddPoints2LineShapfile ( const long shpLayerID , const PtStruct * pts , const int ptNum )
{
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> shapfile
shapePtr - > Create ( mapWindow : : SHP_POLYLINE ) ;
long i = 0 ;
for ( i = 0 ; i < ptNum ; i + + )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = pts [ i ] . dX ;
//γ <> <CEB3>
pintPtr - > y = pts [ i ] . dY ;
shapePtr - > InsertPoint ( pintPtr , & i ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʸ<EFBFBD> <CAB8>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & i ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> shpfileͼ<65> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӻ<EFBFBD> <D3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺ʸ<EBA3BA> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44> shpLayerID<49> <44> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> shpType<70> <65> 0Ϊ<30> <CEAA> <EFBFBD> <EFBFBD> ͼ<EFBFBD> 㣻1Ϊ<31> <CEAA> ͼ<EFBFBD> 㣻2Ϊ<32> <CEAA> ͼ<EFBFBD> 㣩
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD> pts<74> <73> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ptNum
void CGISDlg : : AddPoints2Shapfile ( const long shpLayerID , const int shpType , const PtStruct * pts , const int ptNum )
{
long i = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( shpType = = 0 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
for ( i = 0 ; i < ptNum ; i + + )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
shapePtr - > Create ( mapWindow : : SHP_POINT ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = pts [ i ] . dX ;
//γ <> <CEB3>
pintPtr - > y = pts [ i ] . dY ;
shapePtr - > InsertPoint ( pintPtr , & i ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & i ) ;
}
}
else if ( ( shpType = = 1 ) | | ( shpType = = 2 ) ) //<2F> <> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
{
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
//<2F> <> <EFBFBD> <EFBFBD> shp
if ( shpType = = 1 ) //<2F> <> ʸ<EFBFBD> <CAB8>
{
shapePtr - > Create ( mapWindow : : SHP_POLYLINE ) ;
}
else //<2F> <> ʸ<EFBFBD> <CAB8>
{
shapePtr - > Create ( mapWindow : : SHP_POLYGON ) ;
}
for ( i = 0 ; i < ptNum ; i + + )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = pts [ i ] . dX ;
//γ <> <CEB3>
pintPtr - > y = pts [ i ] . dY ;
shapePtr - > InsertPoint ( pintPtr , & i ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & i ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> shpfile<6C> <65> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> 淽<EFBFBD> <E6B7BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> UAV
void CGISDlg : : AddUAVPoints2Polygon ( const long shpLayerID )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
shapePtr - > Create ( mapWindow : : SHP_POLYGON ) ;
long shpNum = 0 ;
for ( int i = 0 ; i < 18 ; i + + )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = m_ppUavPtArray [ i ] [ 0 ] ;
//γ <> <CEB3>
pintPtr - > y = m_ppUavPtArray [ i ] [ 1 ] ;
//<2F> <> <EFBFBD> <EFBFBD> ǰshp<68> в<EFBFBD> <D0B2> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
shapePtr - > InsertPoint ( pintPtr , & shpNum ) ;
}
shpNum = 0 ;
( m_map . GetShapefile ( shpLayerID ) ) . EditClear ( ) ;
//<2F> <> shpfile<6C> ļ<EFBFBD> <C4BC> в<EFBFBD> <D0B2> <EFBFBD> shp<68> ļ<EFBFBD>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & shpNum ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> shpfileͼ<65> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1<EFBFBD> <31> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺ʸ<EBA3BA> <CAB8> ͼ<EFBFBD> <CDBC> ID<49> <44> shpLayerID<49> <44> shp<68> <70> <EFBFBD> <EFBFBD> shpType
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <DDA3> <EFBFBD> <EFBFBD> ȡ<EFBFBD> dX; γ <> ȡ<EFBFBD> dY
void CGISDlg : : AddOnePoint2Shapfile ( const long shpLayerID , const int shpType , const double dX , const double dY )
{
mapWindow : : IPointPtr pintPtr ;
pintPtr . CreateInstance ( " MapWinGIS.Point " ) ;
//<2F> <> <EFBFBD> <EFBFBD>
pintPtr - > x = dX ;
//γ <> <CEB3>
pintPtr - > y = dY ;
//shpfile<6C> ļ<EFBFBD> <C4BC> е <EFBFBD> shpͼ<70> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long shpNum = ( m_map . GetShapefile ( shpLayerID ) ) . GetNumShapes ( ) ;
//<2F> ж<EFBFBD> <D0B6> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڸ<EFBFBD> shpͼ<70> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> shpͼ<70> <CDBC>
if ( shpNum = = 0 )
{
mapWindow : : IShapePtr shapePtr ;
shapePtr . CreateInstance ( " MapWinGIS.Shape " ) ;
if ( shpType = = 0 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
shapePtr - > Create ( mapWindow : : SHP_POINT ) ;
}
else if ( shpType = = 1 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
shapePtr - > Create ( mapWindow : : SHP_POLYLINE ) ;
}
else if ( shpType = = 2 ) //<2F> <> ͼ<EFBFBD> <CDBC>
{
shapePtr - > Create ( mapWindow : : SHP_POLYGON ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> ǰshp<68> в<EFBFBD> <D0B2> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
shapePtr - > InsertPoint ( pintPtr , & shpNum ) ;
//<2F> <> shpfile<6C> ļ<EFBFBD> <C4BC> в<EFBFBD> <D0B2> <EFBFBD> shp<68> ļ<EFBFBD>
( m_map . GetShapefile ( shpLayerID ) ) . EditInsertShape ( shapePtr , & shpNum ) ;
}
else
{
//<2F> <> <EFBFBD> õ<EFBFBD> ǰ<EFBFBD> <C7B0> shp
CShape shape = ( m_map . GetShapefile ( shpLayerID ) ) . GetShape ( shpNum - 1 ) ;
//<2F> <> ǰ<EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long curLinePts = shape . GetNumPoints ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> ǰshp<68> в<EFBFBD> <D0B2> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
shape . InsertPoint ( pintPtr , & curLinePts ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> ķ<EFBFBD> <C4B7> к<EFBFBD> <D0BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 弯<EFBFBD> <E5BCAF> linePtArray<61> <79> <EFBFBD> <EFBFBD> <EFBFBD> ߵ ĺ<DFB5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ptNum
//˵<> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˸ ú<CBB8> <C3BA> ߣ<EFBFBD> <DFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 棬<EFBFBD> <E6A3AC> <EFBFBD> ±<EFBFBD> <C2B1> 溽<EFBFBD> <E6BABD>
void CGISDlg : : DrawBindingLine ( const PtStruct * linePtArray , const int ptNum )
{
if ( ptNum = = 0 )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD>
DrawLineDataStruct lineDataArr ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD>
m_lineManage . LinePoint2DrawLinePoints ( lineDataArr , linePtArray , ptNum ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( lineDataArr . lineID - 1 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <DDB5> <EFBFBD> <EFBFBD> <EFBFBD> <DFBC> <EFBFBD> <EFBFBD> <EFBFBD>
m_pFlyLines [ lineDataArr . lineID - 1 ] = lineDataArr ;
//<2F> <> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//DrawFlyLine(m_pFlyLines[lineDataArr.lineID-1]);
DrawFlyLine ( lineDataArr ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> lineData
void CGISDlg : : DrawFlyLine ( const DrawLineDataStruct lineData )
{
//field<6C> <64> <EFBFBD> <EFBFBD> ֵ
long fieldIndex = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
int lineID = lineData . lineID - 1 ;
//û<> <C3BB> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( ! m_pHaveDrawLineFlag [ lineID ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 0 ] , 0 , /*RGB(0,255,0)*/ LineClr [ lineID ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 1 ] , 1 , /*RGB(0,255,0)*/ LineClr [ lineID ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> ɹ<EFBFBD>
m_pHaveDrawLineFlag [ lineID ] = true ;
}
//<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
AddPoints2PointShapfile ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 0 ] , lineData . pts , lineData . pointNum ) ;
//<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
AddPoints2LineShapfile ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 1 ] , lineData . linePts , lineData . linePointNum ) ;
/////////////////////<2F> <> SHPͼ<50> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ///////////////////////////////
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 0 ] ) ) . GetLabels ( ) ;
//CLabelCategory labelCategory = labesPtr.AddCategory(_T("<22> <> ɫ"));
//labelCategory.SetFontColor(/*RGB(255,0,0)*/LineClr[lineID]);
//labelCategory.SetAlignment(1);
//labelCategory.SetFontBold(TRUE);
//labelCategory.SetFontName(LPCTSTR("<22> <> <EFBFBD> <EFBFBD> "));
//labelCategory.SetFontSize(12);
//labesPtr.SetAvoidCollisions(FALSE);
labesPtr . SetFontColor ( /*RGB(255,0,0)*/ LineClr [ lineID ] ) ;
labesPtr . SetAlignment ( 1 ) ;
labesPtr . SetFontBold ( true ) ;
labesPtr . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labesPtr . SetFontSize ( 16 ) ;
labesPtr . put_FontSize2 ( 16 ) ;
labesPtr . SetFrameVisible ( false ) ;
labesPtr . SetAvoidCollisions ( FALSE ) ;
CString strText = _T ( " " ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
for ( long i = 0 ; i < lineData . pointNum ; i + + )
{
//<2F> <> ע<EFBFBD> <D7A2> Ϣ
if ( 14 = = lineData . lineID )
{
strText . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ½<EFBFBD> <EFBFBD> " ) /*lineData.lineID, */ /*lineData.pts[i].nPt*/ ) ;
}
else
{
strText . Format ( _T ( " %d-%d " ) , lineData . lineID , lineData . pts [ i ] . nPt ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> Labels
labesPtr . AddLabel ( ( LPCTSTR ) strText , lineData . pts [ i ] . dX , lineData . pts [ i ] . dY , 0 , 0 ) ;
}
/////////////////////<2F> <> SHPͼ<50> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ///////////////////////////////
//<2F> <> <EFBFBD> »<EFBFBD> <C2BB> <EFBFBD>
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ݵ<EFBFBD> ͼ<EFBFBD> ؼ<EFBFBD> <D8BC> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> ͼ<EFBFBD> ؼ<EFBFBD>
//˵<> <CBB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> ֱ<EFBFBD> <D6B1> ʺ<EFBFBD> <CABA> <EFBFBD> <EFBFBD> Ʒ ֱ<C6B7> <D6B1> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> ļ<EFBFBD> <C4BC> ι <EFBFBD> ϵ
//<2F> <> <EFBFBD> 룺<EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> moveToArea
void CGISDlg : : MoveGISShowWindow ( const CRect moveToArea )
{
CRect gisRect ;
//X<> <58> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD>
double cx = 1.0 * moveToArea . Width ( ) / m_rcDesignGISWindow . Width ( ) ;
//Y<> <59> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD>
double cy = 1.0 * moveToArea . Height ( ) / m_rcDesignGISWindow . Height ( ) ;
gisRect . left = static_cast < int > ( m_rcDesignGISWindow . left * cx ) ;
gisRect . top = static_cast < int > ( m_rcDesignGISWindow . top * cy ) ;
gisRect . right = moveToArea . right ;
gisRect . bottom = moveToArea . bottom ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ߶ȵ<DFB6> <C8B5> <EFBFBD>
m_onePerWidth = 1.0 / gisRect . Width ( ) ;
m_onePerHeight = 1.0 / gisRect . Height ( ) ;
//<2F> <> ͼ<EFBFBD> <CDBC> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> ߶<EFBFBD>
m_mapAreaHalfWidth = 0.5 * gisRect . Width ( ) ;
m_mapAreaHalfHeight = 0.5 * gisRect . Height ( ) ;
//<2F> <> ͼ<EFBFBD> ؼ<EFBFBD> <D8BC> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
GetDlgItem ( IDC_MAP1 ) - > MoveWindow ( gisRect , TRUE ) ;
}
void CGISDlg : : OnMouseMove ( UINT nFlags , CPoint point )
{
CBCGPDialog : : OnMouseMove ( nFlags , point ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : CreateFloatToolBar ( )
{
CBitmap bm ;
UINT Resource [ 14 ] = { IDB_BITMAP_ADD_SHPFILE , IDB_BITMAP_ADD_IMGFILE , IDB_BITMAP_ADD_FLYLINE ,
IDB_BITMAP_LAYER_MANAGE , IDB_BITMAP_DELETE_LAYER ,
IDB_BITMAP_SELECT , IDB_BITMAP_ZOOMIN , IDB_BITMAP_ZOOMOUT ,
IDB_BITMAP_MOVE , IDB_BITMAP_FULLSCREEN , IDB_BITMAP_RULER ,
IDB_BITMAP_XY , IDB_BITMAP_SURVEY ,
IDB_BITMAP10 /*IDB_BITMAP_PRINT*/ } ; //λͼID<49> <44> <EFBFBD> <EFBFBD>
m_ImageList . Create ( 24 , 24 , ILC_COLOR24 | ILC_MASK , 0 , 0 ) ; //<2F> <> <EFBFBD> <EFBFBD> Image List
CRect rcToolBar ;
/*
rcToolBar . top = m_rcGISArea . top ;
rcToolBar . left = m_rcGISArea . right - 24 ;
rcToolBar . bottom = m_rcGISArea . bottom ;
rcToolBar . right = m_rcGISArea . right ; */
//m_ToolBar.Create(TBSTYLE_FLAT | CCS_TOP | WS_VISIBLE | /*WS_BORDER |*/ CCS_ADJUSTABLE | TBSTYLE_TOOLTIPS, rcToolBar, this, IDR_TOOLBAR1); //<2F> <> <EFBFBD> <EFBFBD> Toolbar Control
m_ToolBar . Create ( TBSTYLE_FLAT | CCS_TOP | WS_VISIBLE | /*WS_BORDER |*/ TBSTYLE_TOOLTIPS , rcToolBar , this , IDR_TOOLBAR1 ) ; //<2F> <> <EFBFBD> <EFBFBD> Toolbar Control
m_ToolBar . SetBitmapSize ( CSize ( 24 , 24 ) ) ;
int buttonItems = 14 ;
int i ;
for ( i = 0 ; i < buttonItems ; i + + )
{
bm . LoadBitmap ( Resource [ i ] ) ;
m_ImageList . Add ( & bm , ( CBitmap * ) NULL ) ;
bm . Detach ( ) ;
}
m_ToolBar . SetImageList ( & m_ImageList ) ;
TBBUTTON Buttons [ 14 ] ; //<2F> <> <EFBFBD> <EFBFBD> TBBUTTON<4F> ṹ<EFBFBD> <E1B9B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CString str ;
for ( i = 0 ; i < buttonItems ; i + + )
{
str . LoadString ( IDT_BUTTON1 + i ) ; //IDS_FILE<4C> <45> <EFBFBD> <EFBFBD> String Table<6C> <65> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> String
// Buttons[i].iString = m_ToolBar.AddStrings(str);
Buttons [ i ] . iString = NULL ;
Buttons [ i ] . dwData = 0 ;
Buttons [ i ] . fsState = TBSTATE_ENABLED ;
Buttons [ i ] . fsStyle = TBSTYLE_BUTTON ;
Buttons [ i ] . iBitmap = i ;
Buttons [ i ] . idCommand = IDT_BUTTON1 + i ; //<2F> <> ť<EFBFBD> <C5A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ
}
m_ToolBar . EnableToolTips ( true ) ; //<2F> <> <EFBFBD> ӹ<EFBFBD> <D3B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϰ<EFBFBD> ť<EFBFBD> <C5A5> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
m_ToolBar . AddButtons ( buttonItems , Buttons ) ;
m_ToolBar . AutoSize ( ) ;
//m_ToolBar.ShowWindow(SW_HIDE);
RepositionBars ( AFX_IDW_CONTROLBAR_FIRST , AFX_IDW_CONTROLBAR_LAST , 0 ) ;
}
BOOL CGISDlg : : OnToolTipText ( UINT , NMHDR * pNMHDR , LRESULT * pResult )
{
ASSERT ( pNMHDR - > code = = TTN_NEEDTEXTA | | pNMHDR - > code = = TTN_NEEDTEXTW ) ; // UNICODE<44> <45> Ϣ
TOOLTIPTEXTA * pTTTA = ( TOOLTIPTEXTA * ) pNMHDR ; TOOLTIPTEXTW * pTTTW = ( TOOLTIPTEXTW * ) pNMHDR ; //TCHAR szFullText[512];
CString strTipText ;
UINT nID = pNMHDR - > idFrom ;
if ( pNMHDR - > code = = TTN_NEEDTEXTA & & ( pTTTA - > uFlags & TTF_IDISHWND ) | | pNMHDR - > code = = TTN_NEEDTEXTW & & ( pTTTW - > uFlags & TTF_IDISHWND ) )
{ // idFromΪ<6D> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> HWND
nID = : : GetDlgCtrlID ( ( HWND ) nID ) ;
}
if ( nID ! = 0 ) //<2F> <> Ϊ<EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD>
{ //AfxLoadString(nID, szFullText); //strTipText=szFullText;
strTipText . LoadString ( nID ) ;
strTipText = strTipText . Mid ( strTipText . Find ( ' \n ' , 0 ) + 1 ) ;
# ifndef _UNICODE
if ( pNMHDR - > code = = TTN_NEEDTEXTA )
{
lstrcpyn ( pTTTA - > szText , strTipText , sizeof ( pTTTA - > szText ) ) ;
}
else
{
_mbstowcsz ( pTTTW - > szText , strTipText , sizeof ( pTTTW - > szText ) ) ;
}
# else
if ( pNMHDR - > code = = TTN_NEEDTEXTA )
{
_wcstombsz ( pTTTA - > szText , strTipText , sizeof ( pTTTA - > szText ) ) ;
}
else
{
lstrcpyn ( pTTTW - > szText , strTipText , sizeof ( pTTTW - > szText ) ) ;
}
# endif
* pResult = 0 ; //ʹ <> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
: : SetWindowPos ( pNMHDR - > hwndFrom , HWND_TOP , 0 , 0 , 0 , 0 , SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_NOOWNERZORDER ) ;
return TRUE ;
}
return TRUE ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> õ<EFBFBD> <C3B5> <EFBFBD> վλ<D5BE> <CEBB>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY<64> <59> <EFBFBD> ߶<EFBFBD> alt
void CGISDlg : : SetGCSPosition ( const double dX , const double dY , const double alt )
{
//<2F> <> <EFBFBD> <EFBFBD> վλ<D5BE> <CEBB>
g_gcsLon = dX ; //<2F> <> <EFBFBD> <EFBFBD>
g_gcsLat = dY ; //γ <> <CEB3>
g_gcsAlt = alt ; //<2F> ߶<EFBFBD>
CString str = _T ( " GCS " ) ;
CString strColor = _T ( " <EFBFBD> <EFBFBD> ɫ" ) ;
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_gcsPtShpLayerID , dX , dY , str , strColor , RGB ( 255 , 0 , 0 ) ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ һ <CABD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵<EFBFBD> <CDB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnGuideMode1 ( )
{
//<2F> жϵ<D0B6> ͼ<EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> أ<EFBFBD> û<EFBFBD> м<EFBFBD> <D0BC> ط<EFBFBD> <D8B7> <EFBFBD>
if ( ! m_bHaveAddMap ) //û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ?
{
AfxMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> " ) ) ;
return ;
}
m_guidePtInfo . guideMode = 1 ;
m_guidePointMode = 1 ;
m_bGuideMode = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ Ϊ<CABD> <CEAA>
//2023.4.3 JackLiu
/*
DrawGuidePoint ( 1 , m_guidePtInfo . guidePtLon , m_guidePtInfo . guidePtLat ) ;
m_struMapOut . cmd = MapCmd_Guide1 ;
m_struMapOut . lon = m_guidePtInfo . guidePtLon ;
m_struMapOut . lat = m_guidePtInfo . guidePtLat ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ; */
//::PostMessage(HWND_BROADCAST, WM_SEND_GUIDEPOINT_INFO , WPARAM(&m_guidePtInfo) , 1);
//::PostMessage(m_MsgHwnd, m_MsgID, WPARAM(&m_guidePtInfo) , 1);
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <CABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵<EFBFBD> <CDB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnGuideMode2 ( )
{
//<2F> жϵ<D0B6> ͼ<EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> أ<EFBFBD> û<EFBFBD> м<EFBFBD> <D0BC> ط<EFBFBD> <D8B7> <EFBFBD>
if ( ! m_bHaveAddMap ) //û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ?
{
AfxMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> " ) ) ;
return ;
}
m_guidePtInfo . guideMode = 2 ;
m_guidePointMode = 2 ;
m_bGuideMode = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ Ϊ<CABD> <CEAA>
//2023.4.3 JackLiu
/*DrawGuidePoint(2,m_guidePtInfo.guidePtLon, m_guidePtInfo.guidePtLat);
m_struMapOut . cmd = MapCmd_Guide2 ;
m_struMapOut . lon = m_guidePtInfo . guidePtLon ;
m_struMapOut . lat = m_guidePtInfo . guidePtLat ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ; */
//::PostMessage(m_MsgHwnd, m_MsgID, WPARAM(&m_guidePtInfo) , 2);
//::PostMessage(HWND_BROADCAST, WM_SEND_GUIDEPOINT_INFO , WPARAM(&m_guidePtInfo) , 2);
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 1<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine1 ( )
{
SetFlyLineShowStatus ( 1 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 2<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine2 ( )
{
SetFlyLineShowStatus ( 2 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 3<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine3 ( )
{
SetFlyLineShowStatus ( 3 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 4<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine4 ( )
{
SetFlyLineShowStatus ( 4 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 5<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine5 ( )
{
SetFlyLineShowStatus ( 5 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 6<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine6 ( )
{
SetFlyLineShowStatus ( 6 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 7<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine7 ( )
{
SetFlyLineShowStatus ( 7 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 8<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine8 ( )
{
SetFlyLineShowStatus ( 8 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 9<CABE> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine9 ( )
{
SetFlyLineShowStatus ( 9 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ 10<31> ź<EFBFBD> <C5BA> <EFBFBD>
void CGISDlg : : OnShowLine10 ( )
{
SetFlyLineShowStatus ( 10 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> Ͷ
void CGISDlg : : OnShowLine14 ( )
{
SetFlyLineShowStatus ( 14 ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> lineID<49> <44> <EFBFBD> <EFBFBD> 0<EFBFBD> <30> ʼ <EFBFBD> <CABC> <EFBFBD> <EFBFBD>
void CGISDlg : : ClearDrawedLine ( const int lineID )
{
if ( m_pHaveDrawLineFlag [ lineID ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 0 ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
m_map . RemoveLayer ( m_ppPlanLineShpLayerIDArr [ lineID ] [ 1 ] ) ;
m_pHaveDrawLineFlag [ lineID ] = false ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݲ˵<DDB2> <CBB5> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> صIJ<D8B5> <C4B2> <EFBFBD>
// 1)<29> <> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
// 2)<29> <> <EFBFBD> <EFBFBD> δ<EFBFBD> <CEB4> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD> lineID
void CGISDlg : : SetFlyLineShowStatus ( const int lineID )
{
int lineIndex = lineID - 1 ;
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> 棬<EFBFBD> <E6A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_pHaveDrawLineFlag [ lineIndex ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( lineIndex ) ;
//ˢ<> <CBA2>
m_map . Redraw ( ) ;
//<2F> <> ʶ<EFBFBD> <CAB6> false
m_pHaveDrawLineFlag [ lineIndex ] = false ;
}
else
{
TCHAR filter [ 500 ] = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.txt)\0 *.txt \0 <EFBFBD> <EFBFBD> " ) ;
CFileDialog LineRouteDlg ( TRUE , NULL , NULL , OFN_HIDEREADONLY , filter , NULL ) ;
//LineRouteDlg.m_ofn.lpstrInitialDir = strRouteFileDir;
LineRouteDlg . m_ofn . lpstrFilter = " txt(*.txt) \0 *.txt " ;
LineRouteDlg . m_ofn . lpstrTitle = " ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɵĺ<EFBFBD> <EFBFBD> <EFBFBD> " ;
if ( LineRouteDlg . DoModal ( ) = = IDOK ) //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> OK<4F> <4B> ť<EFBFBD> <C5A5> ֹ<EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> ķ<EFBFBD> <C4B7> <EFBFBD> ֵ
{
CString str = LineRouteDlg . GetPathName ( ) ; //<2F> <> ȡ<EFBFBD> ļ<EFBFBD> ·<EFBFBD> <C2B7> <EFBFBD> <EFBFBD>
//OnShowGivenLine(GetFlyLineName(lineID));
OnShowGivenLine ( str ) ;
}
}
}
void CGISDlg : : OnUpdateLineDisplay1 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 0 ] ) ; //<2F> <> 1<EFBFBD> ź<EFBFBD> <C5BA> <EFBFBD> ѡ <EFBFBD> к<D0BA> <F3A3ACB4> ϼǺ<CFBC>
}
void CGISDlg : : OnUpdateLineDisplay2 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 1 ] ) ;
}
void CGISDlg : : OnUpdateLineDisplay3 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 2 ] ) ;
}
void CGISDlg : : OnUpdateLineDisplay4 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 3 ] ) ;
}
void CGISDlg : : OnUpdateLineDisplay5 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 4 ] ) ;
}
void CGISDlg : : OnUpdateShowLine6 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 5 ] ) ;
}
void CGISDlg : : OnUpdateShowLine7 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 6 ] ) ;
}
void CGISDlg : : OnUpdateShowLine8 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 7 ] ) ;
}
void CGISDlg : : OnUpdateShowLine9 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 8 ] ) ;
}
void CGISDlg : : OnUpdateShowLine10 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 9 ] ) ;
}
void CGISDlg : : OnUpdateShowLine14 ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 13 ] ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> strLineFileName
void CGISDlg : : OnShowGivenLine ( const CString strLineFileName )
{
//<2F> жϵ<D0B6> ͼ<EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> أ<EFBFBD> û<EFBFBD> м<EFBFBD> <D0BC> ط<EFBFBD> <D8B7> <EFBFBD>
if ( ! m_bHaveAddMap ) //û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ?
{
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> " ) ) ;
return ;
}
if ( _T ( " " ) = = strLineFileName )
{
return ;
}
//<2F> ж<EFBFBD> <D0B6> ļ<EFBFBD> <C4BC> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! SearchDirectory ( strLineFileName ) )
{
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> ·<EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڣ<EFBFBD> " ) ) ;
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> <DDBC> <EFBFBD>
DrawLineDataStruct lineDataGroup ;
//<2F> <> ʼ <EFBFBD> <CABC>
memset ( & lineDataGroup , 0 , sizeof ( DrawLineDataStruct ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> ȡ<EFBFBD> ɹ<EFBFBD>
if ( m_lineManage . ReadLineDataFromFile ( lineDataGroup , strLineFileName ) )
{
//<2F> жϺ <D0B6> <CFBA> ߺ <EFBFBD> <DFBA> Ƿ<EFBFBD> <C7B7> <EFBFBD> ȷ<EFBFBD> <C8B7> lineIDȡֵ1-8,10-11,13<31> <33> <EFBFBD> <EFBFBD> add by jackwong 2018.08.01<EFBFBD> <EFBFBD>
if ( lineDataGroup . lineID < 1 | | /*(*/ lineDataGroup . lineID > 14 /*&& lineDataGroup.lineID<10)*/ /*|| lineDataGroup.lineID==14 */ /*|| lineDataGroup.lineID>13*/ )
{
BCGPMessageBox ( " <EFBFBD> <EFBFBD> <EFBFBD> ߺ Ų<EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <EFBFBD> " ) ;
return ;
}
/*******************by Wu 2023.09.14****************************/
m_ShowedLineDataList [ lineDataGroup . lineID ] = lineDataGroup ;
if ( lineDataGroup . lineID = = 11 ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڱ༭
{
//<2F> <> ʼ <EFBFBD> <CABC>
//memset(&backLineDataGroup, 0, sizeof(DrawLineDataStruct));
backLineDataGroup = lineDataGroup ;
//Σ<> յ<EFBFBD> <D5B5> ε<EFBFBD> <CEB5> <EFBFBD> <EFBFBD> <EFBFBD>
ClearDangerousTerrainPoints ( ) ;
double height = backLineDataGroup . linePts [ 0 ] . nH ;
double pts [ 128 ] [ 2 ] ;
for ( int i = 0 ; i < backLineDataGroup . linePointNum ; i + + )
{
pts [ i ] [ 0 ] = backLineDataGroup . linePts [ i ] . dX ;
pts [ i ] [ 1 ] = backLineDataGroup . linePts [ i ] . dY ;
}
DrawDangerousTerrainPoints ( pts , backLineDataGroup . linePointNum , height ) ;
}
/**********************************************************************************/
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( lineDataGroup . lineID - 1 ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
DrawFlyLine ( lineDataGroup ) ;
}
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> 浼<EFBFBD> <E6B5BC> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> guideMode<64> <65> 1Ϊ<31> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1,2Ϊ<32> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2<EFBFBD> <32> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY
void CGISDlg : : DrawGuidePoint ( const BYTE guideMode , const double dX , const double dY )
{
CString str = _T ( " " ) ;
if ( guideMode = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
{
str = _T ( " GuidePoint1 " ) ;
}
else if ( guideMode = = 2 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
{
str = _T ( " GuidePoint2 " ) ;
}
CString strColor = _T ( " <EFBFBD> <EFBFBD> ɫ" ) ;
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_guidePtShpLayerID , dX , dY , str , strColor , RGB ( 255 , 0 , 0 ) ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ڵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> drawLayerID
// <09> <> <EFBFBD> <EFBFBD> <EFBFBD> ꣬<EFBFBD> <EAA3AC> <EFBFBD> <EFBFBD> dX, γ <> <CEB3> dY
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> strPtName
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫstrColor
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ<EFBFBD> <C9AB> ֵfontColor
void CGISDlg : : AddPointShapeLayer ( long & drawLayerID , const double dX , const double dY , const CString strPtName , const CString strColor , unsigned long fontColor )
{
//<2F> жϵ<D0B6> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
if ( drawLayerID ! = - 1 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( drawLayerID ) ;
}
///////////////////////////////////<2F> ½<EFBFBD> <C2BD> <EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <C4BF> ///////////////////////////////////
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
//CreateEmptyShapfile(drawLayerID, 0, RGB(0,255,0));
CreateEmptyShapfile ( drawLayerID , 0 , fontColor ) ;
PtStruct pointDataArr [ 1 ] ;
pointDataArr [ 0 ] . dX = dX ;
pointDataArr [ 0 ] . dY = dY ;
//<2F> <> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> 뺽<EFBFBD> <EBBABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
AddPoints2PointShapfile ( drawLayerID , pointDataArr , 1 ) ;
/////////////////////<2F> <> SHPͼ<50> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ///////////////////////////////
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
CShapefile shp = m_map . GetShapefile ( drawLayerID ) ;
labesPtr = ( m_map . GetShapefile ( drawLayerID ) ) . GetLabels ( ) ;
labesPtr . SetFontColor ( fontColor ) ;
labesPtr . SetAlignment ( 1 ) ;
labesPtr . SetFontBold ( TRUE ) ;
labesPtr . SetFontName ( _T ( " Times New Roman " ) ) ;
labesPtr . SetFontSize ( 11 ) ;
labesPtr . put_FontSize2 ( 11 ) ;
labesPtr . SetFrameVisible ( false ) ;
/*
CLabelCategory labelCategory = labesPtr . AddCategory ( strColor ) ;
labelCategory . SetFontColor ( fontColor ) ;
labelCategory . SetAlignment ( 1 ) ;
labelCategory . SetFontBold ( TRUE ) ;
labelCategory . SetFontName ( _T ( " Times New Roman " ) ) ;
labelCategory . SetFontSize ( 11 ) ;
labelCategory . SetFrameVisible ( false ) ; */
//<2F> <> <EFBFBD> <EFBFBD> Labels
labesPtr . AddLabel ( ( LPCTSTR ) strPtName , dX , dY , 0 , 0 ) ;
/////////////////////<2F> <> SHPͼ<50> <CDBC> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ///////////////////////////////
//<2F> <> <EFBFBD> »<EFBFBD> <C2BB> <EFBFBD>
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> ͼ<EFBFBD> <CDBC> ID<49> <44> layerID
void CGISDlg : : ClearPointShape ( long layerID )
{
if ( layerID = = - 1 )
{
return ;
}
CLabels labesPtr ;
CShapefile sf = m_map . GetShapefile ( layerID ) ;
if ( sf )
{
labesPtr = sf . GetLabels ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
labesPtr . RemoveCategory ( 0 ) ;
labesPtr . Clear ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
m_map . RemoveLayer ( layerID ) ;
}
//labesPtr = (m_map.GetShapefile(layerID)).GetLabels();
}
LRESULT CGISDlg : : OnCheckFlyLineShowStatus ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD>
int lineIndex = wParam - 1 ;
if ( m_pHaveDrawLineFlag [ lineIndex ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( lineIndex ) ;
//ˢ<> <CBA2>
m_map . Redraw ( ) ;
//<2F> <> ʶ<EFBFBD> <CAB6> false
m_pHaveDrawLineFlag [ lineIndex ] = false ;
}
return 0 ;
}
// <20> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ÷<EFBFBD> <C3B7> ͵<EFBFBD> <CDB5> <EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <CABD> Ϣ<EFBFBD> <CFA2> <EFBFBD> ; <EFBFBD> <CDBE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2>
void CGISDlg : : SetMsgInfo ( const HWND hwnd , const UINT msgID )
{
m_MsgHwnd = hwnd ;
m_MsgID = msgID ;
}
// <20> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> ú<EFBFBD> <C3BA> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> ; <EFBFBD> <CDBE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2>
void CGISDlg : : SetLoadLineMsgInfo ( const HWND hwnd , const UINT msgID )
{
m_MsgHwnd = hwnd ;
m_LineLoadMsgID = msgID ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> ѡ <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> curpoint<6E> <74> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> x<EFBFBD> <78> y
//<2F> <> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> true<75> <65> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> к<EFBFBD> <D0BA> <EFBFBD>
// false<73> <65> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> δѡ <CEB4> к<EFBFBD> <D0BA> <EFBFBD>
bool CGISDlg : : BeMouseClickedLinePoint ( const PtStruct curpoint , const long x , const long y )
{
CRect rc ;
double ptPixelX = 0 ;
double ptPixelY = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . ProjToPixel ( curpoint . dX , curpoint . dY , & ptPixelX , & ptPixelY ) ;
rc . left = static_cast < long > ( ptPixelX - 20 ) ;
rc . top = static_cast < long > ( ptPixelY - 20 ) ;
rc . right = static_cast < long > ( ptPixelX + 20 ) ;
rc . bottom = static_cast < long > ( ptPixelY + 20 ) ;
CPoint xy ;
xy . x = x ;
xy . y = y ;
if ( rc . PtInRect ( xy ) )
{
return true ;
}
return false ;
}
void CGISDlg : : MouseUpMap1 ( short Button , short Shift , long x , long y )
{
m_iPtSel = - 1 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnAutoMove ( )
{
if ( m_bAutoMove )
{
m_bAutoMove = false ;
}
else
{
m_bAutoMove = true ;
}
}
void CGISDlg : : OnDesignLine ( ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( m_bHaveAddMap )
{
//<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ں<EFBFBD> <DABA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ״̬ʱ<CCAC> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_bLineDesign )
{
return ;
}
else
{
m_bLineDesign = true ;
// //<2F> <> <EFBFBD> Ƶ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// m_bDesignFirstPoint = true;
}
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е ĺ<D0B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
// m_pFlyLineDesign->ClearCurrentData();
//
// //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƶԻ<C6B6> <D4BB> <EFBFBD>
// m_pFlyLineDesign->ShowWindow(SW_SHOW);
//
// //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
// m_pLineSectDlg->ShowWindow(SW_SHOW);
//
// //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ
// m_map.SetCursorMode(3);
}
else
{
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> " ) ) ;
}
if ( m_bLineDesign = = false )
{
m_bLineDesign = true ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ <C4A3> <CABD> <EFBFBD> <EFBFBD>
}
}
void CGISDlg : : OnData ( )
{
AfxMessageBox ( " this is test!!! " ) ;
}
void CGISDlg : : OnUpdateAutoMov ( CCmdUI * pCmdUI )
{
pCmdUI - > SetCheck ( m_bAutoMove ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> յ<EFBFBD> λ<EFBFBD> <CEBB>
//<2F> <> <EFBFBD> 룺<EFBFBD> <EBA3BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> callbackMode<64> <65> 1Ϊ<31> <CEAA> <EFBFBD> յ<EFBFBD> 1<EFBFBD> <31> 2Ϊ<32> <CEAA> <EFBFBD> յ<EFBFBD> 2<EFBFBD> <32> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> dX<64> <58> γ <EFBFBD> <CEB3> dY
void CGISDlg : : DrawCallBackPoint ( const BYTE callbackMode , const double dX , const double dY )
{
//û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ
if ( ! m_bHaveAddMap )
{
return ;
}
if ( ( callbackMode > 255 ) | | ( callbackMode < 1 ) )
{
return ;
}
CString str ;
str . Format ( _T ( " CallbackPoint%d " ) , callbackMode ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɫ
CString strColor = _T ( " <EFBFBD> <EFBFBD> ɫ" ) ;
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_pCallBackShapfileID [ callbackMode - 1 ] , dX , dY , str , strColor , RGB ( 0 , 255 , 0 ) ) ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnRemoveGuidePtDraw ( )
{
//<2F> жϵ<D0B6> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC> <EFBFBD> Ƿ<EFBFBD> <C7B7> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE>
if ( m_guidePtShpLayerID ! = - 1 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( m_guidePtShpLayerID ) ;
m_guidePtShpLayerID = - 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģʽ
m_guidePointMode = 0 ;
m_bGuideMode = false ;
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ݲ˵<DDB2>
CMenu menu ;
menu . LoadMenuA ( IDR_MENU2 ) ;
menu . CheckMenuItem ( IDM_GUIDE_FLY1 , MF_BYCOMMAND | MF_UNCHECKED ) ;
menu . CheckMenuItem ( IDM_GUIDE_FLY2 , MF_BYCOMMAND | MF_UNCHECKED ) ;
m_map . Redraw ( ) ;
}
void CGISDlg : : OnUpdateGuideMode1 ( CCmdUI * pCmdUI )
{
if ( m_guidePointMode = = 1 )
{
pCmdUI - > SetCheck ( 1 ) ;
}
else
{
pCmdUI - > SetCheck ( 0 ) ;
}
}
void CGISDlg : : OnUpdateGuideMode2 ( CCmdUI * pCmdUI )
{
if ( m_guidePointMode = = 2 )
{
pCmdUI - > SetCheck ( 1 ) ;
}
else
{
pCmdUI - > SetCheck ( 0 ) ;
}
}
void CGISDlg : : OnAddpoint ( ) //<2F> <> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> õ㹤<C3B5> <E3B9A4> ״̬
{
// TODO: Add your command handler code here
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
//m_map.SetCursorMode(5);
m_bSetPointModel = TRUE ;
m_bLineDesign = TRUE ;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_bDesignFirstPoint = false ;
//<2F> <> <EFBFBD> ƺ<EFBFBD> <C6BA> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
/*
if ( m_bLineDesign )
{
for ( int i = 0 ; i < sizeof ( m_pHaveDrawLineFlag ) / sizeof ( m_pHaveDrawLineFlag [ 0 ] ) ; i + + )
{
if ( m_pHaveDrawLineFlag [ i ] )
{
m_map . RemoveLayer ( m_ppPlanLineShpLayerIDArr [ i ] [ 1 ] ) ;
m_map . RemoveLayer ( m_ppPlanLineShpLayerIDArr [ i ] [ 0 ] ) ;
}
}
}
*/
}
void CGISDlg : : OnEnddesign ( ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ༭
{
// TODO: Add your command handler code here
if ( m_designLinePointNum < 3 & & m_designLinePointNum > 0 )
{
BCGPMessageBox ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3!!!" ) ;
return ;
}
//m_bEndSetPoint=TRUE;
m_bSetPointModel = FALSE ;
m_bLineDesign = FALSE ;
m_bPtDel = FALSE ;
m_bPtEdit = FALSE ;
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
///////Save the Designed Line
if ( m_designLinePointNum < = 0 )
{
return ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> ·<EFBFBD> <C2B7>
CString strFlyLineName = _T ( " " ) ;
//<2F> <> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD>
int designLineID = 0 ;
//<2F> <> ·<EFBFBD> <C2B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
int lineProperty = 0 ;
//<2F> <> <EFBFBD> ߸߶<DFB8>
double lineHeight = 1500.0 ;
//<2F> պϱ <D5BA> ־
int designLineCE = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD>
CSetSaveLineID dlg ;
if ( dlg . DoModal ( ) = = IDOK )
{
//<2F> <> ·<EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD>
strFlyLineName = dlg . m_strFlyLineName ;
//<2F> <> <EFBFBD> ߱<EFBFBD> <DFB1> <EFBFBD>
designLineID = dlg . m_designLineID ;
//<2F> <> ·<EFBFBD> <C2B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
lineProperty = dlg . m_lineProperty ;
//<2F> <> <EFBFBD> ߸߶<DFB8>
lineHeight = dlg . m_LineHgt ;
//<2F> պϱ <D5BA> ־
if ( dlg . m_bClosedLine = = 0 ) designLineCE + = 2 ;
}
else
{
//δ<> <CEB4> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѻ<EFBFBD> <D1BB> Ƶĺ<C6B5> <C4BA> ߵ ĺ<DFB5> <C4BA> <EFBFBD> <EFBFBD> ݣ<EFBFBD> add by jackwong 2018.08.01<EFBFBD> <EFBFBD>
memset ( m_pDesignLineStruct , 0 , sizeof ( PtStruct ) * m_lineMaxPointNum ) ; //<2F> <> ʼ <EFBFBD> <CABC> <EFBFBD> ½<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_designLinePointNum = 0 ;
ClearDrawingInLineDesign ( ) ;
return ;
}
CString strRouteFileDir = GetSoftwareCurrentDirectory ( ) + _T ( " \\ Route " ) ;
TCHAR s [ 10000 ] ;
s [ 0 ] = 0 ;
CFileDialog dlgSave ( FALSE , _T ( " .txt " ) , _T ( " *.txt " ) ) ;
dlgSave . m_ofn . lpstrTitle = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> 溽<EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> " ) ;
dlgSave . m_ofn . lpstrFile = s ;
dlgSave . m_ofn . nMaxFile = sizeof ( s ) / sizeof ( TCHAR ) ;
TCHAR filter [ 500 ] = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.txt)\0 *.txt \0 " ) ;
dlgSave . m_ofn . lpstrFilter = filter ;
dlgSave . m_ofn . Flags | = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_CREATEPROMPT ;
dlgSave . m_ofn . lpstrInitialDir = strRouteFileDir ;
if ( IDOK = = dlgSave . DoModal ( ) )
{
strFlyLineName = dlgSave . GetPathName ( ) ;
////д<> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
FILE * fp = fopen ( strFlyLineName , " w " ) ;
if ( fp = = NULL )
{
BCGPMessageBox ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ;
}
else
{
PtStruct pt ;
memset ( & pt , 0 , sizeof ( PtStruct ) ) ;
//ԭ<> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4>
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, %d, %02X, %02X \n " , designLineID , 0 , g_gcsLon , g_gcsLat , 0.0 , 0 , 0 , 3 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㼯<EFBFBD> <E3BCAF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
for ( int i = 0 ; i < m_designLinePointNum ; i + + )
{
pt = m_pDesignLineStruct [ i ] ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> ļ<EFBFBD>
if ( i < ( m_designLinePointNum - 1 ) )
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, %d, %02X, %02X \n " , designLineID , pt . nPt , pt . dX , pt . dY , lineHeight , pt . nV , pt . ch1 , 3 ) ;
}
else //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> ļ<EFBFBD>
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, %d, %02X, %02X \n " , designLineID , pt . nPt , pt . dX , pt . dY , lineHeight , pt . nV , designLineCE /*pt.ch1*/ , lineProperty ) ;
}
}
fclose ( fp ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> <C9B9> Ի<EFBFBD> <D4BB> <EFBFBD>
BCGPMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
}
}
memset ( m_pDesignLineStruct , 0 , sizeof ( PtStruct ) * m_lineMaxPointNum ) ; //<2F> <> ʼ <EFBFBD> <CABC> <EFBFBD> ½<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_designLinePointNum = 0 ;
ClearDrawingInLineDesign ( ) ;
int lineIndex = designLineID - 1 ;
if ( m_pHaveDrawLineFlag [ lineIndex ] )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( lineIndex ) ;
OnShowGivenLine ( strFlyLineName /*GetFlyLineName(designLineID)*/ ) ;
//OnShowGivenLine(GetFlyLineName(designLineID));
}
else
{
OnShowGivenLine ( strFlyLineName /*GetFlyLineName(designLineID)*/ ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ0
}
void CGISDlg : : OnClearpoint ( ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD>
{
//m_map.SetCursorMode(5);
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_bPtEdit = FALSE ; //<2F> ༭
m_bPtDel = FALSE ; //ɾ<> <C9BE>
m_bSetPointModel = FALSE ;
m_bLineDesign = TRUE ;
m_bLDSetPoint = FALSE ;
RemoveDesignLineData ( ) ;
}
void CGISDlg : : OnEditProper ( ) //<2F> <> <EFBFBD> <EFBFBD>
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/*m_map.SetCursorMode(5);
m_bSetPointModel = FALSE ;
m_bLineDesign = TRUE ;
m_bPtDel = FALSE ;
m_bPtEdit = TRUE ; */
}
void CGISDlg : : OnEditpoint ( ) //<2F> ༭
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//m_map.SetCursorMode(5);
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_bSetPointModel = FALSE ;
m_bLineDesign = TRUE ;
m_bPtDel = FALSE ;
m_bPtEdit = TRUE ;
}
int CGISDlg : : GetPtSel ( int x , int y ) //<2F> <> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> ѡ ȡ<D1A1> ĵ<EFBFBD> <C4B5> <EFBFBD>
{
int i = 0 ;
double px = 0 ;
double py = 0 ;
int dis = 10.0 ;
for ( i = 0 ; i < m_designLinePointNum ; i + + )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . ProjToPixel ( m_pDesignLineStruct [ i ] . dX , m_pDesignLineStruct [ i ] . dY , & px , & py ) ;
if ( fabs ( px - x ) < dis & & fabs ( py - y ) < dis )
{
return i ;
}
}
return - 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> by Wu 2023.09.14
int CGISDlg : : GetPtSel ( PtStruct * m_pLinePtStruct , int m_PointNum , int x , int y )
{
int i = 0 ;
double px = 0 ;
double py = 0 ;
int dis = 10.0 ;
for ( i = 0 ; i < m_PointNum ; i + + )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . ProjToPixel ( m_pLinePtStruct [ i ] . dX , m_pLinePtStruct [ i ] . dY , & px , & py ) ;
if ( fabs ( px - x ) < dis & & fabs ( py - y ) < dis )
{
return i ;
}
}
return - 1 ;
}
void CGISDlg : : OnDelpoint ( ) //ɾ<> <C9BE>
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//m_map.SetCursorMode(5);
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
m_bSetPointModel = FALSE ;
m_bLineDesign = TRUE ;
m_bPtDel = TRUE ;
m_bPtEdit = FALSE ;
m_bDesignFirstPoint = true ;
}
void CGISDlg : : DrawLineDesign ( )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> ı <EFBFBD> ע<EFBFBD> <D7A2> Ϣ
ClearDrawingInLineDesign ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶĺ<C6B5> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
DrawDesignLineData ( ) ;
}
// <20> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ༭<EFBFBD> <E0BCAD> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> ------by Wu 2023.09.14
void CGISDlg : : OnEditLine ( )
{
m_map . SetCursorMode ( mapWindow : : tkCursorMode : : cmNone ) ;
if ( m_lineSelectedID > 0 & & m_bSelectFeatureFlag ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> ʾ
{
m_bEditLine = true ;
ClearHighLightLine ( ) ;
}
m_bSelectFeatureFlag = false ;
}
//void CGISDlg::OnBindline1()
//{
// ::PostMessage(m_MsgHwnd,m_LineLoadMsgID,1,0); //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
//}
void CGISDlg : : OnBindline2 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 2 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,2,0);
}
void CGISDlg : : OnLoadMyline1 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 1 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,1,0);
}
void CGISDlg : : OnBindline3 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 3 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,3,0);
}
void CGISDlg : : OnBindline4 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 4
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 4 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,4,0);
}
void CGISDlg : : OnBindline5 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 5 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,5,0);
}
void CGISDlg : : OnBindline6 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 6
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 6 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnBindline7 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 7
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 7 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnBindline8 ( ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 8
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 8 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnBindline9 ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 9 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnBindline10 ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 10 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnLayermng ( ) //ͼ<> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_Layer - > ShowWindow ( SW_SHOW ) ;
}
void CGISDlg : : OnAddgtarget ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
//void CGISDlg::OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt)
//{
// // <20> ˹<EFBFBD> <CBB9> <EFBFBD> Ҫ<EFBFBD> <D2AA> Windows Vista <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ߰汾<DFB0> <E6B1BE>
// // _WIN32_WINNT <20> <> <EFBFBD> ű<EFBFBD> <C5B1> <EFBFBD> >= 0x0600<30> <30>
// // TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ĭ<EFBFBD> <C4AC> ֵ
//
// CBCGPDialog::OnMouseHWheel(nFlags, zDelta, pt);
//}
void CGISDlg : : SetRouteLine ( int iLine , PTLIST * pList )
{
CString sRouteDir = GetSoftwareCurrentDirectory ( ) ;
//2015.11.24
CString str ;
str . Format ( " %d " , iLine ) ;
CString m_sRoute = sRouteDir + _T ( " \\ route " ) + str + _T ( " .txt " ) ;
//2015.10.24 <09> <> <EFBFBD> Ӷ<EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD>
// if (!SearchDirectory(m_sRoute))
// {
// str = m_sRoute + "<22> <> <EFBFBD> ߲<EFBFBD> <DFB2> <EFBFBD> <EFBFBD> <EFBFBD> ";
// MessageBox(str, "<22> <> ͼ");
// }
//
// DrawLineDataStruct CXLineGroup;
// m_lineManage.ReadLineDataFromFile(CXLineGroup,m_sRoute);
// DrawLineDataStruct CXLineGroup;
// if (m_lineManage.ReadLineDataFromFile(CXLineGroup,m_sRoute))
// {
// int idNum = m_lineManage.line->GetCount();
// //int idNum = CXLineGroup.linePointNum;
// POSITION ps = m_lineManage.line->GetHeadPosition();
// for (int i = 0; i < idNum; i++)
// {
// PtStruct pt = m_lineManage.line->GetNext(ps);
// pList->AddTail(pt);
// }
//
//
// }
// else
// {
// MessageBox("<22> <> ·<EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ","<22> <> ͼ");
// pList->RemoveAll();
// }
}
//2016.02.19
// LRESULT CGISDlg::DRAW_ZK(WPARAM wParam, LPARAM lParam)
// {
// if (!m_bHaveAddMap)
// {
// return FALSE;
// }
// tagDRAWZK DrZk = m_DRAWZK;
//
// CString str="";
//
/ / str . Format ( " <EFBFBD> <EFBFBD> <EFBFBD> ߺ <EFBFBD> :%02d <09> <> <EFBFBD> ɾ<EFBFBD> :%d ƫ<> <C6AB> <EFBFBD> <EFBFBD> :%.2f <09> ߶ȸ<DFB6> <C8B8> <EFBFBD> :%.2f <09> ɻ<EFBFBD> <C9BB> <EFBFBD> <EFBFBD> <EFBFBD> :%.2f <09> <> <EFBFBD> <EFBFBD> :%.2f\n \
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :%02d <09> <> ƫ<EFBFBD> <C6AB> :%d <09> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :%.2f <09> <> <EFBFBD> ٸ<EFBFBD> <D9B8> <EFBFBD> :%.2f <09> ɻ<EFBFBD> <C9BB> <EFBFBD> λ:%.2f",
/ / DrZk . ID_Line , DrZk . Dis_DF , DrZk . Yaw_Offset , DrZk . Heg_GD , DrZk . Dis_Air , DrZk . Heg_GRD , \
// DrZk.ID_Pt, DrZk.Dis_Offset, DrZk.Yaw_GD, DrZk.AirSpeed_GD, DrZk.Azi_Air);
//
//
// //GetDlgItem( IDC_STATIC_MAPSHOW )->EnableWindow( TRUE );
// //GetDlgItem(IDC_STATIC_MAPSHOW)->SetWindowText(str);
//
// return 0;
// }
void CGISDlg : : OnNlinedesign ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_bLDSetPoint = TRUE ;
m_pLineDesign = new CLineDesign ( ) ;
m_pLineDesign - > Create ( IDD_DLG_LINEDESIGN , this ) ;
m_pLineDesign - > ShowWindow ( TRUE ) ;
if ( ! m_bHaveShowLineDesign )
{
m_bHaveShowLineDesign = true ;
//m_pLineDesign->ShowLonLat(0, 0);
m_pLineDesign - > ShowWindow ( SW_SHOW ) ;
}
else
{
m_bHaveShowLineDesign = false ;
m_pLineDesign - > ShowWindow ( SW_HIDE ) ;
}
}
void CGISDlg : : OnUpdateNlinedesign ( CCmdUI * pCmdUI )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> 洦<EFBFBD> <E6B4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
}
BOOL CGISDlg : : ReadLine ( int iLine , PTLIST * pList )
{
if ( pList = = NULL )
{
return FALSE ;
}
else
{
pList - > RemoveAll ( ) ;
}
if ( iLine < 1 | | iLine > 14 ) //2015.10.12
{
return FALSE ;
}
CString str ;
CString sLineName = GetFlyLineName ( iLine ) ;
if ( ! SearchDirectory ( sLineName ) )
{
str = sLineName + " <20> <> <EFBFBD> ߲<EFBFBD> <DFB2> <EFBFBD> <EFBFBD> <EFBFBD> " ;
MessageBox ( str , " <EFBFBD> <EFBFBD> ͼ" ) ;
return FALSE ;
}
CLineManage tpLine ;
if ( tpLine . OpenFlyLineFile ( sLineName , iLine , true ) )
{
int idNum = tpLine . line . GetCount ( ) ;
POSITION ps = tpLine . line . GetHeadPosition ( ) ;
for ( int i = 0 ; i < idNum ; i + + )
{
PtStruct pt = tpLine . line . GetNext ( ps ) ;
pList - > AddTail ( pt ) ;
}
return TRUE ;
}
else
{
MessageBox ( " <EFBFBD> <EFBFBD> ·<EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !" , " <EFBFBD> <EFBFBD> ͼ" ) ;
pList - > RemoveAll ( ) ;
return FALSE ;
}
}
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> պ<EFBFBD> <D5BA> ߣ<EFBFBD> 14<31> <34>
void CGISDlg : : OnShowBackLine ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( g_b981ADesktop | | g_b981APad )
{
SetFlyLineShowStatus ( 14 ) ;
}
if ( g_b981CDesktop )
{
SetFlyLineShowStatus ( 11 ) ;
}
}
void CGISDlg : : OnUpdateShowBackLine ( CCmdUI * pCmdUI )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> 洦<EFBFBD> <E6B4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( g_b981ADesktop | | g_b981APad )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 13 ] ) ;
}
if ( g_b981CDesktop )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 10 ] ) ;
}
}
void CGISDlg : : OnShowHs11 ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( g_b981ADesktop | | g_b981APad )
{
SetFlyLineShowStatus ( 11 ) ;
}
if ( g_b981CDesktop )
{
SetFlyLineShowStatus ( 7 ) ;
}
}
//Ӧ<> <D3A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 11
void CGISDlg : : OnUpdateShowHs11 ( CCmdUI * pCmdUI )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> 洦<EFBFBD> <E6B4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( g_b981ADesktop | | g_b981APad )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 10 ] ) ;
}
if ( g_b981CDesktop )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 6 ] ) ;
}
}
void CGISDlg : : OnBindHs11 ( )
{
m_struMapOut . cmd = MapCmd_BindLine ;
if ( g_b981ADesktop | | g_b981APad )
{
m_struMapOut . ID = 11 ;
}
if ( g_b981CDesktop )
{
m_struMapOut . ID = 7 ;
}
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> Χ <EFBFBD> <CEA7> 12
void CGISDlg : : OnShowTc12 ( )
{
if ( g_b981ADesktop | | g_b981APad )
{
SetFlyLineShowStatus ( 12 ) ;
}
if ( g_b981CDesktop )
{
SetFlyLineShowStatus ( 6 ) ;
}
}
void CGISDlg : : OnBindTc12 ( )
{
m_struMapOut . cmd = MapCmd_BindLine ;
if ( g_b981ADesktop | | g_b981APad )
{
m_struMapOut . ID = 12 ;
}
if ( g_b981CDesktop )
{
m_struMapOut . ID = 6 ;
}
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : OnUpdateShowTc12 ( CCmdUI * pCmdUI )
{
if ( g_b981ADesktop | | g_b981APad )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 11 ] ) ;
}
if ( g_b981CDesktop )
{
pCmdUI - > SetCheck ( m_pHaveDrawLineFlag [ 5 ] ) ;
}
}
void CGISDlg : : OnSize ( UINT nType , int cx , int cy )
{
CBCGPDialog : : OnSize ( nType , cx , cy ) ;
// TODO: <20> ڴ˴ <DAB4> <CBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_map . GetSafeHwnd ( ) )
{
CRect rc ;
GetClientRect ( & rc ) ;
rc . top + = 35 ;
m_map . MoveWindow ( rc ) ;
//RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST, 0);
}
}
void CGISDlg : : OnBindBackLine ( )
{
m_struMapOut . cmd = MapCmd_BindLine ;
if ( g_b981ADesktop | | g_b981APad )
{
m_struMapOut . ID = 14 ;
}
if ( g_b981CDesktop )
{
m_struMapOut . ID = 11 ;
}
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
void CGISDlg : : UpdateDataInfo ( int index , const char * key , double value )
{
switch ( index )
{
case 0 :
m_infoData . lineID = value ;
break ;
case 1 :
m_infoData . ptID = value ;
break ;
case 2 :
m_infoData . disDF = value ;
break ;
case 3 :
m_infoData . disCP = value ;
break ;
case 4 :
m_infoData . headingGD = value ;
break ;
case 5 :
m_infoData . anglePH = value ;
break ;
case 6 :
m_infoData . heightGD = value ;
break ;
case 7 :
m_infoData . heightPC = value ;
break ;
case 8 :
m_infoData . speedGD = value ;
break ;
case 9 :
m_infoData . heightCG = value ;
break ;
case 10 :
m_infoData . dis = value ;
break ;
case 11 :
m_infoData . heading = value ;
break ;
default :
break ;
}
DrawCanvas ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD>
void CGISDlg : : DrawCanvas ( )
{
COLORREF color = RGB ( 50 , 235 , 50 ) ;
//COLORREF colorback= RGB(0,0,0);//<2F> ڵ<EFBFBD>
CRect rec ;
m_map . GetClientRect ( & rec ) ;
const long leftEdge = rec . left ;
const long topEdge = rec . top + 20 ;
const int horizonInter = 11 ;
const int verticalInter = rec . Height ( ) / 19 ;
CLabels labesPtr ;
if ( m_canvasLayerID ! = - 1 )
{
labesPtr = m_map . GetDrawingLabels ( m_canvasLayerID ) ;
labesPtr . Clear ( ) ;
CString str = " " ;
str . Format ( _T ( " %-s%-d " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . lineID ) ;
labesPtr . AddLabel ( str , leftEdge + horizonInter , topEdge + verticalInter * 1 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-d " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . ptID ) ;
labesPtr . AddLabel ( str , leftEdge + horizonInter , topEdge + verticalInter * 2 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-d " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . disDF ) ;
labesPtr . AddLabel ( str , leftEdge + horizonInter , topEdge + verticalInter * 4 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> <EFBFBD> ƫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . disCP ) ;
labesPtr . AddLabel ( str , leftEdge + horizonInter , topEdge + verticalInter * 5 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . headingGD ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter /* - 11*/ , topEdge + verticalInter * 7 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " ƫ<EFBFBD> <EFBFBD> <EFBFBD> Ƕ<EFBFBD> : " ) , m_infoData . anglePH ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter /* - 11*/ , topEdge + verticalInter * 8 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> ߶<EFBFBD> ƫ<EFBFBD> <EFBFBD> :" ) , m_infoData . heightPC ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter , topEdge + verticalInter * 10 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> ߶ȸ<EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . heightGD ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter , topEdge + verticalInter * 11 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ٸ<EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . speedGD ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter , topEdge + verticalInter * 13 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> г <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . heightCG ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter , topEdge + verticalInter * 14 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> ɻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :" ) , m_infoData . dis ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter , topEdge + verticalInter * 16 , 0 , 0 ) ;
str . Format ( _T ( " %-s%-.1lf " ) , _T ( " <EFBFBD> ɻ<EFBFBD> <EFBFBD> <EFBFBD> λ:" ) , m_infoData . heading ) ;
labesPtr . AddLabel ( str , rec . left + horizonInter /*- 5*/ , topEdge + verticalInter * 17 , 0 , 0 ) ;
}
else
{
m_canvasLayerID = m_map . NewDrawing ( 0 ) ;
labesPtr = m_map . GetDrawingLabels ( m_canvasLayerID ) ;
CLabelCategory left = labesPtr . AddCategory ( _T ( " " ) ) ;
left . SetFontColor ( color ) ;
left . SetAlignment ( 2 ) ; //0<> <30> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> 1 <20> Ҷ<EFBFBD> <D2B6> 룬2<EBA3AC> <32> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
left . SetOffsetX ( 0 ) ;
left . SetOffsetY ( 0 ) ;
left . SetFontBold ( true ) ;
left . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
left . SetFontSize ( 13 ) ;
left . SetFrameBackColor ( RGB ( 0 , 0 , 0 ) ) ;
left . SetFrameVisible ( TRUE ) ;
left . SetFrameTransparency ( 0 ) ;
CLabelCategory right = labesPtr . AddCategory ( _T ( " " ) ) ;
right . SetFontColor ( color ) ;
right . SetAlignment ( 2 ) ; //0<> <30> <EFBFBD> ң<EFBFBD> 1 <20> <> <EFBFBD> У <EFBFBD> 2<EFBFBD> <32> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
right . SetOffsetX ( 0 ) ;
right . SetOffsetY ( 0 ) ;
right . SetFontBold ( true ) ;
right . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
right . SetFontSize ( 13 ) ;
right . SetFrameBackColor ( RGB ( 0 , 0 , 0 ) ) ;
right . SetFrameVisible ( TRUE ) ;
right . SetFrameTransparency ( 0 ) ;
}
//m_map.Redraw();
}
void CGISDlg : : SetLabelCategory ( const long & shapeID , int fontSize /*= 12*/ , unsigned long fontColor /*= RGB(255,0,0)*/ , unsigned long frameBackColor /*= RGB(0,0,0)*/ ,
double XOffset /* = 0*/ , double YOffset /*= 0*/ )
{
if ( shapeID = = - 1 )
return ;
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( shapeID ) ) . GetLabels ( ) ;
CLabelCategory labelCategory = labesPtr . AddCategory ( _T ( " " ) ) ;
labelCategory . SetFontColor ( fontColor ) ;
labelCategory . SetAlignment ( 1 ) ;
labelCategory . SetOffsetX ( XOffset ) ;
labelCategory . SetOffsetY ( YOffset ) ;
labelCategory . SetFontBold ( TRUE ) ;
labelCategory . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontSize ( fontSize ) ;
labelCategory . SetFrameBackColor ( frameBackColor ) ;
labelCategory . SetFrameVisible ( TRUE ) ;
}
void CGISDlg : : OnMove ( int x , int y )
{
CBCGPDialog : : OnMove ( x , y ) ;
// TODO: <20> ڴ˴ <DAB4> <CBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CRect rc ;
GetClientRect ( & rc ) ;
ClientToScreen ( & rc ) ;
/*if (m_pUavSelDlg1->GetSafeHwnd())
{
m_pUavSelDlg1 - > MoveWindow ( rc . left , rc . top + 10 , 50 , 50 ) ;
}
if ( m_pUavSelDlg2 - > GetSafeHwnd ( ) )
{
m_pUavSelDlg2 - > MoveWindow ( rc . left + rc . Width ( ) / 2 - 100 , rc . top + 10 , 50 , 50 ) ;
}
if ( m_pUavSelDlg3 - > GetSafeHwnd ( ) )
{
m_pUavSelDlg3 - > MoveWindow ( rc . left + rc . Width ( ) - 100 , rc . top + 10 , 50 , 50 ) ;
} */
}
BOOL CGISDlg : : OnWndMsg ( UINT message , WPARAM wParam , LPARAM lParam , LRESULT * pResult )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> ר<EFBFBD> ô<EFBFBD> <C3B4> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
return CBCGPDialog : : OnWndMsg ( message , wParam , lParam , pResult ) ;
}
//<2F> л<EFBFBD> <D0BB> ɻ<EFBFBD>
afx_msg LRESULT CGISDlg : : OnSelUav ( WPARAM wParam , LPARAM lParam )
{
return 0 ;
}
//<2F> <> <EFBFBD> ӵر<D3B5> <D8B1> <EFBFBD>
void CGISDlg : : OnAddTarget ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/*if (m_pTargetDlg->GetSafeHwnd())
{
ReadTargetIni ( false ) ;
m_pTargetDlg - > ShowWindow ( SW_SHOW ) ;
} */
m_dlgMarker . ShowWindow ( TRUE ) ;
}
void CGISDlg : : ReadTargetIni ( bool bDraw )
{
CString m_MapPath ; //Ĭ<> ϴ<CFB4> ͼ·<CDBC> <C2B7>
char lonBuf [ 255 ] ;
char latBuf [ 255 ] ;
CString fileName = GetSoftwareCurrentDirectory ( ) + " \\ target.ini " ;
CString strTarget ;
for ( int i = 1 ; i < 255 ; i + + )
{
if ( m_pTargetDlg )
{
m_pTargetDlg - > SetExistFlag ( i , false ) ;
}
strTarget . Format ( " %d " , i ) ;
BOOL blon = GetPrivateProfileString ( strTarget , " lon " , 0 , lonBuf , 20 , fileName ) ;
BOOL blat = GetPrivateProfileString ( strTarget , " lat " , 0 , latBuf , 20 , fileName ) ;
if ( blon & & blat )
{
double lon = atof ( lonBuf ) ;
double lat = atof ( latBuf ) ;
if ( fabs ( lon ) > 180.0 | | fabs ( lat ) > 90.0 ) //<2F> <> <EFBFBD> ݷǷ<DDB7> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
WritePrivateProfileString ( strTarget , " lon " , NULL , fileName ) ;
WritePrivateProfileString ( strTarget , " lat " , NULL , fileName ) ;
WritePrivateProfileString ( strTarget , " alt " , NULL , fileName ) ;
continue ;
}
m_targets [ i - 1 ] . id = i ;
m_targets [ i - 1 ] . lon = lon ;
m_targets [ i - 1 ] . lat = lat ;
if ( bDraw )
{
AddTargetPoint ( i , lon , lat ) ;
}
if ( m_pTargetDlg )
{
m_pTargetDlg - > SetExistFlag ( i , true ) ;
}
}
else
{
m_targets [ i - 1 ] . id = - 1 ;
}
}
}
afx_msg LRESULT CGISDlg : : OnDrawTarget ( WPARAM wParam , LPARAM lParam )
{
if ( m_pTargetDlg - > GetSafeHwnd ( ) )
{
int id = 0 ;
double lon = 0.0 ;
double lat = 0.0 ;
double alt = 0.0 ;
m_pTargetDlg - > GetTargetLLA ( id , lon , lat , alt ) ;
if ( id > 0 & & id < 255 )
{
m_targets [ id - 1 ] . id = id ;
m_targets [ id - 1 ] . lon = lon ;
m_targets [ id - 1 ] . lat = lat ;
}
AddTargetPoint ( id , lon , lat ) ;
}
return 0 ;
}
void CGISDlg : : OnShowWindow ( BOOL bShow , UINT nStatus )
{
CBCGPDialog : : OnShowWindow ( bShow , nStatus ) ;
// TODO: <20> ڴ˴ <DAB4> <CBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( bShow )
{
HCURSOR hCur = LoadCursor ( NULL , IDC_ARROW ) ;
: : SetCursor ( hCur ) ;
CString dir = " " ;
CString fileName = GetSoftwareCurrentDirectory ( ) + " \\ map.ini " ;
: : GetPrivateProfileString ( " map " , " layer " , " " , dir . GetBuffer ( 256 ) , 256 , fileName ) ;
dir . ReleaseBuffer ( 256 ) ;
if ( ! m_bHaveAddMap )
{
CFileFind fd ;
if ( fd . FindFile ( dir ) )
{
Openlocalfile ( dir ) ;
}
fd . Close ( ) ;
}
}
//ReadTargetIni(true);
}
//ɾ<> <C9BE> ѡ <EFBFBD> е <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> 㣨<EFBFBD> <E3A3A8> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> ȷ<EFBFBD> <C8B7> ͼ<EFBFBD> <CDBC> <EFBFBD> е ĵ㣬<C4B5> <E3A3AC> <EFBFBD> Բ<EFBFBD> <D4B2> <EFBFBD> ȫ<EFBFBD> <C8AB> ɾ<EFBFBD> <C9BE> <EFBFBD> ٻ<EFBFBD> <D9BB> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnTargetDelete ( )
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
CString strID = " " ;
strID . Format ( " %d " , m_targetSelID ) ;
CString fileName = GetSoftwareCurrentDirectory ( ) + " \\ target.ini " ;
WritePrivateProfileString ( strID , " lon " , NULL , fileName ) ;
WritePrivateProfileString ( strID , " lat " , NULL , fileName ) ;
WritePrivateProfileString ( strID , " alt " , NULL , fileName ) ;
m_map . GetShapefile ( m_targetDrawLayerID ) . EditClear ( ) ;
m_map . GetShapefile ( m_targetDrawLayerID ) . GetLabels ( ) . Clear ( ) ;
ReadTargetIni ( true ) ;
m_map . Redraw ( ) ;
m_targetSelID = 0 ;
}
//<2F> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> ѡ <EFBFBD> <D1A1>
afx_msg LRESULT CGISDlg : : OnSendSelectTarget ( WPARAM wParam , LPARAM lParam )
{
m_bSelectDropPoint = true ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ
m_map . SetCursorMode ( 3 ) ;
return 0 ;
}
//<2F> <> ʾ <EFBFBD> <CABE> ע<EFBFBD> <D7A2>
afx_msg LRESULT CGISDlg : : OnShowPointInMap ( WPARAM wParam , LPARAM lParam )
{
if ( ! m_bHaveAddMap )
{
return 0 ;
}
if ( 0 = = m_longGroundID )
{
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_longGroundID , m_dlgLightRegion . m_dGroundLon , m_dlgLightRegion . m_dGroundLat , _T ( " GCS(LOS) " ) , _T ( " <EFBFBD> <EFBFBD> ɫ" ) , RGB ( 255 , 0 , 0 ) ) ;
}
else
{
ClearPointShape ( m_longGroundID ) ;
m_longGroundID = 0 ;
}
return 0 ;
}
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowPointVisible ( WPARAM wParam , LPARAM lParam )
{
if ( m_visbleCircleLayerID < 0 )
{
m_gisManager - > CreateEmptyAreaShapfile ( m_visbleCircleLayerID , RGB ( 0 , 255 , 0 ) , RGB ( 0 , 255 , 0 ) , 40 ) ; //<2F> <> ɫ
}
for ( int i = 0 ; i < 360 ; i + + )
{
m_gisManager - > AddOnePoint2Shapfile ( m_visbleCircleLayerID , 2 , g_structPointVisible [ i ] . lon , g_structPointVisible [ i ] . lat ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( 0 = = m_map . GetShapefile ( m_visbleCircleLayerID ) . GetShape ( 0 ) . GetArea ( ) )
{
m_map . GetShapefile ( m_visbleCircleLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
/*structPoint *_structPoint = (structPoint*)wParam;
m_gisManager - > AddOnePoint2Shapfile ( m_visbleCircleLayerID , 2 , _structPoint - > lon , _structPoint - > lat ) ; */
return 0 ;
}
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowPointNotVisible ( WPARAM wParam , LPARAM lParam )
{
if ( m_notVisibleCircleLayerID < 0 )
{
m_gisManager - > CreateEmptyAreaShapfile ( m_notVisibleCircleLayerID , RGB ( 255 , 0 , 0 ) , RGB ( 255 , 0 , 0 ) , 40 ) ; //<2F> <> ɫ
}
for ( int i = 0 ; i < 722 ; i + + )
{
m_gisManager - > AddOnePoint2Shapfile ( m_notVisibleCircleLayerID , 2 , g_structPointNotVisible [ i ] . lon , g_structPointNotVisible [ i ] . lat ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( 0 = = m_map . GetShapefile ( m_notVisibleCircleLayerID ) . GetShape ( 0 ) . GetArea ( ) )
{
m_map . GetShapefile ( m_notVisibleCircleLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
/*structPoint *_structPoint = (structPoint*)wParam;
m_gisManager - > AddOnePoint2Shapfile ( m_notVisibleCircleLayerID , 2 , _structPoint - > lon , _structPoint - > lat ) ; */
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 벻<EFBFBD> <EBB2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
afx_msg LRESULT CGISDlg : : OnSendClearShape ( WPARAM wParam , LPARAM lParam )
{
if ( m_visbleCircleLayerID > 0 )
{
m_map . GetShapefile ( m_visbleCircleLayerID ) . EditClear ( ) ;
}
if ( m_notVisibleCircleLayerID > 0 )
{
m_map . GetShapefile ( m_notVisibleCircleLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
return 0 ;
}
//ʵʱ<CAB5> <CAB1> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowAreaVisible ( WPARAM wParam , LPARAM lParam )
{
if ( m_visiRealCircleLayerID < 0 )
{
m_gisManager - > CreateEmptyAreaShapfile ( m_visiRealCircleLayerID , RGB ( 0 , 255 , 0 ) , RGB ( 0 , 255 , 0 ) , 40 ) ; //<2F> <> ɫ
}
for ( int i = 0 ; i < = int ( wParam ) ; i + + )
{
m_gisManager - > AddOnePoint2Shapfile ( m_visiRealCircleLayerID , 2 , g_structPointVisiReal [ i ] . lon , g_structPointVisiReal [ i ] . lat ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( 0 = = m_map . GetShapefile ( m_visiRealCircleLayerID ) . GetShape ( 0 ) . GetArea ( ) )
{
m_map . GetShapefile ( m_visiRealCircleLayerID ) . EditClear ( ) ;
}
/*double _uavlon,_uavlat;
CalculatePtCoordinate ( _uavlon , _uavlat , m_dlgLightRegion . m_dRealTime_GCSlon , m_dlgLightRegion . m_dRealTime_GCSlat , m_dlgLightRegion . m_dRealTime_AngToGCS , m_dlgLightRegion . m_dRealTime_DisToGCS , 3 ) ;
if ( m_RealCircleLayerID < 0 )
{
m_gisManager - > CreateEmptyAreaShapfile ( m_RealCircleLayerID , RGB ( 0 , 0 , 255 ) , RGB ( 0 , 0 , 255 ) , 40 ) ;
}
double ptLon , ptLat ;
for ( int i = 0 ; i < = 360 ; i + + )
{
CalculatePtCoordinate ( ptLon , ptLat , _uavlon , _uavlat , i , 2800 , 3 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_RealCircleLayerID , 2 , ptLon , ptLat ) ;
} */
m_map . Redraw ( ) ;
return 0 ;
}
//ʵʱ<CAB5> <CAB1> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowAreaNotVisible ( WPARAM wParam , LPARAM lParam )
{
if ( m_notVisiRealCircleLayerID < 0 )
{
m_gisManager - > CreateEmptyAreaShapfile ( m_notVisiRealCircleLayerID , RGB ( 255 , 0 , 0 ) , RGB ( 255 , 0 , 0 ) , 40 ) ; //<2F> <> ɫ
}
for ( int i = 0 ; i < = int ( wParam ) ; i + + )
{
m_gisManager - > AddOnePoint2Shapfile ( m_notVisiRealCircleLayerID , 2 , g_structPointNotVisiReal [ i ] . lon , g_structPointNotVisiReal [ i ] . lat ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( 0 = = m_map . GetShapefile ( m_notVisiRealCircleLayerID ) . GetShape ( 0 ) . GetArea ( ) )
{
m_map . GetShapefile ( m_notVisiRealCircleLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> ʵʱ<CAB5> <CAB1> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowClearArea ( WPARAM wParam , LPARAM lParam )
{
if ( m_visiRealCircleLayerID > 0 )
{
m_map . GetShapefile ( m_visiRealCircleLayerID ) . EditClear ( ) ;
}
if ( m_notVisiRealCircleLayerID > 0 )
{
m_map . GetShapefile ( m_notVisiRealCircleLayerID ) . EditClear ( ) ;
}
/*if (m_RealCircleLayerID > 0)
{
m_map . GetShapefile ( m_RealCircleLayerID ) . EditClear ( ) ;
} */
m_map . Redraw ( ) ;
return 0 ;
}
//ɾ<> <C9BE> ͨ<EFBFBD> ӵȸ<D3B5> <C8B8> <EFBFBD> ͼ<EFBFBD> <CDBC>
afx_msg LRESULT CGISDlg : : OnDelLineLayer ( WPARAM wParam , LPARAM lParam )
{
for ( int i = 0 ; i < 20 ; i + + )
{
if ( m_longContourLineID [ i ] > 0 )
{
m_map . GetShapefile ( m_longContourLineID [ i ] ) . EditClear ( ) ;
}
m_gisManager - > CreateEmptyLineShapfile ( m_longContourLineID [ i ] , RGB ( 0 , 255 , 0 ) , 1.5 ) ; //<2F> <> ɫ
if ( m_longContourTextID [ i ] ! = 0 )
{
ClearPointShape ( m_longContourTextID [ i ] ) ;
m_longContourTextID [ i ] = 0 ;
}
}
m_map . Redraw ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ӵ㵽ͨ<E3B5BD> ӵȸ<D3B5> <C8B8> <EFBFBD> ͼ<EFBFBD> <CDBC>
afx_msg LRESULT CGISDlg : : OnAddLineLayer ( WPARAM wParam , LPARAM lParam )
{
structPoint * _structPoint = ( structPoint * ) wParam ;
m_gisManager - > AddOnePoint2Shapfile ( m_longContourLineID [ ( int ) lParam ] , 1 , _structPoint - > lon , _structPoint - > lat ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ߶<EFBFBD>
if ( m_longContourTextID [ ( int ) lParam ] = = 0 )
{
//<2F> <> ע
CString str ;
str . Format ( _T ( " %dm " ) , ( int ) lParam * 500 ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_longContourTextID [ ( int ) lParam ] , 0 , RGB ( 255 , 0 , 0 ) ) ; //<2F> <> ɫ
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( m_longContourTextID [ ( int ) lParam ] ) ) . GetLabels ( ) ;
CLabelCategory labelCategory = labesPtr . AddCategory ( _T ( " <EFBFBD> <EFBFBD> ɫ" ) ) ;
labelCategory . SetFontColor ( RGB ( 255 , 0 , 0 ) ) ;
labelCategory . SetAlignment ( 1 ) ;
labelCategory . SetFontBold ( TRUE ) ;
labelCategory . SetFontName ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontSize ( 11 ) ;
labesPtr . AddLabel ( str , _structPoint - > lon , _structPoint - > lat + 0.0005 , 0 , 0 ) ;
}
m_map . Redraw ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> GIS<49> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <CFA2> Ӧ<EFBFBD> <D3A6> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnSendRegionToGis ( WPARAM wParam , LPARAM lParam )
{
if ( 1 = = ( int ) wParam )
{
g_bSelectDropPoint = true ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ
m_map . SetCursorMode ( 3 ) ;
}
else if ( 2 = = ( int ) wParam )
{
if ( m_longSelectLineID > 0 )
{
m_map . GetShapefile ( m_longSelectLineID ) . EditClear ( ) ;
}
if ( m_longLabelPlotID ! = 0 )
{
ClearPointShape ( m_longLabelPlotID ) ;
m_longLabelPlotID = 0 ;
}
m_map . Redraw ( ) ;
}
else if ( 3 = = ( int ) wParam )
{
structPoint * _structPoint = ( structPoint * ) lParam ;
if ( m_longSelectLineID > 0 )
{
m_map . GetShapefile ( m_longSelectLineID ) . EditClear ( ) ;
}
m_gisManager - > CreateEmptyLineShapfile ( m_longSelectLineID , RGB ( 0 , 255 , 0 ) , 2 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_longSelectLineID , 1 , m_dlgLightRegion . m_dGroundLon , m_dlgLightRegion . m_dGroundLat ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_longSelectLineID , 1 , _structPoint - > lon , _structPoint - > lat ) ;
double _distance = 0.0 , _angle = 0.0 ;
CalculateTwoPtsDistanceAzimuth ( _distance , _angle , m_dlgLightRegion . m_dGroundLon , m_dlgLightRegion . m_dGroundLat , _structPoint - > lon , _structPoint - > lat , 3 ) ;
CString str ;
str . Format ( _T ( " D:%.1fkm A:%.1f<EFBFBD> <EFBFBD> " ) , _distance / 1000 , _angle ) ;
if ( m_longLabelPlotID ! = 0 )
{
ClearPointShape ( m_longLabelPlotID ) ;
m_longLabelPlotID = 0 ;
}
//<2F> <> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ
AddPointShapeLayer ( m_longLabelPlotID , _structPoint - > lon , _structPoint - > lat , str , _T ( " <EFBFBD> <EFBFBD> ɫ" ) , RGB ( 255 , 0 , 0 ) ) ;
}
return 0 ;
}
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD> <EFBFBD> ϵĵ<CFB5>
afx_msg LRESULT CGISDlg : : OnDrawLinePoint ( WPARAM wParam , LPARAM lParam )
{
if ( m_longLinePointID > 0 )
{
ClearPointShape ( m_longLinePointID ) ;
m_longLinePointID = 0 ;
}
if ( 1 = = ( int ) lParam )
{
structPoint * _structPoint = ( structPoint * ) wParam ;
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( m_longLinePointID , _structPoint - > lon , _structPoint - > lat , _T ( " Pt " ) , _T ( " <EFBFBD> <EFBFBD> ɫ" ) , RGB ( 255 , 0 , 0 ) ) ;
}
return 0 ;
}
//<2F> <> ʾ ʵʱ<CAB5> <CAB1> ײ<EFBFBD> <D7B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnShowCrashArea ( WPARAM wParam , LPARAM lParam )
{
if ( 1 = = ( int ) wParam )
{
if ( m_crashAreaLayerID > 0 )
{
m_map . GetShapefile ( m_crashAreaLayerID ) . EditClear ( ) ;
}
m_gisManager - > CreateEmptyAreaShapfile ( m_crashAreaLayerID , RGB ( 0 , 255 , 0 ) , RGB ( 0 , 255 , 0 ) , 40 ) ; //<2F> <> ɫ
for ( int i = 0 ; i < 360 ; i + + )
{
m_gisManager - > AddOnePoint2Shapfile ( m_crashAreaLayerID , 2 , g_structPointCrashReal [ i ] . lon , g_structPointCrashReal [ i ] . lat ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
if ( 0 = = m_map . GetShapefile ( m_crashAreaLayerID ) . GetShape ( 0 ) . GetArea ( ) )
{
m_map . GetShapefile ( m_crashAreaLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
}
else if ( 0 = = ( int ) wParam )
{
if ( m_crashAreaLayerID > 0 )
{
m_map . GetShapefile ( m_crashAreaLayerID ) . EditClear ( ) ;
}
m_map . Redraw ( ) ;
}
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÷<EFBFBD> Χ
afx_msg LRESULT CGISDlg : : OnSendDrawFight ( WPARAM wParam , LPARAM lParam )
{
if ( m_fightRegionLayerID > 0 )
{
m_map . GetShapefile ( m_fightRegionLayerID ) . EditClear ( ) ;
m_map . Redraw ( ) ;
}
if ( 0 = = ( int ) lParam )
{
return 0 ;
}
m_gisManager - > CreateEmptyAreaShapfile ( m_fightRegionLayerID , RGB ( 0 , 255 , 0 ) , RGB ( 0 , 255 , 0 ) , 20 ) ;
structPoint * _structPoint = ( structPoint * ) wParam ;
double ptLon , ptLat ;
for ( int i = 0 ; i < = 360 ; i + + )
{
CalculatePtCoordinate ( ptLon , ptLat , _structPoint - > lon , _structPoint - > lat , i , ( int ) lParam , 3 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_fightRegionLayerID , 2 , ptLon , ptLat ) ;
}
m_map . Redraw ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> Ƹ߳<C6B8> <DFB3> <EFBFBD> <EFBFBD> <EFBFBD>
afx_msg LRESULT CGISDlg : : OnSendDrawDemRegion ( WPARAM wParam , LPARAM lParam )
{
if ( m_DemRegionLayerID [ ( int ) lParam ] > 0 )
{
m_map . GetShapefile ( m_DemRegionLayerID [ ( int ) lParam ] ) . EditClear ( ) ;
m_DemRegionLayerID [ ( int ) lParam ] = - 1 ;
m_map . Redraw ( ) ;
}
else
{
m_gisManager - > CreateEmptyAreaShapfile ( m_DemRegionLayerID [ ( int ) lParam ] , RGB ( 0 , 0 , 255 ) , RGB ( 0 , 0 , 255 ) , 20 ) ;
structPoint * _structPoint = ( structPoint * ) wParam ;
m_gisManager - > AddOnePoint2Shapfile ( m_DemRegionLayerID [ ( int ) lParam ] , 2 , _structPoint - > lon , _structPoint - > lat ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_DemRegionLayerID [ ( int ) lParam ] , 2 , _structPoint - > lon + 1 , _structPoint - > lat ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_DemRegionLayerID [ ( int ) lParam ] , 2 , _structPoint - > lon + 1 , _structPoint - > lat + 1 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_DemRegionLayerID [ ( int ) lParam ] , 2 , _structPoint - > lon , _structPoint - > lat + 1 ) ;
m_gisManager - > AddOnePoint2Shapfile ( m_DemRegionLayerID [ ( int ) lParam ] , 2 , _structPoint - > lon , _structPoint - > lat ) ;
m_map . Redraw ( ) ;
}
return 0 ;
}
//<2F> <> <EFBFBD> ߵ <EFBFBD> ͼ<EFBFBD> <CDBC> λ
afx_msg LRESULT CGISDlg : : OnZoomToLocation ( WPARAM wParam , LPARAM lParam )
{
//double lon = (double)wParam/1000000;
//double lat = (double)lParam/1000000;
double * lon = ( double * ) wParam ;
double * lat = ( double * ) lParam ;
ZoomToLocation ( * lon , * lat ) ;
return 0 ;
}
// <20> Ҽ<EFBFBD> <D2BC> ˵<EFBFBD> -<2D> ̷߳<DFB3> <CCB7> <EFBFBD> -<2D> ̷߳<DFB3> <CCB7> <EFBFBD>
void CGISDlg : : OnMenuLightRegion ( )
{
/*if (m_dlgLightRegion.GetSafeHwnd())
{
m_dlgLightRegion . ShowWindow ( TRUE ) ;
} */
if ( ! m_bHaveAddMap ) {
AfxMessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ȼ<EFBFBD> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <EFBFBD> " ) ) ;
return ;
}
g_bDemAnalysising = true ;
g_iDemPointNum = 0 ;
}
//<2F> رո ̷߳<DFB3> <CCB7> <EFBFBD> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> ʱ
afx_msg LRESULT CGISDlg : : OnSendCloseDemAlt ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ̷߳<DFB3> <CCB7> <EFBFBD> ͼ<EFBFBD> <CDBC>
for ( int i = 0 ; i < g_iDemAltPtNum ; i + + )
{
m_map . RemoveLayer ( g_lDemAltLayerID [ i ] ) ;
if ( g_lDemAltDisLayerID [ i ] > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( g_lDemAltDisLayerID [ i ] ) ;
g_lDemAltDisLayerID [ i ] = - 1 ;
}
if ( g_lDemPtNumLayerID [ i ] > 0 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<EFBFBD> ʸ<EFBFBD> <CAB8> ͼ<EFBFBD> <CDBC>
ClearPointShape ( g_lDemPtNumLayerID [ i ] ) ;
g_lDemPtNumLayerID [ i ] = - 1 ;
}
}
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnMenuEntryPoint ( )
{
m_struMapOut . cmd = MapCmd_EntryPoint ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ߳<EFBFBD> <DFB3> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : OnMenuPlotdemArea ( )
{
if ( m_dlgLightRegion . GetSafeHwnd ( ) )
{
m_dlgLightRegion . OnBnClickedButtonGetDemRegion ( ) ;
}
m_bPlotDemArea = ! m_bPlotDemArea ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> ı <EFBFBD> CursorMode
afx_msg LRESULT CGISDlg : : OnSetMapCursorMode ( WPARAM wParam , LPARAM lParam )
{
m_map . SetCursorMode ( ( long ) wParam ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ر<EFBFBD> <D8B1> ǵ<EFBFBD>
afx_msg LRESULT CGISDlg : : OnDrawMarker ( WPARAM wParam , LPARAM lParam )
{
if ( int ( lParam ) = = 1 ) //<2F> <> <EFBFBD> ر<EFBFBD> <D8B1> ǵ<EFBFBD>
{
if ( g_lMarkerLayerID [ ( int ) wParam ] > = 0 )
{
ClearPointShape ( g_lMarkerLayerID [ ( int ) wParam ] ) ;
g_lMarkerLayerID [ ( int ) wParam ] = - 1 ;
}
g_bMarkerPlot [ ( int ) wParam ] = false ;
}
else //<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> ǵ<EFBFBD>
{
if ( g_lMarkerLayerID [ ( int ) wParam ] > = 0 )
{
ClearPointShape ( g_lMarkerLayerID [ ( int ) wParam ] ) ;
g_lMarkerLayerID [ ( int ) wParam ] = - 1 ;
}
//<2F> <> <EFBFBD> ڵ<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ע
AddPointShapeLayer ( g_lMarkerLayerID [ ( int ) wParam ] , g_iMarkerLon [ ( int ) wParam ] , g_iMarkerLat [ ( int ) wParam ] , g_iMarkerName [ ( int ) wParam ] , _T ( " " ) , RGB ( 255 , 0 , 0 ) ) ;
g_bMarkerPlot [ ( int ) wParam ] = true ;
}
return 0 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> վ<EFBFBD> <D5BE> <EFBFBD> <EFBFBD>
void CGISDlg : : OnMenuClearGCS ( )
{
if ( m_gcsPtShpLayerID ! = - 1 )
{
ClearPointShape ( m_gcsPtShpLayerID ) ;
m_gcsPtShpLayerID = - 1 ;
}
}
//<2F> Ƿ<EFBFBD> <C7B7> <EFBFBD> ʾ ADS<44> ɻ<EFBFBD> <C9BB> <EFBFBD> Ϣ
void CGISDlg : : OnMenuADSB ( )
{
m_bEnableShowADSB = ! m_bEnableShowADSB ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD>
LRESULT CGISDlg : : OnTimerDrawUAV ( WPARAM wParam , LPARAM lParam )
{
//δ<> <CEB4> <EFBFBD> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return 0 ;
}
if ( ! m_bEnableShowADSB )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ADS<44> ɻ<EFBFBD> <C9BB> ı <EFBFBD> <C4B1> <EFBFBD> ͼ<EFBFBD> <CDBC>
for ( int i = 0 ; i < MAX_PLANE_NUM_ADS ; i + + )
{
if ( m_UAVFlyTrackLayerID_ADS [ i ] ! = - 1 )
{
//m_map.ClearLabels(m_UAVFlyTrackLayerID_ADS[i]);
//m_map.ClearDrawing(m_UAVFlyTrackLayerID_ADS[i]);
m_map . RemoveLayer ( m_UAVFlyTrackLayerID_ADS [ i ] ) ;
m_UAVFlyTrackLayerID_ADS [ i ] = - 1 ;
}
}
return 0 ;
}
if ( m_iTotalADSnum < = 0 )
{
return 0 ;
}
if ( m_iCurrentADSid < ( m_iTotalADSnum - 1 ) )
{
m_iCurrentADSid + + ;
}
else
{
m_iCurrentADSid = 0 ;
}
static int _ADSidRecord = 0 ;
_ADSidRecord = m_iCurrentADSid ;
//whileѭ<65> <D1AD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> ij<EFBFBD> <C4B3> ADS<44> ɻ<EFBFBD> <C9BB> <EFBFBD> <EFBFBD> <EFBFBD> ״̬ΪҪ<CEAA> <D2AA> <EFBFBD> 棬<EFBFBD> <E6A3AC> <EFBFBD> <EFBFBD> ѭ<EFBFBD> <D1AD>
while ( m_bWithin100km_ADS [ m_iCurrentADSid ] = = false )
{
//<2F> <> <EFBFBD> <EFBFBD> ADS<44> ɻ<EFBFBD> <C9BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] ! = - 1 )
{
//m_map.ClearLabels(m_UAVFlyTrackLayerID_ADS[i]);
//m_map.ClearDrawing(m_UAVFlyTrackLayerID_ADS[i]);
m_map . RemoveLayer ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] ) ;
m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] = - 1 ;
}
TRACE ( " Remove: %d/%d \n " , m_iCurrentADSid , _ADSidRecord ) ;
if ( m_iCurrentADSid < ( m_iTotalADSnum - 1 ) )
{
m_iCurrentADSid + + ;
}
else
{
m_iCurrentADSid = 0 ;
}
//<2F> <> <EFBFBD> ٴ<EFBFBD> ѭ<EFBFBD> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѭ<EFBFBD> <D1AD>
if ( m_iCurrentADSid = = _ADSidRecord )
{
TRACE ( " return " ) ;
return 0 ;
}
}
TRACE ( " ID: %d/%d \n " , m_iCurrentADSid , m_iTotalADSnum ) ;
if ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] ! = - 1 ) //<2F> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD>
{
//m_map.ClearLabels(m_UAVFlyTrackLayerID_ADS[i]);
//m_map.ClearDrawing(m_UAVFlyTrackLayerID_ADS[i]);
m_map . RemoveLayer ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] ) ;
m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] = - 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
CreateEmptyShapfile ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] , 2 , RGB ( 0 , 255 , 0 ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˻<EFBFBD> <CBBB> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> ĵ<EFBFBD> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
CalculateUAVPolygonCoordinate_ADS ( m_dLon_ADS [ m_iCurrentADSid ] , m_dLat_ADS [ m_iCurrentADSid ] , m_dYaw_ADS [ m_iCurrentADSid ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> ˻<EFBFBD> shp
for ( int i = 0 ; i < m_ptNum ; i + + )
{
AddOnePoint2Shapfile ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] , 2 , m_ppUavPtArray_ADS [ i ] [ 0 ] , m_ppUavPtArray_ADS [ i ] [ 1 ] ) ;
}
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = ( m_map . GetShapefile ( m_UAVFlyTrackLayerID_ADS [ m_iCurrentADSid ] ) ) . GetLabels ( ) ;
//<2F> <> <EFBFBD> ñ<EFBFBD> ע̫<D7A2> <CCAB> ʱ<EFBFBD> Ƿ<EFBFBD> <C7B7> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <EFBFBD>
labesPtr . SetAvoidCollisions ( FALSE ) ;
CLabelCategory labelCategory = labesPtr . AddCategory ( m_strColor_ADS [ m_iCurrentADSid ] ) ;
labelCategory . SetFontColor ( m_fontColor_ADS [ m_iCurrentADSid ] ) ;
labelCategory . SetAlignment ( 1 ) ;
//labelCategory.SetFontBold(TRUE);
labelCategory . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> ź<EFBFBD> " ) ) ;
labelCategory . SetFontSize ( 8 ) ;
//<2F> <> <EFBFBD> <EFBFBD> Labels
labesPtr . AddLabel ( ( LPCTSTR ) m_strPlaneName_ADS [ m_iCurrentADSid ] , m_dLon_ADS [ m_iCurrentADSid ] , m_dLat_ADS [ m_iCurrentADSid ] , 0 , 0 ) ;
//<2F> ػ<EFBFBD>
m_map . Redraw ( ) ;
}
/*************************************by wu 2023.10.10**********************************************/
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ע<EFBFBD> <D7A2> Ͷ<EFBFBD> <CDB6>
LRESULT CGISDlg : : OnDrawKTPoint ( WPARAM wParam , LPARAM lParam )
{
//û<> м<EFBFBD> <D0BC> ص<EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( ! m_bHaveAddMap )
{
return 0 ;
}
double * lon = ( double * ) wParam ;
double * lat = ( double * ) lParam ;
CString strLon , strLat ;
strLon . Format ( _T ( " %.7f " ) , * lon ) ;
strLat . Format ( _T ( " %.7f " ) , * lat ) ;
AddPointShapeLayer ( m_KTPtShpLayerID , * lon , * lat , ( strLon + " , " + strLat ) , _T ( " " ) , RGB ( 255 , 0 , 0 ) ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͷ<EFBFBD> <CDB6>
LRESULT CGISDlg : : OnClearKTPoint ( WPARAM wParam , LPARAM lParam )
{
ClearPointShape ( m_KTPtShpLayerID ) ;
m_KTPtShpLayerID = - 1 ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ <EFBFBD> <CABE> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnShowKTLine ( WPARAM wParam , LPARAM lParam )
{
CString path = ( char * ) wParam ;
OnShowGivenLine ( path ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ʾ /<2F> رտ<D8B1> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnShowKTLine6 ( WPARAM wParam , LPARAM lParam )
{
OnShowLine6 ( ) ;
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnBindKTLine ( WPARAM wParam , LPARAM lParam ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 6 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,2,0);
return 0 ;
}
//<2F> <> <EFBFBD> ܣ<EFBFBD> װ<EFBFBD> <D7B0> Ӧ<EFBFBD> <D3A6> <EFBFBD> <EFBFBD>
LRESULT CGISDlg : : OnBindEPPoint ( WPARAM wParam , LPARAM lParam ) //<2F> <> <EFBFBD> <EFBFBD> <CDB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> װ<EFBFBD> <D7B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2
{
// TODO: <20> ڴ<EFBFBD> <DAB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EEB4A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_struMapOut . cmd = MapCmd_BindLine ;
m_struMapOut . ID = 15 ;
: : SendMessage ( GetParent ( ) - > GetSafeHwnd ( ) , MESSAGE_B8MAP , ( int ) ( & m_struMapOut ) , 0 ) ;
//::PostMessage(m_MsgHwnd,m_LineLoadMsgID,2,0);
return 0 ;
}
/* <20> <> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> ȡ<EFBFBD> з<EFBFBD> <D0B7> յĵ<D5B5> <C4B5> ε<EFBFBD>
* <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> alt [ in ] <EFBFBD> ߶ <EFBFBD> <EFBFBD> <EFBFBD> ֵ
* vec_alt [ out ] <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֵ <EFBFBD> ĸ ߶ <EFBFBD> ֵ
vec_lon [ out ] <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
vec_lat [ out ] γ <EFBFBD> <EFBFBD>
*/
void CGISDlg : : GetDangerousTerrainPoints ( double pts [ ] [ 2 ] , int pointNum , long alt , vector < double > & vec_alt , vector < double > & vec_lon , vector < double > & vec_lat )
{
//<2F> <> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> դ<EFBFBD> <D5A4> <EFBFBD> <EFBFBD>
mapWindow : : IGridHeaderPtr gridHeaderPtr = m_mapElevation . m_grid - > GetHeader ( ) ;
int n_gridrow = gridHeaderPtr - > NumberRows ;
int n_gridcol = gridHeaderPtr - > NumberCols ;
//<2F> <> <EFBFBD> <EFBFBD> γ <EFBFBD> <CEB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> Ϊդ<CEAA> <D5A4> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD>
vector < int > pts_row , pts_col ;
TransformToXY ( pts , pointNum , pts_row , pts_col ) ;
//<2F> <> դ<EFBFBD> <D5A4> <EFBFBD> <EFBFBD>
VectorToRaster vectorToRaster ;
set < vector < int > > resultSet = vectorToRaster . GetRasterLineEx ( pts_row , pts_col , n_gridrow - 1 , n_gridcol - 1 , 1 ) ;
double lat , lon ;
//<2F> <> ȡΣ<C8A1> յ<EFBFBD>
for ( auto it = resultSet . begin ( ) ; it ! = resultSet . end ( ) ; it + + )
{
vector < int > pt = * it ;
int altValue = m_mapElevation . m_grid - > GetValue ( pt . at ( 1 ) , pt . at ( 0 ) ) ;
if ( altValue > = alt ) //Σ<> յ㱣<D5B5> <E3B1A3>
{
vec_alt . push_back ( altValue ) ;
//ת<> <D7AA> Ϊ<EFBFBD> <CEAA> γ <EFBFBD> <CEB3>
m_mapElevation . m_grid - > CellToProj ( pt . at ( 1 ) , pt . at ( 0 ) , & lon , & lat ) ;
vec_lon . push_back ( lon ) ;
vec_lat . push_back ( lat ) ;
//int i = 0;
}
}
}
//<2F> <> <EFBFBD> <EFBFBD> Σ<EFBFBD> յ<EFBFBD> <D5B5> ε<EFBFBD>
int CGISDlg : : DrawDangerousTerrainPoints ( double pts [ ] [ 2 ] , int pointNum , long alt )
{
/*
double lon [ ] = { 119.711715 , 119.738307 , 119.738553 , 119.711715 } ;
double lat [ ] = { 32.201856 , 32.239036 , 32.178465 , 32.141285 } ;
double pts [ 6 ] [ 2 ] ;
long shpPointLayerID = - 1 ;
long shpLineLayerID = - 1 ;
//vector<double> vec_lon,vec_lat;
for ( int i = 0 ; i < 4 ; i + + )
{
pts [ i ] [ 0 ] = lon [ i ] ;
pts [ i ] [ 1 ] = lat [ i ] ;
}
*/
if ( ! m_mapElevation . m_isAdd )
{
//BCGPMessageBox("δ<> <CEB4> <EFBFBD> Ӹ߳<D3B8> <DFB3> <EFBFBD> Ϣ<EFBFBD> <CFA2> <EFBFBD> <EFBFBD> <DEB7> жϵ<D0B6> ǰ<EFBFBD> <C7B0> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> ȫ!");
return 0 ;
}
vector < double > vec_alt ;
vector < double > vec_lon ;
vector < double > vec_lat ;
GetDangerousTerrainPoints ( pts , pointNum , alt , vec_alt , vec_lon , vec_lat ) ;
if ( vec_alt . size ( ) = = 0 )
{
return - 1 ;
}
//<2F> ½<EFBFBD> <C2BD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
if ( m_tempTerrainPointsLayerID = = - 1 )
{
m_tempTerrainPointsLayerID = m_map . NewDrawing ( 1 ) ;
}
//m_map.SetShapePointType(m_tempLayerID,0,mapWindow::tkPointType::ptTriangleUp);
m_map . SetShapeLayerPointType ( m_tempTerrainPointsLayerID , mapWindow : : tkPointType : : ptTriangleUp ) ;
CLabels labels = m_map . GetDrawingLabels ( m_tempTerrainPointsLayerID ) ;
//labels.SetAutoOffset(true);
labels . SetFontColor ( RGB ( 0 , 255 , 0 ) ) ;
labels . SetFontSize ( 8 ) ;
labels . SetFontBold ( true ) ;
labels . SetOffsetY ( - 10 ) ;
for ( int i = 0 ; i < vec_lon . size ( ) ; i + + )
{
/*
std : : stringstream stream ;
stream < < std : : setprecision ( 2 ) < < vec_alt . at ( i ) ;
std : : string alt = stream . str ( ) ;
labels . AddLabel ( alt . c_str ( ) , vec_lon . at ( i ) , vec_lat . at ( i ) , 0 , 0 ) ;
*/
m_map . DrawPointEx ( m_tempTerrainPointsLayerID , vec_lon . at ( i ) , vec_lat . at ( i ) , 8 , RGB ( 255 , 0 , 0 ) ) ;
//m_map.DrawCircleEx(m_tempLayerID,vec_lon.at(i),vec_lat.at(i),3,RGB(255,0,0),true);
}
m_map . Redraw ( ) ;
return 1 ;
}
//<2F> <> <EFBFBD> <EFBFBD> Σ<EFBFBD> յ<EFBFBD> <D5B5> ε<EFBFBD>
void CGISDlg : : ClearDangerousTerrainPoints ( )
{
if ( m_tempTerrainPointsLayerID ! = - 1 )
{
m_map . ClearDrawing ( m_tempTerrainPointsLayerID ) ;
m_tempTerrainPointsLayerID = - 1 ;
m_map . Redraw ( ) ;
}
}
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1>
void CGISDlg : : DrawTempLine ( double m_Pts [ ] [ 2 ] , int pointNum )
{
//int pointNum = 6;
PtStruct pts [ 128 ] ;
PtStruct linePts [ 128 ] ;
for ( int i = 0 ; i < pointNum ; i + + )
{
pts [ i ] . dX = m_Pts [ i ] [ 0 ] ;
pts [ i ] . dY = m_Pts [ i ] [ 1 ] ;
linePts [ i ] . dX = m_Pts [ i ] [ 0 ] ;
linePts [ i ] . dY = m_Pts [ i ] [ 1 ] ;
}
linePts [ pointNum ] . dX = m_Pts [ 0 ] [ 0 ] ;
linePts [ pointNum ] . dY = m_Pts [ 0 ] [ 1 ] ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> <CDBC>
if ( m_tempshpPointLayerID = = - 1 )
{
CreateEmptyShapfile ( m_tempshpPointLayerID , 0 , LineClr [ 10 ] ) ;
}
AddPoints2PointShapfile ( m_tempshpPointLayerID , pts , pointNum ) ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> <CDBC>
if ( m_tempshpLineLayerID = = - 1 )
{
CreateEmptyShapfile ( m_tempshpLineLayerID , 1 , LineClr [ 10 ] ) ;
}
AddPoints2LineShapfile ( m_tempshpLineLayerID , linePts , pointNum + 1 ) ;
//Label<65> <6C> <EFBFBD> <EFBFBD>
CLabels labesPtr ;
labesPtr = m_map . GetShapefile ( m_tempshpLineLayerID ) . GetLabels ( ) ;
CLabelCategory labelCategory = labesPtr . AddCategory ( _T ( " <EFBFBD> <EFBFBD> ɫ" ) ) ;
labelCategory . SetFontColor ( /*RGB(255,0,0)*/ LineClr [ 10 ] ) ;
labelCategory . SetAlignment ( 1 ) ;
labelCategory . SetFontBold ( TRUE ) ;
labelCategory . SetFontName ( LPCTSTR ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) ) ;
labelCategory . SetFontSize ( 12 ) ;
labesPtr . SetAvoidCollisions ( FALSE ) ;
CString strText = _T ( " " ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
for ( long i = 0 ; i < pointNum ; i + + )
{
//<2F> <> ע<EFBFBD> <D7A2> Ϣ
//strText.Format(_T("%d-%d"), lineData.lineID, lineData.pts[i].nPt);
strText . Format ( _T ( " %d " ) , i + 1 ) ;
//<2F> <> <EFBFBD> <EFBFBD> Labels
labesPtr . AddLabel ( ( LPCTSTR ) strText , pts [ i ] . dX , pts [ i ] . dY , 0 , 0 ) ;
}
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> ѡ <EFBFBD> и<EFBFBD> <D0B8> <EFBFBD> ͼ<EFBFBD> <CDBC>
void CGISDlg : : DrawHighLightLine ( const PtStruct * pts , const int ptNum )
{
if ( m_highLightLineLayerID = = - 1 )
{
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SHPͼ<50> <CDBC>
mapWindow : : IShapefilePtr targetPtShape ;
targetPtShape . CreateInstance ( " MapWinGIS.Shapefile " ) ;
targetPtShape - > CreateNewWithShapeID ( _T ( " " ) , mapWindow : : SHP_POLYLINE ) ;
//Ŀ<> <C4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_highLightLineLayerID = m_map . AddLayer ( targetPtShape , true ) ;
mapWindow : : IShapeDrawingOptionsPtr pShapeDrawingOption ;
pShapeDrawingOption . CreateInstance ( " MapWinGIS.ShapeDrawingOptions " ) ;
pShapeDrawingOption - > LineColor = RGB ( 242 , 155 , 41 ) ;
pShapeDrawingOption - > LineWidth = 2 ;
( m_map . GetShapefile ( m_highLightLineLayerID ) ) . SetDefaultDrawingOptions ( pShapeDrawingOption ) ;
}
AddPoints2LineShapfile ( m_highLightLineLayerID , pts , ptNum ) ;
m_map . Redraw ( ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1>
void CGISDlg : : ClearTempLine ( )
{
if ( m_tempshpPointLayerID ! = - 1 )
{
m_map . RemoveLayer ( m_tempshpPointLayerID ) ;
m_tempshpPointLayerID = - 1 ;
m_map . GetShapefile ( m_tempshpPointLayerID ) . Close ( ) ;
}
if ( m_tempshpLineLayerID ! = - 1 )
{
m_map . RemoveLayer ( m_tempshpLineLayerID ) ;
m_tempshpLineLayerID = - 1 ;
m_map . GetShapefile ( m_tempshpLineLayerID ) . Close ( ) ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : ClearHighLightLine ( )
{
if ( m_highLightLineLayerID ! = - 1 )
{
m_map . RemoveLayer ( m_highLightLineLayerID ) ;
m_highLightLineLayerID = - 1 ;
m_map . GetShapefile ( m_highLightLineLayerID ) . Close ( ) ;
}
}
//ת<> <D7AA> ΪGrid<69> <64> <EFBFBD> <EFBFBD>
void CGISDlg : : TransformToXY ( double pts [ ] [ 2 ] , int pointNum , vector < int > & ptsRow , vector < int > & ptsCol )
{
mapWindow : : IGridHeaderPtr gridHeaderPtr = m_mapElevation . m_grid - > GetHeader ( ) ;
int n_gridrow = gridHeaderPtr - > NumberRows ;
int n_gridcol = gridHeaderPtr - > NumberCols ;
long col1 [ 1 ] , col2 [ 1 ] , col3 [ 1 ] , col4 [ 1 ] ;
long row1 [ 1 ] , row2 [ 1 ] , row3 [ 1 ] , row4 [ 1 ] ;
long col , row ;
for ( int i = 0 ; i < pointNum ; i + + )
{
m_mapElevation . m_grid - > ProjToCell ( pts [ i ] [ 0 ] , pts [ i ] [ 1 ] , & col , & row ) ;
ptsRow . push_back ( row ) ;
ptsCol . push_back ( col ) ;
i ;
}
}
//<2F> <> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> 㼯
void CGISDlg : : TransformToVectorPoints ( DrawLineDataStruct lineDataGroup , vector < double > & lineX , vector < double > & lineY )
{
for ( int i = 0 ; i < lineDataGroup . linePointNum ; i + + )
{
lineX . push_back ( lineDataGroup . linePts [ i ] . dX ) ;
lineY . push_back ( lineDataGroup . linePts [ i ] . dY ) ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : AddPointInLine ( int ptPos , double * pt , DrawLineDataStruct & editLineDataGroup )
{
// <20> <EFBFBD> <DEB8> ߶ν ṹ
int lineNum = editLineDataGroup . linePointNum ;
editLineDataGroup . linePointNum = editLineDataGroup . linePointNum + 1 ;
for ( int i = lineNum ; i > ptPos ; i - - ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> <EFBFBD> һ λ
{
editLineDataGroup . linePts [ i ] = editLineDataGroup . linePts [ i - 1 ] ;
editLineDataGroup . linePts [ i ] . nPt = editLineDataGroup . linePts [ i ] . nPt + 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
}
//<2F> IJ<DEB8> <C4B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
editLineDataGroup . linePts [ ptPos ] . dX = pt [ 0 ] ;
editLineDataGroup . linePts [ ptPos ] . dY = pt [ 1 ] ;
editLineDataGroup . linePts [ ptPos ] . nPt = ptPos + 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> β<EFBFBD> 㺽<EFBFBD> <E3BABD> <EFBFBD> <EFBFBD>
editLineDataGroup . linePts [ editLineDataGroup . linePointNum - 1 ] . nPt = 1 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
editLineDataGroup . linePts [ ptPos ] . nL = editLineDataGroup . lineID ;
editLineDataGroup . linePts [ ptPos ] . nH = editLineDataGroup . linePts [ ptPos - 1 ] . nH ;
//<2F> ĵ㼯<C4B5> ṹ
int ptNum = editLineDataGroup . pointNum ;
editLineDataGroup . pointNum = editLineDataGroup . pointNum + 1 ;
for ( int j = ptNum ; j > ptPos ; j - - ) //<2F> ƶ<EFBFBD> <C6B6> 㼯<EFBFBD> <E3BCAF> <EFBFBD> <EFBFBD>
{
editLineDataGroup . pts [ j ] = editLineDataGroup . pts [ j - 1 ] ;
editLineDataGroup . pts [ j ] . nPt = editLineDataGroup . pts [ j ] . nPt + 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
}
//<2F> IJ<DEB8> <C4B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
editLineDataGroup . pts [ ptPos ] . dX = pt [ 0 ] ;
editLineDataGroup . pts [ ptPos ] . dY = pt [ 1 ] ;
editLineDataGroup . pts [ ptPos ] . nPt = ptPos + 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
editLineDataGroup . pts [ ptPos ] . nL = editLineDataGroup . lineID ;
editLineDataGroup . pts [ ptPos ] . nH = editLineDataGroup . pts [ ptPos - 1 ] . nH ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD>
bool CGISDlg : : RemovePointInLine ( int ptPos , DrawLineDataStruct & backLineDataGroup )
{
if ( backLineDataGroup . pointNum < = 2 ) //ֱ<> ߲<EFBFBD> <DFB2> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> ڵ<EFBFBD>
{
return false ;
}
// <20> <EFBFBD> <DEB8> ߶ν ṹ
int lineNum = backLineDataGroup . linePointNum ;
backLineDataGroup . linePointNum = backLineDataGroup . linePointNum - 1 ;
for ( int i = ptPos ; i < lineNum - 2 ; i + + ) //<2F> ƶ<EFBFBD> <C6B6> ߶<EFBFBD> <DFB6> <EFBFBD> <EFBFBD> <EFBFBD>
{
backLineDataGroup . linePts [ i ] = backLineDataGroup . linePts [ i + 1 ] ;
backLineDataGroup . linePts [ i ] . nPt = backLineDataGroup . linePts [ i ] . nPt - 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
}
if ( backLineDataGroup . linePointNum = = 3 ) //<2F> <> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ߣ<EFBFBD> <DFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> β<EFBFBD> <CEB2>
{
backLineDataGroup . linePointNum = 2 ;
}
else //<2F> <> β<EFBFBD> <CEB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( backLineDataGroup . pts [ lineNum - 2 ] . ch1 ! = 2 ) //<2F> պϺ <D5BA> <CFBA> <EFBFBD>
{
backLineDataGroup . linePts [ backLineDataGroup . linePointNum - 1 ] = backLineDataGroup . linePts [ 0 ] ;
}
}
//<2F> ĵ㼯<C4B5> ṹ
int ptNum = backLineDataGroup . pointNum ;
backLineDataGroup . pointNum = backLineDataGroup . pointNum - 1 ;
for ( int j = ptPos ; j < ptNum - 1 ; j + + ) //<2F> ƶ<EFBFBD> <C6B6> 㼯<EFBFBD> <E3BCAF> <EFBFBD> <EFBFBD>
{
backLineDataGroup . pts [ j ] = backLineDataGroup . pts [ j + 1 ] ;
backLineDataGroup . pts [ j ] . nPt = backLineDataGroup . pts [ j ] . nPt - 1 ; //<2F> ĺ<DEB8> <C4BA> <EFBFBD> <EFBFBD> <EFBFBD>
}
return true ;
}
// <20> Ƿ<EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> ,<2C> <> ѡ <EFBFBD> з<EFBFBD> <D0B7> غ<EFBFBD> <D8BA> ߱<EFBFBD> <DFB1> ţ<EFBFBD> <C5A3> <EFBFBD> <EFBFBD> <EFBFBD> -1
int CGISDlg : : IsSelectLine ( double * pt )
{
float tolerance = 0.001 ;
//ƽ <> <C6BD> ģʽ <C4A3> <CABD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> Χ
if ( g_b981APad )
{
tolerance = 0.003 ;
}
if ( m_ShowedLineDataList . size ( ) = = 0 )
{
return false ;
}
for ( auto i = m_ShowedLineDataList . begin ( ) ; i ! = m_ShowedLineDataList . end ( ) ; i + + )
{
//cout<<"<22> <> ="<<i->first<<" ֵ="<<i->second<<endl;
std : : vector < double > lineX , lineY ;
DrawLineDataStruct lineData = i - > second ;
TransformToVectorPoints ( lineData , lineX , lineY ) ;
if ( topologicalAnalysis . isPointInPolyLine ( pt , lineX , lineY , tolerance ) )
{
return lineData . lineID ;
} ;
}
return - 1 ;
}
/**************************************************************************************************/
//<2F> ༭<EFBFBD> <E0BCAD> <EFBFBD> <EFBFBD> ʱ,<2C> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> öԻ<C3B6> <D4BB> <EFBFBD>
void CGISDlg : : ShowModifyPointDlg ( int selectedPointID )
{
if ( ! m_bEditLine )
{
return ;
}
CModifyLinePointDlg dlg ;
dlg . m_editLineDataGroup = m_editLineDataGroup ;
dlg . SetSelectedPointID ( selectedPointID ) ;
if ( m_lineSelectedID ! = 11 ) //<2F> ǻ<EFBFBD> <C7BB> պ<EFBFBD> <D5BA> ߣ<EFBFBD> <DFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
dlg . SetCirclingPointRBTNVisible ( false ) ;
}
dlg . SetLonLat ( m_editLineDataGroup . pts [ selectedPointID ] . dX , m_editLineDataGroup . pts [ selectedPointID ] . dY ) ;
if ( circlingPointID = = selectedPointID ) //ѡ <> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> ð<EFBFBD> ťѡ <C5A5> <D1A1>
{
dlg . CheckedCirclingPoint ( ) ;
}
if ( dlg . DoModal ( ) = = IDOK )
{
double targetLat , targetLon ;
int pointID ;
dlg . GetLonLat ( targetLon , targetLat , pointID ) ;
//bool bb = dlg.IsCirclingPoint();
if ( m_lineSelectedID = = 11 ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
{
if ( circlingPointID = = selectedPointID ) //<2F> <> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
if ( ! dlg . IsCirclingPoint ( ) ) //<2F> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
circlingPointID = - 1 ;
}
}
if ( dlg . IsCirclingPoint ( ) ) //<2F> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
circlingPointID = selectedPointID ;
}
}
//<2F> ĵ<DEB8> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD>
m_editLineDataGroup . pts [ pointID - 1 ] . dX = targetLon ;
m_editLineDataGroup . pts [ pointID - 1 ] . dY = targetLat ;
//<2F> <EFBFBD> <DEB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_editLineDataGroup . linePts [ pointID - 1 ] . dX = targetLon ;
m_editLineDataGroup . linePts [ pointID - 1 ] . dY = targetLat ;
if ( pointID = = m_editLineDataGroup . linePointNum - 1 & & m_editLineDataGroup . linePts [ m_editLineDataGroup . linePointNum - 1 ] . ch1 = = 2 ) {
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<DEB8> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> պϺ <D5BA> <CFBA> <EFBFBD>
m_editLineDataGroup . linePts [ pointID ] . dX = targetLon ;
m_editLineDataGroup . linePts [ pointID ] . dY = targetLat ;
}
if ( pointID = = 1 & & m_editLineDataGroup . linePts [ m_editLineDataGroup . linePointNum - 1 ] . ch1 = = 0 )
{ // <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<DEB8> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <D7B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> պϺ <D5BA> <CFBA> <EFBFBD>
m_editLineDataGroup . linePts [ m_editLineDataGroup . linePointNum - 1 ] . dX = targetLon ;
m_editLineDataGroup . linePts [ m_editLineDataGroup . linePointNum - 1 ] . dY = targetLat ;
} //m_editLineDataGroup.linePts[0]->ch1==2 <20> <> <EFBFBD> պ<EFBFBD> 0-><3E> պ<EFBFBD>
if ( m_distLabelLayer ! = - 1 )
{
m_map . ClearDrawing ( m_distLabelLayer ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> λ<EFBFBD> DZ<EFBFBD> <C7B1> <EFBFBD>
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( m_editLineDataGroup . lineID - 1 ) ;
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
DrawFlyLine ( m_editLineDataGroup ) ;
}
else
{
//return;
}
return ;
}
void CGISDlg : : ShowModifyPointDlg ( )
{
ShowModifyPointDlg ( 0 ) ;
}
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> ༭<EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD>
void CGISDlg : : ShowEditSaveDlg ( )
{
if ( ! m_bEditLine )
{
return ;
}
CSaveLineEditSetting saveDlg ;
saveDlg . DoModal ( ) ;
int saveStatus = saveDlg . GetSaveStatus ( ) ; //-1Ϊ<31> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> 棬0Ϊ<30> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> ༭<EFBFBD> <E0BCAD> 1Ϊ<31> <CEAA> <EFBFBD> <EFBFBD>
if ( saveStatus = = - 1 )
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
ClearDrawedLine ( m_editLineDataGroup . lineID - 1 ) ;
//<2F> ָ<EFBFBD> δ<EFBFBD> ༭״̬
DrawFlyLine ( m_ShowedLineDataList [ m_lineSelectedID ] ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_map . ClearDrawing ( m_distLabelLayer ) ;
m_bEditLine = false ;
m_bSelectFeatureFlag = false ;
m_lineSelectedID = - 1 ;
return ;
}
else if ( saveStatus = = 0 )
{
return ;
}
//
CString dirName = " " ;
if ( g_b981APad | | g_b981ADesktop )
{
switch ( m_lineSelectedID )
{
case 1 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1\\ " ;
break ;
case 2 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2\\ " ;
break ;
case 3 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3\\ " ;
break ;
case 4 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 4\\ " ;
break ;
case 5 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5\\ " ;
break ;
case 11 :
dirName = " Ӧ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \\ " ;
break ;
case 12 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Χ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \\ " ;
break ;
case 13 :
dirName = " ԭ·<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> \\ " ;
break ;
case 14 :
dirName = " <EFBFBD> <EFBFBD> <EFBFBD> պ<EFBFBD> <EFBFBD> <EFBFBD> \\ " ;
break ;
}
}
//<2F> <> <EFBFBD> ±<EFBFBD> <C2B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
CString filename ;
CString strRouteFileDir = GetSoftwareCurrentDirectory ( ) + _T ( " \\ Route \\ " ) + dirName ;
TCHAR s [ 10000 ] ;
s [ 0 ] = 0 ;
CFileDialog dlg ( FALSE , _T ( " .txt " ) , _T ( " *.txt " ) ) ;
dlg . m_ofn . lpstrTitle = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> 溽<EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> " ) ;
dlg . m_ofn . lpstrFile = s ;
dlg . m_ofn . nMaxFile = sizeof ( s ) / sizeof ( TCHAR ) ;
TCHAR filter [ 500 ] = _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.txt)\0 *.txt \0 " ) ;
dlg . m_ofn . lpstrFilter = filter ;
dlg . m_ofn . Flags | = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_CREATEPROMPT ;
dlg . m_ofn . lpstrInitialDir = strRouteFileDir ;
if ( IDOK = = dlg . DoModal ( ) )
{
filename = dlg . GetPathName ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD>
FILE * fp = fopen ( filename , " w " ) ;
fprintf ( fp , " %d, 0, %lf, %lf, %.2lf, 0, 00, 03 \n " , m_editLineDataGroup . lineID , 0.0 , 0.0 , 0.0 ) ;
int n_linePts = m_editLineDataGroup . pointNum ;
for ( int i = 1 ; i < = n_linePts ; i + + )
{
PtStruct linePt = m_editLineDataGroup . pts [ i - 1 ] ;
if ( i < n_linePts - 1 )
{
if ( circlingPointID = = i - 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 01, 03 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
else
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 00, 03 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
}
else if ( i = = n_linePts - 1 )
{
if ( m_lineSelectedID = = 11 & & g_b981CDesktop ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 00, 07 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
else
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 00, 03 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
}
else if ( i = = n_linePts )
{
if ( m_lineSelectedID = = 11 & & g_b981CDesktop ) //<2F> <> <EFBFBD> պ<EFBFBD> <D5BA> <EFBFBD>
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 00, 0B \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
else
{
if ( linePt . ch1 = = 2 ) //<2F> <> <EFBFBD> Ϻ <EFBFBD> <CFBA> <EFBFBD>
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 02, 01 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
else
{
fprintf ( fp , " %d, %d, %lf, %lf, %.2lf, 0, 00, 01 \n " , m_editLineDataGroup . lineID , i , linePt . dX , linePt . dY , linePt . nH ) ;
}
}
}
}
fclose ( fp ) ;
OnShowGivenLine ( filename ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĺ<EFBFBD> <C4BA> <EFBFBD>
//ClearDrawedLine(m_editLineDataGroup.lineID-1);
//<2F> <> <EFBFBD> 溽<EFBFBD> <E6BABD>
//DrawFlyLine(m_editLineDataGroup);
m_map . ClearDrawing ( m_distLabelLayer ) ;
m_bEditLine = false ;
m_bSelectFeatureFlag = false ;
m_lineSelectedID = - 1 ;
return ;
} else
{
return ;
}
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
void CGISDlg : : EndPolylineMessure ( )
{
//ɾ<> <C9BE> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1>
m_map . ClearDrawing ( m_tempLayerID ) ;
m_bMeasureDrag = false ;
m_bEndMeasure = true ;
m_numPolylineMeasurePts = 0 ;
return ;
}