mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
move glyph_positions to new cpp
This commit is contained in:
parent
39ff0945ef
commit
4e7feaf747
@ -31,7 +31,7 @@
|
||||
#include <mapnik/image_compositing.hpp>
|
||||
#include <mapnik/font_engine_freetype.hpp>
|
||||
#include <mapnik/gradient.hpp>
|
||||
#include <mapnik/text/placements_list.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/vertex.hpp>
|
||||
#include <mapnik/noncopyable.hpp>
|
||||
#include <mapnik/symbolizer_base.hpp>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include <mapnik/group/group_layout_manager.hpp>
|
||||
#include <mapnik/group/group_symbolizer_helper.hpp>
|
||||
#include <mapnik/group/group_symbolizer_properties.hpp>
|
||||
#include <mapnik/text/placements_list.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/util/conversions.hpp>
|
||||
#include <mapnik/util/variant.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
|
||||
@ -76,7 +76,7 @@ public:
|
||||
void reserve(unsigned count);
|
||||
|
||||
pixel_position const& get_base_point() const;
|
||||
void set_base_point(pixel_position base_point);
|
||||
void set_base_point(pixel_position const& base_point);
|
||||
void set_marker(marker_info_ptr marker, pixel_position const& marker_pos);
|
||||
marker_info_ptr marker() const;
|
||||
pixel_position const& marker_pos() const;
|
||||
@ -27,7 +27,7 @@
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/placements/base.hpp>
|
||||
#include <mapnik/text/placements_list.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/text/rotation.hpp>
|
||||
#include <mapnik/noncopyable.hpp>
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
#include <mapnik/text/placement_finder.hpp>
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
#include <mapnik/text/placements_list.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/text/vertex_cache.hpp>
|
||||
#include <mapnik/text/tolerance_iterator.hpp>
|
||||
|
||||
|
||||
@ -210,6 +210,7 @@ source = Split(
|
||||
text/itemizer.cpp
|
||||
text/scrptrun.cpp
|
||||
text/face.cpp
|
||||
text/glyph_positions.cpp
|
||||
text/placement_finder.cpp
|
||||
text/properties_util.cpp
|
||||
text/renderer.cpp
|
||||
|
||||
87
src/text/glyph_positions.cpp
Normal file
87
src/text/glyph_positions.cpp
Normal file
@ -0,0 +1,87 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* This file is part of Mapnik (c++ mapping toolkit)
|
||||
*
|
||||
* Copyright (C) 2013 Artem Pavlenko
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
//mapnik
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/rotation.hpp>
|
||||
#include <mapnik/text/glyph_info.hpp>
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
glyph_positions::glyph_positions()
|
||||
: data_(),
|
||||
base_point_(),
|
||||
marker_(),
|
||||
marker_pos_(),
|
||||
bbox_() {}
|
||||
|
||||
glyph_positions::const_iterator glyph_positions::begin() const
|
||||
{
|
||||
return data_.begin();
|
||||
}
|
||||
|
||||
glyph_positions::const_iterator glyph_positions::end() const
|
||||
{
|
||||
return data_.end();
|
||||
}
|
||||
|
||||
void glyph_positions::push_back(glyph_info const& glyph, pixel_position offset, rotation const& rot)
|
||||
{
|
||||
data_.push_back(glyph_position(glyph, offset, rot));
|
||||
}
|
||||
|
||||
void glyph_positions::reserve(unsigned count)
|
||||
{
|
||||
data_.reserve(count);
|
||||
}
|
||||
|
||||
pixel_position const& glyph_positions::get_base_point() const
|
||||
{
|
||||
return base_point_;
|
||||
}
|
||||
|
||||
void glyph_positions::set_base_point(pixel_position const& base_point)
|
||||
{
|
||||
base_point_ = base_point;
|
||||
}
|
||||
|
||||
void glyph_positions::set_marker(marker_info_ptr marker, pixel_position const& marker_pos)
|
||||
{
|
||||
marker_ = marker;
|
||||
marker_pos_ = marker_pos;
|
||||
}
|
||||
|
||||
marker_info_ptr glyph_positions::marker() const
|
||||
{
|
||||
return marker_;
|
||||
}
|
||||
|
||||
pixel_position const& glyph_positions::marker_pos() const
|
||||
{
|
||||
return marker_pos_;
|
||||
}
|
||||
|
||||
}// ns mapnik
|
||||
@ -28,7 +28,7 @@
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/glyph_info.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
#include <mapnik/text/placements_list.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/text/vertex_cache.hpp>
|
||||
|
||||
// agg
|
||||
@ -397,58 +397,4 @@ box2d<double> placement_finder::get_bbox(text_layout const& layout, glyph_info c
|
||||
return bbox;
|
||||
}
|
||||
|
||||
|
||||
glyph_positions::glyph_positions()
|
||||
: data_(),
|
||||
base_point_(),
|
||||
marker_(),
|
||||
marker_pos_(),
|
||||
bbox_() {}
|
||||
|
||||
glyph_positions::const_iterator glyph_positions::begin() const
|
||||
{
|
||||
return data_.begin();
|
||||
}
|
||||
|
||||
glyph_positions::const_iterator glyph_positions::end() const
|
||||
{
|
||||
return data_.end();
|
||||
}
|
||||
|
||||
void glyph_positions::push_back(glyph_info const& glyph, pixel_position const offset, rotation const& rot)
|
||||
{
|
||||
data_.push_back(glyph_position(glyph, offset, rot));
|
||||
}
|
||||
|
||||
void glyph_positions::reserve(unsigned count)
|
||||
{
|
||||
data_.reserve(count);
|
||||
}
|
||||
|
||||
pixel_position const& glyph_positions::get_base_point() const
|
||||
{
|
||||
return base_point_;
|
||||
}
|
||||
|
||||
void glyph_positions::set_base_point(pixel_position const base_point)
|
||||
{
|
||||
base_point_ = base_point;
|
||||
}
|
||||
|
||||
void glyph_positions::set_marker(marker_info_ptr marker, pixel_position const& marker_pos)
|
||||
{
|
||||
marker_ = marker;
|
||||
marker_pos_ = marker_pos;
|
||||
}
|
||||
|
||||
marker_info_ptr glyph_positions::marker() const
|
||||
{
|
||||
return marker_;
|
||||
}
|
||||
|
||||
pixel_position const& glyph_positions::marker_pos() const
|
||||
{
|
||||
return marker_pos_;
|
||||
}
|
||||
|
||||
}// ns mapnik
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user