Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FileBVH.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
5 * www.openflipper.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenFlipper. *
9 * *
10 * OpenFlipper is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenFlipper is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenFlipper. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36 * *
37 * $Revision: 7918 $ *
38 * $Author: wilden $ *
39 * $Date: 2009-12-15 10:05:44 +0100 (Tue, 15 Dec 2009) $ *
40 * *
41 \*===========================================================================*/
42 
43 #ifndef FILEBVHPLUGIN_HH
44 #define FILEBVHPLUGIN_HH
45 
46 #include <QObject>
47 
56 
58 
61 {
62  Q_OBJECT
63  Q_INTERFACES(FileInterface)
64  Q_INTERFACES(LoadSaveInterface)
65  Q_INTERFACES(LoggingInterface)
66  Q_INTERFACES(BaseInterface)
67  Q_INTERFACES(ScriptInterface)
68 
69  signals:
70  void openedFile( int _id );
71  void addEmptyObject( DataType _type, int& _id);
72  void load(QString _filename, DataType _type, int& _id);
73  void save(int _id , QString _filename );
74  void log(Logtype _type, QString _message);
75  void log(QString _message);
76  void updateView();
77 
78  void deleteObject( int _id );
79 
80  private slots:
81 
82  void fileOpened( int /*_id*/ ){};
83 
84  void noguiSupported() {};
85 
86  void initializePlugin();
87 
88  public :
89 
90  FileBVHPlugin();
91 
92  ~FileBVHPlugin() {};
93 
94  QString name() { return (QString("FileBVH")); };
95  QString description( ) { return (QString(tr("Load/Save BioVision Format"))); };
96 
97  DataType supportedType();
98 
99  QString getSaveFilters();
100  QString getLoadFilters();
101 
102  QWidget* saveOptionsWidget(QString /*_currentFilter*/);
103  QWidget* loadOptionsWidget(QString /*_currentFilter*/);
104 
105  private:
106 
107  bool writeSkeleton( std::ostream& _out, Skeleton& _skeleton );
108 
109  ACG::Vec3d convertToAxisRotation(ACG::Matrix4x4d& _rotationMatrix);
110 
111  bool ignoreJointScaling_;
112 
113  QWidget* loadOptions_;
114  QCheckBox* checkJointScaling_;
115  QPushButton* loadDefaultButton_;
116 
117  public slots:
118 
120  void slotLoadDefault();
121 
123  int loadObject(QString _filename);
124 
125  bool saveObject(int _id, QString _filename);
126 
127  QString version() { return QString("1.0"); };
128 
129 };
130 
131 #endif //FILEBVHPLUGIN_HH