18#include "Inventor/SoPath.h"
19#include "Inventor/nodes/SoSeparator.h"
54 m_d->controllerBuilt =
false;
65 m_d->rootR =
new SoSeparator();
66 m_d->rootE =
new SoSeparator();
67 m_d->root->addChild(
m_d->rootR);
68 m_d->root->addChild(
m_d->rootE);
72 m_d->root->setName(QString(
name+
"_SceneGraph").
replace(
' ',
'_').toStdString().c_str());
73 m_d->rootE->setName(QString(
name+
"_EventSceneGraph").
replace(
' ',
'_').toStdString().c_str());
74 m_d->rootR->setName(QString(
name+
"_PermanentSceneGraph").
replace(
' ',
'_').toStdString().c_str());
75 m_d->wasrefreshed=
false;
76 m_d->wascreated=
false;
92 if (
m_d->controllerBuilt)
94 m_d->controllerBuilt=
true;
111 std::cout<<
"IVP13DSystemSimple::Imp::made_selection Error: Could not find system pointer!"<<std::endl;
115 SoFullPath *fPath =
static_cast<SoFullPath *
>(path);
118 SoNode *selectedNode = fPath->getTail();
123 std::cout <<
"selected nodes: " << system->
m_d->
root->getNumSelected() <<
", " << system->
m_d->
root->getPath(0) << std::endl;
129 return static_cast<SoSeparator*
>(
m_d->root);
138 assert(!
m_d->wasrefreshed);
139 assert(!
m_d->wascreated);
141 m_d->wascreated=
true;
142 m_d->wasrefreshed=
false;
148 assert(
m_d->wascreated);
149 assert(!
m_d->wasrefreshed);
153 messageVerbose(
"IVP13DSystemSimple first refresh - so calling create methods (i.e. delayed create).");
157 m_d->root->removeChild(
m_d->rootR);
159 m_d->root->addChild(
m_d->rootR);
162 m_d->root->removeChild(
m_d->rootE);
166 m_d->root->addChild(
m_d->rootE);
168 m_d->wasrefreshed=
true;
178 assert(
m_d->wascreated);
179 assert(
m_d->wasrefreshed);
181 bool saveE =
m_d->rootE->enableNotify(
false);
185 messageVerbose(
"IVP13DSystemSimple::erase() Removing all event objects from scene");
188 m_d->rootE->removeAllChildren();
191 m_d->rootE->enableNotify(
true);
195 m_d->wasrefreshed=
false;
209 assert(
m_d->wascreated);
210 assert(!
m_d->wasrefreshed);
211 m_d->rootE->enableNotify(
false);
212 m_d->rootR->enableNotify(
false);
214 m_d->root->removeAllChildren();
215 m_d->rootE->removeAllChildren();
216 m_d->rootR->removeAllChildren();
217 m_d->wascreated=
false;
223 QList<SoNode*> nodesR;
224 QList<SoNode*> nodesE;
225 m_d->getNodesWithDisabledNotifications(
m_d->rootR, nodesR);
226 m_d->getNodesWithDisabledNotifications(
m_d->rootE, nodesE);
227 if (!nodesR.isEmpty()) {
228 message(
"WARNING: Found "+
str(nodesR.count())+
" node"+QString(nodesR.count()>1?
"s":0)+
" with disabled notifications in permanent scenegraph:");
229 for (SoNode *
node : nodesR)
230 message(
" => Node ("+
str(
node)+
") of type "+QString(
node->getTypeId().getName().getString())+
", named "+QString(
node->getName().getString()));
232 if (!nodesE.isEmpty()) {
233 message(
"WARNING: Found "+
str(nodesE.count())+
" node"+QString(nodesE.count()>1?
"s":0)+
" with disabled notifications in event scenegraph:");
234 for (SoNode *
node : nodesE)
235 message(
" => Node ("+
str(
node)+
") of type "+QString(
node->getTypeId().getName().getString())+
", named "+QString(
node->getName().getString()));
242 const int n =
gr->getNumChildren();
243 for (
int i = 0; i < n; ++i) {
244 SoNode * child =
gr->getChild(i);
245 if (!child->isNotifyEnabled())
247 if (child->getTypeId().isDerivedFrom(SoGroup::getClassTypeId()))
IVP13DSystemSimple * theclass
static void made_selection(void *userdata, SoPath *path)
void getNodesWithDisabledNotifications(SoGroup *, QList< SoNode * > &) const
SoCooperativeSelection * root
virtual void systemcreate(StoreGateSvc *detstore)
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
SoSeparator * getSceneGraph() const
void create(StoreGateSvc *detstore)
void refresh(StoreGateSvc *storegate)
virtual void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
virtual void buildPermanentSceneGraph(StoreGateSvc *detstore, SoSeparator *root)
virtual QWidget * buildController()
virtual void systemerase()
virtual ~IVP13DSystemSimple()
void warnOnDisabledNotifications() const
virtual void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)=0
void ensureBuildController()
virtual void systemuncreate()
void unregisterSelectionNode(SoCooperativeSelection *)
IVP13DSystem(const QString &name, const QString &information, const QString &contact_info)
void setUserSelectionNotificationsEnabled(SoCooperativeSelection *sel, bool enabled)
void registerSelectionNode(SoCooperativeSelection *)
void messageVerbose(const QString &) const
StoreGateSvc * detectorStore() const
void messageDebug(const QString &) const
const QString & name() const
void message(const QString &) const
void registerController(QWidget *)
const QString & information() const
const QString & contact_info() const
static void ensureInitClass()
The Athena Transient Store API.
const std::string selection
std::string replace(std::string s, const std::string &s2, const std::string &s3)