Free Electron
SurfaceTransform.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 __surface_SurfaceTransform_h__
8 #define __surface_SurfaceTransform_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief SurfaceTransform RecordView
17 
18  @ingroup surface
19 *//***************************************************************************/
20 class FE_DL_EXPORT SurfaceTransform:
21  virtual public SurfacePoint,
22  public CastableAs<SurfaceTransform>
23 {
24  public:
25  Functor<SpatialTransform> transform;
26  Functor<SpatialVector> direction;
28 
29  SurfaceTransform(void) { setName("SurfaceTransform"); }
30 virtual void addFunctors(void)
31  {
33 
34  add(transform, FE_SPEC("spc:transform",
35  "Spatial position"));
36  add(direction, FE_SPEC("spc:dir",
37  "Orientation facing forward"));
38  add(left, FE_SPEC("spc:left",
39  "Orientation to side from direction"));
40  }
41 virtual void populate(sp<Layout> spLayout)
42  {
43  SurfacePoint::populate(spLayout);
44 
45 // TODO: Jason, these are no longer embedded. Probably needs some fixing
46 #ifdef DEPRECATE
47  //* embed sub-vectors
48  scope()->within(spLayout->name(), "spc:dir",
49  "spc:transform", 0);
50  scope()->within(spLayout->name(), "spc:left",
51  "spc:transform", sizeof(SpatialVector));
52  scope()->within(spLayout->name(), "spc:up",
53  "spc:transform", 2*sizeof(SpatialVector));
54  scope()->within(spLayout->name(), "spc:at",
55  "spc:transform", 3*sizeof(SpatialVector));
56 #endif
57  }
58 virtual void initializeRecord(void)
59  {
61 
62  transform.attribute()->setSerialize(FALSE);
63 
64  set(uvw(),0.0f,0.0f,1.0f);
65  setIdentity(transform());
66  }
67 };
68 
69 } /* namespace ext */
70 } /* namespace fe */
71 
72 #endif /* __surface_SurfaceTransform_h__ */
73 
74 
75 
SurfaceTransform RecordView.
Definition: SurfaceTransform.h:20
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: SurfaceTransform.h:58
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: SurfacePoint.h:41
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: SurfaceTransform.h:30
sp< Attribute > attribute(void) const
Return the attribute this accessor is for.
Definition: Accessor.cc:151
SurfacePoint RecordView.
Definition: SurfacePoint.h:20
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: SurfacePoint.h:31
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192