Code-Eli  0.3.6
equivalent_curves.hpp
Go to the documentation of this file.
1 /*********************************************************************************
2 * Copyright (c) 2013 David D. Marshall <ddmarsha@calpoly.edu>
3 *
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * David D. Marshall - initial code and implementation
11 ********************************************************************************/
12 
13 #ifndef eli_geom_curve_equivalent_curves_hpp
14 #define eli_geom_curve_equivalent_curves_hpp
15 
16 #include "eli/code_eli.hpp"
17 
19 
20 namespace eli
21 {
22  namespace geom
23  {
24  namespace curve
25  {
26  template<typename data__, unsigned short dim__, typename tol__>
28  {
29  // if are same degree then compare control points
30  if (c0.degree()==c1.degree())
31  {
32  return c0.approximately_equal(c1);
33  }
34  // else need to degree promote lower degree curve
35  else if (c0.degree()<c1.degree())
36  {
38  while(c0e.degree()<c1.degree())
39  {
40  c0e.degree_promote();
41  }
42 
43  return c0e.approximately_equal(c1);
44  }
45  else
46  {
47  assert(c0.degree()>c1.degree());
48 
50  while(c1e.degree()<c0.degree())
51  {
52  c1e.degree_promote();
53  }
54 
55  return c1e.approximately_equal(c0);
56  }
57 
58  return false;
59  }
60  }
61  }
62 }
63 #endif
64 
Definition: math.hpp:20
void degree_promote()
Definition: bezier.hpp:436
bool approximately_equal(const bezier< data_type, dim__, tolerance_type > &bc) const
Definition: bezier.hpp:153
index_type degree() const
Definition: bezier.hpp:191
bool equivalent_curves(const bezier< data__, dim__, tol__ > &c0, const bezier< data__, dim__, tol__ > &c1)
Definition: equivalent_curves.hpp:27
Definition: bezier.hpp:109