MeVisLab Toolbox Reference
SoCast Class Reference

#include <SoCast.h>

Inheritance diagram for SoCast:
SoShadowCast SoPickableShadowCast

Public Types

enum  LightMode { FREE , PLANE , CAMERA }
 How to cast regarding the light. More...
 

Public Member Functions

const SbVec4f & getCurLightDir () const
 Return the vector used to setup the current cast matrix. More...
 
void animatePlaneAngleAssignment (float newAngle)
 
void getBoundingBox (SoGetBoundingBoxAction *action) override
 
void GLRenderBelowPath (SoGLRenderAction *action) override
 
void GLRenderInPath (SoGLRenderAction *action) override
 
virtual void commonGLRender (SoGLRenderAction *action)
 
const SbVec3f & getNearestPlaneVertex ()
 
const SbVec3f & getFarestPlaneVertex ()
 
virtual const SbVec3f & getFarestSceneVertex ()
 

Static Public Member Functions

static void initClass ()
 

Public Attributes

SoSFVec4f lightPos
 Direction of the light. Default is (-1,-1,-1,0). More...
 
SoSFEnum lightMode
 ... . Default is (FREE). More...
 
SoSFPlane projectionPlane
 Plane to cast projected model onto. Default is ((0, 1, 0), 0). More...
 
SoSFFloat planeAngle
 Rotation around camera side vector. Default is (SbDeg2Rad<float>(40)). More...
 
SoSFColor castColor
 Color used to draw projected shapes. Default is (0.65, 0.62, 0.51). More...
 
SoSFBool castRender
 Enable/disable cast render pass. Default is (TRUE). More...
 

Protected Member Functions

 SoCast ()
 Protected constructor. More...
 
virtual ~SoCast ()
 
SbPlane cameraToPlane (SoState *state, SbGroundplane &area)
 Calculates plane and plane vertices from viewing state. More...
 
SbBox3f getPlaneBoundingBox (SoState *state, SbBool usePlaneElement=FALSE)
 Calculates bounding box for plane. More...
 
virtual void normalRenderSetup (SoGLRenderAction *)
 
virtual void castRenderSetup (SoGLRenderAction *)
 
virtual SbMatrix getCastMatrix (SoState *)
 
void adjustCurrentCameraClippingPlanes (SoState *state)
 

Protected Attributes

SbVec4f _curlightPos
 
SbGroundplane _curPlaneArea
 

Detailed Description

Definition at line 41 of file SoCast.h.

Member Enumeration Documentation

◆ LightMode

How to cast regarding the light.

Enumerator
FREE 

The field "lightPos" is used.

PLANE 

Light is perpendicular to the shadow plane.

CAMERA 

Light comes from the current camera.

Definition at line 93 of file SoCast.h.

Constructor & Destructor Documentation

◆ SoCast()

SoCast::SoCast ( )
protected

Protected constructor.

◆ ~SoCast()

virtual SoCast::~SoCast ( )
protectedvirtual

Member Function Documentation

◆ adjustCurrentCameraClippingPlanes()

void SoCast::adjustCurrentCameraClippingPlanes ( SoState *  state)
protected

Adjust camera clipping planes to contain the entire scene including shadow projection plane.

◆ animatePlaneAngleAssignment()

void SoCast::animatePlaneAngleAssignment ( float  newAngle)

◆ cameraToPlane()

SbPlane SoCast::cameraToPlane ( SoState *  state,
SbGroundplane area 
)
protected

Calculates plane and plane vertices from viewing state.

◆ castRenderSetup()

virtual void SoCast::castRenderSetup ( SoGLRenderAction *  )
protectedvirtual

Called from GLRender() before rendering traversal of model in cast-mode starts. SoShadowRenderElement will be set by GLRender().

◆ commonGLRender()

virtual void SoCast::commonGLRender ( SoGLRenderAction *  action)
virtual

Reimplemented in SoShadowCast.

◆ getBoundingBox()

void SoCast::getBoundingBox ( SoGetBoundingBoxAction *  action)
override

◆ getCastMatrix()

virtual SbMatrix SoCast::getCastMatrix ( SoState *  )
protectedvirtual

Returns a matrix projecting model vertices on a plane. Method is used by castRenderSetup().

◆ getCurLightDir()

const SbVec4f& SoCast::getCurLightDir ( ) const
inline

Return the vector used to setup the current cast matrix.

This value depends on the current lightMode.

Definition at line 127 of file SoCast.h.

◆ getFarestPlaneVertex()

const SbVec3f& SoCast::getFarestPlaneVertex ( )
inline

Definition at line 143 of file SoCast.h.

◆ getFarestSceneVertex()

virtual const SbVec3f& SoCast::getFarestSceneVertex ( )
inlinevirtual

Definition at line 145 of file SoCast.h.

◆ getNearestPlaneVertex()

const SbVec3f& SoCast::getNearestPlaneVertex ( )
inline

Used by viewers to extend clipping planes. Returns the nearest/farest plane vertex from the camera.

Definition at line 142 of file SoCast.h.

◆ getPlaneBoundingBox()

SbBox3f SoCast::getPlaneBoundingBox ( SoState *  state,
SbBool  usePlaneElement = FALSE 
)
protected

Calculates bounding box for plane.

◆ GLRenderBelowPath()

void SoCast::GLRenderBelowPath ( SoGLRenderAction *  action)
override

◆ GLRenderInPath()

void SoCast::GLRenderInPath ( SoGLRenderAction *  action)
override

◆ initClass()

static void SoCast::initClass ( )
static

◆ normalRenderSetup()

virtual void SoCast::normalRenderSetup ( SoGLRenderAction *  )
inlineprotectedvirtual

Called from GLRender() before normal rendering traversal of model starts. SoShadowRenderElement will be set by GLRender().

Definition at line 70 of file SoCast.h.

Member Data Documentation

◆ _curlightPos

SbVec4f SoCast::_curlightPos
protected

Definition at line 51 of file SoCast.h.

◆ _curPlaneArea

SbGroundplane SoCast::_curPlaneArea
protected

Definition at line 52 of file SoCast.h.

◆ castColor

SoSFColor SoCast::castColor

Color used to draw projected shapes. Default is (0.65, 0.62, 0.51).

Definition at line 118 of file SoCast.h.

◆ castRender

SoSFBool SoCast::castRender

Enable/disable cast render pass. Default is (TRUE).

Definition at line 121 of file SoCast.h.

◆ lightMode

SoSFEnum SoCast::lightMode

... . Default is (FREE).

Definition at line 103 of file SoCast.h.

◆ lightPos

SoSFVec4f SoCast::lightPos

Direction of the light. Default is (-1,-1,-1,0).

Definition at line 100 of file SoCast.h.

◆ planeAngle

SoSFFloat SoCast::planeAngle

Rotation around camera side vector. Default is (SbDeg2Rad<float>(40)).

Value is only used if field projectionPlane is ignored.

Definition at line 115 of file SoCast.h.

◆ projectionPlane

SoSFPlane SoCast::projectionPlane

Plane to cast projected model onto. Default is ((0, 1, 0), 0).

If the field is set to be ignored, compute plane from camera.

Definition at line 109 of file SoCast.h.


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