#include <Iguana/GLModels/interface/Ig2DRep.h>
Public Member Functions | |
Ig2DRep (Ig2DModel *model, Ig2DRep *parent, Ig2DRep *prev, SoGroup *node) | |
virtual void | repositionChildren (void) |
Definition at line 22 of file Ig2DRep.h.
Definition at line 20 of file Ig2DRep.cc.
References Ig3DBaseRep::magic(), repositionChildren(), and scale.
00024 : Ig3DBaseRep (model, parent, prev, node) 00025 { 00026 // Translate by a fixed amount: the rep will have a scaling 00027 // operation in front which takes care of everything. 00028 SoTranslation *translation = new SoTranslation; 00029 translation->translation = SbVec3f (0, 0, 1); 00030 translation->setName ("LAYER_OFFSET"); 00031 magic ()->addChild (translation); 00032 00033 SoScale *scale = new SoScale; 00034 scale->setName ("SUBLAYER_SCALING"); 00035 magic ()->addChild (scale); 00036 00037 if (parent) 00038 parent->repositionChildren (); 00039 }
Definition at line 42 of file Ig2DRep.cc.
References ASSERT, Ig3DBaseRep::child(), Ig3DBaseRep::children(), Ig3DBaseRep::findMagic(), i, Ig3DBaseRep::node(), and scale.
Referenced by Ig2DRep().
00043 { 00044 for (int i = 0; i < children (); i++) 00045 { 00046 SoNode *node = child (i)->findMagic ("LAYER_OFFSET"); 00047 SoTranslation *translation = dynamic_cast<SoTranslation *>(node); 00048 ASSERT (translation); 00049 translation->translation = SbVec3f(0,0,i); 00050 } 00051 SoNode *node = findMagic ("SUBLAYER_SCALING"); 00052 SoScale *scale = dynamic_cast<SoScale *> (node); 00053 ASSERT (scale); 00054 scale->scaleFactor = SbVec3f (1, 1, 1./(children () + 1)); 00055 }