SoFrictionCone Class Reference
[libipsa classes]

Displays friction cones for friction between two bodies (off by default). More...

#include <SoFrictionCone.h>

Collaboration diagram for SoFrictionCone:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void addToGraph (SoSeparator *root)
virtual SoBaseKit * copy (SbBool copyConnections) const
virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways)
 SoFrictionCone ()

Static Public Member Functions

static void initClass ()
static void RemoveAllFrictionConesFromGraph (SoSeparator *root)

Public Attributes

SoSFVec3f color
SoSFVec3f contactNormal
SoSFVec3f contactPoint
SoSFFloat height
SoSFFloat radius
SoSFFloat scaling
SoSFFloat transparency

Static Public Attributes

static std::string FrictionConeSeparatorName = std::string("FrictionCones")

Protected Attributes

SoFieldSensor updateParametersSensor
SoSFTrigger updateParametersTrigger

Private Member Functions

 SO_KIT_CATALOG_ENTRY_HEADER (visualisation)
 SO_KIT_CATALOG_ENTRY_HEADER (material)
 SO_KIT_CATALOG_ENTRY_HEADER (transform)
 SO_KIT_CATALOG_ENTRY_HEADER (offsetTransform)
 SO_KIT_CATALOG_ENTRY_HEADER (resetTransform)
 SO_KIT_HEADER (SoFrictionCone)

Static Private Member Functions

static SoSeparator * GetFrictionConeSeparatorFromGraph (SoSeparator *root)
static void UpdateParametersCB (void *data, SoSensor *)


Detailed Description

Displays friction cones for friction between two bodies (off by default).

Defines a class which represents friction cones by contactPoint, contactNormal, radius and height.
Set SoPhysics::measureContactForces to TRUE (in the code or in the .iv file) to enable the visualisation of friction cones for a body.

Warning:
Do not set the visualisation or material properties manually as they will be overwritten by the fieldsensor update callback.

Definition at line 40 of file SoFrictionCone.h.


Constructor & Destructor Documentation

SoFrictionCone::SoFrictionCone (  ) 


Member Function Documentation

void SoFrictionCone::addToGraph ( SoSeparator *  root  ) 

Adds itself to the FrictionCone separator of the scenegraph supplied by root.

Parameters:
root Inventor scenegraph to add the friction cone visualisations to

Definition at line 204 of file SoFrictionCone.cpp.

References GetFrictionConeSeparatorFromGraph().

SoBaseKit * SoFrictionCone::copy ( SbBool  copyConnections  )  const [virtual]

The overwritten copy() method

Parameters:
copyConnections copy connections if true

Definition at line 158 of file SoFrictionCone.cpp.

SoSeparator * SoFrictionCone::GetFrictionConeSeparatorFromGraph ( SoSeparator *  root  )  [static, private]

Returns the separator with the name SoFrictionCone::FrictionConeSeparatorName which is situated below the separator specified by root. If it is not existent it is created.

Parameters:
root Inventor scenegraph in which the friction cone separator should be stored in
Returns:
SoSeparator* the separator all friction cones should be added to.

Definition at line 233 of file SoFrictionCone.cpp.

References FrictionConeSeparatorName.

Referenced by addToGraph(), and RemoveAllFrictionConesFromGraph().

void SoFrictionCone::initClass (  )  [static]

Initialises the class and it's type id variables.

Definition at line 112 of file SoFrictionCone.cpp.

void SoFrictionCone::RemoveAllFrictionConesFromGraph ( SoSeparator *  root  )  [static]

Removes all friction cones from the root scenegraph.

Parameters:
root Inventor scenegraph to remove the friction cone visualisations from

Definition at line 217 of file SoFrictionCone.cpp.

References GetFrictionConeSeparatorFromGraph().

Referenced by SoWorldPhysics::resetWorld(), and SoWorldPhysics::UpdateSingleWorldCB().

SbBool SoFrictionCone::setUpConnections ( SbBool  onOff,
SbBool  doItAlways 
) [virtual]

This method attaches/detaches SoFrictionCone::updateParametersTrigger to the SoFrictionCone::updateParametersSensor.

Parameters:
onOff attach sensors if TRUE, detach sensors if FALSE
doItAlways always perform attach/detach of sensors if this parameter is TRUE
Returns:
SbBool

Definition at line 175 of file SoFrictionCone.cpp.

References UpdateParametersCB(), updateParametersSensor, and updateParametersTrigger.

Referenced by SoFrictionCone().

SoFrictionCone::SO_KIT_CATALOG_ENTRY_HEADER ( visualisation   )  [private]

SoFrictionCone::SO_KIT_CATALOG_ENTRY_HEADER ( material   )  [private]

SoFrictionCone::SO_KIT_CATALOG_ENTRY_HEADER ( transform   )  [private]

SoFrictionCone::SO_KIT_CATALOG_ENTRY_HEADER ( offsetTransform   )  [private]

SoFrictionCone::SO_KIT_CATALOG_ENTRY_HEADER ( resetTransform   )  [private]

SoFrictionCone::SO_KIT_HEADER ( SoFrictionCone   )  [private]

void SoFrictionCone::UpdateParametersCB ( void *  data,
SoSensor *   
) [static, private]

The fieldsensor updated callback. It updates the parameters of the visualisation cone, the material properties like color and transparency as well as the transformations and the scaling. If the transparency is set smaller than 0 or greater than 1 it is reset to the appropriate upper or lower bound.

Parameters:
data pointer to the current friction cone

Definition at line 257 of file SoFrictionCone.cpp.

References color, contactNormal, contactPoint, height, radius, scaling, and transparency.

Referenced by setUpConnections(), and SoFrictionCone().


Member Data Documentation

The visualisation color of the friction cone (default = {1.0f, 0.5f, 0.5f}).

Definition at line 67 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

The normal along which to aling the friction cone (default = {1.0f, 0.0f, 0.0f}).

Definition at line 69 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

The contact point at which the friction cone should start (default = {0.0f, 0.0f, 0.0f}).

Definition at line 68 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

std::string SoFrictionCone::FrictionConeSeparatorName = std::string("FrictionCones") [static]

Name of the SoSeparator which is inserted into the inventor graph.

Definition at line 61 of file SoFrictionCone.h.

Referenced by GetFrictionConeSeparatorFromGraph().

The height of the friction cone (default = 1.0f).

Definition at line 63 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

The radius of the friction cone (default = 1.0f).

Definition at line 64 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

The amount the friction cone should be scaled up or down (default = 1.0f).

Definition at line 65 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

The amount of transparency used to display the friction cones (default = 0.0f). 0.0f is no transparancy.

Definition at line 66 of file SoFrictionCone.h.

Referenced by SoFrictionCone(), and UpdateParametersCB().

This sensor monitors the SoFrictionCone::updateParametersTrigger member and calls SoFrictionCone::UpdateParametersCB() if it changes.

Definition at line 73 of file SoFrictionCone.h.

Referenced by setUpConnections(), and SoFrictionCone().

This field is connected to SoFrictionCone::updateParametersSensor and triggers a change when any of the appended fields change their value.

Definition at line 72 of file SoFrictionCone.h.

Referenced by setUpConnections(), and SoFrictionCone().


The documentation for this class was generated from the following files:

Get IPSA - Inventor Physics Simulation API at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on Sat Mar 10 20:00:20 2012 for IPSA by  doxygen 1.5.8