47 #include <OpenMesh/Core/IO/IOManager.hh> 58 return QString( tr(
"View definition files ( *.ofv )") );
62 return QString( tr(
"View definition files ( *.ofv )") );
69 int FileViewPlugin::loadObject(QString _filename) {
78 bool e_center =
false;
80 bool e_background =
false;
82 QSettings settings(_filename, QSettings::IniFormat);
83 settings.beginGroup(
"VIEW");
85 if(settings.contains(
"Width") && settings.contains(
"Height")) {
86 const int width = settings.value(
"Width").toInt();
87 const int height = settings.value(
"Height").toInt();
88 std::cerr <<
"Setting new viewport to " << width <<
"x" << height << std::endl;
91 if(settings.contains(
"EyeX")) {
92 eye[0] = settings.value(
"EyeX").toDouble();
93 eye[1] = settings.value(
"EyeY").toDouble();
94 eye[2] = settings.value(
"EyeZ").toDouble();
95 std::cerr <<
"Setting new eye position to " << eye << std::endl;
99 if(settings.contains(
"CenterX")) {
100 center[0] = settings.value(
"CenterX").toDouble();
101 center[1] = settings.value(
"CenterY").toDouble();
102 center[2] = settings.value(
"CenterZ").toDouble();
103 std::cerr <<
"Setting new scene center to " << center << std::endl;
107 if(settings.contains(
"UpX")) {
108 up[0] = settings.value(
"UpX").toDouble();
109 up[1] = settings.value(
"UpY").toDouble();
110 up[2] = settings.value(
"UpZ").toDouble();
111 std::cerr <<
"Setting new up vector to " << up << std::endl;
116 if(settings.contains(
"BackgroundR")) {
117 background[0] = settings.value(
"BackgroundR").toDouble();
118 background[1] = settings.value(
"BackgroundG").toDouble();
119 background[2] = settings.value(
"BackgroundB").toDouble();
120 background[3] = settings.value(
"BackgroundA").toDouble();
121 std::cerr <<
"Setting new background color to " << background << std::endl;
146 bool FileViewPlugin::saveObject(
int , QString ) {
ACG::Vec3d upVector(int _viewer)
Get the current up vector.
const ACG::Vec3d sceneCenter(int _viewer)
Get the current scene center.
ACG::Vec3d eyePos(int _viewer)
Get the current viewer position.
DataType supportedType()
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
void lookAt(const ACG::Vec3d &_eye, const ACG::Vec3d &_center, const ACG::Vec3d &_up, int _viewer)
Set the look at transformation directly.
void setBackColor(OpenMesh::Vec4f _color)
Set the background color of the examiner widget.
void initializePlugin()
Initialize Plugin.