fix behavior of marker-ignore-placement on lines - closes #1931

This commit is contained in:
Dane Springmeyer 2013-06-28 15:53:08 -04:00
parent 36814bcb2e
commit 3ae432ac96
4 changed files with 13 additions and 9 deletions

View file

@ -123,7 +123,7 @@ struct raster_markers_rasterizer_dispatch_grid
sym_.get_max_error(), sym_.get_max_error(),
sym_.get_allow_overlap()); sym_.get_allow_overlap());
double x, y, angle; double x, y, angle;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle, sym_.get_ignore_placement()))
{ {
agg::trans_affine matrix = marker_trans_; agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle); matrix.rotate(angle);
@ -260,7 +260,7 @@ struct vector_markers_rasterizer_dispatch_grid
sym_.get_max_error(), sym_.get_max_error(),
sym_.get_allow_overlap()); sym_.get_allow_overlap());
double x, y, angle; double x, y, angle;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle, sym_.get_ignore_placement()))
{ {
agg::trans_affine matrix = marker_trans_; agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle); matrix.rotate(angle);

View file

@ -142,7 +142,7 @@ struct vector_markers_rasterizer_dispatch
double x = 0; double x = 0;
double y = 0; double y = 0;
double angle = 0; double angle = 0;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle, sym_.get_ignore_placement()))
{ {
agg::trans_affine matrix = marker_trans_; agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle); matrix.rotate(angle);
@ -245,7 +245,7 @@ struct raster_markers_rasterizer_dispatch
sym_.get_max_error(), sym_.get_max_error(),
sym_.get_allow_overlap()); sym_.get_allow_overlap());
double x, y, angle; double x, y, angle;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle,sym_.get_ignore_placement()))
{ {
agg::trans_affine matrix = marker_trans_; agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle); matrix.rotate(angle);

View file

@ -107,10 +107,10 @@ public:
* \param x Return value for x position * \param x Return value for x position
* \param y Return value for x position * \param y Return value for x position
* \param angle Return value for rotation angle * \param angle Return value for rotation angle
* \param add_to_detector Add selected position to detector * \param ignore_placement Whether to add selected position to detector
* \return True if a place is found, false if none is found. * \return True if a place is found, false if none is found.
*/ */
bool get_point(double & x, double & y, double & angle, bool add_to_detector = true) bool get_point(double & x, double & y, double & angle, bool ignore_placement)
{ {
if (done_) if (done_)
{ {
@ -219,7 +219,11 @@ public:
set_spacing_left(spacing_left_ + spacing_ * max_error_ / 10.0); //Only moves forward set_spacing_left(spacing_left_ + spacing_ * max_error_ / 10.0); //Only moves forward
continue; continue;
} }
if (add_to_detector) detector_.insert(box); if (!ignore_placement)
{
std::clog << "Adding\n";
detector_.insert(box);
}
last_x = x; last_x = x;
last_y = y; last_y = y;
return true; return true;

View file

@ -1031,7 +1031,7 @@ struct markers_dispatch
sym_.get_max_error(), sym_.get_max_error(),
sym_.get_allow_overlap()); sym_.get_allow_overlap());
double x, y, angle; double x, y, angle;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle, sym_.get_ignore_placement()))
{ {
agg::trans_affine matrix = marker_trans_; agg::trans_affine matrix = marker_trans_;
matrix.rotate(angle); matrix.rotate(angle);
@ -1119,7 +1119,7 @@ struct markers_dispatch_2
sym_.get_max_error(), sym_.get_max_error(),
sym_.get_allow_overlap()); sym_.get_allow_overlap());
double x, y, angle; double x, y, angle;
while (placement.get_point(x, y, angle)) while (placement.get_point(x, y, angle, sym_.get_ignore_placement()))
{ {
coord2d center = bbox_.center(); coord2d center = bbox_.center();
agg::trans_affine matrix = agg::trans_affine_translation(-center.x, -center.y); agg::trans_affine matrix = agg::trans_affine_translation(-center.x, -center.y);