Mark.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/se/Mark.h
22 
23  \brief A Mark specifies a geometric shape and applies coloring to it.
24 */
25 
26 #ifndef __TERRALIB_SE_INTERNAL_MARK_H
27 #define __TERRALIB_SE_INTERNAL_MARK_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <string>
34 
35 // Boost
36 #include <boost/noncopyable.hpp>
37 
38 namespace te
39 {
40 // Forward declarations
41  namespace xl { class SimpleLink; }
42 
43  namespace se
44  {
45 // Forward declarations
46  class Fill;
47  class InlineContent;
48  class Stroke;
49 
50  /*!
51  \class Mark
52 
53  \brief A Mark specifies a geometric shape and applies coloring to it.
54 
55  The WellKnownName element gives the well-known name
56  of the shape of the mark. Allowed values include at
57  least "square", "circle", "triangle", "star", "cross",
58  and "x", though map servers may draw a different symbol
59  instead if they don't have a shape for all of these. The
60  default WellKnownName is "square". Renderings of these
61  marks may be made solid or hollow depending on Fill
62  and Stroke elements.
63 
64  The alternative to a WellKnownName is an external
65  mark format. The MarkIndex allows an individual mark
66  in a mark archive to be selected. An example format
67  for an external mark achive would be a TrueType font
68  file, with MarkIndex being used to select an individual
69  glyph from that file.
70 
71  The Mark element serves two purposes. It allows the
72  selection of simple shapes, and, in combination with
73  the capability to select and mix multiple external-URL
74  graphics and marks, it allows a style to be specified
75  that can produce a usable result in a best-effort
76  rendering environment, provided that a simple Mark
77  is included at the bottom of the list of sources for
78  every Graphic.
79 
80  \ingroup se
81 
82  \sa Graphic, Fill, Stroke, InlineContent
83  */
84  class TESEEXPORT Mark : public boost::noncopyable
85  {
86  public:
87 
88  /** @name Initializer Methods
89  * Methods related to instantiation and destruction.
90  */
91  //@{
92 
93  /*! \brief It initializes a new Mark. */
94  Mark();
95 
96  /*! \brief Destructor. */
97  ~Mark();
98 
99  //@}
100 
101  /*!
102  \brief The WellKnownName element gives the well-known name of the shape of the mark.
103 
104  Allowed values include at least "square", "circle", "triangle", "star", "cross", and "x".
105  The default WellKnownName is "square".
106  */
107  void setWellKnownName(std::string* name);
108 
109  const std::string* getWellKnownName() const;
110 
111  void setOnlineResource(te::xl::SimpleLink* link);
112 
113  const te::xl::SimpleLink* getOnlineResource() const;
114 
115  void setInlineContent(InlineContent* iContent);
116 
117  InlineContent* getInlineContent() const;
118 
119  void setFormat(std::string* f);
120 
121  const std::string* getFormat() const;
122 
123  void setMarkIndex(int i);
124 
125  int getMarkIndex() const;
126 
127  void setFill(Fill* f);
128 
129  const Fill* getFill() const;
130 
131  void setStroke(Stroke* s);
132 
133  const Stroke* getStroke() const;
134 
135  /*! \brief It creates a new copy of this object. */
136  Mark* clone() const;
137 
138  private:
139 
140  std::string* m_wellKnownName; //!< The WellKnownName element gives the well-known name of the shape of the mark. (Optional and if it is set then nor onlineResource_ neither inlineContent_ should be set)
141  te::xl::SimpleLink* m_onlineResource; //!< The graphics can either be referenced from an external URL in a common format. (Optional and just one of onlineResource_ or inlineContent_ can be set a time)
142  InlineContent* m_inlineContent; //!< Allows the content of an external graphic object to be included in-line. (Optional and just one of onlineResource_ or inlineContent_ can be set a time)
143  std::string* m_format; //!< Identifies the expected document MIME type of a successful fetch. (Mandatory if onlineResource_ or inlineContent_ is set)
144  int m_markIndex; //!< It allows an individual mark in a mark archive to be selected. (Optional and it should be set only if onlineResource_ or inlineContent_ is set)
145  Fill* m_fill; //!< It specifies the pattern for filling an area geometry. (Optional)
146  Stroke* m_stroke; //!< It specifies the appearance of a linear geometry. (Optional)
147  };
148 
149  } // end namespace se
150 } // end namespace te
151 
152 #endif // __TERRALIB_SE_INTERNAL_MARK_H
153 
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
Fill * m_fill
It specifies the pattern for filling an area geometry. (Optional)
Definition: Mark.h:145
Stroke * m_stroke
It specifies the appearance of a linear geometry. (Optional)
Definition: Mark.h:146
InlineContent is XML- or base64-encoded encoded content in some externally-defined format that is inc...
Definition: InlineContent.h:51
URI C++ Library.
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
std::string * m_format
Identifies the expected document MIME type of a successful fetch. (Mandatory if onlineResource_ or in...
Definition: Mark.h:143
#define TESEEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:187
Configuration flags for the Symbology Encoding support of TerraLib.
te::xl::SimpleLink * m_onlineResource
The graphics can either be referenced from an external URL in a common format. (Optional and just one...
Definition: Mark.h:141
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
std::string * m_wellKnownName
The WellKnownName element gives the well-known name of the shape of the mark. (Optional and if it is ...
Definition: Mark.h:140
InlineContent * m_inlineContent
Allows the content of an external graphic object to be included in-line. (Optional and just one of on...
Definition: Mark.h:142
int m_markIndex
It allows an individual mark in a mark archive to be selected. (Optional and it should be set only if...
Definition: Mark.h:144