All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
ef997f2259
commit
9fe130cd73
@@ -21,8 +21,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
|
||||
# include <Inventor/elements/SoOverrideElement.h>
|
||||
#include <Inventor/elements/SoOverrideElement.h>
|
||||
|
||||
|
||||
#include "SoFCInteractiveElement.h"
|
||||
@@ -33,37 +32,36 @@ SO_ELEMENT_SOURCE(SoFCInteractiveElement)
|
||||
|
||||
void SoFCInteractiveElement::initClass()
|
||||
{
|
||||
SO_ELEMENT_INIT_CLASS(SoFCInteractiveElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoFCInteractiveElement);
|
||||
SO_ELEMENT_INIT_CLASS(SoFCInteractiveElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoFCInteractiveElement);
|
||||
}
|
||||
|
||||
void SoFCInteractiveElement::init(SoState * /*state*/)
|
||||
void SoFCInteractiveElement::init(SoState* /*state*/)
|
||||
{
|
||||
this->interactiveMode = false;
|
||||
this->interactiveMode = false;
|
||||
}
|
||||
|
||||
SoFCInteractiveElement::~SoFCInteractiveElement() = default;
|
||||
|
||||
void SoFCInteractiveElement::set(SoState * const state, SoNode * const node, SbBool mode)
|
||||
void SoFCInteractiveElement::set(SoState* const state, SoNode* const node, SbBool mode)
|
||||
{
|
||||
auto elem = (SoFCInteractiveElement *)
|
||||
SoReplacedElement::getElement(state, classStackIndex, node);
|
||||
elem->setElt(mode);
|
||||
auto elem = (SoFCInteractiveElement*)SoReplacedElement::getElement(state, classStackIndex, node);
|
||||
elem->setElt(mode);
|
||||
}
|
||||
|
||||
SbBool SoFCInteractiveElement::get(SoState * const state)
|
||||
SbBool SoFCInteractiveElement::get(SoState* const state)
|
||||
{
|
||||
return SoFCInteractiveElement::getInstance(state)->interactiveMode;
|
||||
return SoFCInteractiveElement::getInstance(state)->interactiveMode;
|
||||
}
|
||||
|
||||
void SoFCInteractiveElement::setElt(SbBool mode)
|
||||
{
|
||||
this->interactiveMode = mode;
|
||||
this->interactiveMode = mode;
|
||||
}
|
||||
|
||||
const SoFCInteractiveElement * SoFCInteractiveElement::getInstance(SoState * state)
|
||||
const SoFCInteractiveElement* SoFCInteractiveElement::getInstance(SoState* state)
|
||||
{
|
||||
return (const SoFCInteractiveElement *) SoElement::getConstElement(state, classStackIndex);
|
||||
return (const SoFCInteractiveElement*)SoElement::getConstElement(state, classStackIndex);
|
||||
}
|
||||
|
||||
// ---------------------------------
|
||||
@@ -72,49 +70,49 @@ SO_ELEMENT_SOURCE(SoGLWidgetElement)
|
||||
|
||||
void SoGLWidgetElement::initClass()
|
||||
{
|
||||
SO_ELEMENT_INIT_CLASS(SoGLWidgetElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLWidgetElement);
|
||||
SO_ELEMENT_INIT_CLASS(SoGLWidgetElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLWidgetElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLWidgetElement);
|
||||
}
|
||||
|
||||
void SoGLWidgetElement::init(SoState * state)
|
||||
void SoGLWidgetElement::init(SoState* state)
|
||||
{
|
||||
inherited::init(state);
|
||||
this->window = nullptr;
|
||||
inherited::init(state);
|
||||
this->window = nullptr;
|
||||
}
|
||||
|
||||
SoGLWidgetElement::~SoGLWidgetElement() = default;
|
||||
|
||||
void SoGLWidgetElement::set(SoState * state, QOpenGLWidget * window)
|
||||
void SoGLWidgetElement::set(SoState* state, QOpenGLWidget* window)
|
||||
{
|
||||
auto elem = static_cast<SoGLWidgetElement *>
|
||||
(SoElement::getElement(state, classStackIndex));
|
||||
elem->window = window;
|
||||
auto elem = static_cast<SoGLWidgetElement*>(SoElement::getElement(state, classStackIndex));
|
||||
elem->window = window;
|
||||
}
|
||||
|
||||
void SoGLWidgetElement::get(SoState * state, QOpenGLWidget *& window)
|
||||
void SoGLWidgetElement::get(SoState* state, QOpenGLWidget*& window)
|
||||
{
|
||||
const auto that = static_cast<const SoGLWidgetElement *>
|
||||
(SoElement::getConstElement(state, classStackIndex));
|
||||
const auto that = static_cast<const SoGLWidgetElement*>(
|
||||
SoElement::getConstElement(state, classStackIndex)
|
||||
);
|
||||
window = that->window;
|
||||
}
|
||||
|
||||
void SoGLWidgetElement::push(SoState * state)
|
||||
void SoGLWidgetElement::push(SoState* state)
|
||||
{
|
||||
inherited::push(state);
|
||||
}
|
||||
|
||||
void SoGLWidgetElement::pop(SoState * state, const SoElement * prevTopElement)
|
||||
void SoGLWidgetElement::pop(SoState* state, const SoElement* prevTopElement)
|
||||
{
|
||||
inherited::pop(state, prevTopElement);
|
||||
}
|
||||
|
||||
SbBool SoGLWidgetElement::matches(const SoElement * /*element*/) const
|
||||
SbBool SoGLWidgetElement::matches(const SoElement* /*element*/) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
SoElement * SoGLWidgetElement::copyMatchInfo() const
|
||||
SoElement* SoGLWidgetElement::copyMatchInfo() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
@@ -125,49 +123,49 @@ SO_ELEMENT_SOURCE(SoGLRenderActionElement)
|
||||
|
||||
void SoGLRenderActionElement::initClass()
|
||||
{
|
||||
SO_ELEMENT_INIT_CLASS(SoGLRenderActionElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLRenderActionElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLRenderActionElement);
|
||||
SO_ELEMENT_INIT_CLASS(SoGLRenderActionElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLRenderActionElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLRenderActionElement);
|
||||
}
|
||||
|
||||
void SoGLRenderActionElement::init(SoState * state)
|
||||
void SoGLRenderActionElement::init(SoState* state)
|
||||
{
|
||||
inherited::init(state);
|
||||
this->glRenderAction = nullptr;
|
||||
inherited::init(state);
|
||||
this->glRenderAction = nullptr;
|
||||
}
|
||||
|
||||
SoGLRenderActionElement::~SoGLRenderActionElement() = default;
|
||||
|
||||
void SoGLRenderActionElement::set(SoState * state, SoGLRenderAction * action)
|
||||
void SoGLRenderActionElement::set(SoState* state, SoGLRenderAction* action)
|
||||
{
|
||||
auto elem = static_cast<SoGLRenderActionElement *>
|
||||
(SoElement::getElement(state, classStackIndex));
|
||||
elem->glRenderAction = action;
|
||||
auto elem = static_cast<SoGLRenderActionElement*>(SoElement::getElement(state, classStackIndex));
|
||||
elem->glRenderAction = action;
|
||||
}
|
||||
|
||||
void SoGLRenderActionElement::get(SoState * state, SoGLRenderAction * & action)
|
||||
void SoGLRenderActionElement::get(SoState* state, SoGLRenderAction*& action)
|
||||
{
|
||||
const auto that = static_cast<const SoGLRenderActionElement *>
|
||||
(SoElement::getConstElement(state, classStackIndex));
|
||||
const auto that = static_cast<const SoGLRenderActionElement*>(
|
||||
SoElement::getConstElement(state, classStackIndex)
|
||||
);
|
||||
action = that->glRenderAction;
|
||||
}
|
||||
|
||||
void SoGLRenderActionElement::push(SoState * state)
|
||||
void SoGLRenderActionElement::push(SoState* state)
|
||||
{
|
||||
inherited::push(state);
|
||||
}
|
||||
|
||||
void SoGLRenderActionElement::pop(SoState * state, const SoElement * prevTopElement)
|
||||
void SoGLRenderActionElement::pop(SoState* state, const SoElement* prevTopElement)
|
||||
{
|
||||
inherited::pop(state, prevTopElement);
|
||||
}
|
||||
|
||||
SbBool SoGLRenderActionElement::matches(const SoElement * /*element*/) const
|
||||
SbBool SoGLRenderActionElement::matches(const SoElement* /*element*/) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
SoElement * SoGLRenderActionElement::copyMatchInfo() const
|
||||
SoElement* SoGLRenderActionElement::copyMatchInfo() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
@@ -198,13 +196,13 @@ void SoGLWidgetNode::initClass()
|
||||
}
|
||||
|
||||
// Doc from superclass.
|
||||
void SoGLWidgetNode::doAction(SoAction * action)
|
||||
void SoGLWidgetNode::doAction(SoAction* action)
|
||||
{
|
||||
SoGLWidgetElement::set(action->getState(), this->window);
|
||||
}
|
||||
|
||||
// Doc from superclass.
|
||||
void SoGLWidgetNode::GLRender(SoGLRenderAction * action)
|
||||
void SoGLWidgetNode::GLRender(SoGLRenderAction* action)
|
||||
{
|
||||
SoGLWidgetNode::doAction(action);
|
||||
}
|
||||
@@ -215,59 +213,58 @@ SO_ELEMENT_SOURCE(SoGLVBOActivatedElement)
|
||||
|
||||
void SoGLVBOActivatedElement::initClass()
|
||||
{
|
||||
SO_ELEMENT_INIT_CLASS(SoGLVBOActivatedElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLVBOActivatedElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLVBOActivatedElement);
|
||||
SO_ELEMENT_INIT_CLASS(SoGLVBOActivatedElement, inherited);
|
||||
SO_ENABLE(SoGLRenderAction, SoGLVBOActivatedElement);
|
||||
SO_ENABLE(SoHandleEventAction, SoGLVBOActivatedElement);
|
||||
}
|
||||
|
||||
void SoGLVBOActivatedElement::init(SoState * state)
|
||||
void SoGLVBOActivatedElement::init(SoState* state)
|
||||
{
|
||||
inherited::init(state);
|
||||
this->active = false;
|
||||
inherited::init(state);
|
||||
this->active = false;
|
||||
}
|
||||
|
||||
SoGLVBOActivatedElement::~SoGLVBOActivatedElement() = default;
|
||||
|
||||
void SoGLVBOActivatedElement::set(SoState * state, SbBool active)
|
||||
void SoGLVBOActivatedElement::set(SoState* state, SbBool active)
|
||||
{
|
||||
auto elem = static_cast<SoGLVBOActivatedElement *>
|
||||
(SoElement::getElement(state, classStackIndex));
|
||||
elem->active = active;
|
||||
auto elem = static_cast<SoGLVBOActivatedElement*>(SoElement::getElement(state, classStackIndex));
|
||||
elem->active = active;
|
||||
}
|
||||
|
||||
void SoGLVBOActivatedElement::get(SoState * state, SbBool& active)
|
||||
void SoGLVBOActivatedElement::get(SoState* state, SbBool& active)
|
||||
{
|
||||
const auto self = static_cast<const SoGLVBOActivatedElement *>
|
||||
(SoElement::getConstElement(state, classStackIndex));
|
||||
const auto self = static_cast<const SoGLVBOActivatedElement*>(
|
||||
SoElement::getConstElement(state, classStackIndex)
|
||||
);
|
||||
active = self->active;
|
||||
if(active) {
|
||||
if (active) {
|
||||
uint32_t flags = SoOverrideElement::getFlags(state);
|
||||
if(flags & (SoOverrideElement::COLOR_INDEX|
|
||||
SoOverrideElement::DIFFUSE_COLOR|
|
||||
SoOverrideElement::MATERIAL_BINDING|
|
||||
SoOverrideElement::TRANSPARENCY|
|
||||
SoOverrideElement::NORMAL_VECTOR|
|
||||
SoOverrideElement::NORMAL_BINDING))
|
||||
if (flags
|
||||
& (SoOverrideElement::COLOR_INDEX | SoOverrideElement::DIFFUSE_COLOR
|
||||
| SoOverrideElement::MATERIAL_BINDING | SoOverrideElement::TRANSPARENCY
|
||||
| SoOverrideElement::NORMAL_VECTOR | SoOverrideElement::NORMAL_BINDING)) {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SoGLVBOActivatedElement::push(SoState * state)
|
||||
void SoGLVBOActivatedElement::push(SoState* state)
|
||||
{
|
||||
inherited::push(state);
|
||||
}
|
||||
|
||||
void SoGLVBOActivatedElement::pop(SoState * state, const SoElement * prevTopElement)
|
||||
void SoGLVBOActivatedElement::pop(SoState* state, const SoElement* prevTopElement)
|
||||
{
|
||||
inherited::pop(state, prevTopElement);
|
||||
}
|
||||
|
||||
SbBool SoGLVBOActivatedElement::matches(const SoElement * /*element*/) const
|
||||
SbBool SoGLVBOActivatedElement::matches(const SoElement* /*element*/) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
SoElement * SoGLVBOActivatedElement::copyMatchInfo() const
|
||||
SoElement* SoGLVBOActivatedElement::copyMatchInfo() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user