00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef TEXT_SYMBOLIZER_HPP
00026 #define TEXT_SYMBOLIZER_HPP
00027
00028 #include <string>
00029
00030 #include <boost/tuple/tuple.hpp>
00031
00032 #include <mapnik/color.hpp>
00033
00034 namespace mapnik
00035 {
00036 enum label_placement_e {
00037 point_placement=1,
00038 line_placement=2
00039 };
00040
00041 typedef boost::tuple<double,double> position;
00042
00043 struct MAPNIK_DECL text_symbolizer
00044 {
00045 text_symbolizer(std::string const& name,std::string const& face_name,
00046 unsigned size,Color const& fill);
00047 text_symbolizer(text_symbolizer const& rhs);
00048 text_symbolizer& operator=(text_symbolizer const& rhs);
00049 std::string const& get_name() const;
00050 unsigned get_text_ratio() const;
00051 void set_text_ratio(unsigned ratio);
00052 unsigned get_wrap_width() const;
00053 void set_wrap_width(unsigned ratio);
00054 unsigned get_label_spacing() const;
00055 void set_label_spacing(unsigned spacing);
00056 unsigned get_label_position_tolerance() const;
00057 void set_label_position_tolerance(unsigned tolerance);
00058 bool get_force_odd_labels() const;
00059 void set_force_odd_labels(bool force);
00060 double get_max_char_angle_delta() const;
00061 void set_max_char_angle_delta(double angle);
00062 unsigned get_text_size() const;
00063 std::string const& get_face_name() const;
00064 Color const& get_fill() const;
00065 void set_halo_fill(Color const& fill);
00066 Color const& get_halo_fill() const;
00067 void set_halo_radius(unsigned radius);
00068 unsigned get_halo_radius() const;
00069 void set_label_placement(label_placement_e label_p);
00070 label_placement_e get_label_placement() const;
00071 void set_anchor(double x, double y);
00072 position const& get_anchor() const;
00073 void set_displacement(double x, double y);
00074 position const& get_displacement() const;
00075
00076 void set_avoid_edges(bool avoid);
00077 bool get_avoid_edges() const;
00078 private:
00079 std::string name_;
00080 std::string face_name_;
00081 unsigned size_;
00082 unsigned text_ratio_;
00083 unsigned wrap_width_;
00084 unsigned label_spacing_;
00085 unsigned label_position_tolerance_;
00086 bool force_odd_labels_;
00087 double max_char_angle_delta_;
00088 Color fill_;
00089 Color halo_fill_;
00090 unsigned halo_radius_;
00091 label_placement_e label_p_;
00092 position anchor_;
00093 position displacement_;
00094 bool avoid_edges_;
00095 };
00096 }
00097
00098 #endif //TEXT_SYMBOLIZER_HPP