~ubuntu-branches/debian/stretch/cgal/stretch

« back to all changes in this revision

Viewing changes to include/CGAL/Arr_point_location/Arr_lm_specified_points_generator.h

  • Committer: Package Import Robot
  • Author(s): Joachim Reichel
  • Date: 2014-04-05 10:56:43 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20140405105643-jgnrpu2thtx23zfs
Tags: 4.4-1
* New upstream release.
* Remove patches do-not-link-example-with-qt4-support-library.patch and
  fix_jet_fitting_3.patch (applied upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
//
15
15
// $URL$
16
16
// $Id$
17
 
// 
 
17
//
18
18
// Author(s)     : Shlomo Golubev   <golubevs@post.tau.ac.il>
19
19
 
20
 
#ifndef CGAL_ARR_SPECIFIED_POINTS_GENERATOR_H
21
 
#define CGAL_ARR_SPECIFIED_POINTS_GENERATOR_H
 
20
#ifndef CGAL_ARR_LANDMARKS_SPECIFIED_POINTS_GENERATOR_H
 
21
#define CGAL_ARR_LANDMARKS_SPECIFIED_POINTS_GENERATOR_H
22
22
 
23
23
/*! \file
24
24
 * Definition of the Arr_lm_specified_points_generator<Arrangement> template.
65
65
 
66
66
  typedef typename Nearest_neighbor::NN_Point_2         NN_Point_2;
67
67
  typedef std::list<NN_Point_2>                         NN_Point_list;
68
 
  
 
68
 
69
69
protected:
70
70
  typedef Arr_traits_basic_adaptor_2<Geometry_traits_2> Traits_adaptor_2;
71
71
  typedef typename Base::PL_result_type                 PL_result_type;
85
85
  /*! Assignment operator - not supported. */
86
86
  Self& operator=(const Self&);
87
87
 
88
 
public: 
89
 
  /*! Constructor. */
 
88
public:
 
89
  /*! Constructor.
 
90
   * Create landmarks in the points that are given to it.
 
91
   */
90
92
  Arr_landmarks_specified_points_generator(const Arrangement_2& arr,
91
93
                                           const Points_set points) :
92
94
    Base(arr),
 
95
    m_traits(static_cast<const Traits_adaptor_2*>(arr.geometry_traits())),
 
96
    m_points(points),
93
97
    num_landmarks(points.size())
94
 
  {
95
 
    //this constructor creates landmarks in the points that are given to it
96
 
    m_traits = static_cast<const Traits_adaptor_2*>(arr.geometry_traits());
97
 
    m_points = points;
98
 
    build_landmark_set();
99
 
  }
 
98
  { build_landmark_set(); }
100
99
 
 
100
  /*! Constructor. from an arrangement.
 
101
   * \param arr (in) The arrangement.
 
102
   */
101
103
  Arr_landmarks_specified_points_generator(const Arrangement_2& arr) :
102
 
    Base(arr)
 
104
    Base(arr),
 
105
    m_traits(static_cast<const Traits_adaptor_2*> (arr.geometry_traits())),
 
106
    num_landmarks(1)
103
107
  {
104
108
    //this constructor creates a single landmark in the origin
105
109
    m_points.push_back(Point_2(0,0));
106
 
    num_landmarks = 1;
107
 
    m_traits = static_cast<const Traits_adaptor_2*> (arr.geometry_traits());
108
110
    build_landmark_set();
109
111
  }
110
112
 
114
116
    CGAL_error();
115
117
  }
116
118
 
117
 
  /*!
118
 
   * Creates the landmark set, using all arrangement vertices.
 
119
  /*! Create the landmark set, using all arrangement vertices.
119
120
   */
120
121
  void build_landmark_set()
121
122
  {
122
 
 
123
123
    lm_pairs.clear();
124
 
    locate (*(this->arrangement()), m_points.begin(), m_points.end(),
125
 
            std::back_inserter(lm_pairs));
 
124
    locate(*(this->arrangement()), m_points.begin(), m_points.end(),
 
125
           std::back_inserter(lm_pairs));
126
126
 
127
127
    // Go over the container of the specified points and insert them as
128
128
    // landmarks.
129
 
    NN_Point_list                   nnp_list; 
 
129
    NN_Point_list                   nnp_list;
130
130
    typename Points_set::iterator   pt_it;
131
131
    typename Pairs_set::iterator    pairs_it;
132
 
    for (pt_it = m_points.begin(); pt_it != m_points.end(); ++pt_it)
133
 
    {
 
132
    for (pt_it = m_points.begin(); pt_it != m_points.end(); ++pt_it) {
134
133
      for (pairs_it = lm_pairs.begin();
135
134
           pairs_it != lm_pairs.end() && (*pairs_it).first != (*pt_it);
136
135
           ++pairs_it) {};
137
 
      if ((*pairs_it).first == (*pt_it))
138
 
      {
 
136
      if ((*pairs_it).first == (*pt_it)) {
139
137
        nnp_list.push_back (NN_Point_2 ((*pt_it),(*pairs_it).second));
140
138
      }
141
139
    }