gwnavgeneration/raster/cellrasterizerfromdynamictriangulation.h Source File

cellrasterizerfromdynamictriangulation.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 
8 
9 
10 
11 // primary contact: GUAL - secondary contact: LASI
12 #ifndef GwNavGen_CellRasterizerFromDynamicTriangulation_H
13 #define GwNavGen_CellRasterizerFromDynamicTriangulation_H
14 
21 
22 namespace Kaim
23 {
24 
25 class GeneratorSystem;
26 class InputCellBlob;
27 class DynamicTriangulation;
28 
29 class CellRasterizerFromDynamicTriangulation : public CellRasterizer
30 {
31 public:
32  CellRasterizerFromDynamicTriangulation(
33  GeneratorSystem* sys, KyInt32 stride, DynamicTriangulation* triangulation,
34  DynamicRasterCell* dynamicRaster, const PixelBox& pixelBox, const KyArrayDH_POD<KyUInt32>* modifiedTriangles, CellDesc& cellDesc
35  )
36  : CellRasterizer(dynamicRaster)
37  , m_singleStageRaster(GeneratorMemory::TlsHeap())
38  , m_triangleRasterizer(sys)
39  {
40  m_sys = sys;
41  m_dynamicTriangulation = triangulation;
42  m_pixelBox = pixelBox;
43  m_modifiedTriangles = modifiedTriangles;
44  m_singleStageRaster.Init(m_pixelBox);
45  m_triangleRasterizer.Init((KyFloat32)stride * m_sys->GetNormalizedRasterPrecision(), stride * IntCoordSystem::IntPixelSize(), &m_singleStageRaster);
46  m_cellDesc = cellDesc;
47  }
48 
49 public:
50  void SetDynamicTriangulation(DynamicTriangulation* triangulation)
51  {
52  m_dynamicTriangulation = triangulation;
53  }
54  void SetDynamicRasterCell(DynamicRasterCell* rasterCell)
55  {
56  m_dynamicRaster = rasterCell;
57  }
58  void SetModifiedTriangles(const KyArrayDH_POD<KyUInt32>* triangles)
59  {
60  m_modifiedTriangles = triangles;
61  }
62 
63 protected:
64  virtual KyResult DoRasterize();
65 
66 protected:
67  DynamicTriangulation* m_dynamicTriangulation;
68  PixelBox m_pixelBox;
69  const KyArrayDH_POD<KyUInt32>* m_modifiedTriangles;
70  SingleStageRaster m_singleStageRaster;
71  TriangleRasterizer m_triangleRasterizer;
72  CellDesc m_cellDesc;
73  GeneratorSystem* m_sys;
74 };
75 
76 
77 }
78 
79 
80 #endif
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43