Free Electron
HammerOp.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 __operator_HammerOp_h__
8 #define __operator_HammerOp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Operator to alter regions of a surface
17 
18  @ingroup operator
19 *//***************************************************************************/
20 class FE_DL_EXPORT HammerOp:
21  public OperatorSurfaceCommon,
22  public Initialize<HammerOp>
23 {
24  public:
25 
26  HammerOp(void);
27 virtual ~HammerOp(void);
28 
29  void initialize(void);
30 
31  //* As HandlerI
32 virtual void handle(Record& a_rSignal);
33 
34 virtual BWORD undo(String a_change,sp<Counted> a_spCounted);
35 virtual BWORD redo(String a_change,sp<Counted> a_spCounted);
36 
37  protected:
38 
39  I32 getTriIndex(void);
40  SpatialBary getBarycenter(void);
41  SpatialTransform getParamPivot(void);
42  void setParamPivot(SpatialTransform a_transform,
43  BWORD a_anticipate=FALSE);
44  SpatialTransform getParamDeform(void);
45  void setParamDeform(SpatialTransform a_transform,
46  BWORD a_anticipate=FALSE);
47  void applyThreshold(SpatialVector& a_rVector,
48  Real a_default);
49 
50  BWORD located(void);
51  BWORD anchorPicked(void);
52  String anchorLabel(void);
53  String& anchorParent(void);
54  String anchorWeightAttr(void);
55  Real anchorRadius(void);
56  Real anchorPower(void);
57  SpatialTransform evaluateLocator(void);
58  SpatialTransform evaluateConcatenation(void);
59 
60  void resetManipulator(void);
61  void pushToManipulator(void);
62  void pullFromManipulator(BWORD a_anticipate=FALSE);
63 
64  BWORD m_anchorless;
65 
66  private:
67 
68  class State:
69  public Counted,
70  CastableAs<State>
71  {
72  public:
73  enum Space
74  {
75  e_pivot,
76  e_deform
77  };
78 
79  Space m_space;
80  SpatialTransform m_transform;
81  };
82 
83  enum EditMode
84  {
85  e_pickAnchor,
86  e_moveAnchor,
87  e_manipulator
88  };
89 
90  BWORD restore(sp<State> a_spState);
91 
92  String scanPeers(sp<DrawI>& a_rspDrawOverlay,
93  const SpatialVector& a_cameraPos,
94  const SpatialVector& a_cameraDir,
95  BWORD a_draw,BWORD a_labels,
96  I32 a_mouseX,I32 a_mouseY);
97 
98  void changeMode(EditMode a_editMode);
99 
100  EditMode m_editMode;
101 
102  sp<ManipulatorI> m_spManipulator;
103  sp<SurfaceAccessibleI> m_spOutputAccessible;
104  sp<SurfaceI> m_spInput;
105  sp<SurfaceI> m_spDriver;
106  sp<SurfaceI> m_spParent;
107  WindowEvent m_event;
108 
109  sp<DrawMode> m_spWireframe;
110  sp<DrawMode> m_spWide;
111  sp<DrawMode> m_spSolid;
112 
113  SpatialTransform m_locator;
114  SpatialTransform m_lastPivot;
115  SpatialTransform m_lastDeform;
116  Real m_lastFrame;
117  BWORD m_brushed;
118  I32 m_pickTriIndex;
119  SpatialBary m_pickBarycenter;
120  String m_highlightNode;
121 };
122 
123 } /* namespace ext */
124 } /* namespace fe */
125 
126 #endif /* __operator_HammerOp_h__ */
Heap-based support for classes participating in fe::ptr <>
Definition: Counted.h:35
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
Partial Generic SurfaceI Implemention.
Definition: OperatorSurfaceCommon.h:20
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Operator to alter regions of a surface.
Definition: HammerOp.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192