Free Electron
DrawNull.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 __draw_DrawNull_h__
8 #define __draw_DrawNull_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Draw nothing for DrawI, elegantly
17 
18  @ingroup draw
19 *//***************************************************************************/
20 class FE_DL_EXPORT DrawNull: virtual public DrawI
21 {
22  public:
23 virtual BWORD isDirect(void) const { return TRUE; }
24 
25 virtual void setDrawMode(sp<DrawMode> spDrawMode) {}
26 virtual sp<DrawMode> drawMode(void) const { return sp<DrawMode>(NULL); }
27 virtual void pushDrawMode(sp<DrawMode> mode) {}
28 virtual sp<DrawMode> popDrawMode(void) { return sp<DrawMode>(NULL); }
29 virtual void pushMatrixState(void) {}
30 virtual void popMatrixState(void) {}
31 virtual void pushMatrix(MatrixMode a_mode,Real a_values[16]) {}
32 virtual void popMatrix(MatrixMode a_mode) {}
33 virtual void unbindVertexArray(void) {}
34 virtual void setBrightness(Real a_brightness) {}
35 virtual Real brightness(void) { return 0.0; }
36 virtual void setContrast(Real a_contrast) {}
37 virtual Real contrast(void) { return 1.0; }
38 virtual void setView(sp<ViewI> spViewI) {}
39 virtual sp<ViewI> view(void) const { return sp<ViewI>(NULL); }
40 
41 virtual void setDrawChain(sp<DrawI> a_spDrawI) {}
42 virtual sp<DrawI> drawChain(void)
43  { return sp<DrawI>(NULL); }
44 virtual void setTransform(const SpatialTransform& a_rTransform) {}
45 virtual void flush(void) {}
46 virtual void flushLive(void) {}
47 virtual void clearInput(void) {}
48 virtual BWORD empty(void) const { return TRUE; }
49 
50 virtual sp<FontI> font(void) { return sp<FontI>(NULL); }
51 //~virtual void setFontBase(U32 index) {}
52 //~virtual I32 fontHeight(I32* pAscent,I32* pDescent) { return 0; }
53 //~virtual I32 pixelWidth(String string) { return 0; }
54 
55 virtual Real multiplication(void) { return Real(1); }
56 virtual void drawPoints(const SpatialVector *vertex,
57  const SpatialVector *normal,U32 vertices,
58  BWORD multicolor,const Color *color) {}
59 virtual void drawPoints(const SpatialVector *vertex,
60  const SpatialVector *normal,U32 vertices,
61  BWORD multicolor,const Color *color,
62  sp<DrawBufferI> spDrawBuffer) {}
63 virtual void drawLines(const SpatialVector *vertex,
64  const SpatialVector *normal,U32 vertices,
65  StripMode strip,BWORD multicolor,
66  const Color *color) {}
67 virtual void drawLines(const SpatialVector *vertex,
68  const SpatialVector *normal,U32 vertices,
69  StripMode strip,
70  BWORD multicolor,const Color *color,
71  BWORD multiradius,const Real *radius,
72  const Vector3i *element,U32 elementCount,
73  sp<DrawBufferI> spDrawBuffer) {}
74 virtual void drawCurve(const SpatialVector *vertex,
75  const SpatialVector *normal,
76  const Real* radius,U32 vertices,
77  BWORD multicolor,const Color *color) {}
78 virtual void drawTriangles(const SpatialVector *vertex,
79  const SpatialVector *normal,
80  const Vector2 *texture,U32 vertices,
81  StripMode strip,BWORD multicolor,
82  const Color *color) {}
83 virtual void drawTriangles(const SpatialVector *vertex,
84  const SpatialVector *normal,
85  const Vector2 *texture,U32 vertices,
86  StripMode strip,BWORD multicolor,
87  const Color* color,
88  const Array<I32>* vertexMap,
89  const Array<I32>* hullPointMap,
90  const Array<Vector4i>* hullFacePoint,
91  sp<DrawBufferI> spDrawBuffer) {}
92 virtual void drawRectangles(const SpatialVector *vertex,
93  U32 vertices,
94  BWORD multicolor,const Color *color) {}
95 virtual void draw(cp<DrawableI> cpDrawableI,const Color* color) {}
96 virtual void draw(cp<DrawableI> cpDrawableI,const Color* color,
97  sp<DrawBufferI> spDrawBuffer) {}
98 virtual void drawTransformed(const SpatialTransform& transform,
99  cp<DrawableI> cpDrawableI,
100  const Color* color) {}
101 virtual void drawTransformed(const SpatialTransform& transform,
102  cp<DrawableI> cpDrawableI,const Color* color,
103  sp<DrawBufferI> spDrawBuffer) {}
104 virtual void drawBox(const Box2& box,const Color& color) {}
105 virtual void drawBox(const Box2i& box,const Color& color) {}
106 virtual void drawBox(const Box3& box,const Color& color) {}
107 virtual void drawAlignedText(const SpatialVector& location,
108  const String text,const Color& color) {}
109 virtual void drawCircle(const SpatialTransform& transform,
110  const SpatialVector *scale,
111  const Color& color) {}
112 virtual void drawSphere(const SpatialTransform& transform,
113  const SpatialVector *scale,
114  const Color& color) {}
115 virtual void drawCylinder(const SpatialTransform& transform,
116  const SpatialVector *scale,Real baseScale,
117  const Color& color,U32 slices) {}
118 virtual void drawCylinder(const SpatialVector& location1,
119  const SpatialVector& location2,
120  Real radius1,Real radius2,
121  const Color& color,U32 slices) {}
122 virtual void drawCylinders(const SpatialTransform* transform,
123  const SpatialVector* scale,
124  const Real *baseScale,
125  const U32* slices,U32 cylinders,
126  BWORD multicolor,const Color* color) {}
127 virtual void drawTransformedCylinders(
128  const SpatialTransform& pretransform,
129  const SpatialTransform* transform,
130  const SpatialVector* scale,
131  const Real *baseScale,
132  const U32* slices,U32 cylinders,
133  BWORD multicolor,const Color* color) {}
134 virtual void drawArc(const SpatialTransform& transform,
135  const SpatialVector *scale,
136  Real startangle,Real endangle,
137  const Color& color) {}
138 virtual void drawTransformedPoints(
139  const SpatialTransform& transform,
140  const SpatialVector *scale,
141  const SpatialVector *vertex,
142  const SpatialVector *normal,U32 vertices,
143  BWORD multicolor,const Color *color) {}
144 virtual void drawTransformedPoints(
145  const SpatialTransform& transform,
146  const SpatialVector *scale,
147  const SpatialVector *vertex,
148  const SpatialVector *normal,U32 vertices,
149  BWORD multicolor,const Color *color,
150  sp<DrawBufferI> spDrawBuffer) {}
151 virtual void drawTransformedLines(
152  const SpatialTransform& transform,
153  const SpatialVector *scale,
154  const SpatialVector *vertex,
155  const SpatialVector *normal,
156  U32 vertices,StripMode strip,
157  BWORD multicolor,const Color *color) {}
158 virtual void drawTransformedLines(
159  const SpatialTransform& transform,
160  const SpatialVector *scale,
161  const SpatialVector *vertex,
162  const SpatialVector *normal,
163  U32 vertices,StripMode strip,
164  BWORD multicolor,const Color *color,
165  BWORD multiradius,const Real *radius,
166  const Vector3i *element,U32 elementCount,
167  sp<DrawBufferI> spDrawBuffer) {}
168 virtual void drawTransformedCurve(
169  const SpatialTransform& transform,
170  const SpatialVector *scale,
171  const SpatialVector *vertex,
172  const SpatialVector *normal,
173  const Real* radius,U32 vertices,
174  BWORD multicolor,const Color *color) {}
175 virtual void drawTransformedTriangles(
176  const SpatialTransform& transform,
177  const SpatialVector *scale,
178  const SpatialVector *vertex,
179  const SpatialVector *normal,
180  const Vector2 *texture,
181  U32 vertices,StripMode strip,BWORD multicolor,
182  const Color *color) {}
183 virtual void drawTransformedTriangles(
184  const SpatialTransform& transform,
185  const SpatialVector *scale,
186  const SpatialVector *vertex,
187  const SpatialVector *normal,
188  const Vector2 *texture,
189  U32 vertices,StripMode strip,BWORD multicolor,
190  const Color* color,
191  const Array<I32>* vertexMap,
192  const Array<I32>* hullPointMap,
193  const Array<Vector4i>* hullFacePoint,
194  sp<DrawBufferI> spDrawBuffer) {}
195 virtual void drawTransformedBox(
196  const SpatialTransform& transform,
197  const Box3& box,
198  const Color& color) {}
199 virtual void drawTransformedBoxes(
200  const SpatialTransform* transform,
201  const SpatialVector* scale,
202  U32 boxes,
203  BWORD multicolor,
204  const Color* color) {}
205 virtual void drawAxes(Real scale) {}
206 virtual void drawTransformedAxes(const SpatialTransform& transform,
207  Real scale) {}
208 virtual void drawMarker(Real radius,const Color& color) {}
209 virtual void drawTransformedMarker(
210  const SpatialTransform& transform,
211  Real radius,const Color& color) {}
212 virtual void drawRaster(sp<ImageI> spImageI,
213  const SpatialVector& location) {}
214 
215 virtual sp<DrawBufferI> createBuffer(void)
216  { return sp<DrawBufferI>(NULL); }
217 };
218 
219 } /* namespace ext */
220 } /* namespace fe */
221 
222 #endif /* __draw_DrawNull_h__ */
virtual void flush(void)
Called once after each frame.
Definition: DrawNull.h:45
virtual void pushMatrixState(void)
Push transform matrices.
Definition: DrawNull.h:29
virtual void drawBox(const Box3 &box, const Color &color)
Draw 3D box.
Definition: DrawNull.h:106
virtual void flushLive(void)
Pass on current input data as is.
Definition: DrawNull.h:46
virtual BWORD isDirect(void) const
Returns TRUE is display is local and rendered directly.
Definition: DrawNull.h:23
virtual void drawCurve(const SpatialVector *vertex, const SpatialVector *normal, const Real *radius, U32 vertices, BWORD multicolor, const Color *color)
Draw one curve.
Definition: DrawNull.h:74
Generalized drawing of points, lines, text, and basic triangles.
Definition: DrawI.h:20
virtual void drawAlignedText(const SpatialVector &location, const String text, const Color &color)
Draw screen-aligned single color text.
Definition: DrawNull.h:107
virtual void drawCylinder(const SpatialTransform &transform, const SpatialVector *scale, Real baseScale, const Color &color, U32 slices)
Draw a transformed cylinder or cone.
Definition: DrawNull.h:115
kernel
Definition: namespace.dox:3
StripMode
Format of vertices for tri-stripping.
Definition: DrawI.h:26
virtual Real multiplication(void)
Select the GL-specific index/handle.
Definition: DrawNull.h:55
virtual BWORD empty(void) const
Returns TRUE if the current input queue is empty.
Definition: DrawNull.h:48
virtual void drawBox(const Box2i &box, const Color &color)
Draw 2D box with pixel adjustments.
Definition: DrawNull.h:105
virtual void drawRectangles(const SpatialVector *vertex, U32 vertices, BWORD multicolor, const Color *color)
Draw rectangles.
Definition: DrawNull.h:92
virtual void draw(cp< DrawableI > cpDrawableI, const Color *color)
Draw DrawableI.
Definition: DrawNull.h:95
Special vector for color (RGBA)
Definition: Color.h:21
N-dimensional axis-aligned bounding-box.
Definition: Box.h:18
virtual sp< DrawMode > popDrawMode(void)
Pop rendering mode from stack.
Definition: DrawNull.h:28
virtual void pushMatrix(MatrixMode a_mode, Real a_values[16])
push a new 4x4 matrix on a particular stack
Definition: DrawNull.h:31
virtual void drawLines(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw lines.
Definition: DrawNull.h:63
virtual void unbindVertexArray(void)
currently, sets vertex array to zero in OpenGL
Definition: DrawNull.h:33
virtual void popMatrix(MatrixMode a_mode)
pop the top 4x4 matrix from a particular stack
Definition: DrawNull.h:32
virtual void pushDrawMode(sp< DrawMode > mode)
Push rendering mode onto stack.
Definition: DrawNull.h:27
virtual void setBrightness(Real a_brightness)
set additive lightening
Definition: DrawNull.h:34
virtual void drawTriangles(const SpatialVector *vertex, const SpatialVector *normal, const Vector2 *texture, U32 vertices, StripMode strip, BWORD multicolor, const Color *color)
Draw triangles.
Definition: DrawNull.h:78
virtual sp< ViewI > view(void) const
Get current view.
Definition: DrawNull.h:39
virtual sp< FontI > font(void)
Get current font.
Definition: DrawNull.h:50
virtual void setContrast(Real a_contrast)
set multiplicitive light scaling
Definition: DrawNull.h:36
virtual sp< DrawMode > drawMode(void) const
Get rendering mode.
Definition: DrawNull.h:26
Automatically reference-counted string container.
Definition: String.h:128
virtual void drawBox(const Box2 &box, const Color &color)
Draw 2D box.
Definition: DrawNull.h:104
virtual Real brightness(void)
get lightening
Definition: DrawNull.h:35
virtual void setView(sp< ViewI > spViewI)
Set current view.
Definition: DrawNull.h:38
Draw nothing for DrawI, elegantly.
Definition: DrawNull.h:20
virtual void popMatrixState(void)
Pop transform matrices.
Definition: DrawNull.h:30
virtual void drawPoints(const SpatialVector *vertex, const SpatialVector *normal, U32 vertices, BWORD multicolor, const Color *color)
Draw points vertex[vertices].
Definition: DrawNull.h:56
Copy-On-Write shared pointer.
Definition: Protectable.h:93
virtual Real contrast(void)
get light scaling
Definition: DrawNull.h:37
virtual void setDrawChain(sp< DrawI > a_spDrawI)
Set next DrawI in a chain.
Definition: DrawNull.h:41
virtual void setTransform(const SpatialTransform &a_rTransform)
Impose a spatial translation.
Definition: DrawNull.h:44
virtual void setDrawMode(sp< DrawMode > spDrawMode)
Set rendering mode.
Definition: DrawNull.h:25
virtual void clearInput(void)
Reset the current input queue.
Definition: DrawNull.h:47