gwnavruntime/visualsystem/displaylist.h Source File

displaylist.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
15 #include <utility>
16 
17 namespace Kaim
18 {
19 
20 class DisplayListData;
21 class IVisualGeometry;
22 class VisualDebugServer;
23 class Triangle3f;
24 class Vec3f;
25 class Box3f;
26 class Box2i;
27 class Transform;
28 class OrientedBox2d;
29 class DatabaseGenMetrics;
30 
35 {
38 };
39 
40 } // namespace Kaim
41 // we close the namespace Kaim here to reopen it cleanly inside
42 // - #ifndef KY_DISABLE_DISPLAYLIST
43 // - #else // KY_DISABLE_DISPLAYLIST
44 
45 
46 
47 // Define KY_DISABLE_DISPLAYLIST to disable DisplayList and DisplayListManager
48 // In that case these classes will be replaced by fully inlined classes, DisabledDisplayList and DisabledDisplayListManager,
49 // thanks to the define at the end of this file.
50 // If DisplayList and DisplayListManager are modified, please apply the changes into disableddisplaylist.inl as well.
51 #ifdef KY_CONFIG_RELEASE
52 # define KY_DISABLE_DISPLAYLIST
53 #endif
54 
55 #ifndef KY_DISABLE_DISPLAYLIST
56 
57 namespace Kaim
58 {
59 
60 class DisplayListManager;
61 
129 {
130  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualSystem)
131 
132 public:
133  typedef DisplayFlags Flags;
134  typedef DisplayDataType DataType;
135  typedef DisplayPrecision Precision;
136  typedef DisplayStyle Style;
137 
138  static const DisplayPrecision::Enum DefaultPrecision = DisplayPrecision::_2cm;
139 
140  // --------------- Constructors -------------
146 
147  DisplayList() : m_displayListManager(nullptr), m_displayListData(nullptr) {}
148 
150 
151  ~DisplayList(); // call SendDisplayListData() and ReleaseDisplayListData()
152 
153 private:
154  // when we drop vc11, let's use the = delete syntax
155  // DisplayList(const DisplayList&) = delete;
156  // DisplayList& operator=(const DisplayList&) = delete;
158  DisplayList& operator=(DisplayList&);
159 
160 public:
161  DisplayList(DisplayList&& moved) : m_displayListManager(moved.m_displayListManager), m_displayListData(moved.m_displayListData)
162  {
163  moved.m_displayListManager = nullptr;
164  moved.m_displayListData = nullptr;
165  }
166 
167  DisplayList& operator=(DisplayList&& moved)
168  {
169  FlushAndClear();
170  m_displayListManager = moved.m_displayListManager;
171  m_displayListData = moved.m_displayListData;
172  moved.m_displayListManager = nullptr;
173  moved.m_displayListData = nullptr;
174  return *this;
175  }
176 
177  void FlushAndClear(); // call SendDisplayListData() and ReleaseDisplayListData()
178  void Flush(); // call SendDisplayListData()
179 
180  DisplayListManager* GetManager() const { return m_displayListManager; }
181 
182  // --------------- Init for DisplayList stored only in the frame it was sent -------------
186 
187  void InitSingleFrameLifespan(const char listName[64], const char groupName[64]);
188  void InitSingleFrameLifespan(const char listName[64], KyUInt32 worldElementId);
189  void InitSingleFrameLifespan(const char listName[64], const char groupName[64], KyUInt32 worldElementId);
190 
191 
192  //static DisplayList Make(const char group[64], const char name[64]);
193 
194  // --------------- Do not call these functions, use DisplayListManager::MakeMultiFrame() instead -------------
195 
196  KyUInt32 InitUserControlledLifespan(const char listName[64], const char groupName[64], KyUInt32 displayListId);
197  KyUInt32 InitUserControlledLifespan(const char listName[64], KyUInt32 worldElementId, KyUInt32 displayListId);
198  KyUInt32 InitUserControlledLifespan(const char listName[64], const char groupName[64], KyUInt32 worldElementId, KyUInt32 displayListId);
199  void InitUserControlledLifespan(const char listName[64], const char groupName[64]);
200  void InitUserControlledLifespan_AssociateWithWorldElement(const char listName[64], const char groupName[64], KyUInt32 worldElementId);
201 
202  // --------------- Optional post-Init functions -------------
203 
207  void ShowInLabWhenSelected(bool showInLabWhenSelected);
208 
212  void ShowInLabWhenNotSelected(bool showInLabWhenNotSelected);
213 
215  void ShowInLab(bool showInLab);
216 
217  // --------------- Text -------------
218 
219  void PushTextVarg(const Vec3f& pos, const Color& color, const char* textFmt, ...);
220  void PushText( const Vec3f& pos, const Color& color, const char* text, KyUInt32 textLength = 0);
221  void PushText( const Vec3f& pos, const Color& color, const StringSpan& s) { PushText(pos, color, s.ptr, (KyUInt32)s.size); }
222 
223  // --------------- Point -------------
224 
225  void PushPoint(const Vec3f& P, const ShapeColor& shapeColor, Flags flags);
226  void PushPoint(const Vec3f& P, const ShapeColor& shapeColor, Style::Enum style = Style::LineCross3d) { PushPoint(P, shapeColor, Flags::P(style)); }
227 
228  void PushPointLine3d(const Vec3f& P, Color color) { PushPoint(P, color, Style::LineCross3d); }
229  void PushPointLine2d(const Vec3f& P, Color color) { PushPoint(P, color, Style::LineCross2d); }
230  void PushPointFlag( const Vec3f& P, const ShapeColor& shapeColor) { PushPoint(P, shapeColor, Style::VerticalFlag); }
231 
232  // --------------- PointRadius-------------
233 
234  void PushPoint(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor, Flags flags);
235  void PushPoint(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor, Style::Enum style = Style::LineCross3d) { PushPoint(P, radius, shapeColor, Flags::P(style)); }
236 
237  void PushPointLine3d( const Vec3f& P, KyFloat32 radius, Color color) { PushPoint(P, radius, color, Style::LineCross3d); }
238  void PushPointLine2d( const Vec3f& P, KyFloat32 radius, Color color) { PushPoint(P, radius, color, Style::LineCross2d); }
239  void PushDiagonalCross2d(const Vec3f& P, KyFloat32 radius, Color color) { PushPoint(P, radius, color, Style::DiagonalCross2d); }
240 
241  void PushQuad2d( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Quad2d); }
242  void PushQuadAndCross2d( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::QuadAndCross2d); }
243  void PushQuadAndDiagonalCross2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::QuadAndDiagonalCross2d); }
244 
245  void PushDiamond2d( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Diamond2d); }
246  void PushDiamondAndCross2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::DiamondAndCross2d); }
247 
248  void PushPentagon2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Pentagon2d); }
249  void PushHexagon2d( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Hexagon2d); }
250 
251  void PushOctogon2d( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Octogon2d); }
252  void PushOctogonAndCross2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::OctogonAndCross2d); }
253 
254  void PushArrowCross2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::ArrowCross2d); }
255 
256  void PushPointBox( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::Box); }
257  void PushPointPyramidInv(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::PyramidInv); }
258 
259  void PushDisk( const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor, Precision::Enum p = DefaultPrecision) { PushPoint(P, radius, shapeColor, Flags::P(Style::Disk2d).Set(p)); }
260  void PushDiskAndCross2d(const Vec3f& P, KyFloat32 radius, const ShapeColor& shapeColor, Precision::Enum p = DefaultPrecision) { PushPoint(P, radius, shapeColor, Flags::P(Style::DiskAndCross2d).Set(p)); }
261 
262  // --------------- Segment -------------
263 
264  void PushSegment(const Vec3f& P, const Vec3f& Q, const ShapeColor& shapeColor, Flags flags);
265  void PushSegment(const Vec3f& P, const Vec3f& Q, const ShapeColor& shapeColor, Style::Enum style) { PushSegment(P, Q, shapeColor, Flags::PQ(style)); }
266 
267  void PushLine( const Vec3f& P, const Vec3f& Q, const Color& color) { PushSegment(P, Q, color , Style::Line); }
268  void PushArrow2d5( const Vec3f& P, const Vec3f& Q, const Color& color) { PushSegment(P, Q, color , Style::Arrow2d5); }
269  void PushArrow2d5_Double( const Vec3f& P, const Vec3f& Q, const Color& color) { PushSegment(P, Q, color , Style::Arrow2d5_Double); }
270  void PushArrowPyramid( const Vec3f& P, const Vec3f& Q, const ShapeColor& shapeColor) { PushSegment(P, Q, shapeColor, Style::ArrowPyramid); }
271  void PushArrowPyramid_Double(const Vec3f& P, const Vec3f& Q, const ShapeColor& shapeColor) { PushSegment(P, Q, shapeColor, Style::ArrowPyramid_Double); }
272 
273  // --------------- SegmentRadius -------------
274 
275  void PushSegment(const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor, Flags flags);
276  void PushSegment(const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor, Style::Enum style, DisplayFaces::Enum faces = DisplayFaces::All)
277  { PushSegment(P, Q, radius, shapeColor, Flags::PQ(style).Set(faces)); }
278 
279  void PushSegmentPyramid( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::Pyramid); }
280  void PushSegmentTriangleCross(const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::TriangleCross); }
281  void PushSegmentBox( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor, DisplayFaces::Enum faces = DisplayFaces::All) { PushSegment(P, Q, radius, shapeColor, Style::Box, faces); }
282  void PushSegmentSquareTube( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::SquareTube); }
283 
284  void PushSegmentTriangle2d5( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::Triangle2d5); }
285  void PushSegmentQuad2d5( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::SegmentQuad2d5); }
286  void PushSegmentCapsule2d5( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor, Precision::Enum p = DefaultPrecision)
287  { PushSegment(P, Q, radius, shapeColor, Flags::PQ(Style::Capsule2d5).Set(p)); }
288 
289  void PushArrowTube( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::ArrowTube); }
290  void PushArrowTube_Double( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor) { PushSegment(P, Q, radius, shapeColor, Style::ArrowTube_Double); }
291 
292  void PushLadder( const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const Color& color) { PushSegment(P, Q, radius, color, Style::Ladder); }
293 
294  // backward compatibility
295  void PushArrow(const Vec3f& P, const Vec3f& Q, KyFloat32 radius, const ShapeColor& shapeColor, KyFloat32, KyFloat32) { PushArrowTube(P, Q, radius, shapeColor); }
296 
297 
298  // --------------- SegmentHeight -------------
299 
300  void PushSegmentHeight(const Vec3f& P, const Vec3f& Q, KyFloat32 height, const ShapeColor& shapeColor, Flags flags);
301  void PushSegmentHeight(const Vec3f& P, const Vec3f& Q, KyFloat32 height, const ShapeColor& shapeColor, Style::Enum style) { PushSegmentHeight(P, Q, height, shapeColor, Flags::PQ(style)); }
302 
303  void PushParabola(const Vec3f& P, const Vec3f& Q, KyFloat32 height, const Color& color) { PushSegmentHeight(P, Q, height, color, Style::Parabola); }
304 
305  // --------------- SegmentHeightRadius -------------
306 
307  void PushSegmentHeightRadius(const Vec3f& P, const Vec3f& Q, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, Flags flags);
308  void PushSegmentHeightRadius(const Vec3f& P, const Vec3f& Q, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, Style::Enum style, DisplayFaces::Enum faces = DisplayFaces::All)
309  { PushSegmentHeightRadius(P, Q, height, radius, shapeColor, Flags::PQ(style).Set(faces)); }
310 
311  void PushShearedBox(const Vec3f& P, const Vec3f& Q, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, DisplayFaces::Enum faces = DisplayFaces::All)
312  { PushSegmentHeightRadius(P, Q, height, radius, shapeColor, Style::ShearedBox, faces); }
313 
314  // --------------- PointHeight (VerticalSegment) -------------
315 
316  void PushVerticalSegment(const Vec3f& P, KyFloat32 height, const ShapeColor& shapeColor, Flags flags);
317  void PushVerticalSegment(const Vec3f& P, KyFloat32 height, const ShapeColor& shapeColor, Style::Enum style) { PushVerticalSegment(P, height, shapeColor, Flags::PQ(style)); }
318 
319  void PushVerticalLine(const Vec3f& P, KyFloat32 height, Color color) { PushVerticalSegment(P, height, color, Style::Line); }
320 
321  // --------------- PointHeightRadius (VerticalSegment) -------------
322 
323  void PushVerticalSegment(const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, Flags flags);
324  void PushVerticalSegment(const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, Style::Enum style, DisplayFaces::Enum faces = DisplayFaces::All)
325  { PushVerticalSegment(P, height, radius, shapeColor, Flags::PQ(style).Set(faces)); }
326 
327  void PushVerticalPyramid( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::Pyramid); }
328  void PushVerticalPyramidInv( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::PyramidInv); }
329  void PushVerticalBox( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, DisplayFaces::Enum faces = DisplayFaces::All) { PushVerticalSegment(P, height, radius, shapeColor, Style::Box, faces); }
330  void PushVerticalTriangleCross( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::TriangleCross); }
331  void PushVerticalTriangleCrossInv(const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::TriangleCrossInv); }
332 
333  void PushVerticalPentagon( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::VerticalPentagon); }
334  void PushVerticalHexagon( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::VerticalHexagon); }
335  void PushVerticalOctogon( const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::VerticalOctogon); }
336 
337  void PushVerticalCylinder(const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor,
338  Precision::Enum precision = DefaultPrecision, DisplayFaces::Enum faces = DisplayFaces::All)
339  { PushVerticalSegment(P, height, radius, shapeColor, Flags::PQ(Style::VerticalCylinder).Set(faces).Set(precision)); }
340 
341  void PushVerticalFlag(const Vec3f& P, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::VerticalFlag); }
342 
343  // --------------- Triangle, Quad, Box -------------
344 
345  void PushTriangle(const Vec3f& A, const Vec3f& B, const Vec3f& C, const ShapeColor& shapeColor);
346  void PushTriangle(const Triangle3f& triangle, const ShapeColor& shapeColor) { PushTriangle(triangle.A, triangle.B, triangle.C, shapeColor); }
347  void PushQuad(const Vec3f& A, const Vec3f& B, const Vec3f& C, const Vec3f& D, const ShapeColor& shapeColor);
348  void PushBox(const Box3f& box, const ShapeColor& shapeColor, DisplayFaces::Enum faces = DisplayFaces::All);
349 
350  // --------------- Other shapes -------------
351 
352  void PushDonut(const Vec3f& P, KyFloat32 innerRadius, KyFloat32 outerRadius, const ShapeColor& shapeColor, Precision::Enum precision = DefaultPrecision);
353  void PushSegmentVerticalQuad(const Vec3f& P, const Vec3f& Q, KyFloat32 above, KyFloat32 below, const ShapeColor& shapeColor);
354  void PushOrientedBox(const Transform& transform, const Box3f& box, const ShapeColor& shapeColor);
355  void PushOrientedBox2d(const OrientedBox2d& orientedBox2d, const ShapeColor& shapeColor);
356  void PushDiskSector(const Vec3f& P, KyFloat32 radius, const Vec3f& startPos, const Vec3f& endPos, const RotationDirection rotDir, const ShapeColor& shapeColor, Precision::Enum precision = DefaultPrecision);
357 
358  // nothing to do here because specific to genMetrics/navmesh
359  void PushCellBox(const Box2i& cellBox, const KyFloat32 altitudeMinMax[/*2*/], const DatabaseGenMetrics& genMetrics, const ShapeColor& shapeColor);
360 
361 private:
362  DisplayText& NewText();
363 
364  KyUInt32 SetDisplayListId(KyUInt32 displayListId);
365  void PushShape(DisplayShape& shape);
366 
367 public: // internal
368  DisplayListManager* m_displayListManager;
369  DisplayListData* m_displayListData;
370 };
371 
372 
376 {
377  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualSystem)
379 
380 public:
381  DisplayListManager(VisualDebugServer* visualDebugServer = nullptr);
383 
384  void SetVisualDebugServer(VisualDebugServer* visualDebugServer) { m_visualDebugServer = visualDebugServer; }
385  bool IsVisualDebugSupported();
386 
387  // ---------- Create a DisplayList that will be displayed 1 frame ----------
388  DisplayList Make(const char group[64], const char name[64]);
389  DisplayList Make(KyUInt32 worldElementId, const char name[64]);
390  DisplayList Make(KyUInt32 worldElementId, const char group[64], const char name[64]);
391 
392  // ---------- Create a DisplayList that will be displayed multiple frames, until RemoveDisplayList() is called ----------
400  DisplayList MakeMultiFrame(KyUInt32& displayListId, const char group[64], const char name[64]);
401 
403  DisplayList MakeMultiFrame(KyUInt32& displayListId, KyUInt32 worldElementId, const char name[64]);
404 
406  DisplayList MakeMultiFrame(KyUInt32& displayListId, KyUInt32 worldElementId, const char group[64], const char name[64]);
407 
410 
412  void RemoveDisplayList(KyUInt32 displayListId);
413 
415  void RemoveDisplayList(const char* displayListName, const char* displayListGroupName, KyUInt32 worldElementId = KyUInt32MAXVAL);
416 
418  void NewFrame();
419 
420 private:
421  // Game side
422  VisualDebugServer* m_visualDebugServer;
423  KyUInt32 m_currentDisplayListId; // used to generate unique ids in GenerateDisplayListId()
424  BlobHandler<DisplayListBlob> m_workingDisplayListBlobHandler; // reusable handler used to create all display list blobs
425  KyArray<DisplayListData*> m_displayListDataPool;
426 
427  // NavigationLab side
428  // buffer containing all the display list blobs packed one after each other
429  KyArrayPOD<char> m_displayListBlobsToRenderBuffer; // [blobSize_1 : KyUInt32][blob_1....][blobSize_2 : KyUInt32][blob_2....]...
430  Ptr<IVisualGeometry> m_visualGeometry;
431 
432 public: // internal
433  DisplayListData* GetNewDisplayListData(); // return the first unused DisplayListData in m_displayListDataPool
434  void SendDisplayListData(DisplayListData* displayListData); // Send DisplayListData to the VisualDebug (and possibly to the VisualGeometry if m_visualGeometry!=NULL)
435  void ReleaseDisplayListData(DisplayListData* displayListData); // Clear this displayListData so that it can be reused by another display list
436 
437  // NavigationLab side : DisplayListBlobToRender management
438  void AddDisplayListBlobToRender(const char* displayListBlob, KyUInt32 blobsize);
439  DisplayListBlob* GetNextDisplayListBlobToRender(KyUInt32& sizeRead);
440  void ClearDisplayListBlobsToRender();
441 
442  // NavigationLab side : DisplayListBlobToRender => VisualGeometry
443  void SetVisualGeometry(IVisualGeometry* visualGeometry); // in cpp to avoid including IVisualGeometry
444  IVisualGeometry* GetVisualGeometry() { return m_visualGeometry; }
445  bool IsVisualGeometrySupported() { return m_visualGeometry != nullptr; }
446 
447  void BuildVisualGeometry(); // fill the m_visualGeometry with the content of m_displayLists.
448 
449 public: // DEPRECATED
450  KY_DEPRECATED(void SubmitToRenderer()) { BuildVisualGeometry(); }
451 };
452 
453 
454 } // namespace Kaim
455 
456 //------------------------------------------------------------------------------------------------------------------------------------------------
457 #else // KY_DISABLE_DISPLAYLIST is defined
458 
459 // Here we use a separated file in order to easily maintain both versions by comparing the two files (displaylist.h and disableddisplaylist.inl)
460 // Note that disableddisplaylist.inl has its own namespace Kaim {}
462 
463 
464 namespace Kaim
465 {
466 
467 // We derive DisplayListManager from DisabledDisplayListManager (instead of typedef) because this allows
468 // to test DisabledDisplayListManager in Debug/Dev mode
469 class DisplayListManager : public DisabledDisplayListManager
470 {
471 };
472 
473 // We derive DisplayList from DisabledDisplayList (instead of typedef) because this allows
474 // to test DisabledDisplayList in Debug/Dev mode
475 class DisplayList : public DisabledDisplayList
476 {
477 public:
478  DisplayList(DisplayListManager* manager, DisplayListActivation activation = DisplayList_Disable)
479  : DisabledDisplayList(manager, activation)
480  {}
481 
482  // in Release DisplayListManager::Make returns a DisabledDisplayList, so we need a way to construct a DisplayList from it
483  DisplayList(DisabledDisplayList) {}
484 
485  // when we drop vc11, let's use the = delete syntax
486  // DisplayList(const DisplayList&) = delete;
487  // DisplayList& operator=(const DisplayList&) = delete;
488 private:
490  DisplayList& operator=(DisplayList&);
491 public:
492 
494  DisplayList& operator=(DisplayList&&) { return *this; }
495 
496  ~DisplayList() {}
497 };
498 
499 } // namespace Kaim
500 
501 #endif // KY_DISABLE_DISPLAYLIST
502 //------------------------------------------------------------------------------------------------------------------------------------------------
503 
504 
505 namespace Kaim
506 {
507 
508 typedef KY_DEPRECATED(DisplayList ScopedDisplayList); // ScopedDisplayList deprecated since 2.17.0, use DisplayList instead
509 
510 } // namespace Kaim
511 
512 
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:375
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
void ShowInLab(bool showInLab)
Makes the NavigationLab hide the displayList whether it's selected or NOT selected. The NavigationLab UI allows to override this.
Definition: displaylist.cpp:472
void ShowInLabWhenSelected(bool showInLabWhenSelected)
Makes the NavigationLab display or hide the displayList when the corresponding Element (Bot...
Definition: displaylist.cpp:460
KyUInt32 GenerateDisplayListId()
Returns a unique displayListId.
Definition: displaylist.cpp:352
DisplayList MakeMultiFrame(KyUInt32 &displayListId, const char group[64], const char name[64])
Definition: displaylist.cpp:264
Calls on the DisplayList will do nothing.
Definition: displaylist.h:36
The display list is activated.
Definition: displaylist.h:37
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:15
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
void NewFrame()
End the current frame and begin a new one.
Definition: displaylist.cpp:98
void PushText(const Vec3f &pos, const Color &color, const char *text, KyUInt32 textLength=0)
when text = "abc", textLength = 3
Definition: displaylist.cpp:531
DisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:128
#define KY_DEPRECATED(expr)
The compiler issues a warning when a deprecated function or typedef is used.
Definition: types.h:93
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
void SubmitToRenderer()
Changed for consistency, please use BuildVisualGeometry instead.
Definition: displaylist.h:450
void InitSingleFrameLifespan(const char listName[64], const char groupName[64])
A name and a group identifier are mandatory.
Definition: displaylist.cpp:395
void PushTextVarg(const Vec3f &pos, const Color &color, const char *textFmt,...)
Pushes text.
Definition: displaylist.cpp:516
void RemoveDisplayList(KyUInt32 displayListId)
Remove a displayList thta was created with MakeMultiFrame().
Definition: displaylist.cpp:79
DisplayList()
Construct a DisplayList, then, you must call one of the InitSingleFrameLifespan function in order to ...
Definition: displaylist.h:147
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68
float KyFloat32
float
Definition: types.h:32
DisplayListActivation
Indicates if the display list is active or not.
Definition: displaylist.h:34
void ShowInLabWhenNotSelected(bool showInLabWhenNotSelected)
Makes the NavigationLab display or hide the displayList when the corresponding Element (Bot...
Definition: displaylist.cpp:466
IVisualGeometry is an abstract base class that displays Triangles, Lines, and Texts.
Definition: ivisualgeometry.h:76