GLfloat xSc, ySc, xPan, yPan;
vp2d->getScale( xSc, ySc );
vp2d->getPan( xPan, yPan );
- retStr.sprintf( "%.12e*%.12e*%.12e*%.12e", xSc, ySc, xPan, yPan );
+
+ QColor aBgColor = vp2d->backgroundColor();
+ int r = aBgColor.red(), g = aBgColor.green(), b = aBgColor.blue();
+
+ retStr.sprintf( "%.12e*%.12e*%.12e*%.12e*%d*%d*%d", xSc, ySc, xPan, yPan, r, g, b );
}
return retStr;
}
void GLViewer_ViewFrame::setVisualParameters( const QString& parameters )
{
QStringList paramsLst = parameters.split( '*' );
- if ( myVP && myVP->inherits( "GLViewer_ViewPort2d" ) && paramsLst.size() == 4) {
+ if ( myVP && myVP->inherits( "GLViewer_ViewPort2d" ) && paramsLst.size() == 7) {
GLViewer_ViewPort2d* vp2d = (GLViewer_ViewPort2d*)myVP;
GLfloat xSc, ySc, xPan, yPan;
vp2d->getGLWidget()->setScale( xSc, ySc, 1. );
vp2d->getGLWidget()->setPan( xPan, yPan, 0. );
+
+ int r = paramsLst[4].toInt();
+ int g = paramsLst[5].toInt();
+ int b = paramsLst[6].toInt();
+ vp2d->setBackgroundColor( QColor( r, g, b ) );
}
}
#include "QtxActionToolMgr.h"
#include "QtxMultiAction.h"
+#include "VTKViewer_Trihedron.h"
#include "VTKViewer_Utilities.h"
#include "SVTK_View.h"
parScale = camera->GetParallelScale();
GetScale( scale );
+ QColor aBgColor = backgroundColor();
+
+ int aThrihedronVisibility = VTKViewer_Trihedron::eOn;
+ if( VTKViewer_Trihedron* aTrihedron = GetTrihedron() )
+ aThrihedronVisibility = (int)aTrihedron->GetVisibility();
+
// Parameters are given in the following format:view position (3 digits), focal point position (3 digits)
// view up values (3 digits), parallel scale (1 digit), scale (3 digits,
// Graduated axes parameters (X, Y, Z axes parameters)
getGradAxisVisualParams(aWriter, gradAxesActor->GetZAxisActor2D(), "Z");
}
+ aWriter.writeStartElement("BackgroundColor");
+ aWriter.writeAttribute("R", QString::number(aBgColor.red()));
+ aWriter.writeAttribute("G", QString::number(aBgColor.green()));
+ aWriter.writeAttribute("B", QString::number(aBgColor.blue()));
+ aWriter.writeEndElement();
+
+ aWriter.writeStartElement("Trihedron");
+ aWriter.writeAttribute("Visibility", QString::number(aThrihedronVisibility));
+ aWriter.writeEndElement();
+
aWriter.writeEndElement();
aWriter.writeEndDocument();
void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters )
{
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
+ QColor aBgColor;
QXmlStreamReader aReader(parameters);
SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes();
setGradAxisVisualParams(aReader, gradAxesActor->GetYAxisActor2D());
else if(aAttr.value("Axis") == "Z")
setGradAxisVisualParams(aReader, gradAxesActor->GetZAxisActor2D());
+ } else if (aReader.name() == "BackgroundColor") {
+ aBgColor.setRed(aAttr.value("R").toString().toInt());
+ aBgColor.setGreen(aAttr.value("G").toString().toInt());
+ aBgColor.setBlue(aAttr.value("B").toString().toInt());
+ } else if (aReader.name() == "Trihedron") {
+ int aThrihedronVisibility = aAttr.value("Visibility").toString().toInt();
+ if( VTKViewer_Trihedron* aTrihedron = GetTrihedron() )
+ aTrihedron->SetVisibility((VTKViewer_Trihedron::TVisibility)aThrihedronVisibility);
}
}
}
camera->SetViewUp( viewUp );
camera->SetParallelScale( parScale );
SetScale( scale );
+ setBackgroundColor( aBgColor );
} else {
QStringList paramsLst = parameters.split( '*' );
if ( paramsLst.size() >= nNormalParams ) {