+ add accessor methods

This commit is contained in:
artemp 2012-07-13 10:25:12 +01:00
parent bc8d6568f5
commit 1e6be7abc3
3 changed files with 13 additions and 10 deletions

View File

@ -82,12 +82,8 @@ public:
inline placements_type const& get_results() { return placements_; }
/** Additional boxes to take into account when finding placement.
* Used for finding line placements where multiple placements are returned.
* Boxes are relative to starting point of current placement.
* Only used for point placements!
*/
std::vector<box2d<double> > additional_boxes;
std::vector<box2d<double> > & additional_boxes() { return additional_boxes_;}
std::vector<box2d<double> > const& additional_boxes() const { return additional_boxes_;}
void set_collect_extents(bool collect) { collect_extents_ = collect; }
bool get_collect_extents() const { return collect_extents_; }
@ -160,6 +156,13 @@ private:
box2d<double> extents_;
/** Collect a bounding box of all texts placed. */
bool collect_extents_;
/** Additional boxes to take into account when finding placement.
* Used for finding line placements where multiple placements are returned.
* Boxes are relative to starting point of current placement.
* Only used for point placements!
*/
std::vector<box2d<double> > additional_boxes_;
};
}

View File

@ -500,9 +500,9 @@ void placement_finder<DetectorT>::find_point_placement(double label_x,
}
// check the placement of any additional envelopes
if (!p.allow_overlap && !additional_boxes.empty())
if (!p.allow_overlap && !additional_boxes_.empty())
{
BOOST_FOREACH(box2d<double> box, additional_boxes)
BOOST_FOREACH(box2d<double> const& box, additional_boxes_)
{
box2d<double> pt(box.minx() + current_placement->center.x,
box.miny() + current_placement->center.y,

View File

@ -380,9 +380,9 @@ template <typename FaceManagerT, typename DetectorT>
bool shield_symbolizer_helper<FaceManagerT, DetectorT>::next_line_placement()
{
position const& pos = placement_->properties.displacement;
finder_->additional_boxes.clear();
finder_->additional_boxes().clear();
//Markers are automatically centered
finder_->additional_boxes.push_back(
finder_->additional_boxes().push_back(
box2d<double>(-0.5 * marker_ext_.width() - pos.first,
-0.5 * marker_ext_.height() - pos.second,
0.5 * marker_ext_.width() - pos.first,