Free Electron
MultiModOp.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 __oplab_MultiModOp_h__
8 #define __oplab_MultiModOp_h__
9 namespace fe
10 {
11 namespace ext
12 {
13 
14 /**************************************************************************//**
15  @brief Operator to alter regions of a surface
16 
17  @ingroup oplab
18 *//***************************************************************************/
19 class FE_DL_EXPORT MultiModOp:
20  public OperatorState,
21  public Initialize<MultiModOp>
22 {
23  public:
24 
25  MultiModOp(void):
26  m_editMode(e_pickAnchor),
27  m_lastFrame(0.0),
28  m_brushed(FALSE),
29  m_anchorPicked(-1) {}
30 
31 virtual ~MultiModOp(void) {}
32 
33  void initialize(void);
34 
35  //* As HandlerI
36 virtual void handle(Record& a_rSignal);
37 
38  protected:
39 
40 virtual void setupState(void);
41 virtual BWORD loadState(const String& a_rBuffer);
42 
43  SpatialTransform getParamPivot(I32 a_anchorIndex);
44  void setParamPivot(I32 a_anchorIndex,
45  SpatialTransform a_transform);
46  SpatialTransform getParamDeform(I32 a_anchorIndex);
47  void setParamDeform(I32 a_anchorIndex,
48  SpatialTransform a_transform);
49 
50  String anchorLabel(I32 a_anchorIndex);
51  String& anchorParent(I32 a_anchorIndex);
52  String anchorWeightAttr(I32 a_anchorIndex);
53  Real anchorRadius(I32 a_anchorIndex);
54  Real anchorPower(I32 a_anchorIndex);
55  SpatialTransform evaluateLocator(I32 a_anchorIndex);
56  SpatialTransform evaluateConcatenation(SpatialTransform a_locator,
57  I32 a_anchorIndex);
58  void createAnchor(I32 a_triIndex,SpatialBary a_bary);
59  void pickAnchor(I32 a_anchorIndex);
60  void updateAnchor(void);
61 
62  private:
63 
64  enum EditMode
65  {
66  e_pickAnchor,
67  e_createAnchor,
68  e_manipulator,
69  e_influence
70  };
71 
72  void changeMode(EditMode a_editMode);
73 
74  EditMode m_editMode;
75 
76  sp<ManipulatorI> m_spManipulator;
77  sp<SurfaceAccessibleI> m_spOutputAccessible;
78  sp<SurfaceI> m_spInput;
79  sp<SurfaceI> m_spDriver;
80  sp<SurfaceI> m_spParent;
81  WindowEvent m_event;
82 
83  sp<DrawMode> m_spWireframe;
84  sp<DrawMode> m_spSolid;
85 
86  sp< RecordMap<I32> > m_spAnchorMap;
87  Accessor<I32> m_aTriIndex;
88  Accessor<Vector3> m_aBarycenter;
89 
90  Array<SpatialTransform> m_locatorList;
91  Real m_lastFrame;
92  BWORD m_brushed;
93  I32 m_anchorPicked;
94  String m_newParent;
95 };
96 
97 } /* namespace ext */
98 } /* namespace fe */
99 
100 #endif /* __oplab_MultiModOp_h__ */
Operator to alter regions of a surface.
Definition: MultiModOp.h:19
Operator base class to save and reload state.
Definition: OperatorState.h:20
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Generalized windowing event.
Definition: WindowEvent.h:43
Automatically reference-counted string container.
Definition: String.h:128
Wrapper for std::vector.
Definition: Array.h:21
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53