00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
00024
00025 #ifndef __INVENTOR_UTILITIES_H__
00026 #define __INVENTOR_UTILITIES_H__
00027
00028
00029
00030
00031
00032
00033 #include <cstdio>
00034 #include <cassert>
00035
00036
00037 #include <iostream>
00038 #include <fstream>
00039 #include <sstream>
00040
00041
00042 #include <vector>
00043 #include <string>
00044
00045
00046
00047
00048
00049 #include <Inventor/Qt/SoQt.h>
00050 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
00051
00052
00053 #include <Inventor/SoOffscreenRenderer.h>
00054 #include <Inventor/SoOutput.h>
00055
00056
00057 #include <Inventor/sensors/SoTimerSensor.h>
00058
00059
00060 #include <Inventor/actions/SoWriteAction.h>
00061
00062
00063 #include <Inventor/events/SoMouseButtonEvent.h>
00064 #include <Inventor/events/SoLocation2Event.h>
00065 #include <Inventor/events/SoKeyboardEvent.h>
00066
00067
00068 #include <Inventor/nodes/SoEventCallback.h>
00069
00070 #include <Inventor/nodes/SoNode.h>
00071 #include <Inventor/nodes/SoCamera.h>
00072 #include <Inventor/nodes/SoPerspectiveCamera.h>
00073 #include <Inventor/nodes/SoSeparator.h>
00074 #include <Inventor/nodes/SoSwitch.h>
00075 #include <Inventor/nodes/SoPointLight.h>
00076 #include <Inventor/nodes/SoSeparator.h>
00077 #include <Inventor/nodes/SoLineSet.h>
00078 #include <Inventor/nodes/SoCoordinate3.h>
00079
00080
00081
00082 #include <Inventor/draggers/SoSpotLightDragger.h>
00083
00084
00085 #ifndef NO_VOLEON
00086 #include <VolumeViz/nodes/SoVolumeRendering.h>
00087 #endif
00088
00089 using namespace std;
00090
00091
00092
00093
00094
00095 SbVec3f ToSbVec3f (const vector<float> &v);
00096 vector<float> ToVector (const SbVec3f &SbV);
00097 SbVec3f InterpolateVec(const SbVec3f &v1, SbVec3f &v2, const float percent);
00098 SbRotation InterpolateRotations(const SbRotation &rot1,const SbRotation &rot2,const float percent);
00099 vector<float>InterpolatePos(const vector<float> &v1, const vector<float> &v2,const float percent);
00100
00101
00102
00103
00104
00105
00110 void SetCameraFromDragger(SoCamera *c,SoSpotLightDragger *d);
00111
00121 bool RenderFrameToDisk (const string &basename,const string &filetype,
00122 const int width, const int height,
00123 SoNode *root, size_t &frame_num, const SbColor &background);
00124
00125
00126
00129 void ListWriteFileTypes();
00130
00134 bool CheckTypeValid(const string &type);
00135
00141 bool LoadSpotLightDraggers(const string filename, SoSeparator *root, vector<SoSpotLightDragger *> &draggerVec);
00142
00143
00144
00149 bool SaveSpotLightDraggersAscii(const string &filename, vector<SoSpotLightDragger *> &draggerVec);
00150
00155 bool WriteSceneGraph (const string &filename, SoNode *root);
00156
00157
00160 bool CheckLibraryPath();
00161
00162 #endif // __INVENTOR_UTILITIES_H__