DGtal  1.5.beta
CBDRFastSolver.h
1 
17 #pragma once
18 
28 #if defined(CBDRFASTSOLVER_RECURSES)
29 #error Recursive header files inclusion detected in CBDRFastSolver.h
30 #else // defined(CBDRFASTSOLVER_RECURSES)
32 #define CBDRFASTSOLVER_RECURSES
33 
34 #if !defined CBDRFASTSOLVER_h
36 #define CBDRFASTSOLVER_h
37 
39 // Inclusions
40 #include "NBijectiveReflectionGenerator.h"
41 namespace DGtal {
42  template<typename TSpace,typename TDomain>
46  public:
47  CBDRFastSolver(const std::vector<BijectiveReflections>& vecOptimisedReflections,const double rotAngle,
48  const typename TDomain::Point center,
49  const int km):my_vecOptimisedReflections(vecOptimisedReflections),my_angle(rotAngle),my_center(center),kmax(km){}
50 
52  double angleInDegrees = my_angle * 180.0 / M_PI;
53  angleInDegrees = fmod(angleInDegrees, 360.0);
54  if (angleInDegrees < 0) {
55  angleInDegrees += 360.0;
56  }
57  return my_vecOptimisedReflections[static_cast<int>(std::round(angleInDegrees))];
58  }
59  protected:
60  std::vector<BijectiveReflections> my_vecOptimisedReflections;
61  double my_angle;
63  int kmax;
64  };
65 }
66 
67 
68 
69 #endif //CBDRFASTSOLVER
70 #undef CBDRFASTSOLVER_RECURSES
71 #endif // else defined(CBDRFASTSOLVER_RECURSES)
CBDR_naiverotation< TSpace > BijectiveReflections
Reflection< TSpace > DigitizedReflection
CBDRFastSolver(const std::vector< BijectiveReflections > &vecOptimisedReflections, const double rotAngle, const typename TDomain::Point center, const int km)
TDomain::Point my_center
std::vector< BijectiveReflections > my_vecOptimisedReflections
BijectiveReflections solve()
DGtal is the top-level namespace which contains all DGtal functions and types.
vec since the parameters are the vectors of digitized reflections
MyPointD Point
Definition: testClone2.cpp:383