gwnavgeneration/raster/edgerasterizer.h Source File

edgerasterizer.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: NOBODY
12 #ifndef GwNavGen_EdgeRasterizer_H
13 #define GwNavGen_EdgeRasterizer_H
14 
15 
17 
18 
19 namespace Kaim
20 {
21 
22 class GeneratorSystem;
23 class Box2i;
24 class RasterPoint;
25 class SingleStageRaster;
26 
27 
28 class EdgeRasterizer
29 {
30 public:
31  EdgeRasterizer(GeneratorSystem* sys, KyFloat32 rasterPrecision, KyInt32 pixelSizeInInt, SingleStageRaster* singleStageRaster);
32 
33  bool InitToRasterizeAlong_X(const RasterPoint& A, const RasterPoint& B);
34 
35  bool InitToRasterizeAlong_Y(const RasterPoint& A, const RasterPoint& B);
36 
37  void Rasterize();
38 
39 private:
40  void FinalizeInit();
41  friend class EdgeRasterizerImpl;
42 
43 private:
44  GeneratorSystem* m_sys;
45  KyInt32 m_pixelSize;
46  KyInt64 m_pixelSize64; // same in 64 bits
47 
48  SingleStageRaster* m_singleStageRaster;
49  KyFloat32 m_meter_pixelSize;
50 
51 
52  Coord m_Au; // Coordinate of A along "u" axis
53  Coord m_Av; // Coordinate of A along "v" axis
54  KyFloat32 m_meter_Az; // the altitude in meter of point A
55 
56  Coord m_Bu; // Coordinate of B along "u" axis
57  Coord m_Bv; // Coordinate of B along "u" axis
58  KyFloat32 m_meter_Bz; // the altitude in meter of point B
59 
60  // Raster pixelBox in uv coordinates
61  // retrieved during InitToRasterizeAlong_X/Y
62  PixelCoord m_MINpu;
63  PixelCoord m_MAXpu;
64  PixelCoord m_MINpv;
65  PixelCoord m_MAXpv;
66 
67  KyFloat32 m_dz_on_du; // gradient of altitude along "u"
68  KyFloat32 m_meter_step_z; // increment of altitude by pixel along "u"
69 
70  // internal values we cache to speedUp GetPv() computation
71  KyInt64 m_ABu; // = (KyInt64)(m_Bu - m_Au);
72  KyInt64 m_ABv; // = (KyInt64)(m_Bv - m_Av); used in GetPv()
73  KyInt64 m_ABu_by_Av; // = m_ABu * m_Av; used in GetPv()
74  KyInt64 m_ABu_by_pixelSize; // = m_ABu * m_coord_pixelSize; used in GetPv()
75 
76  // so: Does "u" means X axis or Y axis ? and v ?
77  // m_x_in_uv = 0;
78  // m_y_in_uv = 1;
79  // means Rasterize along X
80  // m_x_in_uv = 1;
81  // m_y_in_uv = 0;
82  // means Rasterize along Y
83  KyInt32 m_x_in_uv;
84  KyInt32 m_y_in_uv;
85 };
86 
87 
88 }
89 
90 
91 #endif
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43