All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SymbolizerColorFinder.cpp
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/SymbolizerColorFinder.cpp
22 
23  \brief A Symbology Enconding visitor that finds a color given a symbolizer.
24 */
25 
26 // TerraLib
27 
28 #include "../color/RGBAColor.h"
29 #include "Fill.h"
30 #include "Graphic.h"
31 #include "LineSymbolizer.h"
32 #include "Mark.h"
33 #include "PointSymbolizer.h"
34 #include "PolygonSymbolizer.h"
35 #include "Rule.h"
36 #include "Stroke.h"
37 #include "Symbolizer.h"
38 #include "SymbolizerColorFinder.h"
39 #include "Style.h"
40 #include "Utils.h"
41 
43 {
44 }
45 
47 {
48 }
49 
51 {
52  symbolizer->accept(*this);
53 }
54 
56 {
57 }
58 
60 {
61 }
62 
64 {
65 }
66 
68 {
69 }
70 
72 {
73  const te::se::Fill* fill = visited.getFill();
74 
75  if(fill)
76  find(fill);
77 }
78 
80 {
81  const te::se::Stroke* stroke = visited.getStroke();
82 
83  if(stroke)
84  find(stroke);
85 }
86 
88 {
89  const te::se::Graphic* graphic = visited.getGraphic();
90 
91  if(graphic && !graphic->getMarks().empty())
92  find(graphic->getMarks()[0]);
93 }
94 
96 {
97 }
98 
100 {
101 }
102 
104 {
105  te::se::GetColor(stroke, m_color);
106 }
107 
109 {
110  te::se::GetColor(fill, m_color);
111 }
112 
114 {
115  if(mark)
116  find(mark->getFill());
117 }
A TextSymbolizer is used to render text labels according to various graphical parameters.
const Fill * getFill() const
Gets the Fill associates with the PolygonSymbolizer.
TESEEXPORT void GetColor(const te::se::Stroke *stroke, te::color::RGBAColor &color)
It gets the RGBA color from the Stroke element.
Definition: Utils.cpp:404
const Graphic * getGraphic() const
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Definition: Style.h:65
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
A Fill specifies the pattern for filling an area geometry.
A Symbolizer describes how a feature is to appear on a map.
Definition: Symbolizer.h:80
The CoverageStyle defines the styling that is to be applied to a subset of Coverage data...
Definition: CoverageStyle.h:45
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
void visit(const te::se::Style &visited)
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
Definition: Graphic.h:66
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
The FeatureTypeStyle defines the styling that is to be applied to a dataset that can be viewed as a f...
A PolygonSymbolizer is used to draw a polygon (or other area-type geometries), including filling its ...
The RasterSymbolizer describes how to render raster/matrix-coverage data (e.g., satellite photos...
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
const Stroke * getStroke() const
A Mark specifies a geometric shape and applies coloring to it.
void find(const te::se::Symbolizer *symbolizer)
It find the color based on given symbolizer.
const std::vector< Mark * > getMarks() const
Definition: Graphic.cpp:98
virtual ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
A Graphic is a graphic symbol with an inherent shape, color(s), and possibly size.
A Symbolizer describes how a Feature is to appear on a map.
A LineSymbolizer is used to style a stroke along a linear geometry type, such as a string of line seg...
A PointSymbolizer specifies the rendering of a graphic Symbolizer at a point.
A Symbology Enconding visitor that finds a color given a symbolizer.
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
Utility functions for Symbology Enconding module.
A Stroke specifies the appearance of a linear geometry.
const Fill * getFill() const
Definition: Mark.cpp:114