IvfSceneBase.h

00001 //
00002 // Copyright 1999-2006 by Structural Mechanics, Lund University.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Library General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Library General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Library General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00017 // USA.
00018 //
00019 // Please report all bugs and problems to "ivf@byggmek.lth.se".
00020 //
00021 //
00022 // Written by Jonas Lindemann
00023 //
00024 
00025 #ifndef _CIvfSceneBase_h_
00026 #define _CIvfSceneBase_h_
00027 
00028 #include <ivf/IvfShape.h>
00029 #include <ivf/IvfCamera.h>
00030 #include <ivf/IvfLighting.h>
00031 
00032 #include <ivf/IvfCulling.h>
00033 #include <ivf/IvfBufferSelection.h>
00034 
00035 IvfSmartPointer(CIvfSceneBase);
00036 
00068 class IVF_API CIvfSceneBase : public CIvfShape {
00069 public:
00070         enum TLightMode {
00071                 LM_LOCAL,
00072                 LM_WORLD
00073         };
00074 
00075         enum TStereoMode {
00076                 SM_NONE,
00077                 SM_ANAGLYPH,
00078                 SM_QUAD_BUFFER
00079         };
00080 
00081         enum TAnaglyphColorPair {
00082                 CP_RED_GREEN,
00083                 CP_RED_BLUE,
00084                 CP_RED_CYAN
00085         };
00086 private:
00087         CIvfCompositePtr m_preComposite;
00088         CIvfCompositePtr m_composite;
00089         CIvfCompositePtr m_postComposite;
00090         CIvfViewPtr m_view;
00091         CIvfLightingPtr m_lighting;
00092         CIvfCullingPtr m_culling;
00093         CIvfBufferSelectionPtr m_selection;
00094 
00095         TLightMode m_lightMode;
00096         TStereoMode m_stereoMode;
00097         TAnaglyphColorPair m_colorPair;
00098 
00099         bool m_useCulling;
00100         bool m_dirty;
00101 
00102         void defaultRendering();
00103 public:
00104         void doResize(int width, int height);
00106         CIvfSceneBase();
00107 
00109         virtual ~CIvfSceneBase();
00110 
00111         IvfClassInfo("CIvfSceneBase",CIvfShape);
00112 
00114         virtual void setView(CIvfView* view);
00115 
00117         CIvfView* getView();
00118 
00120         void setCamera(CIvfCamera* camera);
00121 
00128         void setLightMode(TLightMode mode);
00129 
00131         TLightMode getLightMode();
00132 
00133         CIvfComposite* getPreComposite();
00134         CIvfComposite* getPostComposite();
00135 
00137         CIvfComposite* getComposite();
00138 
00140         void setUseCulling(bool flag);
00141 
00143         bool getUseCulling();
00144 
00146         int pick(int x, int y);
00147 
00149         void updateSelection();
00150 
00152         CIvfShape* getSelectedShape();
00153 
00155         void clear();
00156 
00158         void deleteAll();
00159 
00161         CIvfShape* removeChild(CIvfShape* shape);
00162 
00164         CIvfShape* removeChild(int idx);
00165 
00167         void addChild(CIvfShape* shape);
00168 
00169         CIvfCamera* getCamera();
00170 
00171         void setStereoMode(TStereoMode mode);
00172         void setAnaglyphColorPair(TAnaglyphColorPair colorPair);
00173         TAnaglyphColorPair getAnaglyphColorPair();
00174 
00175         CIvfSelectedShapesVector& getSelectedShapes();
00176         int getSelectionSize();
00177         CIvfShape* getSelectedShape(int idx);
00178         CIvfShape* removeShape(CIvfShape* shape);
00179 protected:
00180         virtual void createGeometry();
00181 };
00182 
00183 #endif 

Generated on Fri Sep 1 15:36:46 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO