Free Electron
ShapeSelector.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_ShapeSelector_h__
8 #define __shape_ShapeSelector_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Intersect a shape or shapes with a RecordGroup
17 
18  @ingroup shape
19 
20  The configured criteria should be either a Record or RecordGroup of shapes.
21  Each criteria Record is checked to contain a "bnd:shape" attribute or to be
22  a shape itself.
23 
24  Currently, the supported shapes are sphere and cylinder.
25 
26  As a SelectorI, "marking" a shape is defined as setting any
27  "bnd:picked" atrribute to 1.
28 *//***************************************************************************/
29 class FE_DL_EXPORT ShapeSelector: virtual public SelectorI
30 {
31  public:
32  //* as HandlerI
33 virtual void handle(Record &record);
34 
35  //* as SelectorI
36 virtual void configure(const Record& rCriteria,
37  const sp<FilterI>& rspFilter);
38 
39 virtual void configure(const sp<RecordGroup>& rspCriteria,
40  const sp<FilterI>& rspFilter,
41  BWORD cumulative);
42 
43  private:
44 virtual Record pickSingle(sp<RecordGroup>& rspSelection,
45  const sp<RecordGroup>& rspSource,
46  const Record& rCriteria,
47  const sp<FilterI>& rspFilter);
48 
49 virtual Record pickGroup(sp<RecordGroup>& rspSelection,
50  const sp<RecordGroup>& rspSource,
51  const sp<RecordGroup>& rspCriteria,
52  const sp<FilterI>& rspFilter,
53  BWORD cumulative);
54 virtual Record pick(sp<RecordGroup>& rspSelection,
55  const sp<RecordGroup>& rspSource,
56  const Record& rCriteria,
57  const sp<FilterI>& rspFilter,
58  BWORD cumulative);
59 
60  Record pickInCylinder(sp<RecordGroup>& rspSelection,
61  const sp<RecordGroup>& rspSource,
62  const Record& rCriteria,
63  const sp<FilterI>& rspFilter,
64  BWORD cumulative);
65 
66  Record pickInSphere(sp<RecordGroup>& rspSelection,
67  const sp<RecordGroup>& rspSource,
68  const Record& rCriteria,
69  const sp<FilterI>& rspFilter,
70  BWORD cumulative);
71 
72  void resetPicked(const sp<RecordGroup>& rspSource);
73 
74  Record m_criteria;
75  sp<RecordGroup> m_spCriteriaRG;
76  sp<FilterI> m_spFilter;
77  BWORD m_cumulative;
78 
79  Cylinder m_cylinderView;
80  RecordArrayView<Sphere> m_sphereRAV;
81  Operator m_operatorView;
82  Accessor<Record> m_aShape;
83  Accessor<Real> m_aPicked;
84 };
85 
86 } /* namespace ext */
87 } /* namespace fe */
88 
89 #endif /* __shape_ShapeSelector_h__ */
Determine the Records that match a critera, such as shapes.
Definition: SelectorI.h:36
Intersect a shape or shapes with a RecordGroup.
Definition: ShapeSelector.h:29
kernel
Definition: namespace.dox:3
Cylinder RecordView.
Definition: Cylinder.h:27
The main data access class for the data system.
Definition: Accessor.h:128
RecordView Iteration over a RecordArray.
Definition: RecordArrayView.h:37
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Operator RecordView.
Definition: Operator.h:22