PluginFunctionsViewControls.hh

00001 /*===========================================================================*\
00002  *                                                                           *
00003  *                              OpenFlipper                                  *
00004  *      Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen      *
00005  *                           www.openflipper.org                             *
00006  *                                                                           *
00007  *---------------------------------------------------------------------------*
00008  *  This file is part of OpenFlipper.                                        *
00009  *                                                                           *
00010  *  OpenFlipper is free software: you can redistribute it and/or modify      *
00011  *  it under the terms of the GNU Lesser General Public License as           *
00012  *  published by the Free Software Foundation, either version 3 of           *
00013  *  the License, or (at your option) any later version with the              *
00014  *  following exceptions:                                                    *
00015  *                                                                           *
00016  *  If other files instantiate templates or use macros                       *
00017  *  or inline functions from this file, or you compile this file and         *
00018  *  link it with other files to produce an executable, this file does        *
00019  *  not by itself cause the resulting executable to be covered by the        *
00020  *  GNU Lesser General Public License. This exception does not however       *
00021  *  invalidate any other reasons why the executable file might be            *
00022  *  covered by the GNU Lesser General Public License.                        *
00023  *                                                                           *
00024  *  OpenFlipper is distributed in the hope that it will be useful,           *
00025  *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
00026  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
00027  *  GNU Lesser General Public License for more details.                      *
00028  *                                                                           *
00029  *  You should have received a copy of the GNU LesserGeneral Public          *
00030  *  License along with OpenFlipper. If not,                                  *
00031  *  see <http://www.gnu.org/licenses/>.                                      *
00032  *                                                                           *
00033 \*===========================================================================*/
00034 
00035 /*===========================================================================*\
00036  *                                                                           *
00037  *   $Revision: 7223 $                                                         *
00038  *   $Author: moebius $                                                      *
00039  *   $Date: 2009-09-30 08:54:50 +0200 (Mi, 30. Sep 2009) $                   *
00040  *                                                                           *
00041 \*===========================================================================*/
00042 
00043 
00044 
00045 
00046 //=============================================================================
00047 //
00048 //  Standard Functions
00049 //
00050 //=============================================================================
00051 
00057 //
00058 #ifndef PLUGINFUNCTIONS_VIEWCONTROL_HH
00059 #define PLUGINFUNCTIONS_VIEWCONTROL_HH
00060 
00061 #include <OpenFlipper/common/Types.hh>
00062 
00063 #include <ACG/Scenegraph/SceneGraph.hh>
00064 #include <ACG/GL/GLState.hh>
00065 #include <OpenFlipper/common/ViewerProperties.hh>
00066 
00069 namespace PluginFunctions {
00070 
00071 const int ALL_VIEWERS   = -2;
00072 const int ACTIVE_VIEWER = -1;
00073 
00074 const int VIEW_FREE   = 0;
00075 const int VIEW_TOP    = 1;
00076 const int VIEW_BOTTOM = 2;
00077 const int VIEW_LEFT   = 3;
00078 const int VIEW_RIGHT  = 4;
00079 const int VIEW_FRONT  = 5;
00080 const int VIEW_BACK   = 6;
00081 
00082 //=======================================
00083 // Get/set status of viewers
00086 //=======================================
00087 
00093 DLLEXPORT
00094 Viewer::ViewerProperties& viewerProperties(int _id = ACTIVE_VIEWER );
00095 
00099 //=======================================
00100 // View settings
00103 //=======================================
00104 
00113 DLLEXPORT
00114 void allowRotation(bool _mode, int _viewer = ACTIVE_VIEWER);
00115 
00123 DLLEXPORT
00124 bool allowRotation(int _viewer = ACTIVE_VIEWER);
00125 
00128 DLLEXPORT
00129 void setMainGLContext();
00130 
00131 
00140 DLLEXPORT
00141 void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up  , int _viewer = ACTIVE_VIEWER);
00142 
00151 DLLEXPORT
00152 void setScenePos(const ACG::Vec3d& _center, const double _radius  , int _viewer = ALL_VIEWERS);
00153 
00164 void setTrackBallCenter(const ACG::Vec3d& _center, int _viewer );
00165 
00166 
00177 const ACG::Vec3d trackBallCenter(const ACG::Vec3d& _center, int _viewer );
00178 
00188 DLLEXPORT
00189 void setScenePos(const ACG::Vec3d& _center  , int _viewer = ALL_VIEWERS);
00190 
00194 DLLEXPORT
00195 const ACG::Vec3d& sceneCenter( int _viewer = ALL_VIEWERS );
00196 
00201 DLLEXPORT
00202 double sceneRadius();
00203 
00204 DLLEXPORT
00210 double sceneRadius( int _viewer );
00211 
00222 DLLEXPORT
00223 void translate( const ACG::Vec3d &_vector  , int _viewer = ALL_VIEWERS);
00224 
00236 DLLEXPORT
00237 void rotate(const ACG::Vec3d&  _axis,
00238             const double       _angle,
00239             const ACG::Vec3d&  _center,
00240             int                _viewer = ALL_VIEWERS);
00241 
00242 
00250 DLLEXPORT
00251 void viewHome(int _viewer = ALL_VIEWERS);
00252 
00260 DLLEXPORT
00261 void viewAll(int _viewer = ALL_VIEWERS);
00262 
00269 DLLEXPORT
00270 ACG::Vec3d viewingDirection(int _viewer = ALL_VIEWERS);
00271 
00278 DLLEXPORT
00279 bool isProjectionOrthographic( int _viewer = ACTIVE_VIEWER );
00280 
00287 DLLEXPORT
00288 ACG::Vec3d eyePos(int _viewer = ACTIVE_VIEWER);
00289 
00296 DLLEXPORT
00297 ACG::Vec3d upVector(int _viewer = ALL_VIEWERS);
00298 
00305 DLLEXPORT
00306 void orthographicProjection( int _viewer = ALL_VIEWERS );
00307 
00314 DLLEXPORT
00315 void perspectiveProjection( int _viewer = ALL_VIEWERS );
00316 
00326 DLLEXPORT
00327 void setDrawMode( const unsigned int _mode , int _viewer = ALL_VIEWERS);
00328 
00336 DLLEXPORT
00337 unsigned int drawMode( int _viewer = ACTIVE_VIEWER );
00338 
00339 
00343 DLLEXPORT
00344 void setBackColor( OpenMesh::Vec4f _color);
00345 
00354 DLLEXPORT
00355 void setFixedView(int _mode, int _viewer = ACTIVE_VIEWER );
00356 
00357 
00361 //=======================================
00362 // Do animations in examiner viewer
00365 //=======================================
00366 
00372 DLLEXPORT
00373 void flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time=1000.0);
00374 
00377 }
00378 
00379 #endif //PLUGINFUNCTIONS_HH

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .