Free Electron
LocatorFromEulerSystem.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __tire_LocatorFromEulerSystem_h__
8 #define __tire_LocatorFromEulerSystem_h__
9 
10 #include "solve/solve.h"
11 
12 namespace fe
13 {
14 namespace ext
15 {
16 
17 class LocatorFromEulerSystem :
18  virtual public SystemI,
19  public Initialize<LocatorFromEulerSystem>
20 {
21  public:
22  LocatorFromEulerSystem(void) {}
23  void initialize(void) {}
24  void compile(const t_note_id &a_note_id)
25  {
26  AsLocatorFromEuler asLocatorFromEuler;
27  asLocatorFromEuler.bind(m_rg_dataset->scope());
28  std::vector<Record> locators;
29  asLocatorFromEuler.filter(locators, m_rg_dataset);
30 
31  for(unsigned int i_loc = 0; i_loc < locators.size(); i_loc++)
32  {
33  Record &r_locator = locators[i_loc];
34  setIdentity(asLocatorFromEuler.transform(r_locator));
35  translate(asLocatorFromEuler.transform(r_locator),
36  asLocatorFromEuler.location(r_locator));
37  rotate(asLocatorFromEuler.transform(r_locator),
38  asLocatorFromEuler.zyx(r_locator)[0], e_zAxis);
39  rotate(asLocatorFromEuler.transform(r_locator),
40  asLocatorFromEuler.zyx(r_locator)[1], e_yAxis);
41  rotate(asLocatorFromEuler.transform(r_locator),
42  asLocatorFromEuler.zyx(r_locator)[2], e_xAxis);
43  }
44  }
45 virtual void connectOrchestrator(sp<OrchestratorI> a_spOrchestrator)
46  {
47  a_spOrchestrator->connect(this,
48  &LocatorFromEulerSystem::compile,FE_NOTE_COMPILE);
49  m_rg_dataset = a_spOrchestrator->dataset();
50  }
51 
52  protected:
53  sp<RecordGroup> m_rg_dataset;
54 };
55 
56 } /* namespace ext */
57 } /* namespace fe */
58 
59 #endif /* __tire_LocatorFromEulerSystem_h__ */
60 
kernel
Definition: namespace.dox:3