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: 8549 $                                                         *
00038  *   $Author: moebius $                                                      *
00039  *   $Date: 2010-02-12 14:40:38 +0100 (Fr, 12. Feb 2010) $                   *
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/Scenegraph/DrawModes.hh>
00065 #include <ACG/GL/GLState.hh>
00066 #include <OpenFlipper/common/ViewerProperties.hh>
00067 
00070 namespace PluginFunctions {
00071 
00072 const int ALL_VIEWERS   = -2;
00073 const int ACTIVE_VIEWER = -1;
00074 
00075 const int VIEW_FREE   = 0;
00076 const int VIEW_TOP    = 1;
00077 const int VIEW_BOTTOM = 2;
00078 const int VIEW_LEFT   = 3;
00079 const int VIEW_RIGHT  = 4;
00080 const int VIEW_FRONT  = 5;
00081 const int VIEW_BACK   = 6;
00082 
00083 //=======================================
00084 // Get/set status of viewers
00087 //=======================================
00088 
00094 DLLEXPORT
00095 Viewer::ViewerProperties& viewerProperties(int _id = ACTIVE_VIEWER );
00096 
00100 //=======================================
00101 // View settings
00104 //=======================================
00105 
00114 DLLEXPORT
00115 void allowRotation(bool _mode, int _viewer = ACTIVE_VIEWER);
00116 
00124 DLLEXPORT
00125 bool allowRotation(int _viewer = ACTIVE_VIEWER);
00126 
00129 DLLEXPORT
00130 void setMainGLContext();
00131 
00132 
00141 DLLEXPORT
00142 void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up  , int _viewer = ACTIVE_VIEWER);
00143 
00152 DLLEXPORT
00153 void setScenePos(const ACG::Vec3d& _center, const double _radius  , int _viewer = ALL_VIEWERS);
00154 
00165 void setTrackBallCenter(const ACG::Vec3d& _center, int _viewer );
00166 
00167 
00178 const ACG::Vec3d trackBallCenter(const ACG::Vec3d& _center, int _viewer );
00179 
00189 DLLEXPORT
00190 void setScenePos(const ACG::Vec3d& _center  , int _viewer = ALL_VIEWERS);
00191 
00195 DLLEXPORT
00196 const ACG::Vec3d& sceneCenter( int _viewer = ALL_VIEWERS );
00197 
00202 DLLEXPORT
00203 double sceneRadius();
00204 
00205 DLLEXPORT
00211 double sceneRadius( int _viewer );
00212 
00223 DLLEXPORT
00224 void translate( const ACG::Vec3d &_vector  , int _viewer = ALL_VIEWERS);
00225 
00237 DLLEXPORT
00238 void rotate(const ACG::Vec3d&  _axis,
00239             const double       _angle,
00240             const ACG::Vec3d&  _center,
00241             int                _viewer = ALL_VIEWERS);
00242 
00243 
00251 DLLEXPORT
00252 void viewHome(int _viewer = ALL_VIEWERS);
00253 
00261 DLLEXPORT
00262 void viewAll(int _viewer = ALL_VIEWERS);
00263 
00270 DLLEXPORT
00271 ACG::Vec3d viewingDirection(int _viewer = ALL_VIEWERS);
00272 
00279 DLLEXPORT
00280 bool isProjectionOrthographic( int _viewer = ACTIVE_VIEWER );
00281 
00288 DLLEXPORT
00289 ACG::Vec3d eyePos(int _viewer = ACTIVE_VIEWER);
00290 
00297 DLLEXPORT
00298 ACG::Vec3d upVector(int _viewer = ALL_VIEWERS);
00299 
00306 DLLEXPORT
00307 void orthographicProjection( int _viewer = ALL_VIEWERS );
00308 
00315 DLLEXPORT
00316 void perspectiveProjection( int _viewer = ALL_VIEWERS );
00317 
00327 DLLEXPORT
00328 void setDrawMode( const ACG::SceneGraph::DrawModes::DrawMode _mode , int _viewer = ALL_VIEWERS);
00329 
00337 DLLEXPORT
00338 ACG::SceneGraph::DrawModes::DrawMode drawMode( int _viewer = ACTIVE_VIEWER );
00339 
00340 
00344 DLLEXPORT
00345 void setBackColor( OpenMesh::Vec4f _color);
00346 
00355 DLLEXPORT
00356 void setFixedView(int _mode, int _viewer = ACTIVE_VIEWER );
00357 
00358 
00362 //=======================================
00363 // Do animations in examiner viewer
00366 //=======================================
00367 
00373 DLLEXPORT
00374 void flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time=1000.0);
00375 
00378 }
00379 
00380 #endif //PLUGINFUNCTIONS_HH

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