找回密码
 注册
搜索
搜索附件  
Landho 看海-懒猴航海-电子海图 附件中心 电子海图 电子海图学习 S57开发重要源码(C++),关于S57海图开发的信息: s52plib.cpp

热门下载

附件中心&附件聚合2.0
For Discuz! X2.5 © hgcad.com

S57开发重要源码(C++),关于S57海图开发的信息: s52plib.cpp

 

S57开发重要源码(C++),关于S57海图开发的信息:
本文档是S57开发重要源码(C++),关于S57海图开发的信息》...本文档是S57开发重要源码(C++),关于S57海图开发的信息

/******************************************************************************
* $Id: s52plib.cpp,v 1.52 2010/06/13 21:05:43 bdbcat Exp $
*
* Project:  OpenCPN
* Purpose:  S52 Presentation Library
* Author:   David Register
*
***************************************************************************
*   Copyright (C) 2010 by David S. Register                                      *
*   $EMAIL$                                                               *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU General Public License     *
*   along with this program; if not, write to the                         *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************
*
* $Log: s52plib.cpp,v $
* Revision 1.52  2010/06/13 21:05:43  bdbcat
* 613a
*
* Revision 1.51  2010/06/11 16:26:29  bdbcat
* 611a
*
* Revision 1.50  2010/06/07 15:30:00  bdbcat
* 607a
*
* Revision 1.49  2010/06/07 03:26:09  bdbcat
* 606b
*
* Revision 1.48  2010/06/06 20:52:40  bdbcat
* 606a
*
* Revision 1.47  2010/05/20 19:05:19  bdbcat
* Build 520
*
* Revision 1.46  2010/05/19 01:00:58  bdbcat
* Build 518
*
* Revision 1.45  2010/05/15 04:02:59  bdbcat
* Build 514
*
* Revision 1.44  2010/05/02 20:04:50  bdbcat
* Build 502b
*
* Revision 1.43  2010/04/27 01:43:31  bdbcat
* Build 426
*
* Revision 1.42  2010/04/16 13:08:31  bdbcat
* Correct AreaPattern for MSW build.
*
* Revision 1.41  2010/04/15 15:51:27  bdbcat
* Build 415.
*
* Revision 1.40  2010/03/29 03:28:25  bdbcat
* 2.1.0 Beta Initial
*
*/


// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

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

#include <math.h>

#include "dychart.h"

#include "georef.h"

#include "s52plib.h"
#include "s57chart.h"                   // for back function references
#include "mygeom.h"
#include "cutil.h"
#include "s52utils.h"
#include "navutil.h"                    // for LogMessageOnce()
#include "ocpn_pixel.h"

#include <stdlib.h>                             // 261, min() becomes __min(), etc.

#include "wx/image.h"                   // Missing from wxprec.h
#include "wx/tokenzr.h"

extern s52plib          *ps52plib;

void DrawWuLine ( wxDC *pDC, int X0, int Y0, int X1, int Y1, wxColour clrLine, int dash, int space );
extern bool GetDoubleAttr ( S57Obj *obj, const char *AttrName, double &val );

CPL_CVSID ( "$Id: s52plib.cpp,v 1.52 2010/06/13 21:05:43 bdbcat Exp $" );


//    Implement the Bounding Box list
#include <wx/listimpl.cpp>
WX_DEFINE_LIST ( ObjList );


//    Testing
/*
typedef struct
{
        char           colorname[6];
        unsigned char  R;
        unsigned char  G;
        unsigned char  B;
} color_sub;


color_sub color_adjust[] =
{
        {"nimes", 5,5,5},
        {"ddfkl", 4,4,4}
};
*/



//-----------------------------------------------------------------------------
//      s52plib implementation
//-----------------------------------------------------------------------------
s52plib::s52plib ( const wxString& PLib )
{
//      Set up some buffers, etc...
      pBuf = buffer;

      pOBJLArray = new wxArrayPtrVoid;

      ColorTableArray = NULL;
      ColourHashTableArray = NULL;

      lineLUPArray = NULL;            // lines
      areaPlaineLUPArray = NULL;      // areas: PLAIN_BOUNDARIES
      areaSymbolLUPArray = NULL;      // areas: SYMBOLIZED_BOUNDARIE
      pointSimplLUPArray = NULL;      // points: SIMPLIFIED
      pointPaperLUPArray = NULL;      // points: PAPER_CHART
      condSymbolLUPArray = NULL;      // Dynamic Conditional Symbology

      m_bOK = !(S52_load_Plib ( PLib ) == 0);

      m_bShowS57Text = false;
      m_bShowS57ImportantTextOnly = false;
      m_colortable_index = 0;

      _symb_symR = NULL;
      bUseRasterSym = false;

      //      Sensible defaults
      m_nSymbolStyle = PAPER_CHART;
      m_nBoundaryStyle = PLAIN_BOUNDARIES;
      m_nDisplayCategory = OTHER;
      m_nDepthUnitDisplay = 1;                // metres

      UpdateMarinerParams();

      ledge = new int[2000];
      redge = new int[2000];

      //    Defaults
      m_VersionMajor = 3;
      m_VersionMinor = 2;

      //    Compute display scale factor
      int mmx, mmy;
      wxDisplaySizeMM ( &mmx, &mmy );
      int sx, sy;
      wxDisplaySize ( &sx, &sy );
猴哥就是专业户 但这个我真不会了 所以除了支持 就是支持
绝对支持。。。{:soso_e179:}
csnd里面的资源。。。。。
没看错的话, 这段代码是截取自 OpenCPN 吧 : )
正在做一个Sharp转S57格式的软件,正需要段代码

QQ|隐私政策|注册协议|注册协议|Landho 看海-懒猴航海-电子海图 ( 津ICP备19004518号-1 )

GMT+8, 2025-5-2 11:07 , Processed in 0.031249 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

返回顶部