LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
helpermethods.h
Go to the documentation of this file.
1 //
2 // Created by R. van Twisk on 4/27/16.
3 //
4 
5 #pragma once
6 
8 #include <vector>
9 
10 #include <Eigen/Core>
11 #include <Eigen/Dense>
12 
13 namespace lc {
18  class HelperMethods {
19  public:
20  template<typename T>
21  static std::vector<T> transform2d(const std::vector<T> &in,
22  double xx,
23  double yx,
24  double xy,
25  double yy,
26  double x0,
27  double y0) {
28  // TODO
29  // you can transform all points at once, essentially by using a Eigen::Map<const Eigen::Matrix<double, 2, Eigen::Dynamic> >,
30  // initialized with the address of the first coordinate of the first element of the vector
31 
32  std::vector<T> out;
33  for (auto c : in) {
34  out.emplace_back(c.transform2d(xx, yx, xy, yy, x0, y0));
35  }
36  return out;
37  }
38 
39  };
40 }
static std::vector< T > transform2d(const std::vector< T > &in, double xx, double yx, double xy, double yy, double x0, double y0)
Definition: helpermethods.h:21
Definition: cadentity.h:12