Free Electron
Attractor.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 __intelligence_Attractor_h__
8 #define __intelligence_Attractor_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Attractor RecordView
16 
17  @ingroup intelligence
18 *//***************************************************************************/
19 class FE_DL_EXPORT Attractor: public Scanner
20 {
21  public:
22  Functor<F32> attraction;
23  Functor<F32> focus;
24 
25  Attractor(void) { setName("Attractor"); }
26 virtual void addFunctors(void)
27  {
29 
30  add(attraction, FE_SPEC("ai:attraction",
31  "Attractive force"));
32  add(focus, FE_SPEC("ai:focus",
33  "Distance to point of effect"));
34  }
35 virtual void initializeRecord(void)
36  {
38 
39  identifier()="Attractor";
40 
41  Observation observationRV;
42  observationRV.bind(purview());
43  Cylinder cylinderRV;
44  cylinderRV.bind(observationRV.shape());
45 
46  set(cylinderRV.span(),0.0f,-4.0f,0.0f);
47  cylinderRV.baseRadius()=1.0f;
48  cylinderRV.endRadius()=5.0f;
49 
50  set(autoRotate());
51 
52  attraction()=1.0f;
53  focus()=1.0f;
54  }
55 };
56 
57 } /* namespace ext */
58 } /* namespace fe */
59 
60 #endif /* __intelligence_Attractor_h__ */
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: lab/intelligence/Scanner.h:36
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Attractor.h:35
void bind(sp< Scope > &rspScope)
Associate with a Scope.
Definition: RecordView.h:319
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
Attractor RecordView.
Definition: Attractor.h:19
Cylinder RecordView.
Definition: Cylinder.h:27
Scanner RecordView.
Definition: lab/intelligence/Scanner.h:19
Observation RecordView.
Definition: Observation.h:22
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Attractor.h:26
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: lab/intelligence/Scanner.h:65