20 class DisplayListData;
21 class IVisualGeometry;
22 class VisualDebugServer;
29 class DatabaseGenMetrics;
51 #ifdef KY_CONFIG_RELEASE
52 # define KY_DISABLE_DISPLAYLIST
55 #ifndef KY_DISABLE_DISPLAYLIST
60 class DisplayListManager;
133 typedef DisplayFlags Flags;
134 typedef DisplayDataType DataType;
135 typedef DisplayPrecision Precision;
136 typedef DisplayStyle Style;
138 static const DisplayPrecision::Enum DefaultPrecision = DisplayPrecision::_2cm;
147 DisplayList() : m_displayListManager(nullptr), m_displayListData(nullptr) {}
161 DisplayList(
DisplayList&& moved) : m_displayListManager(moved.m_displayListManager), m_displayListData(moved.m_displayListData)
163 moved.m_displayListManager =
nullptr;
164 moved.m_displayListData =
nullptr;
170 m_displayListManager = moved.m_displayListManager;
171 m_displayListData = moved.m_displayListData;
172 moved.m_displayListManager =
nullptr;
173 moved.m_displayListData =
nullptr;
177 void FlushAndClear();
180 DisplayListManager* GetManager()
const {
return m_displayListManager; }
196 KyUInt32 InitUserControlledLifespan(
const char listName[64],
const char groupName[64],
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);
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); }
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)); }
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); }
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)); }
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); }
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); }
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); }
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); }
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); }
254 void PushArrowCross2d(
const Vec3f& P,
KyFloat32 radius,
const ShapeColor& shapeColor) { PushPoint(P, radius, shapeColor, Style::ArrowCross2d); }
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); }
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)); }
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)); }
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); }
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)); }
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); }
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)); }
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); }
292 void PushLadder(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 radius,
const Color& color) { PushSegment(P, Q, radius, color, Style::Ladder); }
295 void PushArrow(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 radius,
const ShapeColor& shapeColor,
KyFloat32,
KyFloat32) { PushArrowTube(P, Q, radius, shapeColor); }
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)); }
303 void PushParabola(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 height,
const Color& color) { PushSegmentHeight(P, Q, height, color, Style::Parabola); }
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)); }
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); }
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)); }
319 void PushVerticalLine(
const Vec3f& P,
KyFloat32 height, Color color) { PushVerticalSegment(P, height, color, Style::Line); }
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)); }
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); }
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); }
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)); }
341 void PushVerticalFlag(
const Vec3f& P,
KyFloat32 height,
KyFloat32 radius,
const ShapeColor& shapeColor) { PushVerticalSegment(P, height, radius, shapeColor, Style::VerticalFlag); }
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);
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);
359 void PushCellBox(
const Box2i& cellBox,
const KyFloat32 altitudeMinMax[],
const DatabaseGenMetrics& genMetrics,
const ShapeColor& shapeColor);
362 DisplayText& NewText();
365 void PushShape(DisplayShape& shape);
368 DisplayListManager* m_displayListManager;
369 DisplayListData* m_displayListData;
384 void SetVisualDebugServer(VisualDebugServer* visualDebugServer) { m_visualDebugServer = visualDebugServer; }
385 bool IsVisualDebugSupported();
388 DisplayList Make(
const char group[64],
const char name[64]);
422 VisualDebugServer* m_visualDebugServer;
430 Ptr<IVisualGeometry> m_visualGeometry;
433 DisplayListData* GetNewDisplayListData();
434 void SendDisplayListData(DisplayListData* displayListData);
435 void ReleaseDisplayListData(DisplayListData* displayListData);
438 void AddDisplayListBlobToRender(
const char* displayListBlob,
KyUInt32 blobsize);
439 DisplayListBlob* GetNextDisplayListBlobToRender(
KyUInt32& sizeRead);
440 void ClearDisplayListBlobsToRender();
445 bool IsVisualGeometrySupported() {
return m_visualGeometry !=
nullptr; }
447 void BuildVisualGeometry();
457 #else // KY_DISABLE_DISPLAYLIST is defined
469 class DisplayListManager :
public DisabledDisplayListManager
475 class DisplayList :
public DisabledDisplayList
479 : DisabledDisplayList(manager, activation)
501 #endif // KY_DISABLE_DISPLAYLIST
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