📄 pointfeature.cpp
字号:
/* 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. */#include <map>#include <GL/gl.h>#include <GL/glu.h>#include "pointfeature.h"#include "util.h"/** * Constructor */PointFeature::PointFeature() : ref_record_id(0){ long_lat[0] = long_lat[1] = 0;}/** * Destructor */PointFeature::~PointFeature(){}/** * Set longitude/latitude of this point * @param isolated_node_vectors_map node:vector map to find point with * @return 0 on success -1 on failure */ int PointFeature::SetLongLat(std::map<int, IsolatedNodeVector> &isolated_node_vectors_map){ sg2d_t *sg2d = isolated_node_vectors_map[ref_record_ids[0]].GetSG2DPtr(); long_lat[0] = sg2d->long_lat[0]; long_lat[1] = sg2d->long_lat[1]; return 0;}void PointFeature::Draw(double zoom){ if (cvg) { glPushMatrix(); glTranslatef(long_lat[0], long_lat[1], 0); glScalef(1/zoom, 1/zoom, 0); cvg->Render(); glPopMatrix(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -