SoFCInteractiveElement.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "PreCompiled.h"
00025
00026 #include "SoFCInteractiveElement.h"
00027
00028 using namespace Gui;
00029
00030 SO_ELEMENT_SOURCE(SoFCInteractiveElement);
00031
00032 void SoFCInteractiveElement::initClass(void)
00033 {
00034 SO_ELEMENT_INIT_CLASS(SoFCInteractiveElement, inherited);
00035 SO_ENABLE(SoGLRenderAction, SoFCInteractiveElement);
00036 }
00037
00038 void SoFCInteractiveElement::init(SoState * state)
00039 {
00040 this->interactiveMode = false;
00041 }
00042
00043 SoFCInteractiveElement::~SoFCInteractiveElement()
00044 {
00045 }
00046
00047 void SoFCInteractiveElement::set(SoState * const state, SoNode * const node, SbBool mode)
00048 {
00049 SoFCInteractiveElement * elem = (SoFCInteractiveElement *)
00050 SoReplacedElement::getElement(state, classStackIndex, node);
00051 elem->setElt(mode);
00052 }
00053
00054 SbBool SoFCInteractiveElement::get(SoState * const state)
00055 {
00056 return SoFCInteractiveElement::getInstance(state)->interactiveMode;
00057 }
00058
00059 void SoFCInteractiveElement::setElt(SbBool mode)
00060 {
00061 this->interactiveMode = mode;
00062 }
00063
00064 const SoFCInteractiveElement * SoFCInteractiveElement::getInstance(SoState * state)
00065 {
00066 return (const SoFCInteractiveElement *) SoElement::getConstElement(state, classStackIndex);
00067 }
00068
00069
00070
00071 SO_ELEMENT_SOURCE(SoGLWidgetElement);
00072
00073 void SoGLWidgetElement::initClass(void)
00074 {
00075 SO_ELEMENT_INIT_CLASS(SoGLWidgetElement, inherited);
00076 SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
00077 SO_ENABLE(SoHandleEventAction, SoGLWidgetElement);
00078 }
00079
00080 void SoGLWidgetElement::init(SoState * state)
00081 {
00082 inherited::init(state);
00083 this->window = 0;
00084 }
00085
00086 SoGLWidgetElement::~SoGLWidgetElement()
00087 {
00088 }
00089
00090 void SoGLWidgetElement::set(SoState * state, QGLWidget * window)
00091 {
00092 SoGLWidgetElement * elem = static_cast<SoGLWidgetElement *>
00093 (SoElement::getElement(state, classStackIndex));
00094 elem->window = window;
00095 }
00096
00097 void SoGLWidgetElement::get(SoState * state, QGLWidget *& window)
00098 {
00099 const SoGLWidgetElement* that = static_cast<const SoGLWidgetElement *>
00100 (SoElement::getConstElement(state, classStackIndex));
00101 window = that->window;
00102 }
00103
00104 void SoGLWidgetElement::push(SoState * state)
00105 {
00106 inherited::push(state);
00107 }
00108
00109 void SoGLWidgetElement::pop(SoState * state, const SoElement * prevTopElement)
00110 {
00111 inherited::pop(state, prevTopElement);
00112 }
00113
00114 SbBool SoGLWidgetElement::matches(const SoElement * element) const
00115 {
00116 return TRUE;
00117 }
00118
00119 SoElement * SoGLWidgetElement::copyMatchInfo(void) const
00120 {
00121 return 0;
00122 }
00123
00124
00125
00126 SO_ELEMENT_SOURCE(SoGLRenderActionElement);
00127
00128 void SoGLRenderActionElement::initClass(void)
00129 {
00130 SO_ELEMENT_INIT_CLASS(SoGLRenderActionElement, inherited);
00131 SO_ENABLE(SoGLRenderAction, SoGLRenderActionElement);
00132 SO_ENABLE(SoHandleEventAction, SoGLRenderActionElement);
00133 }
00134
00135 void SoGLRenderActionElement::init(SoState * state)
00136 {
00137 inherited::init(state);
00138 this->glRenderAction = 0;
00139 }
00140
00141 SoGLRenderActionElement::~SoGLRenderActionElement()
00142 {
00143 }
00144
00145 void SoGLRenderActionElement::set(SoState * state, SoGLRenderAction * action)
00146 {
00147 SoGLRenderActionElement * elem = static_cast<SoGLRenderActionElement *>
00148 (SoElement::getElement(state, classStackIndex));
00149 elem->glRenderAction = action;
00150 }
00151
00152 void SoGLRenderActionElement::get(SoState * state, SoGLRenderAction * & action)
00153 {
00154 const SoGLRenderActionElement* that = static_cast<const SoGLRenderActionElement *>
00155 (SoElement::getConstElement(state, classStackIndex));
00156 action = that->glRenderAction;
00157 }
00158
00159 void SoGLRenderActionElement::push(SoState * state)
00160 {
00161 inherited::push(state);
00162 }
00163
00164 void SoGLRenderActionElement::pop(SoState * state, const SoElement * prevTopElement)
00165 {
00166 inherited::pop(state, prevTopElement);
00167 }
00168
00169 SbBool SoGLRenderActionElement::matches(const SoElement * element) const
00170 {
00171 return TRUE;
00172 }
00173
00174 SoElement * SoGLRenderActionElement::copyMatchInfo(void) const
00175 {
00176 return 0;
00177 }
00178
00179
00180
00181 SO_NODE_SOURCE(SoGLWidgetNode);
00182
00186 SoGLWidgetNode::SoGLWidgetNode(void) : window(0)
00187 {
00188 SO_NODE_CONSTRUCTOR(SoGLWidgetNode);
00189 }
00190
00194 SoGLWidgetNode::~SoGLWidgetNode()
00195 {
00196 }
00197
00198
00199 void SoGLWidgetNode::initClass(void)
00200 {
00201 SO_NODE_INIT_CLASS(SoGLWidgetNode, SoNode, "Node");
00202
00203 SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
00204 }
00205
00206
00207 void SoGLWidgetNode::doAction(SoAction * action)
00208 {
00209 SoGLWidgetElement::set(action->getState(), this->window);
00210 }
00211
00212
00213 void SoGLWidgetNode::GLRender(SoGLRenderAction * action)
00214 {
00215 SoGLWidgetNode::doAction(action);
00216 }