Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes

SoInvisibleLineDragger Class Reference

A line dragger with a shape given from outside. The shape is set by: More...

List of all members.

Public Member Functions

 SoInvisibleLineDragger ()
void setDirection (const SbVec3f &)

Static Public Member Functions

static void initClass ()
static const char * sKeyShape ()

Public Attributes

SbVec3f translation
SoCallbackList needsDirection
SbVec3f startPos

Protected Member Functions

 ~SoInvisibleLineDragger ()
void dragStart (void)
void drag (void)

Private Types

typedef SoDragger inherited

Private Member Functions

 SO_KIT_HEADER (SoInvisibleLineDragger)
 SO_KIT_CATALOG_ENTRY_HEADER (shape)

Static Private Member Functions

static void startCB (void *f, SoDragger *d)
static void motionCB (void *f, SoDragger *d)

Private Attributes

SbLineProjector * lineProj_

Detailed Description

A line dragger with a shape given from outside. The shape is set by:

    SoInvisibleLineDragger* dragger = new SoInvisibleLineDragger;
    dragger->ref();
    dragger->setPart( SoInvisibleLineDragger::sKeyShape(), new SoCube );

When the shape is clicked on, the startPos will be set and the needsDirection callbacks will be invoked. The outide world should then call the setDirection function to set the direction of the drag:

void MyClass::needsDirectionCB( void* data, void* d )
{
    SoInvisibleLineDragger* dragger = (SoInvisibleLineDragger*) d;
    SbVec3f dir = calculateDirection();
    dragger_->setDirection( dir );
}

The class will not change the motionMatrix, so the shape itself will not be moved. The class will not trigger the valueChanged callback on the baseclass - use the Start, Motion and Finish callbacks. The dragged translation is read in SoInvisibleLineDragger::translation following a Motion or Start callback.


Member Typedef Documentation

typedef SoDragger SoInvisibleLineDragger::inherited [private]

Constructor & Destructor Documentation

SoInvisibleLineDragger::SoInvisibleLineDragger (  ) 
SoInvisibleLineDragger::~SoInvisibleLineDragger (  )  [protected]

Member Function Documentation

void SoInvisibleLineDragger::drag ( void   )  [protected]
void SoInvisibleLineDragger::dragStart ( void   )  [protected]
static void SoInvisibleLineDragger::initClass (  )  [static]
static void SoInvisibleLineDragger::motionCB ( void *  f,
SoDragger *  d 
) [static, private]
void SoInvisibleLineDragger::setDirection ( const SbVec3f &   ) 
static const char* SoInvisibleLineDragger::sKeyShape (  )  [inline, static]
SoInvisibleLineDragger::SO_KIT_CATALOG_ENTRY_HEADER ( shape   )  [private]
SoInvisibleLineDragger::SO_KIT_HEADER ( SoInvisibleLineDragger   )  [private]
static void SoInvisibleLineDragger::startCB ( void *  f,
SoDragger *  d 
) [static, private]

Member Data Documentation

SbLineProjector* SoInvisibleLineDragger::lineProj_ [private]