53 #include <OpenMesh/Core/IO/IOManager.hh>
55 #if QT_VERSION >= 0x050000
68 return QString( tr(
"View definition files ( *.ofv )") );
72 return QString( tr(
"View definition files ( *.ofv )") );
79 int FileViewPlugin::loadObject(QString _filename) {
88 bool e_center =
false;
90 bool e_background =
false;
92 QSettings settings(_filename, QSettings::IniFormat);
93 settings.beginGroup(
"VIEW");
95 if(settings.contains(
"Width") && settings.contains(
"Height")) {
96 const int width = settings.value(
"Width").toInt();
97 const int height = settings.value(
"Height").toInt();
98 std::cerr <<
"Setting new viewport to " << width <<
"x" << height << std::endl;
101 if(settings.contains(
"EyeX")) {
102 eye[0] = settings.value(
"EyeX").toDouble();
103 eye[1] = settings.value(
"EyeY").toDouble();
104 eye[2] = settings.value(
"EyeZ").toDouble();
105 std::cerr <<
"Setting new eye position to " << eye << std::endl;
109 if(settings.contains(
"CenterX")) {
110 center[0] = settings.value(
"CenterX").toDouble();
111 center[1] = settings.value(
"CenterY").toDouble();
112 center[2] = settings.value(
"CenterZ").toDouble();
113 std::cerr <<
"Setting new scene center to " << center << std::endl;
117 if(settings.contains(
"UpX")) {
118 up[0] = settings.value(
"UpX").toDouble();
119 up[1] = settings.value(
"UpY").toDouble();
120 up[2] = settings.value(
"UpZ").toDouble();
121 std::cerr <<
"Setting new up vector to " << up << std::endl;
126 if(settings.contains(
"BackgroundR")) {
127 background[0] = settings.value(
"BackgroundR").toDouble();
128 background[1] = settings.value(
"BackgroundG").toDouble();
129 background[2] = settings.value(
"BackgroundB").toDouble();
130 background[3] = settings.value(
"BackgroundA").toDouble();
131 std::cerr <<
"Setting new background color to " << background << std::endl;
156 bool FileViewPlugin::saveObject(
int , QString ) {
161 #if QT_VERSION < 0x050000
const ACG::Vec3d sceneCenter(int _viewer)
Get the current scene center.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void setBackColor(OpenMesh::Vec4f _color)
Set the background color of the examiner widget.
void lookAt(const ACG::Vec3d &_eye, const ACG::Vec3d &_center, const ACG::Vec3d &_up, int _viewer)
Set the look at transformation directly.
ACG::Vec3d eyePos(int _viewer)
Get the current viewer position.
void initializePlugin()
Initialize Plugin.
ACG::Vec3d upVector(int _viewer)
Get the current up vector.