CMS 3D CMS Logo

Ig2DRep Class Reference

#include <Iguana/GLModels/interface/Ig2DRep.h>

Inheritance diagram for Ig2DRep:

Ig3DBaseRep IgRep

List of all members.

Public Member Functions

 Ig2DRep (Ig2DModel *model, Ig2DRep *parent, Ig2DRep *prev, SoGroup *node)
virtual void repositionChildren (void)


Detailed Description

Definition at line 22 of file Ig2DRep.h.


Constructor & Destructor Documentation

Ig2DRep::Ig2DRep ( Ig2DModel model,
Ig2DRep parent,
Ig2DRep prev,
SoGroup *  node 
)

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 }


Member Function Documentation

void Ig2DRep::repositionChildren ( void   )  [virtual]

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 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:50 2009 for CMSSW by  doxygen 1.5.4