📄 chart.h
字号:
/* GHelm - Nautical Navigation Software * Copyright (C) 2004 Jon Michaelchuck * * This application is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This software 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 software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */#ifndef CHART_H_#define CHART_H_#include <map>#include <vector>#include <GL/gl.h>#include <GL/glu.h>#include <gtkmm.h>#include <boost/filesystem/operations.hpp>#include <boost/filesystem/fstream.hpp>#include <boost/filesystem/path.hpp>#include "configuration.h"#include "areafeature.h"#include "connectednodevector.h"#include "dsid.h"#include "dspm.h"#include "edgevector.h"#include "feature.h"#include "iso8211lib/iso8211.h"#include "isolatednodevector.h"#include "linefeature.h"#include "pointfeature.h"/** * This class contains the data from an S57 chart as well as the method * to draw it using OpenGL methods. */class Chart{ public: Chart(); ~Chart(); int Load(boost::filesystem::path &fpath, Configuration &configuration); void Draw(double zoom, Configuration &configuration); // custom signals sigc::signal<void> signal_progress; // public data boost::filesystem::path filepath; std::string description; float slat, wlon, nlat, elon; float absolute_zoom_factor; float zoom_exponent; std::map<int, std::vector<LineFeature> > line_features_map; std::map<int, std::vector<PointFeature> > point_features_map; std::map<int, std::vector<AreaFeature> > area_features_map; std::vector<waypoint_t> waypoints; private: // generation of drawing data void GeneratePointFeatures(Configuration &configuration); void GenerateLineLists(Configuration &configuration); void GenerateAreaLists(Configuration &configuration); void GenerateCoastlines(); void DrawLines(); // Loading/setting up s57 stuff int S57Load(boost::filesystem::path &fpath); int S57ReadDSIDRecord(DDFRecord *record); int S57ReadDSPMRecord(DDFRecord *record); int S57ReadFeatureRecord(DDFRecord *record); int S57LoadPointFeature(DDFRecord *record); int S57LoadLineFeature(DDFRecord *record); int S57LoadAreaFeature(DDFRecord *record); int S57ReadVectorRecord(DDFRecord *record); int S57LoadIsolatedNodeVectorRecord(DDFRecord *record); int S57LoadConnectedNodeVectorRecord(DDFRecord *record); int S57LoadEdgeVectorRecord(DDFRecord *record); void S57NormalizeCoordinates(); int S57SetupEdgeVectors(); int S57SetupAreaFeatures(); // vectors maps std::map<int, IsolatedNodeVector> isolated_node_vectors_map; std::map<int, ConnectedNodeVector> connected_node_vectors_map; std::map<int, EdgeVector> edge_vectors_map; // meta data loading DSID dsid; bool dsid_loaded; DSPM dspm; bool dspm_loaded; std::map<int, GLuint> line_lists; std::map<int, GLuint> area_lists;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -