+ more const correctness

This commit is contained in:
artemp 2012-07-11 10:32:08 +01:00
parent 35ab93667f
commit 8cf9a5a082
8 changed files with 11 additions and 11 deletions

View file

@ -110,7 +110,7 @@ public:
virtual void add_box(box2d<double> const& box, Feature const& feature, virtual void add_box(box2d<double> const& box, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,
metawriter_properties const& properties)=0; metawriter_properties const& properties)=0;
virtual void add_text(boost::ptr_vector<text_path> &placements, virtual void add_text(boost::ptr_vector<text_path> const& placements,
box2d<double> const& extents, box2d<double> const& extents,
Feature const& feature, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,

View file

@ -65,7 +65,7 @@ public:
virtual void add_box(box2d<double> const& box, Feature const& feature, virtual void add_box(box2d<double> const& box, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,
metawriter_properties const& properties); metawriter_properties const& properties);
virtual void add_text(boost::ptr_vector<text_path> &placements, virtual void add_text(boost::ptr_vector<text_path> const& placements,
box2d<double> const& extents, box2d<double> const& extents,
Feature const& feature, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,

View file

@ -45,7 +45,7 @@ public:
virtual void add_box(box2d<double> const& box, Feature const& feature, virtual void add_box(box2d<double> const& box, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,
metawriter_properties const& properties); metawriter_properties const& properties);
virtual void add_text(boost::ptr_vector<text_path> &placements, virtual void add_text(boost::ptr_vector<text_path> const& placements,
box2d<double> const& extents, box2d<double> const& extents,
Feature const& feature, Feature const& feature,
CoordTransform const& t, CoordTransform const& t,

View file

@ -80,7 +80,7 @@ public:
/** Remove old placements. */ /** Remove old placements. */
void clear_placements(); void clear_placements();
inline placements_type &get_results() { return placements_; } inline placements_type const& get_results() { return placements_; }
/** Additional boxes to take into account when finding placement. /** Additional boxes to take into account when finding placement.
* Used for finding line placements where multiple placements are returned. * Used for finding line placements where multiple placements are returned.

View file

@ -85,7 +85,7 @@ public:
bool next(); bool next();
/** Get current placement. next() has to be called before! */ /** Get current placement. next() has to be called before! */
placements_type & placements() const; placements_type const& placements() const;
protected: protected:
bool next_point_placement(); bool next_point_placement();
bool next_line_placement(); bool next_line_placement();

View file

@ -177,7 +177,7 @@ void metawriter_json_stream::add_box(box2d<double> const &box, Feature const& fe
} }
void metawriter_json_stream::add_text( void metawriter_json_stream::add_text(
boost::ptr_vector<text_path> &placements, box2d<double> const& extents, boost::ptr_vector<text_path> const& placements, box2d<double> const& extents,
Feature const& feature, CoordTransform const& t, Feature const& feature, CoordTransform const& t,
metawriter_properties const& properties) metawriter_properties const& properties)
{ {
@ -195,14 +195,15 @@ void metawriter_json_stream::add_text(
*/ */
for (unsigned n = 0; n < placements.size(); n++) for (unsigned n = 0; n < placements.size(); n++)
{ {
text_path &current_placement = placements[n]; text_path const& current_placement = placements[n];
bool inside = false; /* Part of text is inside rendering region */ bool inside = false; /* Part of text is inside rendering region */
bool straight = true; bool straight = true;
char_info_ptr c; char_info_ptr c;
double x, y, angle; double x, y, angle;
current_placement.rewind(); current_placement.rewind();
for (int i = 0; i < current_placement.num_nodes(); ++i) { for (int i = 0; i < current_placement.num_nodes(); ++i)
{
int cx = current_placement.center.x; int cx = current_placement.center.x;
int cy = current_placement.center.y; int cy = current_placement.center.y;
current_placement.vertex(&c, &x, &y, &angle); current_placement.vertex(&c, &x, &y, &angle);

View file

@ -71,7 +71,7 @@ metawriter_inmem::add_box(box2d<double> const& box, Feature const& feature,
void void
metawriter_inmem::add_text( metawriter_inmem::add_text(
boost::ptr_vector<text_path> & /*text*/, boost::ptr_vector<text_path> const& /*text*/,
box2d<double> const& extents, box2d<double> const& extents,
Feature const& feature, Feature const& feature,
CoordTransform const& /*t*/, CoordTransform const& /*t*/,
@ -146,4 +146,3 @@ metawriter_inmem::inst_end() const {
} }

View file

@ -247,7 +247,7 @@ bool text_symbolizer_helper<FaceManagerT, DetectorT>::next_placement()
} }
template <typename FaceManagerT, typename DetectorT> template <typename FaceManagerT, typename DetectorT>
placements_type &text_symbolizer_helper<FaceManagerT, DetectorT>::placements() const placements_type const& text_symbolizer_helper<FaceManagerT, DetectorT>::placements() const
{ {
return finder_->get_results(); return finder_->get_results();
} }