Free Electron
Sphere.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 __shape_Sphere_h__
8 #define __shape_Sphere_h__
9 
10 FE_ATTRIBUTE("spc:at", "Local origin");
11 FE_ATTRIBUTE("bnd:radius", "Spherical shell");
12 FE_ATTRIBUTE("bnd:picked", "Set 0 to 1 during a selection operation");
13 FE_ATTRIBUTE("bnd:shape", "Record of spatial encapsulation");
14 
15 namespace fe
16 {
17 namespace ext
18 {
19 
20 /**************************************************************************//**
21  @brief Sphere RecordView
22 
23  @ingroup shape
24 
25  This is the base for all shapes.
26  All shapes are expected to maintain this as a proper bounding sphere.
27 *//***************************************************************************/
28 class FE_DL_EXPORT Sphere: virtual public RecordView
29 {
30  public:
31  Functor<Real> radius;
32  Functor<Real> picked;
33  Functor<SpatialVector> location;
34 
35  Sphere(void) { setName("Sphere"); }
36 virtual void addFunctors(void)
37  {
38  add(radius, FE_USE("bnd:radius"));
39  add(picked, FE_USE("bnd:picked"));
40  add(location, FE_USE("spc:at"));
41  }
42 virtual void initializeRecord(void)
43  {
44  set(location());
45  radius()=1.0f;
46  picked()=0.0f;
47  }
48 };
49 
50 } /* namespace ext */
51 } /* namespace fe */
52 
53 #endif /* __shape_Sphere_h__ */
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Sphere.h:36
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Sphere.h:42
Bindable collection of accessor Functors.
Definition: RecordView.h:106
Sphere RecordView.
Definition: Sphere.h:28