Free Electron
HingeOp.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_HingeOp_h__
8 #define __operator_HingeOp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Operator to rotate a surface out of another
17 
18  @ingroup operator
19 *//***************************************************************************/
20 class FE_DL_EXPORT HingeOp:
21  public OperatorThreaded,
22  public Initialize<HingeOp>
23 {
24  public:
25 
26  HingeOp(void):
27  m_frame(-1),
28  m_lastPointCount(-1),
29  m_brushed(FALSE),
30  m_selectIndex(-1) {}
31 virtual ~HingeOp(void) {}
32 
33  void initialize(void);
34 
35  //* As HandlerI
36 virtual void handle(Record& a_rSignal);
37 
38  using OperatorThreaded::run;
39 
40 virtual void run(I32 a_id,sp<SpannedRange> a_spRange);
41 
42  private:
43 static void calcConversion(SpatialTransform& a_rTransform,
44  const Real a_angle,const SpatialVector& a_rAxis,
45  const SpatialVector& a_rPivot);
46 
47  class Hit
48  {
49  public:
50  I32 m_partitionIndex;
51  I32 m_pointIndex0;
52  I32 m_pointIndex1;
53  I32 m_pointIndex2;
54  SpatialVector m_barycenter;
55  SpatialVector m_intersection;
56  };
57 
58  I32 m_frame;
59  I32 m_lastPointCount;
60  BWORD m_fragmented;
61  BWORD m_selfCollide;
62  BWORD m_replaceHits;
63  Real m_passage;
64 
65  sp<SurfaceAccessibleI> m_spOutputAccessible;
66  sp<SurfaceI> m_spOutput;
67  sp<SurfaceI> m_spObstacle;
68  sp<SurfaceI> m_spCollider;
69  sp<SurfaceI> m_spDriver;
70  sp<SurfaceI> m_spInputRef;
71  sp<SurfaceI> m_spDriverRef;
72 
73  sp<DrawMode> m_spBrush;
74  sp<DrawMode> m_spOverlay;
75 
76  BWORD m_brushed;
77  WindowEvent m_event;
78  I32 m_selectIndex;
79 
80  Array<SpatialVector> m_inputCache;
81  Array<SpatialVector> m_outputCache;
82  Array<Real> m_totalAngle;
83  Array<Real> m_pointAngle;
84  Array<Real> m_lastAngle;
85 
86  Array<SpatialVector> m_fragPivotRefA;
87  Array<SpatialVector> m_fragPivotRefB;
88  Array<SpatialVector> m_fragPivotRefC;
89  Array<SpatialVector> m_fragPivotA;
90  Array<SpatialVector> m_fragPivotB;
91  Array<SpatialVector> m_fragPivotC;
92  Array<Real> m_fragLength;
93  Array<I32> m_fragFarIndex;
94  Array<I32> m_fragmentOfPoint;
95  Array<I32> m_fragmentOfPartition;
96  Array<String> m_nameOfFragment;
97  Array<String> m_driverOfFragment;
98 
99  std::map<String, sp<PartitionI> > m_partitionMap;
100  std::map<String, sp<PartitionI> > m_colliderPartitionMap;
101 
102  Array< Array<Hit> > m_colliderHitTable;
103  Array< Array<Hit> > m_outputHitTable;
104 
105  sp<DrawI> m_spDrawGuide;
106 
107  sp<Profiler> m_spProfiler;
108  sp<Profiler::Profile> m_spProfileAccess;
109  sp<Profiler::Profile> m_spProfileInit;
110  sp<Profiler::Profile> m_spProfileClear;
111  sp<Profiler::Profile> m_spProfileCopy;
112  sp<Profiler::Profile> m_spProfileFragment;
113  sp<Profiler::Profile> m_spProfilePartition;
114  sp<Profiler::Profile> m_spProfilePivots;
115  sp<Profiler::Profile> m_spProfileLoop;
116  sp<Profiler::Profile> m_spProfileRun;
117  sp<Profiler::Profile> m_spProfilePush;
118  sp<Profiler::Profile> m_spProfilePull;
119  sp<Profiler::Profile> m_spProfileRotate;
120 };
121 
122 } /* namespace ext */
123 } /* namespace fe */
124 
125 #endif /* __operator_HingeOp_h__ */
126 
Handler to move curves away from a collider.
Definition: OperatorThreaded.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
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
Operator to rotate a surface out of another.
Definition: HingeOp.h:20