ToolMap
Loading...
Searching...
No Matches
tmlayerproperties.h
1/***************************************************************************
2 tmlayerproperties.h
3 Class used for managing layer informations
4 -------------------
5 copyright : (C) 2007 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17// comment doxygen
18
19#ifndef _TM_LAYERPROPERTIES_H_
20#define _TM_LAYERPROPERTIES_H_
21
22// For compilers that support precompilation, includes "wx/wx.h".
23#include <wx/wxprec.h>
24
25// Include wxWidgets' headers
26#ifndef WX_PRECOMP
27#include <wx/wx.h>
28#endif
29
30#include <wx/filename.h>
31#include <wx/mstream.h>
32#include <wx/treectrl.h>
33
34#include "tmlayerpropertiesdef.h"
35
36class tmSymbol;
37
39
40class tmWebFrame;
41
42/***************************************************************************/
47class tmLayerProperties : public wxTreeItemData {
48 private:
49 wxFileName m_LayerName;
50 long m_LayerID;
51 long m_layer_parent_ID;
52
53 public:
54 long GetLayerParentId() const;
55 void SetLayerParentId(long mLayerParentId);
56
57 private:
58 TM_GIS_SPATIAL_TYPES m_LayerSpatialType;
59 bool m_LayerVisible;
60 TOC_GENERIC_NAME m_LayerType;
61 tmSymbol* m_LayerSymbol;
62 int m_LayerVertexFlags;
63 bool m_LayerEditing;
64 tmSymbolRuleManager* m_SymbolRulesManager;
65
66 bool m_LabelIsVisible;
67 wxString m_LabelDefinition;
68
69 void InitMemberValues();
70
71 public:
72 // init from string array
73 bool InitFromArray(const wxArrayString& array, bool userelativepath, const wxString& prjpath);
74
75 void InitSymbology(const wxString& itemBinSymbology);
76
77 bool InitFromPathAndName(const wxString& path, const wxString& nameext, const wxArrayString& supportedext);
78
79 wxString GetNameDisplay();
80
81 wxFileName GetName();
82
83 void SetName(const wxFileName& filename) {
84 m_LayerName = filename;
85 }
86
87 inline const long GetID() const;
88
89 void SetID(long value);
90
91 inline const TM_GIS_SPATIAL_TYPES GetSpatialType() const;
92
93 void SetSpatialType(TM_GIS_SPATIAL_TYPES value);
94
95 inline const bool IsVisible() const;
96
97 void SetVisible(bool value);
98
99 inline const TOC_GENERIC_NAME GetType() const;
100
101 void SetType(TOC_GENERIC_NAME value);
102
103 inline const int GetVertexFlags() const;
104
105 void SetVertexFlags(int value);
106
107 inline const bool IsEditing() const;
108
109 void SetEditing(bool value);
110
111 void SetLabelVisible(bool value) {
112 m_LabelIsVisible = value;
113 }
114
115 bool IsLabelVisible() {
116 return m_LabelIsVisible;
117 }
118
119 void SetLabelDefinition(const wxString& value) {
120 m_LabelDefinition = value;
121 }
122
123 wxString GetLabelDefinition() {
124 return m_LabelDefinition;
125 }
126
127 tmSymbol* GetSymbolRef();
128
129 void SetSymbolDirectly(tmSymbol* value);
130
131 tmSymbolRuleManager* GetSymbolRuleManagerRef() {
132 return m_SymbolRulesManager;
133 }
134
135 // constructor
137 InitMemberValues();
138 }
139
141
143};
144
145inline const long tmLayerProperties::GetID() const {
146 return m_LayerID;
147}
148
149inline const TM_GIS_SPATIAL_TYPES tmLayerProperties::GetSpatialType() const {
150 return m_LayerSpatialType;
151}
152
153inline const bool tmLayerProperties::IsVisible() const {
154 return m_LayerVisible;
155}
156
157inline const TOC_GENERIC_NAME tmLayerProperties::GetType() const {
158 return m_LayerType;
159}
160
161inline const int tmLayerProperties::GetVertexFlags() const {
162 return m_LayerVertexFlags;
163}
164
165inline const bool tmLayerProperties::IsEditing() const {
166 return m_LayerEditing;
167}
168
169#endif
Storing object of layer type.
Definition tmlayerproperties.h:47
wxString GetNameDisplay()
Return the display name for using in the TOC.
Definition tmlayerproperties.cpp:192
bool InitFromPathAndName(const wxString &path, const wxString &nameext, const wxArrayString &supportedext)
Init name, path and type member.
Definition tmlayerproperties.cpp:150
bool InitFromArray(const wxArrayString &array, bool userelativepath, const wxString &prjpath)
Init from a string array.
Definition tmlayerproperties.cpp:52
Symbol Rule manager.
Definition tmsymbolrule.h:114
Definition tmsymbol.h:38