CMS 3D CMS Logo

IgSo2DArrow Class Reference

An arrow in the (x,y) plane along the x axis, with total length length. The arrowhead heigth is headHeight and its length lengthRatio*length. More...

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

Inheritance diagram for IgSo2DArrow:

IgSoShapeKit

List of all members.

Public Member Functions

 IgSo2DArrow (void)

Static Public Member Functions

static void initClass (void)

Public Attributes

SoSFFloat headHeight
SoSFFloat length
SoSFFloat lengthRatio

Protected Member Functions

virtual void refresh (void)

Private Member Functions

 SO_KIT_CATALOG_ENTRY_HEADER (head)
 SO_KIT_CATALOG_ENTRY_HEADER (line)
 SO_KIT_HEADER (IgSo2DArrow)


Detailed Description

An arrow in the (x,y) plane along the x axis, with total length length. The arrowhead heigth is headHeight and its length lengthRatio*length.

Author:
Laurent Duflot
Date:
April 2002

Definition at line 27 of file IgSo2DArrow.h.


Constructor & Destructor Documentation

IgSo2DArrow::IgSo2DArrow ( void   ) 

Definition at line 25 of file IgSo2DArrow.cc.

References f, FALSE, headHeight, length, lengthRatio, parsecf::pyparsing::line(), IgSoShapeKit::setUpConnections(), and TRUE.

00026 {
00027     SO_KIT_CONSTRUCTOR (IgSo2DArrow);
00028     SO_KIT_ADD_FIELD (length, (1.0f));
00029     SO_KIT_ADD_FIELD (lengthRatio, (0.1f));
00030     SO_KIT_ADD_FIELD (headHeight, (0.05f));
00031     SO_KIT_ADD_CATALOG_ENTRY (line, SoLineSet, FALSE, separator,\x0, TRUE);
00032     SO_KIT_ADD_CATALOG_ENTRY (head, SoFaceSet, FALSE, separator,\x0, TRUE);
00033     SO_KIT_INIT_INSTANCE ();
00034     setUpConnections (true, true);
00035 }


Member Function Documentation

void IgSo2DArrow::initClass ( void   )  [static]

Reimplemented from IgSoShapeKit.

Definition at line 22 of file IgSo2DArrow.cc.

Referenced by initNodes(), and initShapes().

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

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

Reimplemented from IgSoShapeKit.

Definition at line 38 of file IgSo2DArrow.cc.

References f, headHeight, hh, edm::es::l(), length, lengthRatio, and parsecf::pyparsing::line().

00039 {
00040     SoLineSet           *line = new SoLineSet;
00041     SoFaceSet           *head = new SoFaceSet;
00042     SoVertexProperty    *vtx;
00043 
00044     float               lRatio = lengthRatio.getValue ();
00045     float               hh = headHeight.getValue ();
00046     float               l = length.getValue ();
00047 
00048     // line
00049     vtx = new SoVertexProperty;
00050     vtx->vertex.set1Value (0, 0.f, 0.f, 0.f);
00051     vtx->vertex.set1Value (1, (1.f-lRatio)*l, 0.f, 0.f);
00052     vtx->normal = SbVec3f (0.f,0.f,1.f);
00053     line->numVertices = 2;
00054     line->vertexProperty = vtx;
00055 
00056     // head
00057     vtx = new SoVertexProperty;
00058     vtx->vertex.set1Value (0, (1.f-lRatio)*l, -.5f*hh, 0.f);
00059     vtx->vertex.set1Value (1, l, 0.f, 0.f);
00060     vtx->vertex.set1Value (2, (1.f-lRatio)*l, .5f*hh, 0.f);
00061     vtx->normal = SbVec3f (0.f,0.f,1.f);
00062     head->numVertices = 3;
00063     head->vertexProperty = vtx;
00064 
00065     setPart ("line", line);
00066     setPart ("head", head);
00067 }

IgSo2DArrow::SO_KIT_CATALOG_ENTRY_HEADER ( head   )  [private]

IgSo2DArrow::SO_KIT_CATALOG_ENTRY_HEADER ( line   )  [private]

IgSo2DArrow::SO_KIT_HEADER ( IgSo2DArrow   )  [private]


Member Data Documentation

SoSFFloat IgSo2DArrow::headHeight

Definition at line 39 of file IgSo2DArrow.h.

Referenced by IgSo2DArrow(), and refresh().

SoSFFloat IgSo2DArrow::length

Definition at line 37 of file IgSo2DArrow.h.

Referenced by IgSo2DArrow(), and refresh().

SoSFFloat IgSo2DArrow::lengthRatio

Definition at line 38 of file IgSo2DArrow.h.

Referenced by IgSo2DArrow(), and refresh().


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