An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit b5e4dc79 authored by Ken Martin's avatar Ken Martin
Browse files

subpixel DPoint

parent 292b211a
...@@ -373,7 +373,7 @@ void vtkRenderer::DisplayToView() ...@@ -373,7 +373,7 @@ void vtkRenderer::DisplayToView()
// Convert view coordinates to display coordinates. // Convert view coordinates to display coordinates.
void vtkRenderer::ViewToDisplay() void vtkRenderer::ViewToDisplay()
{ {
int dx,dy; float dx,dy;
int sizex,sizey; int sizex,sizey;
int *size; int *size;
...@@ -382,12 +382,12 @@ void vtkRenderer::ViewToDisplay() ...@@ -382,12 +382,12 @@ void vtkRenderer::ViewToDisplay()
sizex = size[0]; sizex = size[0];
sizey = size[1]; sizey = size[1];
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) * dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 + (sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]); sizex*this->Viewport[0];
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) * dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 + (sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]); sizey*this->Viewport[1];
this->SetDisplayPoint(dx,dy,this->ViewPoint[2]); this->SetDisplayPoint(dx,dy,this->ViewPoint[2]);
} }
......
...@@ -322,7 +322,7 @@ void vtkSbrRenderer::DisplayToView() ...@@ -322,7 +322,7 @@ void vtkSbrRenderer::DisplayToView()
// Convert view coordinates to display coordinates. // Convert view coordinates to display coordinates.
void vtkSbrRenderer::ViewToDisplay() void vtkSbrRenderer::ViewToDisplay()
{ {
int dx,dy; float dx,dy;
int sizex,sizey; int sizex,sizey;
int *size; int *size;
...@@ -338,34 +338,34 @@ void vtkSbrRenderer::ViewToDisplay() ...@@ -338,34 +338,34 @@ void vtkSbrRenderer::ViewToDisplay()
{ {
case VTK_STEREO_CRYSTAL_EYES: case VTK_STEREO_CRYSTAL_EYES:
{ {
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) * dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 + (sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]); sizex*this->Viewport[0];
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) * dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 + (sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]); sizey*this->Viewport[1];
dy = (int)(dy/2.0); dy = dy/2.0;
} }
break; break;
default: default:
{ {
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) * dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 + (sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]); sizex*this->Viewport[0];
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) * dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 + (sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]); sizey*this->Viewport[1];
} }
} }
} }
else else
{ {
dx = (int)((this->ViewPoint[0]/this->Aspect[0] + 1.0) * dx = (this->ViewPoint[0]/this->Aspect[0] + 1.0) *
(sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 + (sizex*(this->Viewport[2]-this->Viewport[0])) / 2.0 +
sizex*this->Viewport[0]); sizex*this->Viewport[0];
dy = (int)((this->ViewPoint[1]/this->Aspect[1] + 1.0) * dy = (this->ViewPoint[1]/this->Aspect[1] + 1.0) *
(sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 + (sizey*(this->Viewport[3]-this->Viewport[1])) / 2.0 +
sizey*this->Viewport[1]); sizey*this->Viewport[1];
} }
this->SetDisplayPoint(dx,dy,this->ViewPoint[2]); this->SetDisplayPoint(dx,dy,this->ViewPoint[2]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment