manualCircleControler.cpp
Go to the documentation of this file.00001 #include "manualCircleControler.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 manualCircleControler::manualCircleControler()
00015 {
00016 }
00017
00018 manualCircleControler::~manualCircleControler()
00019 {
00020 }
00021
00022 manualCircleControler * manualCircleControler :: Clone()
00023 {
00024 manualCircleControler * clone = new manualCircleControler();
00025 CopyAttributesTo(clone);
00026 return clone;
00027 }
00028
00029
00030 void manualCircleControler::CopyAttributesTo( manualCircleControler * cloneObject)
00031 {
00032
00033 manualContourBaseControler::CopyAttributesTo(cloneObject);
00034 }
00035
00036
00037 void manualCircleControler::Configure()
00038 {
00039
00040 }
00041
00042
00043 void manualCircleControler::MouseClickLeft(int x, int y){
00044 int z = GetZ();
00045
00046 if( IsEditable() )
00047 {
00048 if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
00049 bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
00050 SetState(5);
00051 }
00052 }
00053
00054
00055 if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) {
00056 GetManualViewBaseContour()->InitMove(x,y,z);
00057 SetState(6);
00058 }
00059
00060
00061 int size=GetManualViewBaseContour()->GetNumberOfPoints();
00062 if (GetState()==0) {
00063 if (size==0){
00064 AddPoint(x,y,z);
00065 AddPoint(x,y,z);
00066 bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
00067 SetState(1);
00068 }
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 GetManualViewBaseContour()->Refresh();
00086 }
00087
00088
00089 void manualCircleControler::MouseMove(int x, int y)
00090 {
00091 int z=GetZ();
00092
00093
00094 GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
00095 GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
00096
00097 if (GetState()==1){ SetPoint( bakIdPoint , x , y ,z); }
00098 if (GetState()==5){ SetPoint( bakIdPoint , x , y ,z); }
00099
00100 if (GetState()==6){
00101 GetManualViewBaseContour()->MoveContour(x,y,z);
00102 }
00103 GetManualViewBaseContour()->Refresh();
00104 }
00105
00106
00107
00108 void manualCircleControler::DeleteActualMousePoint(int x, int y)
00109 {
00110 }
00111
00112
00113 void manualCircleControler::InitRoi(int ww, int hh, double porcentage)
00114 {
00115 int zz;
00116 manualPoint *mp;
00117
00118 if (GetManualContourModel()->GetSizeLstPoints() ==0)
00119 {
00120 zz = GetZ();
00121 AddPoint(0,0,zz);
00122 AddPoint(0,0,zz);
00123
00124
00125 }
00126
00127 double pp1=porcentage;
00128 double pp2=1-porcentage;
00129
00130
00131
00132
00133
00134 mp = GetManualContourModel()->GetManualPoint(1);
00135 zz=(int)mp->GetZ();
00136 mp->SetPoint(ww*pp2,hh*pp1,zz);
00137
00138 mp = GetManualContourModel()->GetManualPoint(0);
00139 zz=(int)mp->GetZ();
00140 mp->SetPoint(ww*pp2,hh*pp2,zz);
00141
00142
00143
00144
00145
00146 GetManualViewBaseContour() ->UpdateViewPoint(0);
00147 GetManualViewBaseContour() ->UpdateViewPoint(1);
00148
00149
00150
00151 SetState(0);
00152 GetManualViewBaseContour()->Refresh();
00153 }
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182