Free Electron
SurfaceTrianglesAccessible.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_SurfaceTrianglesAccessible_h__
8 #define __surface_SurfaceTrianglesAccessible_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Triangle Surface from generic SurfaceAccessibleI
17 
18  @ingroup surface
19 *//***************************************************************************/
20 class FE_DL_EXPORT SurfaceTrianglesAccessible:
21  public SurfaceTriangles,
22  public CastableAs<SurfaceTrianglesAccessible>
23 {
24  public:
25 
26  class Gauge: virtual public GaugeI
27  {
28  public:
29  Gauge(sp<SurfaceI> a_spSurfaceI):
30  m_spSurfaceI(a_spSurfaceI)
31  {
32 #if FE_COUNTED_STORE_TRACKER
33  setName("SurfaceTriangles::Gauge");
34 #endif
35  }
36  virtual ~Gauge(void) {}
37 
38  virtual void pick(SpatialVector a_source,
39  Real a_maxDistance);
40  virtual Real distanceTo(SpatialVector a_target);
41 
42  sp<Geodesic::Mesh> createMesh(Array<F64>& a_rPoints,
43  Array<U32>& a_rFaces);
44  void setMesh(sp<Geodesic::Mesh> a_spMesh);
45  sp<Geodesic::Mesh> mesh(void);
46 
47  private:
48  sp<SurfaceI> m_spSurfaceI;
49  Geodesic m_geodesic;
50  SpatialVector m_source;
51  Real m_maxDistance;
52  };
53 
55 virtual ~SurfaceTrianglesAccessible(void) {}
56 
57 virtual void cache(void);
58 
59  using SurfaceSphere::bind;
60 
61  void bind(sp<SurfaceAccessibleI>
62  a_spSurfaceAccessibleI);
63 
64 virtual sp<GaugeI> gauge(void);
65 
66 virtual void resolveImpact(sp<ImpactI> a_spImpactI) const;
67 
68  protected:
69  sp<SurfaceAccessibleI> m_spSurfaceAccessibleI;
70 
71  private:
72  sp<Geodesic::Mesh> m_spMesh;
73 };
74 
75 } /* namespace ext */
76 } /* namespace fe */
77 
78 #endif /* __surface_SurfaceTrianglesAccessible_h__ */
calculate surface distances
Definition: SurfaceI.h:121
Discrete Triangle Surface.
Definition: SurfaceTriangles.h:20
kernel
Definition: namespace.dox:3
Triangle Surface from generic SurfaceAccessibleI.
Definition: SurfaceTrianglesAccessible.h:20
Wrapper for std::vector.
Definition: Array.h:21
calculate surface distance between points
Definition: Geodesic.h:21
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192