double xx = x;
double yy = y;
double zz = z;
- GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz,_type);
+ GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz,_type);
if (_type==0)
{
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();
double xx = x;
double yy = y;
double zz = z;
- GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz,_type);
+ GetManualViewBaseContour()->TransfromCoordViewWorld(xx,yy,zz,_type);
if (_type==0)
{
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)
{
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);
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);
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);
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);
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);
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);
void manualContourModel::Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By)
{
manualPoint * mp;
+
int i, size = GetSizeLstPoints();
for( i=0; i<size; i++ )
_d = d;
}
// ----------------------------------------------------------------------------
-void manualView3DContour::TransfromeCoordViewWorld(double &X, double &Y, double &Z, int type)
+void manualView3DContour::TransfromCoordViewWorld(double &X, double &Y, double &Z, int type)
{
X = _vtkmprbasedata->GetX();
Y = _vtkmprbasedata->GetY();
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 );
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;
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];
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;
}*/
//----------------------------------------------------------------------------
// 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
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);
double xx=x;
double yy=y;
double zz=z;
- TransfromeCoordViewWorld(xx,yy,zz);
+ TransfromCoordViewWorld(xx,yy,zz);
bool ok1=false;
bool ok2=false;
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);
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]);
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];
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; i<manualPointsSZ; i++ )
double YY=y;
double ZZ=z;
- TransfromeCoordViewWorld(XX,YY,ZZ);
+ TransfromCoordViewWorld(XX,YY,ZZ);
int i, manualPointsSZ = _manContModel->GetSizeLstPoints();
for ( i=0; i<manualPointsSZ; i++ )
double XX=x;
double YY=y;
double ZZ=z;
- TransfromeCoordViewWorld(XX,YY,ZZ);
+ TransfromCoordViewWorld(XX,YY,ZZ);
if (_manContModel->GetSizeLstPoints()==2)
{
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]);
double xx=x;
double yy=y;
double zz=z;
- TransfromeCoordViewWorld(xx,yy,zz);
+ TransfromCoordViewWorld(xx,yy,zz);
bool ok1=false;
bool ok2=false;
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);
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]);
}
// ----------------------------------------------------------------------------
-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);
}
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)
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:
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;
//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("<Transferencepoint>")!=-1 && histogramReading && tf)
+ else if( (int)(line.find("<Transferencepoint>"))!=-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);
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);
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);
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);
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);
yy=Y;
zz=z;
- _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromeCoordScreenToWorld(xx,yy,zz);
+ _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromCoordScreenToWorld(xx,yy,zz,true);
GetVtkInfoTextImage()->PutWindowLevel();
// --> dif
vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
- vtkplane2Dview->TransfromeCoordViewWorld2(xx,yy,zz);
+ vtkplane2Dview->TransfromCoordViewWorld2(xx,yy,zz);
GetVtkInfoTextImage()->PutWindowLevel();
GetVtkInfoTextImage()->PutColorLevel();
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);
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 );
_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);
double yy = Y;
double zz = 0;
- TransFromeCoordScreenToWorld(xx,yy,zz);
+ TransFromCoordScreenToWorld(xx,yy,zz);
vtkTransform *transf1 = vtkTransform::New();
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);
//----------------------------------------------------------------------------
-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();
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);
*/
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();
}
+
}
+
+
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
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);