From 777c00f27064a5a4b1d5269fd9aadd75051c8544 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Wed, 6 Jul 2011 03:32:02 +0300 Subject: [PATCH] Changed: #1301 Added flag "modified" in ZoneRegionObject. --- .../landscape_editor/zone_region_editor.cpp | 14 ++++++++-- .../landscape_editor/zone_region_editor.h | 28 +++++++++++++++---- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp index 81e4b687c..399d39496 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.cpp @@ -196,12 +196,12 @@ void ZoneRegionObject::setLigoData(const LigoData &data, const sint32 x, const s m_zoneRegion.setSharingCutEdges(x, y, 3, data.sharingCutEdges[3]); } -NLLIGO::CZoneRegion &ZoneRegionObject::zoneRegion() +NLLIGO::CZoneRegion &ZoneRegionObject::ligoZoneRegion() { return m_zoneRegion; } -void ZoneRegionObject::setZoneRegion(const NLLIGO::CZoneRegion &zoneRegion) +void ZoneRegionObject::setLigoZoneRegion(const NLLIGO::CZoneRegion &zoneRegion) { m_zoneRegion = zoneRegion; } @@ -214,4 +214,14 @@ bool ZoneRegionObject::checkPos(const sint32 x, const sint32 y) (y <= m_zoneRegion.getMaxY())); } +bool ZoneRegionObject::isModified() const +{ + return m_modified; +} + +void ZoneRegionObject::setModified(bool modified) +{ + m_modified = modified; +} + } /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h index 2d4f063aa..9081d7002 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/zone_region_editor.h @@ -32,6 +32,7 @@ namespace LandscapeEditor { +// Data struct LigoData { uint8 posX; @@ -47,33 +48,50 @@ struct LigoData bool operator!= (const LigoData& other) const; }; +/** +@class ZoneRegionObject +@brief +@details +*/ class ZoneRegionObject { public: ZoneRegionObject(); ~ZoneRegionObject(); - // Load landscape data from file + /// Load landscape data from file bool load(const std::string &fileName); - // Save landscape data to file + /// Save landscape data to file (before save, should set file name). bool save(); + /// Get ligo data void ligoData(LigoData &data, const sint32 x, const sint32 y); + /// Set ligo data void setLigoData(const LigoData &data, const sint32 x, const sint32 y); + /// Get file name std::string fileName() const; - // Set file name + /// Set file name, use for saving data in file void setFileName(const std::string &fileName); - NLLIGO::CZoneRegion &zoneRegion(); + /// Accessor to LIGO CZoneRegion + NLLIGO::CZoneRegion &ligoZoneRegion(); - void setZoneRegion(const NLLIGO::CZoneRegion &zoneRegion); + void setLigoZoneRegion(const NLLIGO::CZoneRegion &zoneRegion); + /// Check position, it belongs to the landscape bool checkPos(const sint32 x, const sint32 y); + /// Helper flag to know if a ps has been modified + /// @{ + bool isModified() const; + + void setModified(bool modified); + /// @} + private: bool m_modified;