#include <zone_region.h>
Public Member Functions | |
| void | basicSet (sint32 x, sint32 y, sint32 PosX, sint32 PosY, const std::string &ZoneName) |
| CZoneRegion () | |
| uint8 | getCutEdge (sint32 x, sint32 y, uint8 pos) const |
| uint32 | getDate (sint32 x, sint32 y, uint8 lowOrHigh) const |
| uint8 | getFlip (sint32 x, sint32 y) const |
| sint32 | getMaxX () const |
| sint32 | getMaxY () const |
| sint32 | getMinX () const |
| sint32 | getMinY () const |
| const std::string & | getName (sint32 x, sint32 y) const |
| uint8 | getPosX (sint32 x, sint32 y) const |
| uint8 | getPosY (sint32 x, sint32 y) const |
| uint8 | getRot (sint32 x, sint32 y) const |
| uint8 | getSharingCutEdges (sint32 x, sint32 y, uint edge) |
| std::string | getSharingMatNames (sint32 x, sint32 y, uint edge) |
| void | resize (sint32 newMinX, sint32 newMaxX, sint32 newMinY, sint32 newMaxY) |
| void | serial (NLMISC::IStream &f) |
| bool | setFlip (sint32 x, sint32 y, uint8 newValue) |
| void | setMaxX (sint32 newValue) |
| void | setMaxY (sint32 newValue) |
| void | setMinX (sint32 newValue) |
| void | setMinY (sint32 newValue) |
| bool | setName (sint32 x, sint32 y, const std::string &newValue) |
| bool | setPosX (sint32 x, sint32 y, uint8 newValue) |
| bool | setPosY (sint32 x, sint32 y, uint8 newValue) |
| bool | setRot (sint32 x, sint32 y, uint8 newValue) |
| bool | setSharingCutEdges (sint32 x, sint32 y, uint edge, uint8 newValue) |
| bool | setSharingMatNames (sint32 x, sint32 y, uint edge, const std::string &newValue) |
Protected Attributes | |
| sint32 | _MaxX |
| sint32 | _MaxY |
| sint32 | _MinX |
| sint32 | _MinY |
| std::vector< SZoneUnit2 > | _Zones |
Static Protected Attributes | |
| std::string | _StringOutOfBound |
|
|
Definition at line 151 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, _StringOutOfBound, and STRING_OUT_OF_BOUND.
00152 {
00153 _StringOutOfBound = STRING_OUT_OF_BOUND;
00154 _MinX = _MinY = 0;
00155 _MaxX = _MaxY = -1;
00156 }
|
|
||||||||||||||||||||||||
|
Definition at line 317 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, resize(), sint32, stride, uint8, x, and y.
00318 {
00319 // Do we need to resize ?
00320 if ((x < _MinX) || (x > _MaxX) ||
00321 (y < _MinY) || (y > _MaxY))
00322 {
00323 sint32 newMinX = (x<_MinX?x:_MinX), newMinY = (y<_MinY?y:_MinY);
00324 sint32 newMaxX = (x>_MaxX?x:_MaxX), newMaxY = (y>_MaxY?y:_MaxY);
00325
00326 resize (newMinX, newMaxX, newMinY, newMaxY);
00327 }
00328 sint32 stride = (1+_MaxX-_MinX); // Nb to go to next line
00329
00330 _Zones[(x-_MinX)+(y-_MinY)*stride].ZoneName = ZoneName;
00331 _Zones[(x-_MinX)+(y-_MinY)*stride].PosX = (uint8)PosX;
00332 _Zones[(x-_MinX)+(y-_MinY)*stride].PosY = (uint8)PosY;
00333 }
|
|
||||||||||||||||
|
Definition at line 259 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||||||
|
Definition at line 273 of file zone_region.cpp. References sint32, uint32, uint8, x, and y.
00274 {
00275 if ((x < _MinX) || (x > _MaxX) ||
00276 (y < _MinY) || (y > _MaxY))
00277 {
00278 return 0;
00279 }
00280 else
00281 {
00282 if (lowOrHigh == 0)
00283 return _Zones[(x-_MinX)+(y-_MinY)*(1+_MaxX-_MinX)].DateLow;
00284 else
00285 return _Zones[(x-_MinX)+(y-_MinY)*(1+_MaxX-_MinX)].DateHigh;
00286 }
00287 }
|
|
||||||||||||
|
Definition at line 245 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
|
Definition at line 88 of file zone_region.h.
00088 { return _MaxX; };
|
|
|
Definition at line 90 of file zone_region.h.
00090 { return _MaxY; };
|
|
|
Definition at line 87 of file zone_region.h.
00087 { return _MinX; };
|
|
|
Definition at line 89 of file zone_region.h.
00089 { return _MinY; };
|
|
||||||||||||
|
Definition at line 189 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, _StringOutOfBound, sint32, x, and y.
|
|
||||||||||||
|
Definition at line 203 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||
|
Definition at line 217 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||
|
Definition at line 231 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||||||
|
Definition at line 417 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint, uint8, x, and y.
|
|
||||||||||||||||
|
Definition at line 402 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, _StringOutOfBound, sint32, uint, x, and y.
|
|
||||||||||||||||||||
|
Definition at line 290 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, and sint32. Referenced by basicSet().
00291 {
00292 sint32 i, j;
00293 vector<SZoneUnit2> newZones;
00294 SZoneUnit2 zuTmp;
00295
00296 newZones.resize ((1+newMaxX-newMinX)*(1+newMaxY-newMinY));
00297 sint32 newStride = 1+newMaxX-newMinX;
00298 sint32 Stride = 1+_MaxX-_MinX;
00299 for (j = newMinY; j <= newMaxY; ++j)
00300 for (i = newMinX; i <= newMaxX; ++i)
00301 {
00302 if ((i >= _MinX)&&(i <= _MaxX)&&(j >= _MinY)&&(j <= _MaxY))
00303 {
00304 newZones[(i-newMinX)+(j-newMinY)*newStride] = _Zones[(i-_MinX)+(j-_MinY)*Stride];
00305 }
00306 else
00307 {
00308 newZones[(i-newMinX)+(j-newMinY)*newStride] = zuTmp;
00309 }
00310 }
00311 _MinX = newMinX; _MaxX = newMaxX;
00312 _MinY = newMinY; _MaxY = newMaxY;
00313 _Zones = newZones;
00314 }
|
|
|
Definition at line 159 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, NLMISC::IStream::serialCheck(), NLMISC::IStream::serialCont(), NLMISC::IStream::serialVersion(), sint32, uint32, NLMISC::IStream::xmlPop(), NLMISC::IStream::xmlPush(), and NLMISC::IStream::xmlSerial().
00160 {
00161 f.xmlPush ("LAND");
00162
00163 sint32 version = f.serialVersion (1);
00164 f.serialCheck ((uint32)'DNAL');
00165
00166 f.xmlSerial (_MinX, "MIN_X");
00167 f.xmlSerial (_MinY, "MIN_Y");
00168 f.xmlSerial (_MaxX, "MAX_X");
00169 f.xmlSerial (_MaxY, "MAX_Y");
00170
00171 if (version == 1)
00172 {
00173 f.serialCont (_Zones);
00174 }
00175
00176 if (version == 0)
00177 {
00178 std::vector<SZoneUnit> vZonesTmp;
00179 f.serialCont (vZonesTmp);
00180 _Zones.resize (vZonesTmp.size());
00181 for (uint32 i = 0; i < vZonesTmp.size(); ++i)
00182 _Zones[i] = vZonesTmp[i];
00183 }
00184
00185 f.xmlPop ();
00186 }
|
|
||||||||||||||||
|
Definition at line 496 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
|
Definition at line 93 of file zone_region.h.
00093 { _MaxX = newValue; };
|
|
|
Definition at line 95 of file zone_region.h.
00095 { _MaxY = newValue; };
|
|
|
Definition at line 92 of file zone_region.h.
00092 { _MinX = newValue; };
|
|
|
Definition at line 94 of file zone_region.h.
00094 { _MinY = newValue; };
|
|
||||||||||||||||
|
Definition at line 432 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, x, and y.
|
|
||||||||||||||||
|
Definition at line 448 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||||||
|
Definition at line 464 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||||||
|
Definition at line 480 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint8, x, and y.
|
|
||||||||||||||||||||
|
Definition at line 528 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint, uint8, x, and y.
|
|
||||||||||||||||||||
|
Definition at line 512 of file zone_region.cpp. References _MaxX, _MaxY, _MinX, _MinY, sint32, uint, x, and y.
|
|
|
Definition at line 132 of file zone_region.h. Referenced by basicSet(), CZoneRegion(), getCutEdge(), getFlip(), getMaxX(), getName(), getPosX(), getPosY(), getRot(), getSharingCutEdges(), getSharingMatNames(), resize(), serial(), setFlip(), setMaxX(), setName(), setPosX(), setPosY(), setRot(), setSharingCutEdges(), and setSharingMatNames(). |
|
|
Definition at line 132 of file zone_region.h. Referenced by basicSet(), CZoneRegion(), getCutEdge(), getFlip(), getMaxY(), getName(), getPosX(), getPosY(), getRot(), getSharingCutEdges(), getSharingMatNames(), resize(), serial(), setFlip(), setMaxY(), setName(), setPosX(), setPosY(), setRot(), setSharingCutEdges(), and setSharingMatNames(). |
|
|
Definition at line 131 of file zone_region.h. Referenced by basicSet(), CZoneRegion(), getCutEdge(), getFlip(), getMinX(), getName(), getPosX(), getPosY(), getRot(), getSharingCutEdges(), getSharingMatNames(), resize(), serial(), setFlip(), setMinX(), setName(), setPosX(), setPosY(), setRot(), setSharingCutEdges(), and setSharingMatNames(). |
|
|
Definition at line 131 of file zone_region.h. Referenced by basicSet(), CZoneRegion(), getCutEdge(), getFlip(), getMinY(), getName(), getPosX(), getPosY(), getRot(), getSharingCutEdges(), getSharingMatNames(), resize(), serial(), setFlip(), setMinY(), setName(), setPosX(), setPosY(), setRot(), setSharingCutEdges(), and setSharingMatNames(). |
|
|
Definition at line 34 of file zone_region.cpp. Referenced by CZoneRegion(), getName(), and getSharingMatNames(). |
|
|
Definition at line 130 of file zone_region.h. |
1.3.6