Free Electron
SubdivideOp.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_SubdivideOp_h__
8 #define __operator_SubdivideOp_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Increase resolution of a mesh
17 
18  @ingroup operator
19 *//***************************************************************************/
20 class FE_DL_EXPORT SubdivideOp:
21  public OperatorThreaded,
22  public Initialize<SubdivideOp>
23 {
24  public:
25  SubdivideOp(void) {}
26 virtual ~SubdivideOp(void) {}
27 
28  void initialize(void);
29 
30  //* As HandlerI
31 virtual void handleBind(sp<SignalerI> a_spSignalerI,sp<Layout> a_spLayout);
32 virtual void handle(Record& a_rSignal);
33 
34  using OperatorThreaded::run;
35 
36 virtual void run(I32 a_id,sp<SpannedRange> a_spRange,String a_stage);
37 
38  protected:
39 
40  void clearData(void);
41 
42  void run_edge(I32 a_id,sp<SpannedRange> a_spRange);
43  void run_point(I32 a_id,sp<SpannedRange> a_spRange);
44 
45  void expandIncremental(void);
46  void expandPost(void);
47 
48  private:
49 
50  class Edge
51  {
52  public:
53  Edge(void):
54  m_pointIndex(-1) {}
55 
56  std::set<I32> m_faceSet;
57  I32 m_pointIndex;
58  };
59 
60  sp<SurfaceAccessibleI> m_spInputAccessible;
61  sp<SurfaceAccessibleI> m_spOutputAccessible;
62 
63  sp<OperatorSurfaceI> m_spSurfaceNormalOp;
64 
65  BWORD m_flat;
66  OperatorSurfaceCommon::Element m_uvRate;
67 
68  SpatialVector* m_pointsIn;
69  SpatialVector* m_normalsIn;
70 
71  Array<I32> m_facePointIndex;
72 
73  Array<SpatialVector> m_facePointSum;
74  Array<I32> m_faceCount;
75 
76  Array<SpatialVector> m_midPointSum;
77  Array<I32> m_midpointCount;
78 
79  Array<SpatialVector> m_boundaryPointSum;
80  Array<I32> m_boundaryCount;
81 
82  Array<Real> m_expand;
83 
84  //* face list per edge
85  std::map<U64,Edge> m_edgeMap;
86 
87  sp<Profiler> m_spProfiler;
88  sp<Profiler::Profile> m_spProfileAccess;
89  sp<Profiler::Profile> m_spProfileResize;
90  sp<Profiler::Profile> m_spProfileSlot;
91  sp<Profiler::Profile> m_spProfileFace;
92  sp<Profiler::Profile> m_spProfileFacePoint;
93  sp<Profiler::Profile> m_spProfileVertSize;
94  sp<Profiler::Profile> m_spProfileEdgeMap;
95  sp<Profiler::Profile> m_spProfileEdgePoint;
96  sp<Profiler::Profile> m_spProfileVertex;
97  sp<Profiler::Profile> m_spProfileAppend;
98  sp<Profiler::Profile> m_spProfileEdge;
99  sp<Profiler::Profile> m_spProfilePoint;
100  sp<Profiler::Profile> m_spProfileExpand;
101  sp<Profiler::Profile> m_spProfileNormal;
102 };
103 
104 } /* namespace ext */
105 } /* namespace fe */
106 
107 #endif /* __operator_SubdivideOp_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
Increase resolution of a mesh.
Definition: SubdivideOp.h:20
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35