~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Gui/SoFCInteractiveElement.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
 
2
 *   Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
3
 *                                                                         *
4
4
 *   This file is part of the FreeCAD CAx development system.              *
5
5
 *                                                                         *
65
65
{
66
66
  return (const SoFCInteractiveElement *) SoElement::getConstElement(state, classStackIndex);
67
67
}
 
68
 
 
69
// ---------------------------------
 
70
 
 
71
SO_ELEMENT_SOURCE(SoGLWidgetElement);
 
72
 
 
73
void SoGLWidgetElement::initClass(void)
 
74
{
 
75
  SO_ELEMENT_INIT_CLASS(SoGLWidgetElement, inherited);
 
76
  SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
 
77
}
 
78
 
 
79
void SoGLWidgetElement::init(SoState * state)
 
80
{
 
81
  inherited::init(state);
 
82
  this->window = 0;
 
83
}
 
84
 
 
85
SoGLWidgetElement::~SoGLWidgetElement()
 
86
{
 
87
}
 
88
 
 
89
void SoGLWidgetElement::set(SoState * state, QGLWidget * window)
 
90
{
 
91
  SoGLWidgetElement * elem = static_cast<SoGLWidgetElement *>
 
92
        (SoElement::getElement(state, classStackIndex));
 
93
  elem->window = window;
 
94
}
 
95
 
 
96
void SoGLWidgetElement::get(SoState * state, QGLWidget *& window)
 
97
{
 
98
    const SoGLWidgetElement* that =  static_cast<const SoGLWidgetElement *>
 
99
        (SoElement::getConstElement(state, classStackIndex));
 
100
    window = that->window;
 
101
}
 
102
 
 
103
void SoGLWidgetElement::push(SoState * state)
 
104
{
 
105
    inherited::push(state);
 
106
}
 
107
 
 
108
void SoGLWidgetElement::pop(SoState * state, const SoElement * prevTopElement)
 
109
{
 
110
    inherited::pop(state, prevTopElement);
 
111
}
 
112
 
 
113
SbBool SoGLWidgetElement::matches(const SoElement * element) const
 
114
{
 
115
    return TRUE;
 
116
}
 
117
 
 
118
SoElement * SoGLWidgetElement::copyMatchInfo(void) const
 
119
{
 
120
    return 0;
 
121
}
 
122
 
 
123
// ---------------------------------
 
124
 
 
125
SO_ELEMENT_SOURCE(SoGLRenderActionElement);
 
126
 
 
127
void SoGLRenderActionElement::initClass(void)
 
128
{
 
129
  SO_ELEMENT_INIT_CLASS(SoGLRenderActionElement, inherited);
 
130
  SO_ENABLE(SoGLRenderAction, SoGLRenderActionElement);
 
131
}
 
132
 
 
133
void SoGLRenderActionElement::init(SoState * state)
 
134
{
 
135
  inherited::init(state);
 
136
  this->glRenderAction = 0;
 
137
}
 
138
 
 
139
SoGLRenderActionElement::~SoGLRenderActionElement()
 
140
{
 
141
}
 
142
 
 
143
void SoGLRenderActionElement::set(SoState * state, SoGLRenderAction * action)
 
144
{
 
145
  SoGLRenderActionElement * elem = static_cast<SoGLRenderActionElement *>
 
146
        (SoElement::getElement(state, classStackIndex));
 
147
  elem->glRenderAction = action;
 
148
}
 
149
 
 
150
void SoGLRenderActionElement::get(SoState * state, SoGLRenderAction * & action)
 
151
{
 
152
    const SoGLRenderActionElement* that =  static_cast<const SoGLRenderActionElement *>
 
153
        (SoElement::getConstElement(state, classStackIndex));
 
154
    action = that->glRenderAction;
 
155
}
 
156
 
 
157
void SoGLRenderActionElement::push(SoState * state)
 
158
{
 
159
    inherited::push(state);
 
160
}
 
161
 
 
162
void SoGLRenderActionElement::pop(SoState * state, const SoElement * prevTopElement)
 
163
{
 
164
    inherited::pop(state, prevTopElement);
 
165
}
 
166
 
 
167
SbBool SoGLRenderActionElement::matches(const SoElement * element) const
 
168
{
 
169
    return TRUE;
 
170
}
 
171
 
 
172
SoElement * SoGLRenderActionElement::copyMatchInfo(void) const
 
173
{
 
174
    return 0;
 
175
}
 
176
 
 
177
// ---------------------------------
 
178
 
 
179
SO_NODE_SOURCE(SoGLWidgetNode);
 
180
 
 
181
/*!
 
182
  Constructor.
 
183
*/
 
184
SoGLWidgetNode::SoGLWidgetNode(void) : window(0)
 
185
{
 
186
    SO_NODE_CONSTRUCTOR(SoGLWidgetNode);
 
187
}
 
188
 
 
189
/*!
 
190
  Destructor.
 
191
*/
 
192
SoGLWidgetNode::~SoGLWidgetNode()
 
193
{
 
194
}
 
195
 
 
196
// Doc from superclass.
 
197
void SoGLWidgetNode::initClass(void)
 
198
{
 
199
    SO_NODE_INIT_CLASS(SoGLWidgetNode, SoNode, "Node");
 
200
 
 
201
    SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
 
202
}
 
203
 
 
204
// Doc from superclass.
 
205
void SoGLWidgetNode::doAction(SoAction * action)
 
206
{
 
207
    SoGLWidgetElement::set(action->getState(), this->window);
 
208
}
 
209
 
 
210
// Doc from superclass.
 
211
void SoGLWidgetNode::GLRender(SoGLRenderAction * action)
 
212
{
 
213
    SoGLWidgetNode::doAction(action);
 
214
}