Free Electron
SurfaceCurves.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 __surface_SurfaceCurve_h__
8 #define __surface_SurfaceCurve_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Segmented Path Surface
17 
18  @ingroup surface
19 
20  This surface presumes uniform cv counts.
21 *//***************************************************************************/
22 class FE_DL_EXPORT SurfaceCurves:
23  public SurfaceSearchable,
24  public CastableAs<SurfaceCurves>
25 {
26  public:
27  class FE_DL_EXPORT Impact:
28  public SurfaceSearchable::Impact,
29  public CastableAs<Impact>
30  {
31  public:
32  Impact(void)
33  {
34 #if FE_COUNTED_STORE_TRACKER
35  setName("SurfaceCurves::Impact");
36 #endif
37  }
38  virtual ~Impact(void) {}
39 
40  using SurfaceSearchable::Impact::draw;
41 
42  virtual void draw(const SpatialTransform& a_rTransform,
43  sp<DrawI> a_spDrawI,
44  const fe::Color* a_pColor,
45  sp<DrawBufferI> a_spDrawBuffer,
46  sp<PartitionI> a_spPartition) const;
47  };
48 
49  SurfaceCurves(void);
50 virtual ~SurfaceCurves(void) {}
51 
52  //* As Protectable
53 virtual Protectable* clone(Protectable* pInstance=NULL);
54 
55  using SurfaceSearchable::sampleImpact;
56  using SurfaceSearchable::sample;
57 
58  //* As SurfaceI
59 virtual sp<ImpactI> sampleImpact(I32 a_triangleIndex,
60  SpatialBary a_barycenter,
61  SpatialVector a_tangent) const;
62 virtual SpatialTransform sample(I32 a_triangleIndex,SpatialBary a_barycenter,
63  SpatialVector a_tangent) const;
64 
65 virtual SpatialTransform sample(Vector2 a_uv) const;
66 
67  protected:
68 
69 virtual void drawInternal(BWORD a_transformed,
70  const SpatialTransform* a_pTransform,
71  sp<DrawI> a_spDrawI,
72  const fe::Color* a_pColor,
73  sp<DrawBufferI> a_spDrawBuffer,
74  sp<PartitionI> a_spPartition) const;
75 
76 /*
77  class Curve
78  {
79  public:
80  Curve(U32 a_start, U32 a_count):
81  m_start(a_start),
82  m_count(a_count) {}
83 
84  U32 start(void) const { return m_start; }
85  U32 count(void) const { return m_count; }
86 
87  private:
88  U32 m_start;
89  U32 m_count;
90  };
91 */
92 
93 // Array<Curve> m_curveArray;
94 
95 virtual void cache(void);
96 
97 virtual void resolveImpact(sp<ImpactI> a_spImpactI) const;
98 
99  private:
100 mutable CountedPool<Impact> m_curveImpactPool;
101 };
102 
103 } /* namespace ext */
104 } /* namespace fe */
105 
106 #endif /* __surface_SurfaceCurve_h__ */
107 
108 
Base class providing protection counting for cp<>
Definition: Protectable.h:28
kernel
Definition: namespace.dox:3
Special vector for color (RGBA)
Definition: Color.h:21
Tree-searchable Surface.
Definition: SurfaceSearchable.h:20
Segmented Path Surface.
Definition: SurfaceCurves.h:22
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192