Free Electron
TerminalDraw.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 __terminal_TerminalDraw_h__
8 #define __terminal_TerminalDraw_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Draw to terminal buffer
17 
18  @ingroup terminal
19 *//***************************************************************************/
20 class FE_DL_EXPORT TerminalDraw:
21  public DrawCommon,
22  public CastableAs<TerminalDraw>
23 {
24  public:
25  TerminalDraw(void) {}
26 virtual ~TerminalDraw(void) {}
27 
28  //* as DrawI
29 
31 
32 virtual void drawPoints(const SpatialVector *vertex,
33  const SpatialVector *normal,U32 vertices,
34  BWORD multicolor,const Color *color,
35  sp<DrawBufferI> spDrawBuffer);
36 
38 
39 virtual void drawLines(const SpatialVector *vertex,
40  const SpatialVector *normal,U32 vertices,
41  StripMode strip,
42  BWORD multicolor,const Color *color,
43  BWORD multiradius,const Real *radius,
44  const Vector3i *element,U32 elementCount,
45  sp<DrawBufferI> spDrawBuffer);
46 
47 virtual void drawCurve(const SpatialVector *vertex,
48  const SpatialVector *normal,
49  const Real *radius,U32 vertices,
50  BWORD multicolor,const Color *color);
51 
53 
54 virtual void drawTriangles(const SpatialVector *vertex,
55  const SpatialVector *normal,
56  const Vector2 *texture,U32 vertices,
57  StripMode strip,BWORD multicolor,
58  const Color* color,
59  const Array<I32>* vertexMap,
60  const Array<I32>* hullPointMap,
61  const Array<Vector4i>* hullFacePoint,
62  sp<DrawBufferI> spDrawBuffer);
63 
64  //* Terminal specific
65 
66  void setSurfaceAccessible(
67  sp<SurfaceAccessibleI> a_spSurfaceAccessibleI)
68  {
69  m_spSurfaceAccessibleI=a_spSurfaceAccessibleI;
70  m_spOutputPoint=NULL;
71  m_spOutputNormal=NULL;
72  m_spOutputColor=NULL;
73  m_spOutputRadius=NULL;
74  m_spOutputVertices=NULL;
75  m_spOutputProperties=NULL;
76  }
77 
78  sp<SurfaceAccessibleI> surfaceAccessible(void)
79  { return m_spSurfaceAccessibleI; }
80 
81  private:
82  void drawPolygons(const SpatialVector *vertex,
83  const SpatialVector *normal,U32 vertices,
84  StripMode strip,BWORD multicolor,
85  const Color *color,BWORD openPoly);
86 
87  sp<SurfaceAccessibleI> m_spSurfaceAccessibleI;
88 
89  sp<SurfaceAccessorI> m_spOutputPoint;
90  sp<SurfaceAccessorI> m_spOutputNormal;
91  sp<SurfaceAccessorI> m_spOutputColor;
92  sp<SurfaceAccessorI> m_spOutputRadius;
93  sp<SurfaceAccessorI> m_spOutputVertices;
94  sp<SurfaceAccessorI> m_spOutputProperties;
95 };
96 
97 } /* namespace ext */
98 } /* namespace fe */
99 
100 #endif /* __terminal_TerminalDraw_h__ */
virtual void drawPoints(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)
Draw points vertex[vertices].
Definition: DrawCommon.cc:222
Draw to terminal buffer.
Definition: TerminalDraw.h:20
Drawing functions not specific to the graphics language.
Definition: DrawCommon.h:32
kernel
Definition: namespace.dox:3
StripMode
Format of vertices for tri-stripping.
Definition: DrawI.h:26
virtual void drawTriangles(const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw triangles.
Definition: DrawCommon.cc:257
Special vector for color (RGBA)
Definition: Color.h:21
virtual void drawLines(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw lines.
Definition: DrawCommon.cc:238
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192