Free Electron
SurfaceModel.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_Surface_h__
8 #define __surface_Surface_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief SurfaceModel RecordView
17 
18  @ingroup surface
19 *//***************************************************************************/
20 class FE_DL_EXPORT SurfaceModel:
21  virtual public Recordable,
22  public CastableAs<SurfaceModel>
23 {
24  public:
25  Functor<String> searchName;
26  Functor< sp<Component> > searchComponent;
27  Functor< sp<RecordGroup> > surfacePointRG;
28  Functor< sp<RecordGroup> > surfacePointSetRG;
29  Functor< sp<RecordGroup> > surfaceVertexRG;
30  Functor< sp<RecordGroup> > surfacePrimitiveRG;
31  Functor< sp<RecordGroup> > surfacePrimitiveSetRG;
32  Functor< sp<RecordGroup> > surfaceDetailRG;
33 
34  SurfaceModel(void) { setName("SurfaceModel"); }
35 virtual void addFunctors(void)
36  {
38 
39  add(searchName, FE_SPEC("surf:searchName",
40  "name of SpatialTreeI Component"));
41  add(searchComponent, FE_SPEC("surf:search",
42  "Instance of SpatialTreeI Component"));
43  add(surfacePointRG, FE_SPEC("surf:pointgroup",
44  "RecordGroup of surface points"));
45  add(surfacePointSetRG, FE_SPEC("surf:ptsetgroup",
46  "RecordGroup of surface point sets"));
47  add(surfaceVertexRG, FE_SPEC("surf:vertgroup",
48  "RecordGroup of surface vertices"));
49  add(surfacePrimitiveRG, FE_SPEC("surf:primgroup",
50  "RecordGroup of surface primitives"));
51  add(surfacePrimitiveSetRG, FE_SPEC("surf:prsetgroup",
52  "RecordGroup of surface primitive sets"));
53  add(surfaceDetailRG, FE_SPEC("surf:detgroup",
54  "RecordGroup of surface details"));
55  }
56 virtual void initializeRecord(void)
57  {
59 
60  surfacePointRG.createAndSetRecordGroup();
61  surfacePointSetRG.createAndSetRecordGroup();
62  surfaceVertexRG.createAndSetRecordGroup();
63  surfacePrimitiveRG.createAndSetRecordGroup();
64  surfacePrimitiveSetRG.createAndSetRecordGroup();
65  surfaceDetailRG.createAndSetRecordGroup();
66 
67  searchComponent.attribute()->setSerialize(FALSE);
68  }
69 virtual void finalizeRecord(void)
70  {
72 
73  //* TODO may need to be more generalized than SpatialTreeI
74  if(!searchName().empty())
75  {
76  searchComponent.createAndSetComponent(searchName());
77  }
78  }
79 };
80 
81 } /* namespace ext */
82 } /* namespace fe */
83 
84 #endif /* __surface_Surface_h__ */
85 
86 
void createAndSetRecordGroup(void)
Create a RecordGroup for the attribute.
Definition: RecordView.h:258
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: SurfaceModel.h:56
virtual void finalizeRecord(void)
Called right after instantiation to finalize complex attributes.
Definition: Recordable.h:45
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Recordable.h:31
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Recordable.h:37
sp< Attribute > attribute(void) const
Return the attribute this accessor is for.
Definition: Accessor.cc:151
virtual void finalizeRecord(void)
Called right after instantiation to finalize complex attributes.
Definition: SurfaceModel.h:69
SurfaceModel RecordView.
Definition: SurfaceModel.h:20
void createAndSetComponent(String componentName)
Create a named component for the attribute.
Definition: RecordView.h:236
Recordable RecordView.
Definition: Recordable.h:23
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: SurfaceModel.h:35
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192