MeVisLab Toolbox Reference
SoCast.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3/*
4 *
5 _______________________________________________________________________
6 ____________ W W W . A W A K E I D E A S . C O M ______________
7 |
8 |
9 | Description:
10 | ...
11 |
12 | Author(s) : Felix Ritter
13 |
14 ____________ W W W . A W A K E I D E A S . C O M ______________
15 _______________________________________________________________________
16 */
17
18#ifndef _SoCast_H
19#define _SoCast_H
20
21#include "SoShadowSystem.h"
23
26class SoState;
27class SoColorPacker;
28
30
31template <class Type>
32inline Type SbDeg2Rad( Type val ) {
33 return (Type)(val * M_PI / 180.0);
34}
35template <class Type>
36inline Type SbRad2Deg( Type val ) {
37 return (Type)(val * 180.0 / M_PI);
38}
39
40// abstract node
41class SOSHADOW_CLASS_SPEC SoCast : public SoSeparator
42{
43 typedef SoSeparator inherited;
44
45 SO_NODE_ABSTRACT_HEADER(SoCast);
46
47 private:
48 SoColorPacker *_colorPacker;
49
50 protected:
53
54 protected:
57 virtual ~SoCast();
58
61
64
71
78
84
90
91 public:
93 enum LightMode {
96 CAMERA
97 };
98
101
104
106
110
112
116
119
122
124
127 const SbVec4f &getCurLightDir() const { return _curlightPos; }
128
130
131 SoEXTENDER public:
133
136
138
142 const SbVec3f &getNearestPlaneVertex() { return _curPlaneArea[0]; }
143 const SbVec3f &getFarestPlaneVertex() { return _curPlaneArea[3]; }
144
145 virtual const SbVec3f &getFarestSceneVertex() { return _curPlaneArea[3]; }
146
147 SoINTERNAL public:
148 static void initClass();
149};
150
152
153#endif // SoCast
#define __MEVIS_IV_END_NAMESPACE
Definition OIVConfig.h:40
#define __MEVIS_IV_BEGIN_NAMESPACE
Definition OIVConfig.h:39
__MEVIS_IV_BEGIN_NAMESPACE Type SbDeg2Rad(Type val)
Definition SoCast.h:32
Type SbRad2Deg(Type val)
Definition SoCast.h:36
#define SOSHADOW_CLASS_SPEC
Define a class export specifier needed to make the class exportable in dll's.
const SbVec3f & getNearestPlaneVertex()
Definition SoCast.h:142
virtual const SbVec3f & getFarestSceneVertex()
Definition SoCast.h:145
virtual SbMatrix getCastMatrix(SoState *)
SoCast()
Protected constructor.
SbBox3f getPlaneBoundingBox(SoState *state, SbBool usePlaneElement=FALSE)
Calculates bounding box for plane.
static void initClass()
const SbVec3f & getFarestPlaneVertex()
Definition SoCast.h:143
SoSFEnum lightMode
... . Default is (FREE).
Definition SoCast.h:103
SoSFBool castRender
Enable/disable cast render pass. Default is (TRUE).
Definition SoCast.h:121
SbGroundplane _curPlaneArea
Definition SoCast.h:52
SoSFVec4f lightPos
Direction of the light. Default is (-1,-1,-1,0).
Definition SoCast.h:100
void GLRenderBelowPath(SoGLRenderAction *action) override
SoSFFloat planeAngle
Rotation around camera side vector. Default is (SbDeg2Rad<float>(40)).
Definition SoCast.h:115
virtual void commonGLRender(SoGLRenderAction *action)
void GLRenderInPath(SoGLRenderAction *action) override
virtual void castRenderSetup(SoGLRenderAction *)
SbVec4f _curlightPos
Definition SoCast.h:51
SbPlane cameraToPlane(SoState *state, SbGroundplane &area)
Calculates plane and plane vertices from viewing state.
virtual void normalRenderSetup(SoGLRenderAction *)
Definition SoCast.h:70
SoSFPlane projectionPlane
Plane to cast projected model onto. Default is ((0, 1, 0), 0).
Definition SoCast.h:109
void getBoundingBox(SoGetBoundingBoxAction *action) override
SoSFColor castColor
Color used to draw projected shapes. Default is (0.65, 0.62, 0.51).
Definition SoCast.h:118
const SbVec4f & getCurLightDir() const
Return the vector used to setup the current cast matrix.
Definition SoCast.h:127
void adjustCurrentCameraClippingPlanes(SoState *state)
virtual ~SoCast()
void animatePlaneAngleAssignment(float newAngle)
LightMode
How to cast regarding the light.
Definition SoCast.h:93
@ FREE
The field "lightPos" is used.
Definition SoCast.h:94
@ PLANE
Light is perpendicular to the shadow plane.
Definition SoCast.h:95
Target mlrange_cast(Source arg)
Generic version of checked ML casts.