CMS 3D CMS Logo

IgSoSphereHit Class Reference

Draws SoSphere at arbitrary location with arbitrary scale. More...

#include <Iguana/Inventor/interface/IgSoSphereHit.h>

Inheritance diagram for IgSoSphereHit:

IgSoShapeKit

List of all members.

Public Member Functions

 IgSoSphereHit (void)

Static Public Member Functions

static void initClass (void)

Public Attributes

SoSFVec3f centre
SoSFFloat energy
SoSFFloat scale

Protected Member Functions

virtual void refresh (void)

Private Member Functions

 SO_KIT_CATALOG_ENTRY_HEADER (sphere)
 SO_KIT_CATALOG_ENTRY_HEADER (transform)
 SO_KIT_HEADER (IgSoSphereHit)


Detailed Description

Draws SoSphere at arbitrary location with arbitrary scale.

Definition at line 21 of file IgSoSphereHit.h.


Constructor & Destructor Documentation

IgSoSphereHit::IgSoSphereHit ( void   ) 

Definition at line 24 of file IgSoSphereHit.cc.

References centre, energy, FALSE, scale, IgSoShapeKit::setUpConnections(), and TRUE.

00025 {
00026     SO_KIT_CONSTRUCTOR (IgSoSphereHit);
00027     SO_KIT_ADD_FIELD (scale,  (1.0));
00028     SO_KIT_ADD_FIELD (energy, (1.0));
00029     SO_KIT_ADD_FIELD (centre, (0.0, 0.0, 0.0));
00030     SO_KIT_ADD_CATALOG_ENTRY (transform, SoTransform, FALSE, separator,\x0, TRUE);
00031     SO_KIT_ADD_CATALOG_ENTRY (sphere, SoSphere, FALSE, separator,\x0, TRUE);
00032     SO_KIT_INIT_INSTANCE ();
00033     setUpConnections (true, true);
00034 }


Member Function Documentation

void IgSoSphereHit::initClass ( void   )  [static]

Reimplemented from IgSoShapeKit.

Definition at line 21 of file IgSoSphereHit.cc.

Referenced by initNodes(), and initShapes().

00022 { SO_KIT_INIT_CLASS (IgSoSphereHit, IgSoShapeKit, "IgSoShapeKit"); }

void IgSoSphereHit::refresh ( void   )  [protected, virtual]

Reimplemented from IgSoShapeKit.

Definition at line 37 of file IgSoSphereHit.cc.

References centre, energy, NULL, scale, and funct::sqrt().

00038 {
00039     if (energy.getValue () < 0)
00040     {   
00041         setPart ("transform", NULL);
00042         setPart ("sphere", NULL);
00043         return;
00044     }
00045     
00046 
00047     SoTransform *transform = new SoTransform;
00048     SoSphere    *sphere = new SoSphere;
00049 
00050     // 2D projected area scales with energy, centred at the requested position
00051     sphere->radius = sqrt (energy.getValue ()) * scale.getValue ();
00052     transform->translation = centre;
00053 
00054     setPart ("transform", transform);
00055     setPart ("sphere", sphere);
00056 }

IgSoSphereHit::SO_KIT_CATALOG_ENTRY_HEADER ( sphere   )  [private]

IgSoSphereHit::SO_KIT_CATALOG_ENTRY_HEADER ( transform   )  [private]

IgSoSphereHit::SO_KIT_HEADER ( IgSoSphereHit   )  [private]


Member Data Documentation

SoSFVec3f IgSoSphereHit::centre

Definition at line 33 of file IgSoSphereHit.h.

Referenced by IgSoSphereHit(), and refresh().

SoSFFloat IgSoSphereHit::energy

Definition at line 32 of file IgSoSphereHit.h.

Referenced by IgSoSphereHit(), and refresh().

SoSFFloat IgSoSphereHit::scale

Definition at line 31 of file IgSoSphereHit.h.

Referenced by IgSoSphereHit(), and refresh().


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