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

SoQtRenderArea.h
1 #ifndef SOQT_RENDERAREA_H
2 #define SOQT_RENDERAREA_H
3 
4 // src/Inventor/Qt/SoQtRenderArea.h. Generated from SoGuiRenderArea.h.in by configure.
5 
6 /**************************************************************************\
7  *
8  * This file is part of the Coin 3D visualization library.
9  * Copyright (C) by Kongsberg Oil & Gas Technologies.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * ("GPL") version 2 as published by the Free Software Foundation.
14  * See the file LICENSE.GPL at the root directory of this source
15  * distribution for additional information about the GNU GPL.
16  *
17  * For using Coin with software that can not be combined with the GNU
18  * GPL, and for taking advantage of the additional benefits of our
19  * support services, please contact Kongsberg Oil & Gas Technologies
20  * about acquiring a Coin Professional Edition License.
21  *
22  * See http://www.coin3d.org/ for more information.
23  *
24  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
25  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
26  *
27 \**************************************************************************/
28 
29 #include <Inventor/SbColor.h>
30 #include <Inventor/SbViewportRegion.h>
31 #include <Inventor/actions/SoGLRenderAction.h>
32 #include <Inventor/SoSceneManager.h>
33 
34 #include <Inventor/Qt/SoQtGLWidget.h>
35 
36 class SbColor;
37 class SoNode;
38 class SoSelection;
39 
40 class SoQtDevice;
41 // SoQtRenderAreaP is only used in the "friend class" statement in
42 // the class definition, so this shouldn't really be necessary. But
43 // the OSF1/cxx compiler complains if it's left out.
44 class SoQtRenderAreaP;
45 
46 typedef SbBool SoQtRenderAreaEventCB(void * closure, QEvent * event);
47 
48 // *************************************************************************
49 
50 class SOQT_DLL_API SoQtRenderArea : public SoQtGLWidget {
51  SOQT_OBJECT_HEADER(SoQtRenderArea, SoQtGLWidget);
52 
53 public:
54  SoQtRenderArea(QWidget * parent = NULL,
55  const char * name = NULL,
56  SbBool embed = TRUE,
57  SbBool mouseInput = TRUE,
58  SbBool keyboardInput = TRUE);
59  ~SoQtRenderArea();
60 
61  virtual void setSceneGraph(SoNode * scene);
62  virtual SoNode * getSceneGraph(void);
63  void setOverlaySceneGraph(SoNode * scene);
64  SoNode * getOverlaySceneGraph(void);
65 
66  void setBackgroundColor(const SbColor & color);
67  const SbColor & getBackgroundColor(void) const;
68  void setBackgroundIndex(int idx);
69  int getBackgroundIndex(void) const;
70  void setOverlayBackgroundIndex(int idx);
71  int getOverlayBackgroundIndex(void) const;
72  void setColorMap(int start, int num, const SbColor * colors);
73  void setOverlayColorMap(int start, int num, const SbColor * colors);
74  void setViewportRegion(const SbViewportRegion & newRegion);
75  const SbViewportRegion & getViewportRegion(void) const;
76  void setTransparencyType(SoGLRenderAction::TransparencyType type);
77  SoGLRenderAction::TransparencyType getTransparencyType(void) const;
78  void setAntialiasing(SbBool smoothing, int numPasses);
79  void getAntialiasing(SbBool & smoothing, int & numPasses) const;
80  void setClearBeforeRender(SbBool enable, SbBool zbEnable = TRUE);
81  SbBool isClearBeforeRender(void) const;
82  SbBool isClearZBufferBeforeRender(void) const;
83  void setClearBeforeOverlayRender(SbBool enable);
84  SbBool isClearBeforeOverlayRender(void) const;
85  void setAutoRedraw(SbBool enable);
86  SbBool isAutoRedraw(void) const;
87  void setRedrawPriority(uint32_t priority);
88  uint32_t getRedrawPriority(void) const;
89  static uint32_t getDefaultRedrawPriority(void);
90  void render(void);
91  void renderOverlay(void);
92  void scheduleRedraw(void);
93  void scheduleOverlayRedraw(void);
94  void redrawOnSelectionChange(SoSelection * selection);
95  void redrawOverlayOnSelectionChange(SoSelection * selection);
96  void setEventCallback(SoQtRenderAreaEventCB * func, void * user = NULL);
97  void setSceneManager(SoSceneManager * manager);
98  SoSceneManager * getSceneManager(void) const;
99  void setOverlaySceneManager(SoSceneManager * manager);
100  SoSceneManager * getOverlaySceneManager(void) const;
101  void setGLRenderAction(SoGLRenderAction * action);
102  SoGLRenderAction * getGLRenderAction(void) const;
103  void setOverlayGLRenderAction(SoGLRenderAction * action);
104  SoGLRenderAction * getOverlayGLRenderAction(void) const;
105 
106  SbBool sendSoEvent(const SoEvent * event);
107 
108  void registerDevice(SoQtDevice * device);
109  void unregisterDevice(SoQtDevice * device);
110 
111 
112 protected:
113  SoQtRenderArea(QWidget * parent,
114  const char * name,
115  SbBool embed,
116  SbBool mouseInput,
117  SbBool keyboardInput,
118  SbBool build);
119 
120  virtual void redraw(void);
121  virtual void actualRedraw(void);
122  virtual void redrawOverlay(void);
123  virtual void actualOverlayRedraw(void);
124 
125  virtual SbBool processSoEvent(const SoEvent * const event);
126  virtual void processEvent(QEvent * event);
127  virtual void initGraphic(void);
128  virtual void initOverlayGraphic(void);
129  virtual void sizeChanged(const SbVec2s & size);
130  virtual void widgetChanged(QWidget * widget);
131  virtual void afterRealizeHook(void);
132 
133  QWidget * buildWidget(QWidget * parent);
134 
135  virtual const char * getDefaultWidgetName(void) const;
136  virtual const char * getDefaultTitle(void) const;
137  virtual const char * getDefaultIconTitle(void) const;
138 
139  virtual SbBool glScheduleRedraw(void);
140 
141 private:
142  class SoQtRenderAreaP * pimpl;
143  friend class SoQtRenderAreaP;
144 };
145 
146 // *************************************************************************
147 
148 #endif // ! SOQT_RENDERAREA_H
virtual SbBool glScheduleRedraw(void)
Definition: SoQtGLWidget.cpp:719
virtual const char * getDefaultWidgetName(void) const
Definition: SoQtComponentCommon.cpp:290
The SoQtDevice class is the base class for the translation devices.The SoQt device classes provide gl...
Definition: SoQtDevice.h:64
virtual void initGraphic(void)
Definition: SoQtGLWidget.cpp:693
virtual void sizeChanged(const SbVec2s &size)
Definition: SoQtGLWidget.cpp:713
virtual void widgetChanged(QWidget *w)
Definition: SoQtGLWidget.cpp:559
The SoQtRenderArea class adds scenegraph handling and event management.The SoQtRenderArea class is a ...
Definition: SoQtRenderArea.h:50
virtual const char * getDefaultIconTitle(void) const
Definition: SoQtComponentCommon.cpp:315
virtual void redrawOverlay(void)
Definition: SoQtGLWidget.cpp:686
The SoQtGLWidget class manages OpenGL contexts.This is the basic, abstract component class which sets...
Definition: SoQtGLWidget.h:84
virtual void processEvent(QEvent *event)
Definition: SoQtGLWidget.cpp:566
virtual void redraw(void)=0
virtual void afterRealizeHook(void)
Definition: SoQtComponent.cpp:888
virtual void initOverlayGraphic(void)
Definition: SoQtGLWidget.cpp:705
virtual const char * getDefaultTitle(void) const
Definition: SoQtComponentCommon.cpp:303
QWidget * buildWidget(QWidget *parent)
Definition: SoQtGLWidget.cpp:232

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Feb 10 2017 for SoQt by Doxygen 1.8.5.