CMS 3D CMS Logo

IgSoHits Class Reference

Provides a minimal object to represent a series of points in space. More...

#include <IgOpenInventor/IgSoHits.h>

Inheritance diagram for IgSoHits:

IgSoShapeKit

List of all members.

Public Member Functions

 IgSoHits (void)
void initRZPhi (int n, const SbVec3f *pts)
void initRZPhi (int n, const float(*pts)[3])
void initXYZ (int n, const SbVec3f *pts)
void initXYZ (int n, const float(*pts)[3])

Static Public Member Functions

static void convertRZPhiToXYZ (const float *rzphi, float *xyz)
static void initClass (void)

Public Attributes

SoMFVec3f points

Protected Member Functions

virtual void refresh (void)

Private Member Functions

 SO_KIT_CATALOG_ENTRY_HEADER (pointset)
 SO_KIT_HEADER (IgSoHits)


Detailed Description

Provides a minimal object to represent a series of points in space.

Author:
G. Alverson

Definition at line 25 of file IgSoHits.h.


Constructor & Destructor Documentation

IgSoHits::IgSoHits ( void   ) 

Definition at line 25 of file IgSoHits.cc.

References FALSE, points, IgSoShapeKit::setUpConnections(), and TRUE.

00026 {
00027     SO_KIT_CONSTRUCTOR (IgSoHits);
00028     SO_KIT_ADD_FIELD (points, (0, 0, 0));
00029     SO_KIT_ADD_CATALOG_ENTRY (pointset, SoPointSet, FALSE, separator,\x0, TRUE);
00030     SO_KIT_INIT_INSTANCE ();
00031     setUpConnections (true, true);
00032 }


Member Function Documentation

void IgSoHits::convertRZPhiToXYZ ( const float *  rzphi,
float *  xyz 
) [static]

Definition at line 47 of file IgSoHits.cc.

References funct::cos(), and funct::sin().

Referenced by initRZPhi().

00048 {
00049     xyz [0] = rzphi [0] * cos (rzphi [2]);
00050     xyz [1] = rzphi [0] * sin (rzphi [2]);
00051     xyz [2] = rzphi [1];
00052 }

void IgSoHits::initClass ( void   )  [static]

Reimplemented from IgSoShapeKit.

Definition at line 22 of file IgSoHits.cc.

Referenced by initNodes(), and initShapes().

00023 { SO_KIT_INIT_CLASS (IgSoHits, IgSoShapeKit, "IgSoShapeKit"); }

void IgSoHits::initRZPhi ( int  n,
const SbVec3f *  pts 
)

void IgSoHits::initRZPhi ( int  n,
const float *  pts[3] 
)

Definition at line 73 of file IgSoHits.cc.

References convertRZPhiToXYZ(), i, and initXYZ().

00074 {
00075     std::vector<SbVec3f> xyz;
00076     xyz.reserve (n);
00077     for (int i = 0; i < n; ++i)
00078     {
00079         SbVec3f pt;
00080         convertRZPhiToXYZ (pts [n], &pt[0]);
00081         xyz.push_back (pt);
00082     }
00083     initXYZ (n, &xyz[0]);
00084 }

void IgSoHits::initXYZ ( int  n,
const SbVec3f *  pts 
)

Definition at line 66 of file IgSoHits.cc.

References points.

00067 {
00068     points.deleteValues (0);
00069     points.setValues (0, n, pts);
00070 }

void IgSoHits::initXYZ ( int  n,
const float *  pts[3] 
)

Definition at line 55 of file IgSoHits.cc.

References i, p, and points.

Referenced by initRZPhi().

00056 {
00057     points.deleteValues (0);
00058     std::vector<SbVec3f> p;
00059     p.reserve (n);
00060     for (int i = 0; i < n; ++i)
00061         p.push_back (pts [n]);
00062     points.setValues (0, n, &p [0]);
00063 }

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

Reimplemented from IgSoShapeKit.

Definition at line 35 of file IgSoHits.cc.

References points.

00036 {
00037     SoPointSet          *pointset = new SoPointSet;
00038     SoVertexProperty    *vtx = new SoVertexProperty;
00039 
00040     vtx->vertex = points;
00041     pointset->vertexProperty = vtx;
00042 
00043     setPart ("pointset", pointset);
00044 }

IgSoHits::SO_KIT_CATALOG_ENTRY_HEADER ( pointset   )  [private]

IgSoHits::SO_KIT_HEADER ( IgSoHits   )  [private]


Member Data Documentation

SoMFVec3f IgSoHits::points

Definition at line 34 of file IgSoHits.h.

Referenced by IgSoHits(), initXYZ(), and refresh().


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