19 #include <Inventor/C/errors/debugerror.h>
20 #include <Inventor/nodes/SoSelection.h>
21 #include <Inventor/nodes/SoSeparator.h>
22 #include <Inventor/nodes/SoSwitch.h>
24 #include <Inventor/nodes/SoSphere.h>
35 #include <Inventor/nodes/SoIndexedFaceSet.h>
36 #include <Inventor/nodes/SoVertexProperty.h>
69 for (
int i = 0;
i<
g->getNumChildren();++
i) {
70 SoNode *
n =
g->getChild(
i);
86 SoGroup * newgroup(0);
87 if (
g->getTypeId().isDerivedFrom(SoSeparator::getClassTypeId()) &&
88 !
g->getTypeId().isDerivedFrom(SoSelection::getClassTypeId()) ) {
89 SoSeparator *
sep =
new SoSeparator;
90 SoSeparator * origsep =
static_cast<SoSeparator*
>(
g);
91 sep->renderCaching.setValue(origsep->renderCaching.getValue());
92 sep->boundingBoxCaching.setValue(origsep->boundingBoxCaching.getValue());
93 sep->renderCulling.setValue(origsep->renderCulling.getValue());
94 sep->pickCulling.setValue(origsep->pickCulling.getValue());
96 }
else if (
g->getTypeId().isDerivedFrom(SoSelection::getClassTypeId()) ) {
97 SoSelection *
sel =
new SoSelection;
98 SoSelection * origsel =
static_cast<SoSelection*
>(
g);
99 sel->renderCaching.setValue(origsel->renderCaching.getValue());
100 sel->boundingBoxCaching.setValue(origsel->boundingBoxCaching.getValue());
101 sel->renderCulling.setValue(origsel->renderCulling.getValue());
102 sel->pickCulling.setValue(origsel->pickCulling.getValue());
103 sel->policy.setValue(origsel->policy.getValue());
105 }
else if (
g->getTypeId().isDerivedFrom(SoSwitch::getClassTypeId()) ) {
106 SoSwitch *sw =
new SoSwitch;
107 sw->whichChild.setValue(
static_cast<SoSwitch*
>(
g)->whichChild.getValue());
111 newgroup =
new SoGroup;
115 newgroup->setName(
g->getName());
118 if (transferChildren)
119 for (
int i = 0;
i<
g->getNumChildren();++
i)
120 newgroup->addChild(
g->getChild(
i));
132 SoGroup * thegroup = convertToStandardGroupNode(
g,
false);
134 std::cout <<
"BAAAAAAAAAD!"<<std::endl;
135 for (
int i = 0;
i<
g->getNumChildren();++
i) {
136 SoNode *
n =
g->getChild(
i);
140 thegroup->addChild(standard);
142 std::cout <<
"BAD 1"<<std::endl;
148 std::cout <<
"BAD 2"<<std::endl;
178 thegroup->unrefNoDelete();
188 return n->getNodeType() & SoNode::EXTENSION;
197 T *
t =
static_cast<T*
>(
n);
198 SoNode * n_alt =
t->alternateRep.getValue();
202 t->generateAlternateRep();
203 n_alt =
t->alternateRep.getValue();
207 t->clearAlternateRep();
208 n_alt->unrefNoDelete();
213 n_alt->setName(
n->getName());
221 T *
t =
static_cast<T*
>(
n);
222 if (
t&&
t->alternateRep.getValue())
223 t->clearAlternateRep();
230 T *
t =
static_cast<T*
>(
n);
231 if (
t&&!
t->alternateRep.getValue()) {
232 t->generateAlternateRep();
233 t->clearAlternateRep();
245 if (
n->getTypeId().isDerivedFrom(SoCons::getClassTypeId()) )
return Imp::convertToAlternateRep<SoCons>(
n);
246 if (
n->getTypeId().isDerivedFrom(SoLAr::getClassTypeId()) )
return Imp::convertToAlternateRep<SoLAr>(
n);
248 if (
n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) )
return Imp::convertToAlternateRep<SoPcons>(
n);
249 if (
n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId()) )
return Imp::convertToAlternateRep<SoGenericBox>(
n);
250 if (
n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId()) )
return Imp::convertToAlternateRep<SoTubs>(
n);
251 if (
n->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId()) )
return Imp::convertToAlternateRep<SoPolyhedron>(
n);
252 if (
n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId()) )
return Imp::convertToAlternateRep<SoTessellated>(
n);
256 SoGroup *
g =
new SoGroup;
263 return n->getTypeId().isDerivedFrom(SoGroup::getClassTypeId());
269 for (
int i = 0;
i<
g->getNumChildren();++
i) {
270 SoNode *
n =
g->getChild(
i);
272 updateAllNullAlternativeReps(
static_cast<SoGroup*
>(
n));
274 if (
n->getTypeId().isDerivedFrom(SoCons::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoCons>(
n);
275 if (
n->getTypeId().isDerivedFrom(SoLAr::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoLAr>(
n);
277 if (
n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoPcons>(
n);
278 if (
n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoGenericBox>(
n);
279 if (
n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoTubs>(
n);
280 if (
n->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoPolyhedron>(
n);
281 if (
n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId()) )
return Imp::updateAlternateRepIfNull<SoTessellated>(
n);
299 for (
int i = 0;
i<
g->getNumChildren();++
i) {
300 SoNode *
n =
g->getChild(
i);
304 if (
n->getTypeId().isDerivedFrom(SoCons::getClassTypeId()) )
return Imp::clearAlternateRep<SoCons>(
n);
305 if (
n->getTypeId().isDerivedFrom(SoLAr::getClassTypeId()) )
return Imp::clearAlternateRep<SoLAr>(
n);
307 if (
n->getTypeId().isDerivedFrom(SoPcons::getClassTypeId()) )
return Imp::clearAlternateRep<SoPcons>(
n);
308 if (
n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId()) )
return Imp::clearAlternateRep<SoGenericBox>(
n);
309 if (
n->getTypeId().isDerivedFrom(SoTubs::getClassTypeId()) )
return Imp::clearAlternateRep<SoTubs>(
n);
310 if (
n->getTypeId().isDerivedFrom(SoPolyhedron::getClassTypeId()) )
return Imp::clearAlternateRep<SoPolyhedron>(
n);
311 if (
n->getTypeId().isDerivedFrom(SoTessellated::getClassTypeId()) )
return Imp::clearAlternateRep<SoTessellated>(
n);