Free Electron
PuppetOp.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_PuppetOp_h__
8 #define __operator_PuppetOp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief manipulate joint transforms
17 
18  @ingroup operator
19 *//***************************************************************************/
20 class FE_DL_EXPORT PuppetOp:
21  public OperatorState,
22  public Initialize<PuppetOp>
23 {
24  public:
25 
26  PuppetOp(void):
27  m_brushed(FALSE),
28  m_dragging(FALSE),
29  m_showAll(FALSE) {}
30 
31 virtual ~PuppetOp(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  private:
44  void addParam(String a_key,String a_label,Real a_value,
45  Real a_min,Real a_max,Color a_color);
46 
47  Color makeColor(Color a_color,BWORD a_bright);
48  void drawJoint(sp<DrawI>& a_rspDrawI,
49  const SpatialVector& a_rTip,
50  const SpatialVector* a_pCorner,
51  const Color* a_pColor);
52 
53  Record lookupJoint(String a_jointName);
54  void deleteJoint(String a_jointName);
55  void deleteJoints(void);
56 
57  Real lookupShift(Record a_record,U32 a_axis);
58  Real lookupStretch(Record a_record,U32 a_axis);
59  Real lookupBend(Record a_record,U32 a_axis);
60  Real lookupResize(Record a_record,U32 a_axis);
61  Real lookupRescale(Record a_record,U32 a_axis);
62  Real lookupForward(Record a_record,U32 a_axis);
63  Real lookupBackward(Record a_record,U32 a_axis);
64 
65  sp<ManipulatorI> m_spManipulator;
66  sp<SurfaceAccessibleI> m_spOutputAccessible;
67 
68  sp<DrawMode> m_spWireframe;
69  sp<DrawMode> m_spThick;
70  sp<DrawMode> m_spOverlay;
71  sp<DrawMode> m_spSolid;
72 
73  BWORD m_brushed;
74  WindowEvent m_event;
75  BWORD m_dragging;
76  I32 m_lastX;
77  I32 m_lastY;
78 
79  BWORD m_showAll;
80  String m_pickName;
81 
82  std::map<String,SpatialTransform> m_origMap;
83  std::map<String,SpatialTransform> m_animMap;
84  std::map<String,I32> m_posePrimitiveMap;
85  std::map<String,I32> m_animPrimitiveMap;
86  std::map<String,I32> m_offsetPrimitiveMap;
87 
88  sp< RecordMap<String> > m_spJointMap;
89  Accessor<String> m_aName;
90  Accessor<SpatialVector> m_aShift;
91  Accessor<SpatialVector> m_aStretch;
93  Accessor<SpatialVector> m_aResize;
94  Accessor<SpatialVector> m_aRescale;
95  Accessor<SpatialVector> m_aForward;
96  Accessor<SpatialVector> m_aBackward;
97 
98 };
99 
100 } /* namespace ext */
101 } /* namespace fe */
102 
103 #endif /* __operator_PuppetOp_h__ */
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
Special vector for color (RGBA)
Definition: Color.h:21
manipulate joint transforms
Definition: PuppetOp.h:20
Generalized windowing event.
Definition: WindowEvent.h:43
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35