Coin Logo http://www.sim.no
http://www.coin3d.org

SoQtRenderArea.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  ("GPL") version 2 as published by the Free Software Foundation.
00009  *  See the file LICENSE.GPL at the root directory of this source
00010  *  distribution for additional information about the GNU GPL.
00011  *
00012  *  For using Coin with software that can not be combined with the GNU
00013  *  GPL, and for taking advantage of the additional benefits of our
00014  *  support services, please contact Systems in Motion about acquiring
00015  *  a Coin Professional Edition License.
00016  *
00017  *  See <URL:http://www.coin3d.org/> for more information.
00018  *
00019  *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
00020  *  <URL:http://www.sim.no/>.
00021  *
00022 \**************************************************************************/
00023 
00024 // src/Inventor/Qt/SoQtRenderArea.h.  Generated from SoGuiRenderArea.h.in by configure.
00025 
00026 #ifndef SOQT_RENDERAREA_H
00027 #define SOQT_RENDERAREA_H
00028 
00029 #include <Inventor/SbColor.h>
00030 #include <Inventor/SbViewportRegion.h>
00031 #include <Inventor/actions/SoGLRenderAction.h>
00032 #include <Inventor/SoSceneManager.h>
00033 
00034 #include <Inventor/Qt/SoQtGLWidget.h>
00035 
00036 class SbColor;
00037 class SoNode;
00038 class SoSelection;
00039 
00040 class SoQtDevice;
00041 // SoQtRenderAreaP is only used in the "friend class" statement in
00042 // the class definition, so this shouldn't really be necessary. But
00043 // the OSF1/cxx compiler complains if it's left out.
00044 class SoQtRenderAreaP;
00045 
00046 typedef SbBool SoQtRenderAreaEventCB(void * closure, QEvent * event);
00047 
00048 // *************************************************************************
00049 
00050 class SOQT_DLL_API SoQtRenderArea : public SoQtGLWidget {
00051   SOQT_OBJECT_HEADER(SoQtRenderArea, SoQtGLWidget);
00052 
00053 public:
00054   SoQtRenderArea(QWidget * parent = NULL,
00055                     const char * name = NULL,
00056                     SbBool embed = TRUE,
00057                     SbBool mouseInput = TRUE,
00058                     SbBool keyboardInput = TRUE);
00059   ~SoQtRenderArea();
00060 
00061   virtual void setSceneGraph(SoNode * scene);
00062   virtual SoNode * getSceneGraph(void);
00063   void setOverlaySceneGraph(SoNode * scene);
00064   SoNode * getOverlaySceneGraph(void);
00065 
00066   void setBackgroundColor(const SbColor & color);
00067   const SbColor & getBackgroundColor(void) const;
00068   void setBackgroundIndex(int idx);
00069   int getBackgroundIndex(void) const;
00070   void setOverlayBackgroundIndex(int idx);
00071   int getOverlayBackgroundIndex(void) const;
00072   void setColorMap(int start, int num, const SbColor * colors);
00073   void setOverlayColorMap(int start, int num, const SbColor * colors);
00074   void setViewportRegion(const SbViewportRegion & newRegion);
00075   const SbViewportRegion & getViewportRegion(void) const;
00076   void setTransparencyType(SoGLRenderAction::TransparencyType type);
00077   SoGLRenderAction::TransparencyType getTransparencyType(void) const;
00078   void setAntialiasing(SbBool smoothing, int numPasses);
00079   void getAntialiasing(SbBool & smoothing, int & numPasses) const;
00080   void setClearBeforeRender(SbBool enable, SbBool zbEnable = TRUE);
00081   SbBool isClearBeforeRender(void) const;
00082   SbBool isClearZBufferBeforeRender(void) const;
00083   void setClearBeforeOverlayRender(SbBool enable);
00084   SbBool isClearBeforeOverlayRender(void) const;
00085   void setAutoRedraw(SbBool enable);
00086   SbBool isAutoRedraw(void) const;
00087   void setRedrawPriority(uint32_t priority);
00088   uint32_t getRedrawPriority(void) const;
00089   static uint32_t getDefaultRedrawPriority(void);
00090   void render(void);
00091   void renderOverlay(void);
00092   void scheduleRedraw(void);
00093   void scheduleOverlayRedraw(void);
00094   void redrawOnSelectionChange(SoSelection * selection);
00095   void redrawOverlayOnSelectionChange(SoSelection * selection);
00096   void setEventCallback(SoQtRenderAreaEventCB * func, void * user = NULL);
00097   void setSceneManager(SoSceneManager * manager);
00098   SoSceneManager * getSceneManager(void) const;
00099   void setOverlaySceneManager(SoSceneManager * manager);
00100   SoSceneManager * getOverlaySceneManager(void) const;
00101   void setGLRenderAction(SoGLRenderAction * action);
00102   SoGLRenderAction * getGLRenderAction(void) const;
00103   void setOverlayGLRenderAction(SoGLRenderAction * action);
00104   SoGLRenderAction * getOverlayGLRenderAction(void) const;
00105 
00106   SbBool sendSoEvent(const SoEvent * event);
00107 
00108   void registerDevice(SoQtDevice * device);
00109   void unregisterDevice(SoQtDevice * device);
00110 
00111 
00112 protected:
00113   SoQtRenderArea(QWidget * parent,
00114                     const char * name,
00115                     SbBool embed,
00116                     SbBool mouseInput,
00117                     SbBool keyboardInput,
00118                     SbBool build);
00119 
00120   virtual void redraw(void);
00121   virtual void actualRedraw(void);
00122   virtual void redrawOverlay(void);
00123   virtual void actualOverlayRedraw(void);
00124 
00125   virtual SbBool processSoEvent(const SoEvent * const event);
00126   virtual void processEvent(QEvent * event);
00127   virtual void initGraphic(void);
00128   virtual void initOverlayGraphic(void);
00129   virtual void sizeChanged(const SbVec2s & size);
00130   virtual void widgetChanged(QWidget * widget);
00131   virtual void afterRealizeHook(void);
00132 
00133   QWidget * buildWidget(QWidget * parent);
00134 
00135   virtual const char * getDefaultWidgetName(void) const;
00136   virtual const char * getDefaultTitle(void) const;
00137   virtual const char * getDefaultIconTitle(void) const;
00138 
00139   virtual SbBool glScheduleRedraw(void);
00140 
00141 private:
00142   class SoQtRenderAreaP * pimpl;
00143   friend class SoQtRenderAreaP;
00144 };
00145 
00146 // *************************************************************************
00147 
00148 #endif // ! SOQT_RENDERAREA_H

Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.

Generated on Mon Mar 27 00:38:51 2006 for SoQt by Doxygen. 1.4.6