+void VTKViewer_OpenGLRenderer::GetCornersColor(Vec2D& cornersColor)
+{
+ if( this->GradientBackground )
+ {
+ double* corner1 = 0;
+ double* corner2 = 0;
+ double* corner3 = 0;
+ double* corner4 = 0;
+ double dcorner1[3];
+ double dcorner2[3];
+
+ switch( this->GradientType )
+ {
+ case HorizontalGradient:
+ corner1 = this->Background;
+ corner2 = this->Background;
+ corner3 = this->Background2;
+ corner4 = this->Background2;
+ break;
+ case VerticalGradient:
+ corner1 = this->Background;
+ corner2 = this->Background2;
+ corner3 = this->Background2;
+ corner4 = this->Background;
+ break;
+ case FirstDiagonalGradient:
+ corner1 = this->Background;
+ corner3 = this->Background2;
+ dcorner1[0] = dcorner2[0] = 0.5F * ( corner1[0] + corner3[0] );
+ dcorner1[1] = dcorner2[1] = 0.5F * ( corner1[1] + corner3[1] );
+ dcorner1[2] = dcorner2[2] = 0.5F * ( corner1[2] + corner3[2] );
+ corner2 = dcorner1;
+ corner4 = dcorner2;
+ break;
+ case SecondDiagonalGradient:
+ corner2 = this->Background2;
+ corner4 = this->Background;
+ dcorner1[0] = dcorner2[0] = 0.5F * ( corner2[0] + corner4[0] );
+ dcorner1[1] = dcorner2[1] = 0.5F * ( corner2[1] + corner4[1] );
+ dcorner1[2] = dcorner2[2] = 0.5F * ( corner2[2] + corner4[2] );
+ corner1 = dcorner1;
+ corner3 = dcorner2;
+ break;
+ case FirstCornerGradient:
+ corner1 = this->Background2;
+ corner2 = this->Background2;
+ corner3 = this->Background;
+ corner4 = this->Background2;
+ break;
+ case SecondCornerGradient:
+ corner1 = this->Background2;
+ corner2 = this->Background2;
+ corner3 = this->Background2;
+ corner4 = this->Background;
+ break;
+ case ThirdCornerGradient:
+ corner1 = this->Background;
+ corner2 = this->Background2;
+ corner3 = this->Background2;
+ corner4 = this->Background2;
+ break;
+ case FourthCornerGradient:
+ corner1 = this->Background2;
+ corner2 = this->Background;
+ corner3 = this->Background2;
+ corner4 = this->Background2;
+ break;
+ default: // just in case
+ corner1 = this->Background;
+ corner2 = this->Background;
+ corner3 = this->Background;
+ corner4 = this->Background;
+ break;
+ }
+ cornersColor[0][0] = corner1[0]; cornersColor[0][1] = corner1[1]; cornersColor[0][2] = corner1[2];
+ cornersColor[1][0] = corner2[0]; cornersColor[1][1] = corner2[1]; cornersColor[1][2] = corner2[2];
+ cornersColor[2][0] = corner3[0]; cornersColor[2][1] = corner3[1]; cornersColor[2][2] = corner3[2];
+ cornersColor[3][0] = corner4[0]; cornersColor[3][1] = corner4[1]; cornersColor[3][2] = corner4[2];
+ }
+ else
+ {
+ for (int i = 0; i < 4; i++)
+ for(int j = 0; j < 3; j++)
+ cornersColor[i][j] = this->Background[j];
+ }
+}
+