Free Electron
SpatialTreeI.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_SpatialTreeI_h__
8 #define __surface_SpatialTreeI_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Triangular storage interface
17 
18  @ingroup surface
19 *//***************************************************************************/
20 class FE_DL_EXPORT SpatialTreeI:
21  virtual public Component,
22  public CastableAs<SpatialTreeI>
23 {
24  public:
25 
26  class Hit:
27  public Counted,
28  public CastableAs<Hit>
29  {
30  public:
31  Hit(void)
32  {
33  setName("Hit");
34  }
35  virtual
36  const SpatialVector& intersection(void) const =0;
37  virtual
38  const SpatialVector& direction(void) const =0;
39  virtual Real distance(void) const =0;
40  virtual I32 face(void) const =0;
41  virtual I32 triangleIndex(void) const =0;
42  virtual I32 primitiveIndex(void) const =0;
43  virtual I32 partitionIndex(void) const =0;
44  virtual
45  const SpatialBary& barycenter(void) const =0;
46  virtual
47  const Vector2& uv(void) const =0;
48  virtual
49  const SpatialVector& du(void) const =0;
50  virtual
51  const SpatialVector& dv(void) const =0;
52  virtual
53  const I32* pointIndex(void) const =0;
54  virtual
55  const SpatialVector* vertex(void) const =0;
56  virtual
57  const SpatialVector* normal(void) const =0;
58  };
59 
60 virtual void setRefinement(U32 a_refinement) =0;
61 
62 virtual void setAccuracy(SurfaceI::Accuracy a_accuracy) =0;
63 
64 virtual void populate(
65  const Vector3i* a_pElementArray,
66  const SpatialVector* a_pVertexArray,
67  const SpatialVector* a_pNormalArray,
68  const Vector2* a_pUVArray,
69  const Color* a_pColorArray,
70  const I32* a_pTriangleIndexArray,
71  const I32* a_pPointIndexArray,
72  const I32* a_pPrimitiveIndexArray,
73  const I32* a_pPartitionIndexArray,
74  U32 a_primitives,U32 a_vertices,
75  const SpatialVector& a_center,F32 a_radius) =0;
76 virtual Real nearestPoint(const SpatialVector& a_origin,
77  Real a_maxDistance,BWORD a_anyHit,U32 a_hitLimit,
78  const sp<PartitionI>& a_rspPartition,
79  Array< sp<Hit> >& a_rHitArray) const =0;
80 virtual Real rayImpact(const SpatialVector& a_origin,
81  const SpatialVector& a_direction,
82  Real a_maxDistance,BWORD a_anyHit,U32 a_hitLimit,
83  const sp<PartitionI>& a_rspPartition,
84  Array< sp<Hit> >& a_rHitArray) const =0;
85 
86 virtual void draw(sp<DrawI>,const fe::Color*) const =0;
87 };
88 
89 } /* namespace ext */
90 } /* namespace fe */
91 
92 #endif /* __surface_SpatialTreeI_h__ */
Heap-based support for classes participating in fe::ptr <>
Definition: Counted.h:35
kernel
Definition: namespace.dox:3
Special vector for color (RGBA)
Definition: Color.h:21
Triangular storage interface.
Definition: SpatialTreeI.h:20
Wrapper for std::vector.
Definition: Array.h:21
Base for all interfacable components.
Definition: Component.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192