X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2FmanualContour.cpp;h=663d888bf43301b899d13e9eb913721a49dc8467;hb=283e48abdf2fec599a277cc00795a994be6b1dd6;hp=1d9f3ad2321e5cf8d30fc14738102f5c792f7850;hpb=c5feadbb145eecf6d73f793535b7e23eb18db2cb;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp index 1d9f3ad..663d888 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp @@ -1,5 +1,5 @@ -#include +#include #include #include @@ -78,7 +78,7 @@ manualContourModelCircle::~manualContourModelCircle() // ---------------------------------------------------------------------------- -manualContourModelCircle * manualContourModelCircle :: Clone() // virtual +manualContourModelCircle * manualContourModelCircle :: Clone() // virtual { manualContourModelCircle * clone = new manualContourModelCircle(); CopyAttributesTo(clone); @@ -94,7 +94,7 @@ void manualContourModelCircle::CopyAttributesTo( manualContourModelCircle * clon } //---------------------------------------------------------------- -int manualContourModelCircle::GetTypeModel() //virtual +int manualContourModelCircle::GetTypeModel() //virtual { return 3; } @@ -135,6 +135,109 @@ void manualContourModelCircle::UpdateSpline() // virtal } } +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- + +//AD: 02-09 + +manualContourModelLine::manualContourModelLine() +: manualContourModel() +{ + SetNumberOfPointsSpline(2); +} + +manualContourModelLine::~manualContourModelLine() +{ +} + + +// ---------------------------------------------------------------------------- +manualContourModelLine * manualContourModelLine :: Clone() // virtual +{ + manualContourModelLine * clone = new manualContourModelLine(); + CopyAttributesTo(clone); + return clone; +} + +// --------------------------------------------------------------------------- + +void manualContourModelLine::CopyAttributesTo( manualContourModelLine * cloneObject) +{ + manualContourModel::CopyAttributesTo(cloneObject); +} + +//---------------------------------------------------------------- +int manualContourModelLine::GetTypeModel() //virtual +{ + return 6; +} + +//---------------------------------------------------------------- +void manualContourModelLine::GetSpline_i_Point(int i, double *x, double *y, double *z) // virtal +{ + int np = GetSizeLstPoints(); + if (np==0) + { + *x = 0; + *y = 0; + *z = 0; + } + if (np==1) + { + manualPoint *mp; + mp = GetManualPoint(0); + *x = mp->GetX(); + *y = mp->GetY(); + *z = mp->GetZ(); + } + if (np==2) + { + manualPoint *mp; + + if (i==0) + { + mp = GetManualPoint(0); + } + else if (i==1) + { + mp = GetManualPoint(1); + } + + *x = mp->GetX(); + *y = mp->GetY(); + *z = mp->GetZ(); + } + +/* + manualPoint *mp; + double difX,difY; + int np = GetSizeLstPoints( ); + int nps = GetNumberOfPointsSpline(); +// _deltaAngle=(3.14159265*2)/(nps-1); + _deltaAngle = 100/nps; + + if (np==2){ + + if (i==0){ + mp = GetManualPoint(0); + } else { + mp = GetManualPoint(1); + } + + *x = mp->GetX(); + *y = mp->GetY(); + *z = mp->GetZ(); + + }else { + *x=-1; + *y=-1; + *z=-1; + } +*/ +} + + // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- @@ -151,7 +254,7 @@ manualContourModelBullEye::~manualContourModelBullEye() // ---------------------------------------------------------------------------- -manualContourModelBullEye * manualContourModelBullEye :: Clone() // virtual +manualContourModelBullEye * manualContourModelBullEye :: Clone() // virtual { manualContourModelBullEye * clone = new manualContourModelBullEye(); CopyAttributesTo(clone); @@ -167,7 +270,7 @@ void manualContourModelBullEye::CopyAttributesTo( manualContourModelBullEye * cl } //---------------------------------------------------------------- -int manualContourModelBullEye::GetTypeModel() //virtual +int manualContourModelBullEye::GetTypeModel() //virtual { return 4; } @@ -203,7 +306,7 @@ manualContourModelBullEyeSector * manualContourModelBullEye::GetModelSector(int } //---------------------------------------------------------------- -void manualContourModelBullEye::GetSector(int id, +void manualContourModelBullEye::GetSector(int id, double *radioA, double *radioB, double *ang, @@ -255,7 +358,7 @@ int manualContourModelBullEye::GetSizeOfSectorLst() //---------------------------------------------------------------- void manualContourModelBullEye::Save(FILE *ff) // virtual { - manualContourModel::Save(ff); + manualContourModel::Save(ff); int i,size = GetSizeOfSectorLst(); fprintf(ff,"numberOfSections %d \n",size); for ( i=0 ; iSetCloseContour(true); - _cntSplineX->SetDefaultTension( 0 ); - _cntSplineX->SetDefaultBias( 0 ); - _cntSplineX->SetDefaultContinuity( 0 ); + _cntSplineX->SetDefaultTension( 0 ); + _cntSplineX->SetDefaultBias( 0 ); + _cntSplineX->SetDefaultContinuity( 0 ); - _cntSplineY->SetDefaultTension( 0 ); - _cntSplineY->SetDefaultBias( 0 ); + _cntSplineY->SetDefaultTension( 0 ); + _cntSplineY->SetDefaultBias( 0 ); _cntSplineY->SetDefaultContinuity( 0 ); - _cntSplineZ->SetDefaultTension( 0 ); - _cntSplineZ->SetDefaultBias( 0 ); + _cntSplineZ->SetDefaultTension( 0 ); + _cntSplineZ->SetDefaultBias( 0 ); _cntSplineZ->SetDefaultContinuity( 0 ); //JSTG 25-02-08 ------------------------------------------------------------------------------------------------- @@ -606,7 +709,7 @@ int manualContourModel::InsertPoint(double x,double y,double z) //manualPoint *mp = new manualPoint(); //mp->SetPoint(x,y,z); //std::vector::iterator itNum = _lstPoints.begin() + ibak; - //_lstPoints.insert(itNum,mp); + //_lstPoints.insert(itNum,mp); InsertPoint_id(ibak,x,y,z); //---------------------------------------------------------------------------- @@ -667,7 +770,7 @@ void manualContourModel::MoveAllPoints(double dx,double dy,double dz) // type=0 x,y // type=1 y,z // type=2 x,z -int manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type) +int manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type) { double range = i_range+1; @@ -683,7 +786,7 @@ int manualContourModel::GetIdPoint(double x, double y, double z, int i_range,in if (type==-1) { if ((fabs(xx-x)ClosedOn(); + _cntSplineX->ClosedOn(); _cntSplineY->ClosedOn(); _cntSplineZ->ClosedOn(); } else { - _cntSplineX->ClosedOff(); + _cntSplineX->ClosedOff(); _cntSplineY->ClosedOff(); _cntSplineZ->ClosedOff(); } @@ -799,7 +902,7 @@ void manualContourModel::UpdateSpline() // virtual /*void manualContourModel::GetSplineiPoint(int i, double &x, double &y, double &z) { - double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour); + double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour); double t = delta*(double)i; GetSplinePoint(t, x, y, z); }*/ @@ -833,9 +936,9 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl } if (_lstPoints.size()>=2) { - *x = _cntSplineX->Evaluate(t); - *y = _cntSplineY->Evaluate(t); - *z = _cntSplineZ->Evaluate(t); + *x = _cntSplineX->Evaluate(t); + *y = _cntSplineY->Evaluate(t); + *z = _cntSplineZ->Evaluate(t); } } @@ -860,9 +963,9 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl } if (_lstPoints.size()>=2) { - x = _cntSplineX->Evaluate(t); - y = _cntSplineY->Evaluate(t); - z = _cntSplineZ->Evaluate(t); + x = _cntSplineX->Evaluate(t); + y = _cntSplineY->Evaluate(t); + z = _cntSplineZ->Evaluate(t); } }*/ // ---------------------------------------------------------------------------- @@ -891,9 +994,9 @@ double manualContourModel::GetPathSize() if (_lstPoints.size()>2) { -// JSTG 25-02-08 ------------------------------------------ +// JSTG 25-02-08 ------------------------------------------ //np = _lstPoints.size( ); - //nps = 200; + //nps = 200; //delta=( double ) ( np ) / ( double ) ( nps ); UpdateSpline(); //GetSplinePoint(0,x1,y1,z1); @@ -910,7 +1013,7 @@ double manualContourModel::GetPathSize() x1=x2; y1=y2; z1=z2; - }// for + }// for } return result; @@ -929,7 +1032,7 @@ double manualContourModel::GetPathArea() double x2,y2,z2; bool okArea=true; int i, j; - + // This uses Green's theorem: // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN // A < 0 -> A = |A| (a negative value could raise because points are @@ -941,7 +1044,7 @@ double manualContourModel::GetPathArea() int nps = GetNumberOfPointsSpline(); //double delta=( double ) ( np ) / ( double ) ( nps ); UpdateSpline(); - for( i = 0, area = 0.0; i < nps; i++ ) + for( i = 0, area = 0.0; i < nps; i++ ) { j = ( i + 1 ) % nps; //ti = delta * (double)i; @@ -958,12 +1061,12 @@ double manualContourModel::GetPathArea() { okArea=false; } - }// for + }// for area /= 2.0; area = fabs( area ); /* - for( i = 0, area = 0.0; i < _lstPoints.size(); i++ ) + for( i = 0, area = 0.0; i < _lstPoints.size(); i++ ) { j = ( i + 1 ) % _lstPoints.size(); // Area @@ -993,8 +1096,8 @@ double manualContourModel::GetPathArea() } // ---------------------------------------------------------------------------- -// p[x,y,z] : data in -// rp[x,y,z] : data out result point +// p[x,y,z] : data in +// rp[x,y,z] : data out result point // rn[x,y,z] : data out result normal void manualContourModel::GetNearestPointAndNormal(double *p, double *rp, double *rn) @@ -1015,13 +1118,13 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp, double if (np>=2) { // JSTG 25-02-08 ------------------------------------------ - //nps = 200; + //nps = 200; nps = GetNumberOfPointsSpline(); //delta = ( double ) ( np ) / ( double ) ( nps ); UpdateSpline(); //GetSplinePoint(0,x1,y1,z1); GetSpline_i_Point(0,&x1,&y1,&z1); - for( i = 0; i < nps; i++ ) + for( i = 0; i < nps; i++ ) { //t = delta * (double)i; //GetSplinePoint(t,x1,y1,z1); @@ -1031,7 +1134,7 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp, double dy= y1-p[1]; dz= z1-p[2]; dist = sqrt( dx*dx + dy*dy + dz*dz ); - if (distAddManualPoint( GetManualPoint( i )->Clone() ); } - cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () ); + cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () ); cloneObject->SetCloseContour( _closeContour ); cloneObject->UpdateSpline(); } @@ -1202,7 +1306,7 @@ void manualViewPoint::SetSelected(bool selected){ } // ---------------------------------------------------------------------------- void manualViewPoint::SetPosibleSelected(bool posibleSelected){ - _posibleSelected=posibleSelected; + _posibleSelected=posibleSelected; } // ---------------------------------------------------------------------------- bool manualViewPoint::GetSelected(){ @@ -1369,7 +1473,7 @@ void manualViewContour::CopyAttributesTo( manualViewContour * cloneObject) { // Call to Fathers object manualViewBaseContour::CopyAttributesTo(cloneObject); - + cloneObject->SetMesureScale(_mesureScale); } @@ -1408,8 +1512,8 @@ void manualViewContour::RefreshContour() // virtual _manContModel->UpdateSpline(); np = GetNumberOfPoints( ); - //nps = GetNumberOfPointsSpline(); - nps = _manContModel->GetNumberOfPointsSpline(); + //nps = GetNumberOfPointsSpline(); + nps = _manContModel->GetNumberOfPointsSpline(); //delta=( double ) ( np ) / ( double ) ( nps-1 ); //JSTG 25-02-08 //printf ("EED manualViewContour::RefreshContour>> %d %d \n", np,nps); @@ -1418,28 +1522,28 @@ void manualViewContour::RefreshContour() // virtual { if (np>=2 ) { - for( i = 0; i < nps; i++ ) + for( i = 0; i < nps; i++ ) { -//JSTG 25-02-08 ------------------------------------------------ +//JSTG 25-02-08 ------------------------------------------------ //t = delta * (double)i; //_manContModel->GetSplinePoint(t,x,y,z); _manContModel->GetSpline_i_Point(i,&x,&y,&z); //-------------------------------------------------------------- // EED 27 sep 2006 - // _pts->SetPoint(i, x,y,z ); - _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] ); + // _pts->SetPoint(i, x,y,z ); + _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] ); //if (i%15==0) //{ // printf ("EED manualViewContour::RefreshContour>> %d : %f %f %f \n", i,x,y,z); //} - }// for - } - else + }// for + } + else { - _pts->SetPoint(0, 0 , 0 , 0); - _pts->SetPoint(1, 0 , 0 , 0); + _pts->SetPoint(0, 0 , 0 , 0); + _pts->SetPoint(1, 0 , 0 , 0); } // if } } @@ -1519,32 +1623,40 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){ yy = yy * _spc[1]; zz = zz * _spc[2]; - unsigned int i, nps,nps_t; - nps = _sizePointsContour; - if (this->_manContModel->IfCloseContour()==true) + nps = _sizePointsContour; + if (this->_manContModel->IfCloseContour()==true) { - nps_t = nps; + nps_t = nps; } else { - nps_t = nps-1; + nps_t = nps-1; } - for( i = 0; i < nps_t; i++ ) { + //ED + printf("\n>%d ",nps_t); + + for( i = 0; i < nps_t; i++ ) + { _pts->GetPoint(i%nps, ppA); _pts->GetPoint((i+1)%nps, ppB); d1= sqrt( (ppA[0]-xx)*(ppA[0]-xx) + (ppA[1]-yy)*(ppA[1]-yy) + (ppA[2]-zz)*(ppA[2]-zz)); d2= sqrt( (ppB[0]-xx)*(ppB[0]-xx) + (ppB[1]-yy)*(ppB[1]-yy) + (ppB[2]-zz)*(ppB[2]-zz)); d3= sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2])); - if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) ) { + + //ED + printf("%d %f %f %f - ", i,d1,d2,d3); + + if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) ) + { result=true; i=nps; } - } + } return result; } // ---------------------------------------------------------------------------- -void manualViewContour::DeletePoint(int id) // virtual +void manualViewContour::DeletePoint(int id) // virtual { if (_lstViewPoints.size()>2) { @@ -1567,19 +1679,19 @@ void manualViewContour::SetMesureScale(double mesureScale) void manualViewContour::InitMove(int x, int y, int z) { _initialConoturModel->DeleteAllPoints(); - + manualPoint *mp = NULL; double XX=x; double YY=y; double ZZ=z; TransfromeCoordViewWorld(XX,YY,ZZ); - + int i, manualPointsSZ = _manContModel->GetSizeLstPoints(); for ( i=0; iGetManualPoint( i ); this->_initialConoturModel->AddPoint( mp->GetX() - XX, mp->GetY() - YY, mp->GetZ() ); - } + } } //------------------------------------------------------------------- void manualViewContour::MoveContour(int x, int y, int z) @@ -1589,7 +1701,7 @@ void manualViewContour::MoveContour(int x, int y, int z) double XX=x; double YY=y; double ZZ=z; - + TransfromeCoordViewWorld(XX,YY,ZZ); int i, manualPointsSZ = _manContModel->GetSizeLstPoints(); @@ -1598,8 +1710,8 @@ void manualViewContour::MoveContour(int x, int y, int z) mpOrigin = _manContModel->GetManualPoint( i ); mpMoving = _initialConoturModel->GetManualPoint(i); mpOrigin->SetPoint( mpMoving->GetX()+XX, mpMoving->GetY() + YY, mpMoving->GetZ() ); - } - UpdateViewPoints(); + } + UpdateViewPoints(); } void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits ) { @@ -1610,8 +1722,8 @@ void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits ) { mpOrigin = _manContModel->GetManualPoint( i ); mpOrigin->SetPoint( mpOrigin->GetX()+horizontalUnits, mpOrigin->GetY()+verticalUnits, mpOrigin->GetZ() ); - } - UpdateViewPoints(); + } + UpdateViewPoints(); } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- @@ -1680,13 +1792,13 @@ void manualView3VContour::RefreshContour() // virtula //int nps = GetNumberOfPointsSpline(); int nps = _manContModel->GetNumberOfPointsSpline(); //------------------------------------------------------- - for( i = 0; i < nps; i++ ) + for( i = 0; i < nps; i++ ) { _pts->GetPoint( i, pp ); FilterCordinateXYZ(pp[0],pp[1],pp[2]); //EED 27 sep 2006 - _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] ); + _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] ); } } @@ -1736,12 +1848,12 @@ bool manualView3VContour::ifTouchContour(int x,int y,int z){ // virtual zz = zz * _spc[2]; unsigned int i, nps,nps_t; - nps = _sizePointsContour; - if (this->_manContModel->IfCloseContour()==true) + nps = _sizePointsContour; + if (this->_manContModel->IfCloseContour()==true) { - nps_t = nps; + nps_t = nps; } else { - nps_t = nps-1; + nps_t = nps-1; } FilterCordinateXYZ(xx,yy,zz); @@ -1757,7 +1869,7 @@ bool manualView3VContour::ifTouchContour(int x,int y,int z){ // virtual result=true; i=nps; } - } + } return result; } // ---------------------------------------------------------------------------- @@ -1813,7 +1925,7 @@ int manualView3DContour::GetIdPoint2(int x, int y) double p[3],pA[3],pB[3]; double pickPoint[ 3 ], cameraPos[ 3 ]; - vtkPointPicker* picker = vtkPointPicker::New( ); + vtkPointPicker* picker = vtkPointPicker::New( ); vtkRenderer *pRenderer = this->GetWxVtkBaseView()->GetRenderer(); picker->Pick( x, y, 0.0, pRenderer ); pRenderer->GetActiveCamera( )->GetPosition( cameraPos ); @@ -1823,7 +1935,7 @@ int manualView3DContour::GetIdPoint2(int x, int y) UtilVtk3DGeometriSelection utilVtk3Dgeometriselection; utilVtk3Dgeometriselection.SetDimentions(_w,_h,_d); - if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos ) ) + if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos ) ) { double dist,distMin=999999999; int i,size=this->_manContModel->GetSizeLstPoints(); @@ -1881,15 +1993,15 @@ void manualViewBullEyeSector::RefreshContour() //---------------------------------- _manContModel->UpdateSpline(); - nps = _manContModel->GetNumberOfPointsSpline(); + nps = _manContModel->GetNumberOfPointsSpline(); if ( _pts!=NULL ) { - for( i = 0; i < nps; i++ ) + for( i = 0; i < nps; i++ ) { _manContModel->GetSpline_i_Point(i,&x,&y,&z); - _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] ); - }// for + _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] ); + }// for } } @@ -1942,7 +2054,7 @@ int manualViewBullEye::GetType() // virtual // ---------------------------------------------------------------------------- void manualViewBullEye::RefreshContour() // virtual -{ +{ // External Rectangle manualViewRoi::RefreshContour(); @@ -2050,6 +2162,7 @@ void manualViewRoi::RefreshContour() // virtual { unsigned int i,ii, np; np = GetNumberOfPoints( ); +//EED01 if ( np > 0) { if (np>=2) @@ -2065,13 +2178,13 @@ void manualViewRoi::RefreshContour() // virtual // wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ); //EED 27 sep 2007 - // _pts->SetPoint(i, XX,YY,ZZ ); - _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] ); + // _pts->SetPoint(i, XX,YY,ZZ ); + _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] ); } // rof } else { - _pts->SetPoint(0, 0 , 0 , 0); - _pts->SetPoint(1, 0 , 0 , 0); + _pts->SetPoint(0, 0 , 0 , 0); + _pts->SetPoint(1, 0 , 0 , 0); } // if } } @@ -2087,9 +2200,9 @@ int manualViewRoi::GetType() // virtual void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &maxY) { double pp[3]; - manualPoint *mp; + manualPoint *mp; unsigned int i; - + minX=99999; minY=99999; maxX=-99999; @@ -2097,30 +2210,30 @@ void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &m unsigned int size=(unsigned int) _manContModel->GetSizeLstPoints(); - for( i = 0; i < size; i++ ) + for( i = 0; i < size; i++ ) { mp=_manContModel->GetManualPoint(i); pp[0]=mp->GetX(); pp[1]=mp->GetY(); - + // min X - if (pp[0]maxX) + if (pp[0]>maxX) { maxX=pp[0]; } // max Y - if (pp[1]>maxY) + if (pp[1]>maxY) { maxY=pp[1]; } @@ -2133,11 +2246,11 @@ void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &m minY=0; maxY=0; } -} +} // ---------------------------------------------------------------------------- -bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual +bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual { bool result=false; double px1=99999,py1=99999,px2=-9999,py2=-99999; @@ -2208,7 +2321,7 @@ void manualViewRoi::InitMove(int x, int y, int z) // virtual // ---------------------------------------------------------------------------- -void manualViewRoi::MoveContour(int x, int y, int z) // virtual +void manualViewRoi::MoveContour(int x, int y, int z) // virtual { manualPoint *mp; double XX=x; @@ -2231,7 +2344,7 @@ void manualViewRoi::MoveContour(int x, int y, int z) // virtual UpdateViewPoint(0); UpdateViewPoint(1); UpdateViewPoint(2); - UpdateViewPoint(3); + UpdateViewPoint(3); } @@ -2300,11 +2413,11 @@ void manualViewCircle::RefreshContour(){ // virtual // XX = cos(angle)*radio+mpA->GetX(); // YY = sin(angle)*radio+mpA->GetY(); ZZ = mpA->GetZ(); - _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] ); + _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] ); } // rof } else { - _pts->SetPoint(0, 0 , 0 , 0); - _pts->SetPoint(1, 0 , 0 , 0); + _pts->SetPoint(0, 0 , 0 , 0); + _pts->SetPoint(1, 0 , 0 , 0); } // if } } @@ -2342,11 +2455,11 @@ void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double minY=0; maxY=0; } -} +} /* // ---------------------------------------------------------------------------- -bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual +bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual { bool result=false; double px1=99999,py1=99999,px2=-9999,py2=-99999; @@ -2418,7 +2531,7 @@ void manualViewCircle::InitMove(int x, int y, int z) // virtual // ---------------------------------------------------------------------------- -void manualViewCircle::MoveContour(int x, int y, int z) // virtual +void manualViewCircle::MoveContour(int x, int y, int z) // virtual { manualPoint *mp; double XX=x; @@ -2441,13 +2554,95 @@ void manualViewCircle::MoveContour(int x, int y, int z) // virtual UpdateViewPoint(0); UpdateViewPoint(1); // UpdateViewPoint(2); -// UpdateViewPoint(3); +// UpdateViewPoint(3); } +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- + +// AD:02-09 +manualViewLine::manualViewLine() +{ +} +// ---------------------------------------------------------------------------- +manualViewLine::~manualViewLine() +{ +} + + +// ---------------------------------------------------------------------------- +manualViewLine * manualViewLine :: Clone() +{ + manualViewLine * clone = new manualViewLine(); + CopyAttributesTo(clone); + return clone; +} + +// --------------------------------------------------------------------------- + +void manualViewLine::CopyAttributesTo( manualViewLine * cloneObject) +{ + // Fathers object + manualViewBaseContour::CopyAttributesTo(cloneObject); +} + +// ---------------------------------------------------------------------------- +int manualViewLine::GetType() // virtual +{ + return 6; +} + + +// ---------------------------------------------------------------------------- + +void manualViewLine::InitMove(int x, int y, int z) // virtual +{ + manualPoint *mp; + double XX=x; + double YY=y; + double ZZ=z; + TransfromeCoordViewWorld(XX,YY,ZZ); + + if (_manContModel->GetSizeLstPoints()==2) + { + mp = _manContModel->GetManualPoint(0); + _dp0[0]= mp->GetX() - XX; + _dp0[1]= mp->GetY() - YY; + _dp0[2]= mp->GetZ(); + + mp = _manContModel->GetManualPoint(1); + _dp1[0]= mp->GetX() - XX; + _dp1[1]= mp->GetY() - YY; + _dp1[2]= mp->GetZ(); + + } +} + + +// ---------------------------------------------------------------------------- +void manualViewLine::MoveContour(int x, int y, int z) // virtual +{ + manualPoint *mp; + double XX=x; + double YY=y; + double ZZ=z; + TransfromeCoordViewWorld(XX,YY,ZZ); + + mp = _manContModel->GetManualPoint(0); + mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]); + + mp = _manContModel->GetManualPoint(1); + mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]); + + + UpdateViewPoint(0); + UpdateViewPoint(1); +} // ---------------------------------------------------------------------------- @@ -2457,7 +2652,7 @@ void manualViewCircle::MoveContour(int x, int y, int z) // virtual manualViewBaseContour::manualViewBaseContour() { - _show_text = true; + _show_text = true; _textActor = NULL; _manContModel = NULL; _wxvtkbaseview = NULL; @@ -2478,7 +2673,7 @@ manualViewBaseContour::manualViewBaseContour() _coulorEdit_g = 1; _coulorEdit_b = 0; - _coulorNormal_r = 1; + _coulorNormal_r = 1; _coulorNormal_g = 0; _coulorNormal_b = 1; @@ -2509,6 +2704,7 @@ int manualViewBaseContour::GetType() // virtual //int manualViewRoi::GetType() 2; //int manualViewCircle::GetType() 3; //int manualViewStar::GetType() 4; +//int manualViewLine::GetType() 6; return 0; @@ -2529,7 +2725,7 @@ void manualViewBaseContour::Open(FILE *pFile) void manualViewBaseContour :: AddCompleteContourActor( bool ifControlPoints ) { _viewControlPoints = ifControlPoints; - vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer(); + /*vtkRenderer * theRenderer = */ _wxvtkbaseview->GetRenderer(); // JPRx ?? //Adding the spline AddSplineActor(); @@ -2543,12 +2739,12 @@ void manualViewBaseContour :: AddCompleteContourActor( bool ifControlPoints ) // --------------------------------------------------------------------------- void manualViewBaseContour :: RemoveCompleteContourActor() -{ - vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer(); +{ + /*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ?? //Removing the spline RemoveSplineActor(); RemoveTextActor(); - + //Removing each point RemoveControlPoints(); RefreshContour(); @@ -2569,7 +2765,7 @@ void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObjec { // Fathers object //XXXX::CopyAttributesTo(cloneObject); - + cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview ); cloneObject-> SetSelected( this->GetSelected() ); cloneObject-> SetPosibleSelected( this->GetPosibleSelected() ); @@ -2579,9 +2775,9 @@ void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObjec cloneObject-> SetSpacing( _spc ); cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b ); cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b ); - cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b ); + cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b ); - int i, size = _lstViewPoints.size(); + int i, size = _lstViewPoints.size(); for ( i=0; iAddPoint( ); @@ -2604,7 +2800,7 @@ void manualViewBaseContour :: RemoveSplineActor() // virtual } // ---------------------------------------------------------------------------- void manualViewBaseContour :: RemoveControlPoints() -{ +{ if (_wxvtkbaseview!=NULL){ vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer(); int i,size=_lstViewPoints.size(); @@ -2612,15 +2808,15 @@ void manualViewBaseContour :: RemoveControlPoints() { vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor(); theRenderer->RemoveActor( pointActor ); - } // for + } // for } // if - SetIfViewControlPoints( false ); + SetIfViewControlPoints( false ); } // ---------------------------------------------------------------------------- void manualViewBaseContour :: AddControlPoints() { vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer(); - SetIfViewControlPoints( true ); + SetIfViewControlPoints( true ); if( _viewControlPoints ) { int i,size=_lstViewPoints.size(); @@ -2628,7 +2824,7 @@ void manualViewBaseContour :: AddControlPoints() { vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor(); theRenderer->AddActor( pointActor ); - } + } } } // ---------------------------------------------------------------------------- @@ -2681,7 +2877,7 @@ void manualViewBaseContour::ConstructVTKObjects() { //JSTG 29-02-08 ----------------------------------------------- //int i , nps = _sizePointsContour; - int i; + int i; int nps = _manContModel->GetNumberOfPointsSpline(); //------------------------------------------------------------- DeleteVtkObjects(); @@ -2690,10 +2886,15 @@ void manualViewBaseContour::ConstructVTKObjects() for (i=0 ; iSetPoint(i, 0 , 0 , 0 ); - } - // This is for the boundaring inicialisation - _pts->SetPoint(0, -1000 , -1000 , -1000 ); - _pts->SetPoint(1, 1000 , 1000 , 1000 ); + } + // This is for the boundaring inicialisation + +//EED 29Mars2009 + _pts->SetPoint(0, 0 , 0 , -1000 ); + _pts->SetPoint(1, 0 , 0 , 1000 ); +// _pts->SetPoint(0, -1000 , -1000 , -1000 ); +// _pts->SetPoint(1, 1000 , 1000 , 1000 ); + vtkCellArray *lines = vtkCellArray::New(); lines->InsertNextCell( nps /* +1 */ ); @@ -2732,7 +2933,7 @@ void manualViewBaseContour::ConstructVTKObjects() vtkTextProperty *tprop = _textActor->GetTextProperty(); tprop->SetFontSize(14); tprop->SetFontFamilyToArial(); - tprop->SetColor(0, 0, 1); + tprop->SetColor(0, 0, 1); } // ---------------------------------------------------------------------------- void manualViewBaseContour::CreateNewContour() @@ -2745,7 +2946,7 @@ void manualViewBaseContour::CreateNewContour() } // ---------------------------------------------------------------------------- void manualViewBaseContour::UpdateViewPoint(int id) // virtual -{ +{ manualPoint *mp = _manContModel->GetManualPoint(id); //EEDx6 @@ -2811,8 +3012,8 @@ void manualViewBaseContour::DeleteContour() Refresh(); } // ---------------------------------------------------------------------------- -void manualViewBaseContour::DeletePoint(int id) // virtual -{ +void manualViewBaseContour::DeletePoint(int id) // virtual +{ int size=_lstViewPoints.size(); if ( (id>=0) && (idGetPoint(i,pp); vx[i]=pp[0]; - } + } return vx; } // ---------------------------------------------------------------------------- @@ -3022,7 +3223,7 @@ double* manualViewBaseContour::GetVectorPointsYManualContour() for (i=0;iGetPoint(i,pp); vy[i]=pp[1]; - } + } return vy; } // ---------------------------------------------------------------------------- @@ -3034,7 +3235,7 @@ double* manualViewBaseContour::GetVectorPointsZManualContour() for (i=0;iGetPoint(i,pp); vz[i]=pp[2]; - } + } return vz; } // ---------------------------------------------------------------------------- @@ -3050,7 +3251,7 @@ void manualViewBaseContour::Refresh() // virtual } UpdateColorActor(); - if (_show_text==true) + if (_show_text==true) { RefreshText(); } @@ -3173,7 +3374,7 @@ void manualViewBaseContour::TransfromeCoordViewWorld(double &X, double &Y, doubl //EED 27 sep 2007 // //EEDx6 // wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview; -// wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z); +// wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z); } // ---------------------------------------------------------------------------- @@ -3204,7 +3405,7 @@ void manualViewBaseContour::InitMove(int x, int y, int z) // virtual } // ---------------------------------------------------------------------------- void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual -{ +{ } // ---------------------------------------------------------------------------- void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual @@ -3215,7 +3416,7 @@ void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits ) void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual { double pp[3]; - manualPoint *mp; + manualPoint *mp; int i; int size=_manContModel->GetSizeLstPoints(); minX=99999; @@ -3228,47 +3429,47 @@ void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, minZ=99999; maxZ=-99999; } - for( i = 0; i < size; i++ ) + for( i = 0; i < size; i++ ) { mp=_manContModel->GetManualPoint(i); pp[0]=mp->GetX(); pp[1]=mp->GetY(); if ( ifFindZ ) pp[2]=mp->GetZ(); - + // min X - if (pp[0]maxX) + if (pp[0]>maxX) { maxX=pp[0]; } // max Y - if (pp[1]>maxY) + if (pp[1]>maxY) { maxY=pp[1]; } if ( ifFindZ ) { // min Z - if (pp[2]maxZ) + if (pp[2]>maxZ) { maxZ=pp[2]; } - } + } } if ( size<1 ) { @@ -3356,9 +3557,9 @@ void manualViewBaseContour::SetSpacing(double spc[3]) // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- -// _type = 0 Sagital -// _type = 1 Coronal -// _type = 2 Axial +// _type = 0 Sagital +// _type = 1 Coronal +// _type = 2 Axial // _type = -1 View 3D manualContour3VControler::manualContour3VControler(int type) @@ -3376,7 +3577,7 @@ manualContour3VControler::~manualContour3VControler() } // ---------------------------------------------------------------------------- -manualContour3VControler * manualContour3VControler :: Clone() // virtual +manualContour3VControler * manualContour3VControler :: Clone() // virtual { manualContour3VControler * clone = new manualContour3VControler( this->GetType() ); CopyAttributesTo(clone); @@ -3407,14 +3608,14 @@ void manualContour3VControler::AddPoint_Others() int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; + mvbc = _lstManualViewBaseContour[i]; mvbc->AddPoint(); } // EEDhh // if (_manViewBaseCont1!=NULL){ -// _manViewBaseCont1->AddPoint(); -// _manViewBaseCont2->AddPoint(); +// _manViewBaseCont1->AddPoint(); +// _manViewBaseCont2->AddPoint(); // _manViewBaseCont3->AddPoint(); // this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); // } @@ -3443,8 +3644,8 @@ void manualContour3VControler::AddPoint( int x, int y, int z ) // virtual } - int id = GetManualContourModel()->AddPoint(xx,yy,zz); - GetManualViewBaseContour()->AddPoint(); + /*int id = */ GetManualContourModel()->AddPoint(xx,yy,zz); // JPRx + GetManualViewBaseContour()->AddPoint(); AddPoint_Others(); } @@ -3458,15 +3659,15 @@ void manualContour3VControler::InsertPoint_Others(int id) int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; + mvbc = _lstManualViewBaseContour[i]; mvbc->InsertPoint(id); } /*EEDhh if (_manViewBaseCont1!=NULL){ - _manViewBaseCont1->InsertPoint(id); - _manViewBaseCont2->InsertPoint(id); - _manViewBaseCont3->InsertPoint(id); + _manViewBaseCont1->InsertPoint(id); + _manViewBaseCont2->InsertPoint(id); + _manViewBaseCont3->InsertPoint(id); this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); } */ @@ -3488,7 +3689,7 @@ void manualContour3VControler::InsertPoint(int x, int y, int z) if (_type==0) { xx=_vtkmprbasedata->GetX(); - } + } if (_type==1) { @@ -3497,11 +3698,11 @@ void manualContour3VControler::InsertPoint(int x, int y, int z) id = GetManualContourModel()->InsertPoint(xx,yy,zz); - GetManualViewBaseContour()->InsertPoint(id); - InsertPoint_Others(0); + GetManualViewBaseContour()->InsertPoint(id); + InsertPoint_Others(0); } else { - AddPoint(x,y,z); + AddPoint(x,y,z); } } } @@ -3509,9 +3710,9 @@ void manualContour3VControler::InsertPoint(int x, int y, int z) // EEDhh /* -void manualContour3VControler::SetModelView ( manualContourModel *manContModel, - manualViewBaseContour *manViewBaseCont0, - manualViewBaseContour *manViewBaseCont1, +void manualContour3VControler::SetModelView ( manualContourModel *manContModel, + manualViewBaseContour *manViewBaseCont0, + manualViewBaseContour *manViewBaseCont1, manualViewBaseContour *manViewBaseCont2, manualViewBaseContour *manViewBaseCont3) { @@ -3569,21 +3770,21 @@ void manualContour3VControler::DeleteActualMousePoint_Others(int id) int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; - mvbc->DeletePoint(id); + mvbc = _lstManualViewBaseContour[i]; + mvbc->DeletePoint(id); mvbc->Refresh(); } /* if (_manViewBaseCont1!=NULL){ - _manViewBaseCont1->DeletePoint(id); - _manViewBaseCont2->DeletePoint(id); + _manViewBaseCont1->DeletePoint(id); + _manViewBaseCont2->DeletePoint(id); _manViewBaseCont3->DeletePoint(id); - + _manViewBaseCont1->Refresh(); _manViewBaseCont2->Refresh(); _manViewBaseCont3->Refresh(); - + this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); } */ @@ -3591,7 +3792,7 @@ void manualContour3VControler::DeleteActualMousePoint_Others(int id) } // ---------------------------------------------------------------------------- void manualContour3VControler::DeleteActualMousePoint(int x, int y)// virtual -{ +{ int id=GetManualViewBaseContour()->GetIdPoint ( x , y , GetZ() ); if (id!=-1){ manualContourBaseControler::DeleteActualMousePoint( x , y ); @@ -3605,30 +3806,30 @@ void manualContour3VControler::MouseMove_Others(int id) // virtual int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; + mvbc = _lstManualViewBaseContour[i]; mvbc->SelectAllPossibleSelected(false); if (id!=-1) - { + { mvbc->SetPointPosibleSelected(id,true); } - mvbc->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); + mvbc->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); mvbc->Refresh(); } - + // EEDhh -/* +/* if (_manViewBaseCont1!=NULL){ _manViewBaseCont1->SelectAllPossibleSelected(false); _manViewBaseCont2->SelectAllPossibleSelected(false); _manViewBaseCont3->SelectAllPossibleSelected(false); - if (id!=-1){ + if (id!=-1){ _manViewBaseCont1->SetPointPosibleSelected(id,true); _manViewBaseCont2->SetPointPosibleSelected(id,true); _manViewBaseCont3->SetPointPosibleSelected(id,true); - } - _manViewBaseCont1->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); - _manViewBaseCont2->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); - _manViewBaseCont3->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); + } + _manViewBaseCont1->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); + _manViewBaseCont2->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); + _manViewBaseCont3->SetPosibleSelected ( GetManualViewBaseContour()->GetPosibleSelected() ); _manViewBaseCont1->Refresh(); _manViewBaseCont2->Refresh(); @@ -3656,7 +3857,7 @@ void manualContour3VControler::OnChar_Others() int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; + mvbc = _lstManualViewBaseContour[i]; mvbc->Refresh(); } // EEDhh @@ -3688,7 +3889,7 @@ void manualContour3VControler::ResetContour_Others() int i,size=this->_lstManualViewBaseContour.size(); for ( i = 0 ; i < size ; i++ ) { - mvbc = _lstManualViewBaseContour[i]; + mvbc = _lstManualViewBaseContour[i]; mvbc->DeleteContour(); mvbc->CreateNewContour(); } @@ -3715,7 +3916,7 @@ manualContour3DControler::~manualContour3DControler() { } // ---------------------------------------------------------------------------- -manualContour3DControler * manualContour3DControler :: Clone() // virtual +manualContour3DControler * manualContour3DControler :: Clone() // virtual { manualContour3DControler * clone = new manualContour3DControler(); CopyAttributesTo(clone); @@ -3770,7 +3971,7 @@ void manualContour3DControler::MouseClickLeft(int x, int y) // virtual manualContourControler::MouseClickLeft(x,y); -} +} // ---------------------------------------------------------------------------- bool manualContour3DControler::OnChar() { @@ -3818,7 +4019,7 @@ manualContour3V3DControler::~manualContour3V3DControler() } // ---------------------------------------------------------------------------- -manualContour3V3DControler * manualContour3V3DControler :: Clone() // virtual +manualContour3V3DControler * manualContour3V3DControler :: Clone() // virtual { manualContour3V3DControler * clone = new manualContour3V3DControler(); CopyAttributesTo(clone); @@ -3883,7 +4084,7 @@ bool manualContour3V3DControler::OnChar() // virtual } // ---------------------------------------------------------------------------- -void manualContour3V3DControler::ResetContour() // virtual +void manualContour3V3DControler::ResetContour() // virtual { manualContourControler::ResetContour(); _manualcontour3Vcontroler->ResetContour_Others(); @@ -3896,21 +4097,21 @@ void manualContour3V3DControler::ResetContour() // virtual // _state = 0 // ..nothing.. // _state = 1 // move with add point -// _state = 5 // move +// _state = 5 // move // _state = 6 // move with insert point // _state = 7 // move with non selection manualContourControler::manualContourControler() { _easyCreation = true; - + } // ---------------------------------------------------------------------------- manualContourControler::~manualContourControler() { } // ---------------------------------------------------------------------------- -manualContourControler * manualContourControler :: Clone() // virtual +manualContourControler * manualContourControler :: Clone() // virtual { manualContourControler * clone = new manualContourControler(); CopyAttributesTo(clone); @@ -3933,40 +4134,40 @@ void manualContourControler::Configure() //virtual // ---------------------------------------------------------------------------- void manualContourControler::MouseClickLeft(int x, int y){ - + bool ok = false; int z = GetZ(); int size= GetManualViewBaseContour()->GetNumberOfPoints(); // Insert a Control Point with shift+ClickLeft - int tt = GetState(); + // int tt = GetState(); // JPRx vtkRenderWindowInteractor *vtkrenderwindowinteractor = _vtkInteractorStyleBaseView->GetInteractor(); //EED3131 if( IsEditable() ) { - if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) ) - { + if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) ) + { ok=true; InsertPoint(x,y,z); size++; } // Start to Insert Control Points with ClickLeft (Empty contour) if ((GetState()==0) && (size==0) && (_easyCreation==true) ) - { + { ok=true; - SetState(1); + SetState(1); AddPoint(x,y,z); } // Continuie to Insert Control Points with ClickLeft (After being empty the contour) - if ((GetState()==1) && (_easyCreation==true) ) - { + if ((GetState()==1) && (_easyCreation==true) ) + { ok=true; AddPoint(x,y,z); _bakIdPoint=GetNumberOfPointsManualContour() - 1; } // Insert Control Points IF Contour si Selected - if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() ) - { + if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() ) + { ok=true; InsertPoint(x,y,z); _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); @@ -3976,14 +4177,14 @@ void manualContourControler::MouseClickLeft(int x, int y){ if ( (GetState()==0 || GetState()==6) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ) { ok=true; - _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(5); } // If nothing selected _state=7 if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) ) { //ok=true; - _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(7); } } @@ -3991,14 +4192,14 @@ void manualContourControler::MouseClickLeft(int x, int y){ { SetPosibleToMove( true ); GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() ); - } + } if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() ) - { + { SetMoving( true ); - ok=true; + ok=true; GetManualViewBaseContour()->InitMove(x,y,z); SetState(6); - } + } if (ok==true) { GetManualViewBaseContour()->Refresh(); @@ -4009,11 +4210,11 @@ void manualContourControler::MouseMove(int x, int y) // virtual { int z=GetZ(); GetManualViewBaseContour()->SelectPosiblePoint(x,y,z); - GetManualViewBaseContour()->SelectPosibleContour(x,y,z); + GetManualViewBaseContour()->SelectPosibleContour(x,y,z); if (GetState()==1){ SetPoint( _bakIdPoint , x , y ,z); } if (GetState()==5){ SetPoint( _bakIdPoint , x , y ,z); } if ( GetState()==6 && !IsEditable() && GetPosibleToMove() &&IsMoving() ) - { + { GetManualViewBaseContour()->MoveContour(x,y,z); } if (GetState()!=7 || GetManualViewBaseContour()->GetPosibleSelected() ){ @@ -4031,16 +4232,16 @@ void manualContourControler::MouseMove(int x, int y) // virtual } // ---------------------------------------------------------------------------- -void manualContourControler::MouseDLeft( int x, int y)//virtual +void manualContourControler::MouseDLeft( int x, int y)//virtual { - manualContourBaseControler::MouseDLeft( x, y); + manualContourBaseControler::MouseDLeft( x, y); if ( IsEditable() ) { GetManualViewBaseContour()->AddControlPoints(); GetManualViewBaseContour()->AddTextActor(); GetManualViewBaseContour()->Refresh(); this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); - } + } } // ---------------------------------------------------------------------------- void manualContourControler::SetEasyCreation(bool easyCreation) @@ -4066,7 +4267,7 @@ manualContourPerpPlaneControler::~manualContourPerpPlaneControler() { } // ---------------------------------------------------------------------------- -manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone() // virtual +manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone() // virtual { manualContourPerpPlaneControler * clone = new manualContourPerpPlaneControler(); CopyAttributesTo(clone); @@ -4151,26 +4352,26 @@ bool manualContourPerpPlaneControler::OnChar() // virtual return true; } // ---------------------------------------------------------------------------- -bool manualContourPerpPlaneControler::OnMouseMove() // virtual +bool manualContourPerpPlaneControler::OnMouseMove() // virtual { manualContourControler::OnMouseMove(); return _flagMouseMove; } // ---------------------------------------------------------------------------- -bool manualContourPerpPlaneControler::OnLeftDClick() // virtual +bool manualContourPerpPlaneControler::OnLeftDClick() // virtual { manualContourControler::OnLeftDClick(); return _flagMouseDClick; } // ---------------------------------------------------------------------------- -void manualContourPerpPlaneControler::ResetContour() // virtual +void manualContourPerpPlaneControler::ResetContour() // virtual { manualContourControler::ResetContour(); _manualcontour3Vcontroler->ResetContour_Others(); } // ---------------------------------------------------------------------------- -void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual +void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual { _flagMouseDClick=true; manualContourControler::MouseDLeft(x,y); @@ -4192,7 +4393,7 @@ void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual // _vtkmprbasedata->SetZ( mp->GetZ() ); // ResetOrientationPlane(); // this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); -// } +// } } @@ -4237,7 +4438,7 @@ manualRoiControler::~manualRoiControler() { } // ---------------------------------------------------------------------------- -manualRoiControler * manualRoiControler :: Clone() // virtual +manualRoiControler * manualRoiControler :: Clone() // virtual { manualRoiControler * clone = new manualRoiControler(); CopyAttributesTo(clone); @@ -4261,27 +4462,27 @@ void manualRoiControler::Configure() //virtual void manualRoiControler::MouseClickLeft(int x, int y){ int z = GetZ(); if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){ - bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(5); } - if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) { + if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) { GetManualViewBaseContour()->InitMove(x,y,z); SetState(6); } int size=GetManualViewBaseContour()->GetNumberOfPoints(); - if (GetState()==0) { + if (GetState()==0) { if (size==0){ - AddPoint(x,y,z); - AddPoint(x,y,z); - AddPoint(x,y,z); - AddPoint(x,y,z); + AddPoint(x,y,z); + AddPoint(x,y,z); + AddPoint(x,y,z); + AddPoint(x,y,z); } else { - SetPoint(0,x,y,z); - SetPoint(1,x,y,z); - SetPoint(2,x,y,z); - SetPoint(3,x,y,z); + SetPoint(0,x,y,z); + SetPoint(1,x,y,z); + SetPoint(2,x,y,z); + SetPoint(3,x,y,z); } - bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(5); } GetManualViewBaseContour()->Refresh(); @@ -4296,37 +4497,37 @@ void manualRoiControler::MouseMove(int x, int y) // virtual GetManualViewBaseContour()->SelectPosibleContour(x,y,z); GetManualViewBaseContour()->SelectPosiblePoint(x,y,z); - if (GetState()==5){ - SetPoint( bakIdPoint , x , y ,z); + if (GetState()==5){ + SetPoint( bakIdPoint , x , y ,z); if (bakIdPoint==0) { - SetPointX( 1 , x ); - SetPointY( 3 , y ); + SetPointX( 1 , x ); + SetPointY( 3 , y ); } if (bakIdPoint==1) { - SetPointX( 0 , x ); - SetPointY( 2 , y ); + SetPointX( 0 , x ); + SetPointY( 2 , y ); } if (bakIdPoint==2) { - SetPointX( 3 , x ); - SetPointY( 1 , y ); + SetPointX( 3 , x ); + SetPointY( 1 , y ); } if (bakIdPoint==3) { - SetPointX( 2 , x ); - SetPointY( 0 , y ); + SetPointX( 2 , x ); + SetPointY( 0 , y ); } } - if (GetState()==6){ + if (GetState()==6){ GetManualViewBaseContour()->MoveContour(x,y,z); } GetManualViewBaseContour()->Refresh(); } // ---------------------------------------------------------------------------- void manualRoiControler::DeleteActualMousePoint(int x, int y) // virtual -{ +{ } // ---------------------------------------------------------------------------- void manualRoiControler::InitRoi(int ww, int hh, double porcentage) @@ -4368,8 +4569,8 @@ void manualRoiControler::InitRoi(int ww, int hh, double porcentage) GetManualViewBaseContour() ->UpdateViewPoint(3); SetState(0); - GetManualViewBaseContour()->Refresh(); -} + GetManualViewBaseContour()->Refresh(); +} // ---------------------------------------------------------------------------- void manualRoiControler::SetRoi(int x1, int y1,int x2, int y2) @@ -4418,7 +4619,7 @@ manualCircleControler::~manualCircleControler() { } // ---------------------------------------------------------------------------- -manualCircleControler * manualCircleControler :: Clone() // virtual +manualCircleControler * manualCircleControler :: Clone() // virtual { manualCircleControler * clone = new manualCircleControler(); CopyAttributesTo(clone); @@ -4442,27 +4643,27 @@ void manualCircleControler::Configure() //virtual void manualCircleControler::MouseClickLeft(int x, int y){ int z = GetZ(); if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){ - bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(5); } - if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) { + if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) { GetManualViewBaseContour()->InitMove(x,y,z); SetState(6); } int size=GetManualViewBaseContour()->GetNumberOfPoints(); - if (GetState()==0) { + if (GetState()==0) { if (size==0){ - AddPoint(x,y,z); - AddPoint(x,y,z); -// AddPoint(x,y,z); -// AddPoint(x,y,z); + AddPoint(x,y,z); + AddPoint(x,y,z); +// AddPoint(x,y,z); +// AddPoint(x,y,z); } else { - SetPoint(0,x,y,z); - SetPoint(1,x,y,z); -// SetPoint(2,x,y,z); -// SetPoint(3,x,y,z); + SetPoint(0,x,y,z); + SetPoint(1,x,y,z); +// SetPoint(2,x,y,z); +// SetPoint(3,x,y,z); } - bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); SetState(5); } GetManualViewBaseContour()->Refresh(); @@ -4478,33 +4679,33 @@ void manualCircleControler::MouseMove(int x, int y) // virtual GetManualViewBaseContour()->SelectPosibleContour(x,y,z); GetManualViewBaseContour()->SelectPosiblePoint(x,y,z); - if (GetState()==5){ - SetPoint( bakIdPoint , x , y ,z); + if (GetState()==5){ + SetPoint( bakIdPoint , x , y ,z); /* if (bakIdPoint==0) { - SetPointX( 1 , x ); - SetPointY( 3 , y ); + SetPointX( 1 , x ); + SetPointY( 3 , y ); } if (bakIdPoint==1) { - SetPointX( 0 , x ); - SetPointY( 2 , y ); + SetPointX( 0 , x ); + SetPointY( 2 , y ); } if (bakIdPoint==2) { - SetPointX( 3 , x ); - SetPointY( 1 , y ); + SetPointX( 3 , x ); + SetPointY( 1 , y ); } if (bakIdPoint==3) { - SetPointX( 2 , x ); - SetPointY( 0 , y ); + SetPointX( 2 , x ); + SetPointY( 0 , y ); } */ } - if (GetState()==6){ + if (GetState()==6){ GetManualViewBaseContour()->MoveContour(x,y,z); } GetManualViewBaseContour()->Refresh(); @@ -4513,7 +4714,7 @@ void manualCircleControler::MouseMove(int x, int y) // virtual // ---------------------------------------------------------------------------- void manualCircleControler::DeleteActualMousePoint(int x, int y) // virtual -{ +{ } // ---------------------------------------------------------------------------- @@ -4556,8 +4757,8 @@ void manualCircleControler::InitRoi(int ww, int hh, double porcentage) // GetManualViewBaseContour() ->UpdateViewPoint(3); SetState(0); - GetManualViewBaseContour()->Refresh(); -} + GetManualViewBaseContour()->Refresh(); +} // ---------------------------------------------------------------------------- /* @@ -4589,6 +4790,120 @@ void manualCircleControler::SetRoi(int x1, int y1,int x2, int y2) */ +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- + +// AD:02-09 + +// _state = 0 // ..nothing.. +// _state = 5 // move point +// _state = 6 // move all +// _state = 7 // Empty mouse drag + +manualLineControler::manualLineControler() +{ +} +// ---------------------------------------------------------------------------- +manualLineControler::~manualLineControler() +{ +} +// ---------------------------------------------------------------------------- +manualLineControler * manualLineControler :: Clone() // virtual +{ + manualLineControler * clone = new manualLineControler(); + CopyAttributesTo(clone); + return clone; +} + +// --------------------------------------------------------------------------- +void manualLineControler::CopyAttributesTo( manualLineControler * cloneObject) +{ + // Fathers object + manualContourBaseControler::CopyAttributesTo(cloneObject); +} + +// ---------------------------------------------------------------------------- +void manualLineControler::MouseClickLeft(int x, int y){ + int z = GetZ(); + if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){ + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + SetState(5); + } + if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true)) { + GetManualViewBaseContour()->InitMove(x,y,z); + SetState(6); + } + int size=GetManualViewBaseContour()->GetNumberOfPoints(); + if (GetState()==0) { + if (size==0){ + AddPoint(x,y,z); + AddPoint(x,y,z); + } else { + SetPoint(0,x,y,z); + SetPoint(1,x,y,z); + } + bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z); + SetState(5); + } + GetManualViewBaseContour()->Refresh(); +} +// ---------------------------------------------------------------------------- + +void manualLineControler::MouseMove(int x, int y) // virtual +{ + int z=GetZ(); + + GetManualViewBaseContour()->SelectPosibleContour(x,y,z); + GetManualViewBaseContour()->SelectPosiblePoint(x,y,z); + + if (GetState()==5) + { + SetPoint( bakIdPoint , x , y ,z); + } + if (GetState()==6) + { + GetManualViewBaseContour()->MoveContour(x,y,z); + } + GetManualViewBaseContour()->Refresh(); +} + + +// ---------------------------------------------------------------------------- +void manualLineControler::DeleteActualMousePoint(int x, int y) // virtual +{ +} +// ---------------------------------------------------------------------------- + +void manualLineControler::InitRoi(int ww, int hh, double porcentage) +{ + int zz; + manualPoint *mp; + + if (GetManualContourModel()->GetSizeLstPoints() ==0) + { + zz = GetZ(); + AddPoint(0,0,zz); + AddPoint(0,0,zz); + } + + double pp1=porcentage; + double pp2=1-porcentage; + + mp = GetManualContourModel()->GetManualPoint(0); + zz=(int)mp->GetZ(); + mp->SetPoint(ww*pp2,hh*pp2,zz); + + mp = GetManualContourModel()->GetManualPoint(1); + zz=(int)mp->GetZ(); + mp->SetPoint(ww*pp2,hh*pp1,zz); + + GetManualViewBaseContour() ->UpdateViewPoint(0); + GetManualViewBaseContour() ->UpdateViewPoint(1); + + SetState(0); + GetManualViewBaseContour()->Refresh(); +} // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- @@ -4602,7 +4917,7 @@ manualContourBaseControler::manualContourBaseControler() _state = 0; _z = -900; _editable = true; - _posibleToMove = true; + _posibleToMove = true; _moving = false; _created = false; _keyBoardMoving = false; @@ -4613,7 +4928,7 @@ manualContourBaseControler::~manualContourBaseControler() } // ---------------------------------------------------------------------------- -manualContourBaseControler * manualContourBaseControler :: Clone() // virtual +manualContourBaseControler * manualContourBaseControler :: Clone() // virtual { manualContourBaseControler * clone = new manualContourBaseControler(); CopyAttributesTo(clone); @@ -4650,8 +4965,8 @@ bool manualContourBaseControler::OnChar() int X,Y; wxVTKRenderWindowInteractor *_wxVTKiren; _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); - _wxVTKiren->GetEventPosition(X, Y); - int Z = GetZ(); + _wxVTKiren->GetEventPosition(X, Y); + //int Z = GetZ(); // JPRx // Delete Point if ((keyCode==8) || (keyCode==127)) { @@ -4662,10 +4977,10 @@ bool manualContourBaseControler::OnChar() } GetManualViewBaseContour()->Refresh(); this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); - } + } else { - // Magnet + // Magnet if (keyCode==32) { Magnet(X,Y); @@ -4673,54 +4988,54 @@ bool manualContourBaseControler::OnChar() this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); } else if( !IsEditable() ) - { + { if ( keyCode == 'L' ) - { - GetManualViewBaseContour()->MoveContour( -1, 0 ); + { + GetManualViewBaseContour()->MoveContour( -1, 0 ); SetKeyBoardMoving( true ); } else if ( keyCode == 'R' ) - { - GetManualViewBaseContour()->MoveContour( 1, 0 ); - SetKeyBoardMoving( true ); + { + GetManualViewBaseContour()->MoveContour( 1, 0 ); + SetKeyBoardMoving( true ); } else if ( keyCode == 'U' ) { - GetManualViewBaseContour()->MoveContour( 0, -1 ); + GetManualViewBaseContour()->MoveContour( 0, -1 ); SetKeyBoardMoving( true ); } else if ( keyCode == 'D' ) { - GetManualViewBaseContour()->MoveContour( 0, 1 ); + GetManualViewBaseContour()->MoveContour( 0, 1 ); SetKeyBoardMoving( true ); } else if ( keyCode == 'W' )//Diagonal left down { - GetManualViewBaseContour()->MoveContour( -1, 1 ); + GetManualViewBaseContour()->MoveContour( -1, 1 ); SetKeyBoardMoving( true ); } else if ( keyCode == 'Q' )//Diagonal left up { - GetManualViewBaseContour()->MoveContour( -1, -1 ); + GetManualViewBaseContour()->MoveContour( -1, -1 ); SetKeyBoardMoving( true ); } else if( keyCode == 'P' )//Diagonal right up { - GetManualViewBaseContour()->MoveContour( 1, -1 ); + GetManualViewBaseContour()->MoveContour( 1, -1 ); SetKeyBoardMoving( true ); } else if( keyCode == 'M' )//Diagonal right down { - GetManualViewBaseContour()->MoveContour( 1, 1 ); + GetManualViewBaseContour()->MoveContour( 1, 1 ); SetKeyBoardMoving( true ); } if( GetKeyBoardMoving() ) { GetManualViewBaseContour()->Refresh(); - this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); + this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); } } - } + } } return true; } @@ -4752,7 +5067,7 @@ bool manualContourBaseControler::OnLeftButtonDown() wxVTKRenderWindowInteractor *wxVTKiren; wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); wxVTKiren->GetEventPosition(X,Y); - + MouseClickLeft(X,Y); } return true; @@ -4785,7 +5100,7 @@ bool manualContourBaseControler::OnLeftDClick() return true; } // ---------------------------------------------------------------------------- -bool manualContourBaseControler::OnMiddleButtonDown() +bool manualContourBaseControler::OnMiddleButtonDown() { // SetKeyBoardMoving( false ); if ( _vtkInteractorStyleBaseView!=NULL ) @@ -4812,7 +5127,7 @@ bool manualContourBaseControler::OnRightButtonDown() wxVTKRenderWindowInteractor *wxVTKiren; wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); wxVTKiren->GetEventPosition(X, Y); - + SetCompleteCreation( true ); SetKeyBoardMoving( false ); MouseClickRight(X,Y); @@ -4842,19 +5157,19 @@ manualViewBaseContour* manualContourBaseControler::GetManualViewBaseContour() } // ---------------------------------------------------------------------------- void manualContourBaseControler::MouseClickLeft(int x, int y) // virtual -{ - +{ + } // ---------------------------------------------------------------------------- void manualContourBaseControler::MouseClickRight(int x, int y) { - if (_state==1) - { + if (_state==1) + { _state=0; } SetEditable( false ); SetPosibleToMove( false ); - //_state = 0; + //_state = 0; _state=7; } // ---------------------------------------------------------------------------- @@ -4862,20 +5177,20 @@ void manualContourBaseControler::MouseReleaseLeft(int x, int y) { if (_state==5){ _state = 0; } if (_state==6){ _state = 0; } - if (_state==7){ _state = 0; } + if (_state==7){ _state = 0; } SetMoving( false ); GetManualViewBaseContour()->SelectPosibleContour(x,y,GetZ()); if( GetIfCompleteCreation() && IsEditable() && !GetManualViewBaseContour()->GetPosibleSelected() && (GetManualViewBaseContour()->GetIdPoint(x,y,GetZ())==-1) ) { SetEditable( false ); - SetPosibleToMove( false ); + SetPosibleToMove( false ); } } // ---------------------------------------------------------------------------- void manualContourBaseControler::MouseDLeft(int x, int y ) { - if (_state==0) - { + if (_state==0) + { int z=GetZ(); GetManualViewBaseContour()->SelectPosibleContour(x,y,z); GetManualViewBaseContour()->SelectPosiblePoint(x,y,z); @@ -4913,7 +5228,7 @@ void manualContourBaseControler::SetEditable( bool condition ) GetManualViewBaseContour()->RemoveControlPoints(); } GetManualViewBaseContour()->SetSelected( condition ); - } + } _editable = condition; } @@ -4984,17 +5299,17 @@ double* manualContourBaseControler::GetVectorPointsYManualContour(){ // ---------------------------------------------------------------------------- void manualContourBaseControler::DeleteContour(){ _manViewBaseCont->DeleteContour(); - _manContModel->DeleteAllPoints(); + _manContModel->DeleteAllPoints(); } // ---------------------------------------------------------------------------- void manualContourBaseControler::DeleteActualMousePoint(int x, int y)// virtual -{ +{ if ((_manContModel!=NULL) && (_manViewBaseCont!=NULL) ) { int id=_manViewBaseCont->GetIdPoint(x,y,GetZ()); if ((id!=-1) && (_manContModel->GetSizeLstPoints()>2) ){ _manContModel->DeletePoint(id); - _manViewBaseCont->DeletePoint(id); + _manViewBaseCont->DeletePoint(id); } } _state = 0; @@ -5002,10 +5317,10 @@ void manualContourBaseControler::DeleteActualMousePoint(int x, int y)// virtual // ---------------------------------------------------------------------------- void manualContourBaseControler::Magnet(int x, int y) -{ +{ if( IsEditable()) { - int id=_manViewBaseCont->GetIdPoint(x,y,GetZ()); + /*int id= */ _manViewBaseCont->GetIdPoint(x,y,GetZ()); // JPRx if (GetManualContourModel()!=NULL){ double xx = x; double yy = y; @@ -5041,8 +5356,8 @@ void manualContourBaseControler::AddPoint(int x, int y, int z) // virtual double yy = y; double zz = z; GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); - int id = GetManualContourModel()->AddPoint(xx,yy,zz); - GetManualViewBaseContour()->AddPoint(); + /*int id =*/ GetManualContourModel()->AddPoint(xx,yy,zz); // JPRx + GetManualViewBaseContour()->AddPoint(); // GetManualViewBaseContour()->UpdateViewPoint(id); } } @@ -5058,12 +5373,12 @@ void manualContourBaseControler::InsertPoint(int x,int y,int z) // virtual GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); if (GetManualContourModel()->GetSizeLstPoints()>1){ id = GetManualContourModel()->InsertPoint(xx,yy,zz); - GetManualViewBaseContour()->InsertPoint(id); + GetManualViewBaseContour()->InsertPoint(id); // GetManualViewBaseContour()->UpdateViewPoint(id); } else { GetManualContourModel()->AddPoint(xx,yy,zz); - GetManualViewBaseContour()->AddPoint(); -// AddPoint(x,y,z); + GetManualViewBaseContour()->AddPoint(); +// AddPoint(x,y,z); // GetManualViewBaseContour()->UpdateViewPoint(id); } }