From 885faee171b5cdcbcbbcb6cc83e6d196544e005c Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Wed, 10 Jun 2009 11:46:06 +0000 Subject: [PATCH] BUG view MPR --- .../manualContour3VControler.cpp | 6 ++--- .../manualContourBaseControler.cpp | 14 ++++++------ .../manualContour/manualContourModel.cpp | 1 + .../manualContour/manualView3DContour.cpp | 2 +- .../manualContour/manualView3DContour.h | 2 +- .../manualContour/manualView3VContour.cpp | 4 ++-- .../manualContour/manualViewBaseContour.cpp | 6 ++--- .../manualContour/manualViewBaseContour.h | 2 +- .../manualContour/manualViewCircle.cpp | 6 ++--- .../manualContour/manualViewContour.cpp | 6 ++--- .../widgets/manualContour/manualViewLine.cpp | 4 ++-- .../widgets/manualContour/manualViewRoi.cpp | 6 ++--- .../widgets/manualViewPerpPlaneContour.cxx | 7 +++--- .../widgets/manualViewPerpPlaneContour.h | 2 +- .../widgets/pPlotter/HistogramDialog.cxx | 22 +++++++++---------- .../widgets/vtkInfoTextImageInteractor.cxx | 2 +- .../vtkInfoTextImageInteractorPlane2D.cxx | 2 +- .../widgets/vtkInteractorStyleMPRView.cxx | 2 +- .../widgets/vtkInteractorStylePlane2D.cxx | 2 +- .../wxWindows/widgets/vtkPlane2DView.cxx | 4 ++-- .../wxWindows/widgets/vtkPlane2DView.h | 2 +- .../wxWindows/widgets/wxVtkBaseView.cxx | 2 +- .../wxWindows/widgets/wxVtkBaseView.h | 2 +- .../wxWindows/widgets/wxVtkMPR2DView.cxx | 18 ++++++++++----- .../wxWindows/widgets/wxVtkMPR2DView.h | 2 +- 25 files changed, 68 insertions(+), 60 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.cpp index 1ad857a..0f50090 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContour3VControler.cpp @@ -78,7 +78,7 @@ void manualContour3VControler::AddPoint( int x, int y, int z ) // virtual double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz,_type); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz,_type); if (_type==0) { @@ -132,7 +132,7 @@ void manualContour3VControler::InsertPoint(int x, int y, int z) double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz,_type); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz,_type); if (_type==0) { xx=_vtkmprbasedata->GetX(); @@ -194,7 +194,7 @@ void manualContour3VControler::SetPoint( int id ,int x ,int y ,int z ) // virtua double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz,_type); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz,_type); if (_type==0) { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp index 519061d..24c974b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.cpp @@ -422,7 +422,7 @@ void manualContourBaseControler::Magnet(int x, int y) double xx = x; double yy = y; double zz = GetZ(); - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); int id = GetManualContourModel()->GetIdPoint(xx,yy,zz,32000,-1); if (id!=-1) { @@ -452,7 +452,7 @@ void manualContourBaseControler::AddPoint(int x, int y, int z) // virtual double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); /*int id =*/ GetManualContourModel()->AddPoint(xx,yy,zz); // JPRx GetManualViewBaseContour()->AddPoint(); // GetManualViewBaseContour()->UpdateViewPoint(id); @@ -467,7 +467,7 @@ void manualContourBaseControler::InsertPoint(int x,int y,int z) // virtual double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); if (GetManualContourModel()->GetSizeLstPoints()>1){ id = GetManualContourModel()->InsertPoint(xx,yy,zz); GetManualViewBaseContour()->InsertPoint(id); @@ -487,7 +487,7 @@ void manualContourBaseControler::SetPoint( int id ,int x , int y , int z){ // vi double xx = x; double yy = y; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); manualPoint *mp = _manContModel->GetManualPoint(id); mp->SetPoint(xx,yy,zz); GetManualViewBaseContour()->UpdateViewPoint(id); @@ -499,7 +499,7 @@ void manualContourBaseControler::SetPointX( int id ,int x ){ double xx = x; double yy = 0; double zz = 0; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); manualPoint *mp = _manContModel->GetManualPoint(id); mp->SetPointX(xx); GetManualViewBaseContour()->UpdateViewPoint(id); @@ -511,7 +511,7 @@ void manualContourBaseControler::SetPointY( int id ,int y ){ double xx = 0; double yy = y; double zz = 0; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); manualPoint *mp = _manContModel->GetManualPoint(id); mp->SetPointY(yy); GetManualViewBaseContour()->UpdateViewPoint(id); @@ -523,7 +523,7 @@ void manualContourBaseControler::SetPointZ( int id ,int z ){ double xx = 0; double yy = 0; double zz = z; - GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz); + GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz); manualPoint *mp = _manContModel->GetManualPoint(id); mp->SetPointZ(zz); GetManualViewBaseContour()->UpdateViewPoint(id); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp index f0e8086..ee0f4d0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp @@ -684,6 +684,7 @@ std::vector manualContourModel::ExploseModel( ) void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By) { manualPoint * mp; + int i, size = GetSizeLstPoints(); for( i=0; iGetX(); Y = _vtkmprbasedata->GetY(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h index aed36d1..b245e6c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3DContour.h @@ -15,7 +15,7 @@ public: virtual manualView3DContour * Clone(); void CopyAttributesTo( manualView3DContour *cloneObject ); - virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type); + virtual void TransfromCoordViewWorld(double &X, double &Y, double &Z, int type); void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata); virtual int SelectPosiblePoint ( int x, int y, int z ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3VContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3VContour.cpp index d8a1139..c7a1d75 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3VContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualView3VContour.cpp @@ -100,7 +100,7 @@ int manualView3VContour::GetIdPoint(int x, int y, int z) // virtual double xx=x; double yy=y; double zz=z; - TransfromeCoordViewWorld(xx,yy,zz,-1); + TransfromCoordViewWorld(xx,yy,zz,-1); ii=_manContModel->GetIdPoint(xx,yy,zz,GetRange(),_type); } return ii; @@ -115,7 +115,7 @@ bool manualView3VContour::ifTouchContour(int x,int y,int z){ // virtual double ppA[3]; double ppB[3]; double d1,d2,d3; - TransfromeCoordViewWorld(xx,yy,zz,-1); + TransfromCoordViewWorld(xx,yy,zz,-1); //EED 27 sep 2006 xx = xx * _spc[0]; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 7508f65..1f7e376 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -691,7 +691,7 @@ int manualViewBaseContour::GetIdPoint(int x, int y, int z) // virtual double xx = x; double yy = y; double zz = z; - TransfromeCoordViewWorld(xx,yy,zz); + TransfromCoordViewWorld(xx,yy,zz); ii=_manContModel->GetIdPoint(xx,yy,zz,_range,-1); } return ii; @@ -721,9 +721,9 @@ int manualViewBaseContour::GetNumberOfPoints() }*/ //---------------------------------------------------------------------------- // virtual -void manualViewBaseContour::TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type) // Virtual +void manualViewBaseContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // Virtual { - _wxvtkbaseview->TransFromeCoordScreenToWorld(X, Y, Z, type); + _wxvtkbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, type); //EED 27 sep 2007 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h index 1766e97..a97246c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h @@ -122,7 +122,7 @@ public: virtual void MoveContour(int x, int y, int z); virtual void MoveContour(int horizontalUnits, int verticalUnits ); virtual void GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ ); - virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type=2); + virtual void TransfromCoordViewWorld(double &X, double &Y, double &Z, int type=2); void ClearContour(); virtual void ClearPoint(int id); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp index c234154..75cba5f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp @@ -120,7 +120,7 @@ bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual double xx=x; double yy=y; double zz=z; - TransfromeCoordViewWorld(xx,yy,zz); + TransfromCoordViewWorld(xx,yy,zz); bool ok1=false; bool ok2=false; @@ -154,7 +154,7 @@ void manualViewCircle::InitMove(int x, int y, int z) // virtual double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); if (_manContModel->GetSizeLstPoints()==2){ mp = _manContModel->GetManualPoint(0); @@ -188,7 +188,7 @@ void manualViewCircle::MoveContour(int x, int y, int z) // virtual double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); mp = _manContModel->GetManualPoint(0); mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp index c5b00f7..f35e231 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp @@ -168,7 +168,7 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){ double ppA[3]; double ppB[3]; double d1,d2,d3; - TransfromeCoordViewWorld(xx,yy,zz); + TransfromCoordViewWorld(xx,yy,zz); //EED 27 sep 2006 xx = xx * _spc[0]; @@ -234,7 +234,7 @@ void manualViewContour::InitMove(int x, int y, int z) double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); int i, manualPointsSZ = _manContModel->GetSizeLstPoints(); for ( i=0; iGetSizeLstPoints(); for ( i=0; iGetSizeLstPoints()==2) { @@ -73,7 +73,7 @@ void manualViewLine::MoveContour(int x, int y, int z) // virtual double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); mp = _manContModel->GetManualPoint(0); mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp index d86be6c..570a372 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp @@ -134,7 +134,7 @@ bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual double xx=x; double yy=y; double zz=z; - TransfromeCoordViewWorld(xx,yy,zz); + TransfromCoordViewWorld(xx,yy,zz); bool ok1=false; bool ok2=false; @@ -167,7 +167,7 @@ void manualViewRoi::InitMove(int x, int y, int z) // virtual double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); if (_manContModel->GetSizeLstPoints()==4){ mp = _manContModel->GetManualPoint(0); @@ -200,7 +200,7 @@ void manualViewRoi::MoveContour(int x, int y, int z) // virtual double XX=x; double YY=y; double ZZ=z; - TransfromeCoordViewWorld(XX,YY,ZZ); + TransfromCoordViewWorld(XX,YY,ZZ); mp = _manContModel->GetManualPoint(0); mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.cxx index ca4f013..edc09ca 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.cxx @@ -82,11 +82,11 @@ void manualViewPerpPlaneContour::FilterCordinateXYZ (double &x, double &y, doubl } // ---------------------------------------------------------------------------- -void manualViewPerpPlaneContour::TransfromeCoordViewWorld( double &X,double &Y,double &Z,int type ) +void manualViewPerpPlaneContour::TransfromCoordViewWorld( double &X,double &Y,double &Z,int type ) { Z = 0; vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)( this->GetWxVtkBaseView() ); - vtkplane2Dview->TransfromeCoordViewWorld2(X,Y,Z); + vtkplane2Dview->TransfromCoordViewWorld2(X,Y,Z); } @@ -192,7 +192,8 @@ bool manualViewPerpPlaneContour::ifTouchContour( int x, int y, int z) double X=x; double Y=y; double Z=z; - vtkplane2Dview->TransFromeCoordScreenToWorld(X,Y,Z); + vtkplane2Dview->TransFromCoordScreenToWorld(X,Y,Z); + double ppA[3]; _pts->GetPoint(0, ppA); if (sqrt( (ppA[0]-X)*(ppA[0]-X) + (ppA[1]-Y)*(ppA[1]-Y) ) <=2) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.h index 6926a9b..03240f9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualViewPerpPlaneContour.h @@ -14,7 +14,7 @@ public: virtual void UpdateViewPoint(int id); virtual void RefreshContour(); - virtual void TransfromeCoordViewWorld( double &X,double &Y,double &Z,int type ); + virtual void TransfromCoordViewWorld( double &X,double &Y,double &Z,int type ); virtual bool ifTouchContour( int x, int y, int z); protected: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx index 1c2d5c0..681263e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialog.cxx @@ -174,7 +174,7 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) std::string line; std::getline(file,line); //int a=line.find("histogram Data"); - if(line.find("histogram Data")!=-1) + if( (int)(line.find("histogram Data"))!=-1) { histogramReading=true; @@ -205,15 +205,15 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) //histogramW->addPointToTransferenceFunction(gc,in); } */ - else if(line.find("TransferenceFunction")!=-1 && histogramReading) + else if( (int)(line.find("TransferenceFunction"))!=-1 && histogramReading) { tf=true; } - else if(line.find("")!=-1 && histogramReading && tf) + else if( (int)(line.find(""))!=-1 && histogramReading && tf) { tfp=true; } - else if(line.find("greyValue")!=-1 && histogramReading && tf && tfp) + else if( (int)(line.find("greyValue"))!=-1 && histogramReading && tf && tfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); @@ -221,7 +221,7 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) gv=atoi(x.c_str()); } - else if(line.find("intensity")!=-1 && histogramReading && tf && tfp) + else if( (int)(line.find("intensity"))!=-1 && histogramReading && tf && tfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); @@ -231,17 +231,17 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) tfp=false; } - else if(line.find("Colors")!=-1 && histogramReading) + else if( (int)(line.find("Colors"))!=-1 && histogramReading) { ctf=true; } - else if(line.find("greyValueRGBpoint")!=-1 && histogramReading && ctf ) + else if( (int)(line.find("greyValueRGBpoint"))!=-1 && histogramReading && ctf ) { ctfp=true; } - else if(line.find("RGBgreyValue")!=-1 && histogramReading && ctf && ctfp) + else if( (int)(line.find("RGBgreyValue"))!=-1 && histogramReading && ctf && ctfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); @@ -249,7 +249,7 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) gv=atoi(x.c_str()); } - else if(line.find("red")!=-1 && histogramReading && ctf && ctfp) + else if( (int)(line.find("red"))!=-1 && histogramReading && ctf && ctfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); @@ -257,14 +257,14 @@ void HistogramDialog::OnLoadData(wxCommandEvent& event) red=atoi(x.c_str()); } - else if(line.find("green")!=-1 && histogramReading && ctf && ctfp) + else if( (int)(line.find("green"))!=-1 && histogramReading && ctf && ctfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); std::string x=line.substr(pos1+1,pos2-pos1-1); gr=atoi(x.c_str()); } - else if(line.find("blue")!=-1 && histogramReading && ctf && ctfp) + else if( (int)(line.find("blue"))!=-1 && histogramReading && ctf && ctfp) { int pos1=line.find(">"); int pos2=line.find("<",pos1+1); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx index 98a24eb..cf03c7c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx @@ -40,7 +40,7 @@ bool vtkInfoTextImageInteractor::OnMouseMove() yy=Y; zz=z; - _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromeCoordScreenToWorld(xx,yy,zz); + _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromCoordScreenToWorld(xx,yy,zz,true); GetVtkInfoTextImage()->PutWindowLevel(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractorPlane2D.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractorPlane2D.cxx index fb4e836..d112867 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractorPlane2D.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractorPlane2D.cxx @@ -23,7 +23,7 @@ bool vtkInfoTextImageInteractorPlane2D::OnMouseMove() // --> dif vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView(); - vtkplane2Dview->TransfromeCoordViewWorld2(xx,yy,zz); + vtkplane2Dview->TransfromCoordViewWorld2(xx,yy,zz); GetVtkInfoTextImage()->PutWindowLevel(); GetVtkInfoTextImage()->PutColorLevel(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleMPRView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleMPRView.cxx index 7e695a3..74a9c9b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleMPRView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleMPRView.cxx @@ -91,7 +91,7 @@ bool vtkInteractorStyleMPRView::OnMouseMove () double z=1; _vtkInteractorStyleBaseView->TransformCoordinate(x,y,z); wxVtkMPR2DView *wxvtkmpr2Dview = (wxVtkMPR2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); -// wxvtkmpr2Dview->TransfromeCoordViewWorld(x,y,z); +// wxvtkmpr2Dview->TransfromCoordViewWorld(x,y,z); wxvtkmpr2Dview->ChangeAxisColor(x,y,z); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx index 77b7fac..d1142f9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStylePlane2D.cxx @@ -93,7 +93,7 @@ bool vtkInteractorStylePlane2D::OnLeftDClick() // virtual vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); vtkMPRBaseData *vtkmprbasedata = vtkplane2Dview->GetVtkmprbasedata(); - vtkplane2Dview->TransfromeCoordViewWorld2(xx,yy,zz); + vtkplane2Dview->TransfromCoordViewWorld2(xx,yy,zz); vtkmprbasedata->SetX( xx ); vtkmprbasedata->SetY( yy ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx index e95ca9d..82442f5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx @@ -519,7 +519,7 @@ void vtkPlane2DView::SetVisibleLine(bool ok) _lineActor->GetProperty()->SetOpacity(opacity); } // ---------------------------------------------------------------------------- -void vtkPlane2DView::TransfromeCoordViewWorld2(double &X, double &Y, double &Z) +void vtkPlane2DView::TransfromCoordViewWorld2(double &X, double &Y, double &Z) { double spc[3]; GetVtkmprbasedata()->GetImageData()->GetSpacing(spc); @@ -528,7 +528,7 @@ void vtkPlane2DView::TransfromeCoordViewWorld2(double &X, double &Y, double &Z) double yy = Y; double zz = 0; - TransFromeCoordScreenToWorld(xx,yy,zz); + TransFromCoordScreenToWorld(xx,yy,zz); vtkTransform *transf1 = vtkTransform::New(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h index 2108748..8df8335 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.h @@ -38,7 +38,7 @@ public: void SetActive(bool active); void SetVisibleLine(bool ok); - void TransfromeCoordViewWorld2(double &X, double &Y, double &Z); + void TransfromCoordViewWorld2(double &X, double &Y, double &Z); int GetMipWidth(); void SetMipWidth(int value); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index a5f79e9..128a844 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -91,7 +91,7 @@ vtkRenderWindow* wxVtkBaseView::GetRenWin() // virtual //---------------------------------------------------------------------------- -void wxVtkBaseView::TransFromeCoordScreenToWorld(double &X, double &Y, double &Z, int type) // virtual +void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2 { GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z); GetRenderer()->DisplayToWorld(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h index 4b16887..eb5dd66 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h @@ -52,7 +52,7 @@ public: virtual void RefreshView(); virtual vtkRenderer* GetRenderer(); virtual vtkRenderWindow* GetRenWin(); - virtual void TransFromeCoordScreenToWorld(double &X, double &Y, double &Z, int type=2); + virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2); /* JCP 04/05/09 void SetInteractorStyleBaseView( vtkInteractorStyleBaseView* interactorStyle); */ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index f4c85f3..0ec8f0d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -463,26 +463,32 @@ void wxVtkMPR2DView::ChangeAxisColor(double x, double y, double z) Refresh(); } + //EED 5 juin 2009 -//void wxVtkMPR2DView::TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type) // virtual -void wxVtkMPR2DView::TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual +//void wxVtkMPR2DView::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type) // virtual +void wxVtkMPR2DView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2 { - wxVtkBaseView::TransFromeCoordScreenToWorld(X,Y,Z,_direction); + wxVtkBaseView::TransFromCoordScreenToWorld(X,Y,Z,keepNormalDirection,_direction); - if (_direction==0) + if ((_direction==0) && (keepNormalDirection==true) ) { X = ((vtkMPRBaseData*)GetVtkBaseData())->GetX(); } - if (_direction==1) + + if ((_direction==1) && (keepNormalDirection==true) ) { Y = ((vtkMPRBaseData*)GetVtkBaseData())->GetY(); } - if (_direction==2) + + if ((_direction==2) && (keepNormalDirection==true) ) { Z = ((vtkMPRBaseData*)GetVtkBaseData())->GetZ(); } + } + + //------------------------------------------------------------------- //------------------------------------------------------------------- //------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h index 5df6055..751bdbd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h @@ -29,7 +29,7 @@ public: void MoveY(double x, double y, double z); void MoveZ(double x, double y, double z); void ChangeAxisColor(double x, double y, double z); - virtual void TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type); + virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2); void SetVisibleAxis(bool ok); -- 2.46.0