11 #ifndef Navigation_IVisualGeometryBuilder_H
12 #define Navigation_IVisualGeometryBuilder_H
29 class IVisualGeometry;
30 class VisualBoxVertices;
42 class VisualGeometryBuildConfig
50 class IVisualGeometryBuilder
54 IVisualGeometryBuilder(IVisualGeometry* visualGeometry =
KY_NULL);
55 virtual ~IVisualGeometryBuilder();
57 void SetConfig(const VisualGeometryBuildConfig& config);
58 void SetVisualGeometry(IVisualGeometry* visualGeometry);
60 bool IsInFillMode() const;
61 bool IsInCountMode() const;
63 IVisualGeometry* GetVisualGeometry() const;
64 VisualGeometryBuildConfig& GetBuildConfig();
67 void BuildVisualGeometry();
71 virtual
void DoBuild() = 0;
73 void BuildSubVisualGeometry(IVisualGeometryBuilder& subGeometryBuilder);
77 void EnableNormalGeneration();
83 void PushTextVarg( const Vec3f& pos, const VisualColor& color, const
char* textFmt, ...);
84 void PushText(const Vec3f& pos, const VisualColor& color, const
char* text,
KyUInt32 textLength = 0);
87 void PushLine(const Vec3f& P, const Vec3f& Q, const VisualColor& color,
KyFloat32 pixelWidth = 1.f);
90 void PushTriangle(const Vec3f& A, const Vec3f& B, const Vec3f& C, const VisualShapeColor& color);
93 void PushTriangle(const Triangle3f& triangle, const VisualShapeColor& color);
96 void PushVerticalCylinder(const Vec3f& P,
KyFloat32 radius,
KyFloat32 height,
KyUInt32 subdivisions, const VisualShapeColor& color);
99 void PushSegment(const Vec3f& A, const Vec3f& B,
KyFloat32 halfWidth, const VisualShapeColor& color);
102 void PushQuad(const Vec3f& A, const Vec3f& B, const Vec3f& C, const Vec3f& D, const VisualShapeColor& color);
105 void PushQuad(const Vec3f& A, const Vec3f& B,
KyFloat32 radius, const VisualShapeColor& color);
108 void PushPoint(const Vec3f& P, const VisualShapeColor& color) { PushPoint(P, 0.1f, color); }
111 void PushPoint(
const Vec3f& P,
KyFloat32 radius,
const VisualShapeColor& color);
114 void PushPyramid(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
118 void PushSquareTubeSegment(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
131 void PushArrow(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color,
KyFloat32 headWidthRatio = 3.0f,
KyFloat32 headLengthRatio = 0.33f);
143 void PushBezierArrow(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color,
KyFloat32 headWidthRatio = 3.0f,
KyUInt32 directionnality = 0);
148 void PushChristmasTree(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
151 void PushSilex(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
155 void PushDoubleSilex(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
160 void PushCrossedRectangles(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
163 void PushColumn(
const Vec3f& P,
KyFloat32 halfWidth,
KyFloat32 height,
const VisualShapeColor& color);
165 void PushOrientedBox(
const Transform& transform,
const Box3f& extents,
const VisualShapeColor& color);
166 void PushOrientedBox2d(
const OrientedBox2d& orientedBox2d,
const VisualShapeColor& color);
169 void PushTetrahedron(
const Vec3f& P,
KyFloat32 halfWidth,
const VisualShapeColor& color);
172 void PushDisk(
const Vec3f& P,
KyFloat32 radius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
175 void PushDiskSector(
const Vec3f& P,
KyFloat32 radius,
const Vec3f& startPos,
const Vec3f& endPos,
const RotationDirection rotDir,
KyUInt32 subdivisions,
const VisualShapeColor& color);
178 void PushCorona(
const Vec3f& P,
KyFloat32 innerRadius,
KyFloat32 outerRadius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
180 void PushStadium(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 radius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
183 void PushBox(
const Box3f& box,
const VisualShapeColor& color);
187 void PushTriangleTubeSegment(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
196 void PushWall(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 upHeight,
KyFloat32 downHeight,
KyFloat32 halfWidth,
const VisualShapeColor& color);
198 void PushLadder(
const Transform& transform,
const Box3f& entrances,
KyFloat32 ladderWidth,
KyFloat32 rungsThickness,
KyFloat32 rungsGapSize,
const VisualShapeColor& shapeColor);
202 void PushFlag(
const Vec3f& P,
KyFloat32 height,
KyFloat32 radius,
const VisualShapeColor& color);
206 void IncrementTextCount(
KyUInt32 increment);
207 void IncrementTriangleCount(
KyUInt32 increment,
const VisualColor& color);
208 void IncrementLineCount(
KyUInt32 increment,
const VisualColor& lineColor);
210 void FillText(
const Vec3f& pos,
const VisualColor& color,
const char* text,
KyUInt32 textLength);
211 void FillLine(
const Vec3f& P,
const Vec3f& Q,
const VisualColor& color,
KyFloat32 width = 1.f);
212 void FillTriangle(
const Vec3f& A,
const Vec3f& B,
const Vec3f& C,
const VisualShapeColor& color);
213 void FillTriangle(
const Triangle3f& triangle,
const VisualShapeColor& color);
215 const VisualShapeColor& color);
216 void FillSegment(
const Vec3f& A,
const Vec3f& B,
KyFloat32 halfWidth,
const VisualShapeColor& color);
217 void FillQuad(
const Vec3f& A,
const Vec3f& B,
KyFloat32 radius,
const VisualShapeColor& color);
218 void FillQuad(
const Vec3f& A,
const Vec3f& B,
const Vec3f& C,
const Vec3f& D,
const VisualShapeColor& color);
219 void FillPoint(
const Vec3f& P,
const VisualShapeColor& color) { PushPoint(P, 0.1f, color); }
220 void FillPoint(
const Vec3f& P,
KyFloat32 radius,
const VisualShapeColor& color);
221 void FillPyramid(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
222 void FillSquareTubeSegment(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
223 void FillArrow(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color,
225 void FillBezierArrow(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color,
227 void FillChristmasTree(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
228 void FillSilex(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
229 void FillDoubleSilex(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
230 void FillCrossedRectangles(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 bodyHalfWidth,
const VisualShapeColor& color);
231 void FillColumn(
const Vec3f& P,
KyFloat32 halfWidth,
KyFloat32 height,
const VisualShapeColor& color);
232 void FillOrientedBox(
const Transform& transform,
const Box3f& extents,
const VisualShapeColor& color);
233 void FillOrientedBox2d(
const OrientedBox2d& orientedBox2d,
const VisualShapeColor& color);
234 void FillTetrahedron(
const Vec3f& P,
KyFloat32 halfWidth,
const VisualShapeColor& color);
235 void FillDisk(
const Vec3f& P,
KyFloat32 radius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
236 void FillDiskSector(
const Vec3f& P,
KyFloat32 radius,
const Vec3f& startPos,
const Vec3f& endPos,
const RotationDirection rotDir,
KyUInt32 subdivisions,
const VisualShapeColor& color);
237 void FillCorona(
const Vec3f& P,
KyFloat32 innerRadius,
KyFloat32 outerRadius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
238 void FillStadium(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 radius,
KyUInt32 subdivisions,
const VisualShapeColor& color);
239 void FillBox(
const Box3f& box,
const VisualShapeColor& color);
240 void FillTriangleTubeSegment(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 halfWidth,
const VisualShapeColor& color);
241 void FillWall(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 upHeight,
KyFloat32 downHeight,
KyFloat32 halfWidth,
const VisualShapeColor& color);
242 void FillLadder(
const Transform& transform,
const Box3f& entrances,
KyFloat32 ladderWidth,
KyFloat32 rungsThickness,
243 KyFloat32 rungsGapSize,
const VisualShapeColor& shapeColor);
245 void FillFlag(
const Vec3f& P,
KyFloat32 height,
KyFloat32 radius,
const VisualShapeColor& color);
247 void FillFromVisualBoxVertices(VisualBoxVertices& box,
const VisualShapeColor& shapeColor);
250 void BeginFillMode();
253 void DebugIncrementTextCount(
KyUInt32 increment);
254 void DebugIncrementTriangleCount(
KyUInt32 increment,
const VisualColor& color);
255 void DebugIncrementLineCount(
KyUInt32 increment,
const VisualColor& lineColor);
257 void FillTriangleWithFinalPos(
const Vec3f& A,
const Vec3f& B,
const Vec3f& C, VisualColor shapeColor);
259 static bool CalculateFrontUpRight(
const Vec3f& P,
const Vec3f& Q, Vec3f& front, Vec3f& up, Vec3f& right);
262 enum BuildMode { BuildMode_COUNT, BuildMode_FILL };
263 BuildMode m_buildMode;
265 VisualGeometryBuildConfig m_buildConfig;
267 VisualGeometrySetupConfig m_setupConfig;
268 Ptr<IVisualGeometry> m_visualGeometry;
271 #ifndef KY_BUILD_SHIPPING
272 VisualGeometrySetupConfig m_debugSetupConfig;
282 #endif //Navigation_IVisualGeometryBuilder_H
Identifies a higher level of detail.
Definition: ivisualgeometrybuilder.h:39
#define KY_NULL
Null value.
Definition: types.h:247
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:20
Identifies a lower level of detail.
Definition: ivisualgeometrybuilder.h:37
VisualGeometryDetailLevel
Enumerates the possible levels of detail that can be set for a VisualRepresentation.
Definition: ivisualgeometrybuilder.h:35
Definition: gamekitcrowddispersion.h:20
Identifies a higher level of detail.
Definition: ivisualgeometrybuilder.h:38
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23