![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtOverlaySettings.h,v $ $Revision: 1.22 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtOverlaySettings_H_ 00014 #define DtOverlaySettings_H_ 00015 00016 #include <vrvCore/vrvCore.h> 00017 #include <makArchives/DtSerialize.h> 00018 #include <makArchives/DtOverlaySettingsRecord.h> 00019 00020 #include <string> 00021 #include <vector> 00022 00023 namespace makVrv 00024 { 00025 class DtTerrainPatch; 00026 00034 class DT_DLL_VRVCORE DtOverlaySettings 00035 { 00036 public: 00037 00038 friend class DtTerrainPatch; 00039 00040 protected: 00041 00043 explicit DtOverlaySettings(DtTerrainPatch* patch = 0); 00044 00049 DtOverlaySettings& operator=( const DtOverlaySettings& orig ); 00050 00054 void setPatch(DtTerrainPatch* patch); 00055 00056 public: 00057 00059 DtTerrainPatch* patch(); 00060 00062 ~DtOverlaySettings(); 00063 00065 void getRecord(makArchives::DtOverlaySettingsRecord& rec) const; 00066 00068 void setFromRecord(const makArchives::DtOverlaySettingsRecord& rec); 00069 00071 std::vector<std::string> availableRasterLayers(); 00072 00074 virtual void getTextureScale(double& x, double& y) const; 00075 00077 virtual void getTextureOffset(double& x, double& y) const; 00078 00081 virtual std::string addRasterLayer(const std::string& name = ""); 00082 00084 virtual bool removeRasterLayer(const std::string& name); 00085 00087 virtual bool renameRasterLayer(const std::string& oldName, const std::string& newName); 00088 00090 00091 00093 bool rasterTextureEnabled(const std::string& raster) const; 00094 00096 void setRasterTextureEnabled(const std::string& raster, bool enabled); 00097 00099 void setRasterTextureWrapMode(const std::string& raster, int enabled); 00100 00102 int rasterTextureWrapMode(const std::string& raster) const; 00103 00105 void setRasterTextureBlendMode(const std::string&, int); 00106 00108 int rasterTextureBlendMode(const std::string& raster) const; 00109 00111 bool rasterTextureTransformIsSet(const std::string& raster) const; 00112 00114 void setRasterTextureTransformIsSet(const std::string& raster, bool enabled); 00115 00117 std::string rasterTextureDefinition(const std::string& raster) const; 00118 00120 void setRasterTextureDefinition(const std::string& raster, const std::string& definition); 00121 00123 void getRasterTextureScale(const std::string& raster, double& x, double& y) const; 00124 00126 void getRasterTextureOffset(const std::string& raster, double& x, double& y) const; 00127 00129 void getDatabaseOrigin(double& x, double& y, double& z) const; 00130 00132 void setRasterTextureScale(const std::string& raster, double x, double y); 00133 00135 void setRasterTextureOffset(const std::string& raster, double x, double y); 00136 00139 void clearRasterTexture(const std::string& raster, bool applyAtEnd = true); 00140 00142 void setBlockApplyRasterSettings(bool); 00143 bool blockApplyRasterSettings() const; 00144 00146 int rasterTexturePosition(const std::string&) const; 00147 00149 int rasterOperation(const std::string&); 00150 00152 bool moveRasterLayer(const std::string&, int); 00153 00155 00156 00158 00159 00161 bool contourEnabled() const; 00162 00164 bool contourIntermediateLinesEnabled() const; 00165 00167 double contourInterval() const; 00168 00170 double contourThickness() const; 00171 00173 void setContourEnabled(bool enabled); 00174 00176 void setContourIntermediateLinesEnabled(bool enabled); 00177 00179 void setContourInterval(double interval); 00180 00182 void setContourThickness(double thickness); 00184 00185 00187 00188 00190 bool elevationEnabled() const; 00191 00193 const makArchives::DtOverlaySettingsRecord::ControlPointList& elevationGradient() const; 00194 00196 void setElevationEnabled(bool enabled); 00197 00199 void setElevationGradient(const makArchives::DtOverlaySettingsRecord::ControlPointList& gradient); 00201 00202 protected: 00203 00204 void applyAllSettings(); 00205 void applyRasterTextureSettings(const std::string& raster); 00206 void applyContourLinesOverlaySettings(); 00207 void applyElevationColorOverlaySettings(); 00208 00209 protected: 00210 00211 DtTerrainPatch* myPatch; 00212 makArchives::DtOverlaySettingsRecord myOverlaySettingsRecord; 00213 bool myBlockRasterSettings; 00214 }; 00215 } 00216 00217 #endif 00218