gwnavruntime/visualsystem/displaylistvisualgeometrybuilder.h Source File

displaylistvisualgeometrybuilder.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 
12 
13 namespace Kaim
14 {
15 
16 class DisplayListManager;
17 class IVisualGeometry;
18 
19 // Build the IVisualGeometry from DisplayShapeBlobs
20 class DisplayListVisualGeometryBuilder : public IVisualGeometryBuilder
21 {
22  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualSystem)
23 public:
24  DisplayListVisualGeometryBuilder(DisplayListManager* displayListManager, IVisualGeometry* visualGeometry)
25  : IVisualGeometryBuilder(visualGeometry), m_displayListManager(displayListManager)
26  {
27  m_defaultRadius = 0.1f;
28  m_defaultHeight = 1.0f;
29  }
30 
31  virtual ~DisplayListVisualGeometryBuilder() {}
32 
33  virtual void DoBuild();
34 
35 private:
36  void PushTextBlob(DisplayTextBlob* blob);
37 
38  void PushShapeBlob(DisplayShapeBlob* blob);
39 
40  void Push(const Vec3f& A, const Vec3f& B, KyFloat32 height, KyFloat32 radius, const ShapeColor& shapeColor, DisplayStyle::Enum style, KyFloat32 precision, DisplayFaces::Enum faces);
41 
42  void PushSegmentVerticalQuadShape(const Display::SegmentVerticalQuad& segmentVerticalQuad, const ShapeColor& shapeColor)
43  {
44  PushSegmentVerticalQuad(segmentVerticalQuad.P, segmentVerticalQuad.Q, segmentVerticalQuad.below, segmentVerticalQuad.above, shapeColor);
45  }
46 
47  void PushOrientedBox3dShape(const Display::OrientedBox3d& orientedBox3d, const ShapeColor& shapeColor)
48  {
49  PushOrientedBox3d(orientedBox3d.transform, orientedBox3d.box, shapeColor);
50  }
51 
52  void PushDiskSectorShape(const Display::DiskSector& diskSector, KyFloat32 precision, const ShapeColor& shapeColor)
53  {
54  PushDiskSectorPrecise(diskSector.P, diskSector.radius, diskSector.startPos, diskSector.endPos, (RotationDirection)diskSector.rotDir, precision, shapeColor);
55  }
56 
57 private:
58  DisplayListManager* m_displayListManager;
59  KyFloat32 m_defaultRadius;
60  KyFloat32 m_defaultHeight;
61 };
62 
63 }
64 
65 
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
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32