00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "layer.h"
00020
00021 #include "structure.h"
00022 #include "guicontainer.h"
00023 #include "guibutton.h"
00024
00025
00026 uint Layer::uiNumberLayer = 0;
00027 GUIButton* Layer::pbtnQW;
00028 GUIButton* Layer::pbtnQE;
00029 GUIButton* Layer::pbtnQG;
00030 GUIButton* Layer::pbtnQR;
00031 GUIButton* Layer::pbtnQC;
00032 GUIButton* Layer::pbtnQI;
00033
00034
00035
00036 Layer::Layer(){
00037 OPENCITY_DEBUG( "ctor" );
00038
00039
00040
00041
00042 if ( Layer::uiNumberLayer++ == 0) {
00043 Layer::pbtnQW = new GUIButton( 20, 20, 30, 30, ocHomeDirPrefix( "graphism/gui/query_water" ));
00044 Layer::pbtnQE = new GUIButton( 60, 0, 30, 30, ocHomeDirPrefix( "graphism/gui/query_electricity" ));
00045 Layer::pbtnQG = new GUIButton( 100, 20, 30, 30, ocHomeDirPrefix( "graphism/gui/query_gas" ));
00046 Layer::pbtnQR = new GUIButton( 20, 80, 30, 30, ocHomeDirPrefix( "graphism/gui/query_residential" ));
00047 Layer::pbtnQC = new GUIButton( 60, 100, 30, 30, ocHomeDirPrefix( "graphism/gui/query_commercial" ));
00048 Layer::pbtnQI = new GUIButton( 100, 80, 30, 30, ocHomeDirPrefix( "graphism/gui/query_industrial" ));
00049
00050
00051 Layer::pbtnQW->Unset( OC_GUIMAIN_BLENDING );
00052 Layer::pbtnQE->Unset( OC_GUIMAIN_BLENDING );
00053 Layer::pbtnQG->Unset( OC_GUIMAIN_BLENDING );
00054 Layer::pbtnQR->Unset( OC_GUIMAIN_BLENDING );
00055 Layer::pbtnQC->Unset( OC_GUIMAIN_BLENDING );
00056 Layer::pbtnQI->Unset( OC_GUIMAIN_BLENDING );
00057 }
00058 }
00059
00060
00061
00062 Layer::~Layer(){
00063 OPENCITY_DEBUG( "dtor" );
00064
00065
00066
00067 if ( Layer::uiNumberLayer-- == 1) {
00068 delete Layer::pbtnQW;
00069 delete Layer::pbtnQE;
00070 delete Layer::pbtnQG;
00071 delete Layer::pbtnQR;
00072 delete Layer::pbtnQC;
00073 delete Layer::pbtnQI;
00074 }
00075 }
00076
00077
00078
00079 const uint
00080 Layer::GetMaxLinear() const
00081 {
00082 return _uiLayerWidth * _uiLayerLength - 1;
00083 }
00084
00085
00086
00087 void
00088 Layer::GetLayerSize(
00089 uint & w,
00090 uint & l) const
00091 {
00092 w = _uiLayerWidth;
00093 l = _uiLayerLength;
00094 }
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124