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