OpenCPN Partial API docs
Loading...
Searching...
No Matches
Layer.cpp
1/******************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2010 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 ***************************************************************************
23 */
24
25#include "Layer.h"
26
27#include <algorithm>
28
29extern bool g_bShowLayers;
30extern LayerList *pLayerList;
31
32Layer::Layer(void) {
33 m_bIsVisibleOnChart = g_bShowLayers;
34 m_bIsVisibleOnListing = false;
35 m_bHasVisibleNames = wxCHK_UNDETERMINED;
36 m_NoOfItems = 0;
37 m_LayerType = "";
38 m_LayerName = "";
39 m_LayerFileName = "";
40 m_LayerDescription = "";
41 m_CreateTime = wxDateTime::Now();
42}
43
44Layer::~Layer(void) {
45 // Remove this layer from the global layer list
46 if (pLayerList) {
47 auto found = std::find(pLayerList->begin(), pLayerList->end(), this);
48 if (found != pLayerList->end()) pLayerList->erase(found);
49 }
50}