InventorUtilities.H

Go to the documentation of this file.
00001 // $Revision: 1.1 $  $Author: schwehr $  $Date: 2004/11/26 15:23:44 $
00002 /*
00003     Copyright (C) 2004  Kurt Schwehr
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 */
00020 
00023 
00024 
00025 #ifndef __INVENTOR_UTILITIES_H__
00026 #define __INVENTOR_UTILITIES_H__
00027 
00028 /***************************************************************************
00029  * INCLUDES
00030  ***************************************************************************/
00031 
00032 // c includes
00033 #include <cstdio>
00034 #include <cassert>
00035 
00036 // C++ includes
00037 #include <iostream>
00038 #include <fstream>
00039 #include <sstream> // string stream
00040 
00041 // STL includes
00042 #include <vector>
00043 #include <string>
00044 
00045 //
00046 // Inventor/Coin
00047 //
00048 // SoQt
00049 #include <Inventor/Qt/SoQt.h>
00050 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
00051 
00052 // Top level includes
00053 #include <Inventor/SoOffscreenRenderer.h>
00054 #include <Inventor/SoOutput.h>
00055 
00056 // Sensors
00057 #include <Inventor/sensors/SoTimerSensor.h>
00058 
00059 // Actions
00060 #include <Inventor/actions/SoWriteAction.h>
00061 
00062 // Events
00063 #include <Inventor/events/SoMouseButtonEvent.h>
00064 #include <Inventor/events/SoLocation2Event.h>
00065 #include <Inventor/events/SoKeyboardEvent.h>
00066 
00067 // Nodes
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 // Draggers
00081 //#include <Inventor/draggers/SoTranslate1Dragger.h>
00082 #include <Inventor/draggers/SoSpotLightDragger.h>
00083 
00084 // Voleon Includes
00085 #ifndef NO_VOLEON
00086 #include <VolumeViz/nodes/SoVolumeRendering.h>
00087 #endif
00088 
00089 using namespace std;
00090 
00091 /***************************************************************************
00092  * Vector Utilities
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  * Utilities
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__

Generated on Thu Mar 2 17:55:25 2006 for density by  doxygen 1.4.6