Free Electron
LengthCorrectOp.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_LengthCorrectOp_h__
8 #define __operator_LengthCorrectOp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Handler to resize curve segments to match an original
17 
18  @ingroup operator
19 *//***************************************************************************/
20 class FE_DL_EXPORT LengthCorrectOp:
21  public OperatorThreaded,
22  public Initialize<LengthCorrectOp>
23 {
24  public:
25 
26  LengthCorrectOp(void):
27  m_frame(-1.0) {}
28 virtual ~LengthCorrectOp(void) {}
29 
30  void initialize(void);
31 
32  //* As HandlerI
33 virtual void handle(Record& a_rSignal);
34 
35  using OperatorThreaded::run;
36 
37 virtual void run(I32 a_id,sp<SpannedRange> a_spRange);
38 
39  private:
40 
41  class Edge
42  {
43  public:
44  Edge(void):
45  m_pointIndexLow0(-1),
46  m_pointIndexLow1(-1),
47  m_pointIndexHigh0(-1),
48  m_pointIndexHigh1(-1) {}
49 
50  I32 m_pointIndexLow0;
51  I32 m_pointIndexLow1;
52  I32 m_pointIndexHigh0;
53  I32 m_pointIndexHigh1;
54  };
55 
56  BWORD relength(I32 a_id,sp<SpannedRange> a_spRange,
57  BWORD a_applyRestoration);
58  BWORD suspendAndCollide(I32 a_id,sp<SpannedRange> a_spRange);
59  BWORD reroute(I32 a_id,sp<SpannedRange> a_spRange);
60  BWORD cacheDuN(sp<SurfaceAccessibleI>& a_rspAccessible,
61  Array<SpatialVector>& a_rNormalCache,
62  Array<SpatialVector>& a_rDuCache,
63  sp<SpannedRange> a_spRange);
64 
65  BWORD collidePoint(SpatialVector a_point,
66  SpatialVector a_target,SpatialVector a_dir,
67  Real a_scalar,SpatialVector& a_rPush);
68 
69  sp<SurfaceAccessibleI> m_spInputAccessible;
70  sp<SurfaceAccessibleI> m_spReferenceAccessible;
71  sp<SurfaceAccessibleI> m_spOutputAccessible;
72  sp<SurfaceAccessibleI> m_spColliderAccessible;
73  sp<SurfaceI> m_spDriver;
74  sp<SurfaceI> m_spCollider;
75 
76  sp<DrawI> m_spDrawDebug;
77 
78  Real m_frame;
79  Array<SpatialVector> m_pointCache;
80  Array<SpatialVector> m_velocityCache;
81 
82  Array<SpatialVector> m_normalCacheRef;
83  Array<SpatialVector> m_normalCache;
84  Array<SpatialVector> m_duCacheRef;
85  Array<SpatialVector> m_duCache;
86  Array<SpatialVector> m_tweakCache;
87 
88  Array<I32> m_fragmentOfPoint;
89  Array<SpatialVector> m_orientationOfFragment;
90 
91  //* opposing points across and edge
92  std::map<U64,Edge> m_edgeMap;
93 };
94 
95 } /* namespace ext */
96 } /* namespace fe */
97 
98 #endif /* __operator_LengthCorrectOp_h__ */
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
Handler to resize curve segments to match an original.
Definition: LengthCorrectOp.h:20
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