| 1 |
NAME SoDirectionalLightDragger SoDirLtDrag "" { directional icon you rotate and translate by dragging with the mouse } |
| 2 |
|
| 3 |
INCLUDE draggers/SoDirectionalLightDragger.h |
| 4 |
|
| 5 |
DESC { \cSoDirectionalLightDragger\. |
| 6 |
is a composite dragger. It looks like a sun with a large arrow coming |
| 7 |
out of it. |
| 8 |
The arrow can be rotated about the sun by dragging with the mouse; its |
| 9 |
orientation is given by the \vrotation\. field. |
| 10 |
You can also drag the sun (and the arrow with it) through 3-space. The |
| 11 |
location is stored in the \vtranslation\. field. |
| 12 |
\p |
| 13 |
The dragger uses an \cSoRotateSphericalDragger\. for changing the |
| 14 |
rotation. Instead of using the default spherical geometry, this dragger |
| 15 |
uses an arrow shape. |
| 16 |
\p |
| 17 |
The sun is an \cSoDragPointDragger\.. Dragging it edits the \vtranslation\. |
| 18 |
field; conversely, if you change the \vtranslation\. field the sun |
| 19 |
will move to that new location, bringing the arrow with it. The sun |
| 20 |
looks and behaves just like |
| 21 |
the sun in an \cSoPointLightDragger\., |
| 22 |
as does the \vmaterial\. part. See the \cSoPointLightDragger\. man page |
| 23 |
for details. |
| 24 |
\p |
| 25 |
\eRemember:\. This is \enot\. a light source! It just looks like one. |
| 26 |
If you want to move a light with this dragger, you can either: |
| 27 |
\p |
| 28 |
[a] Use an \cSoDirectionalLightManip\., which is subclassed from \cSoLight\.. |
| 29 |
It creates an \cSoDirectionalLightDragger\. |
| 30 |
and uses it as the interface to change the \vdirection\. of its |
| 31 |
light source (see the \cSoDirectionalLightManip\. man page). |
| 32 |
The manipulator also edits the \vmaterial\. part of this dragger to match the |
| 33 |
color of light the manipulator is producing. |
| 34 |
However, the directional light manipulator will ignore the \vtranslation\. |
| 35 |
field, because a directional light has no location or translation field. |
| 36 |
So in this case the translation dragger merely allows you to |
| 37 |
move the physical arrow to wherever you'd like it to be. |
| 38 |
\p |
| 39 |
[b] Put an \cSoTransform\. under an \cSoTransformSeparator\.. |
| 40 |
Add the \cSoDirectionalLight\. as the next child. Use |
| 41 |
a field-to-field connection between the \vrotation\. fields of this |
| 42 |
dragger and the transform node to synchronize the light with this dragger. |
| 43 |
\p |
| 44 |
[c] Use engines to connect the \vrotation\. field of this dragger to the |
| 45 |
\vdirection\. field of an \cSoDirectionalLight\.. Use the \vrotation\. as |
| 46 |
input to an \cSoComposeMatrix\. engine. Then, use an |
| 47 |
\cSoTransformVec3f\. engine to apply that matrix to (0,0,-1), the default |
| 48 |
light direction. |
| 49 |
\p |
| 50 |
You can change the parts in any instance of this dragger using |
| 51 |
\m\+setPart()\.\-SoDraggerSetPart()\.\.. |
| 52 |
The default part geometries are defined as resources for this |
| 53 |
\cSoDirectionalLightDragger\. class. They are detailed in the |
| 54 |
Dragger Resources section of the online reference page for this class. |
| 55 |
You can make your program use different default resources for the parts |
| 56 |
by copying the file |
| 57 |
\v/usr/share/data/draggerDefaults/directionalLightDragger.iv\. |
| 58 |
into your own directory, editing the file, and then |
| 59 |
setting the environment variable \vSO_DRAGGER_DIR\. to be a path to that directory. |
| 60 |
} |
| 61 |
|
| 62 |
METHOD "" SoDirectionalLightDragger() { |
| 63 |
Constructor. |
| 64 |
} |
| 65 |
|
| 66 |
METHOD getClassNkitCat static |
| 67 |
const SoNodekitCatalog *getClassNodekitCatalog() const |
| 68 |
{ Returns an \cSoNodekitCatalog\. for this class } |
| 69 |
|
| 70 |
METHOD "" static SoType getClassTypeId() { |
| 71 |
Returns type identifier for this class. |
| 72 |
} |
| 73 |
|
| 74 |
FIELD rotation { Orientation of the rotating part (an arrow by default). } |
| 75 |
FIELD translation { Position of the origin of the directional light dragger.} |
| 76 |
|
| 77 |
DRAGGER_RESOURCE { |
| 78 |
directionalLightRotatorRotator, |
| 79 |
rotator.rotator, |
| 80 |
"white arrow that goes through the sun", |
| 81 |
"picking this begins rotation of the arrow about the sun-shape" |
| 82 |
} |
| 83 |
|
| 84 |
DRAGGER_RESOURCE { |
| 85 |
directionalLightRotatorRotatorActive, |
| 86 |
rotator.rotatorActive, |
| 87 |
"yellow arrow that goes through the sun", |
| 88 |
"displayed while the arrow is being rotated" |
| 89 |
} |
| 90 |
|
| 91 |
DRAGGER_RESOURCE { |
| 92 |
directionalLightRotatorFeedback, |
| 93 |
rotator.feedback, |
| 94 |
"empty Separator", |
| 95 |
"this disables display of the axes that a rotateSpherical dragger uses |
| 96 |
by default" |
| 97 |
} |
| 98 |
|
| 99 |
DRAGGER_RESOURCE { |
| 100 |
directionalLightRotatorFeedbackActive, |
| 101 |
rotator.feedbackActive, |
| 102 |
"empty Separator", |
| 103 |
"this disables display of the axes that a rotateSpherical dragger uses |
| 104 |
by default" |
| 105 |
} |
| 106 |
|
| 107 |
DRAGGER_RESOURCE { |
| 108 |
directionalLightOverallMaterial, |
| 109 |
material, |
| 110 |
"white. half strength emissive, half strength diffuse", |
| 111 |
"sets material for the sun shape when stationary. |
| 112 |
Resource for the moving sun, |
| 113 |
directionalLightTranslatorPlaneTranslatorActive, |
| 114 |
contains a yellow material for highlighting." |
| 115 |
} |
| 116 |
DRAGGER_RESOURCE { |
| 117 |
directionalLightTranslatorPlaneTranslator, |
| 118 |
translator.yzTranslator.translator |
| 119 |
translator.xzTranslator.translator |
| 120 |
translator.xyTranslator.translator, |
| 121 |
"sun shape with no material", |
| 122 |
"picking these parts initiates dragging |
| 123 |
by the yz, xz, and xy planar draggers |
| 124 |
respectively." |
| 125 |
} |
| 126 |
|
| 127 |
DRAGGER_RESOURCE { |
| 128 |
directionalLightTranslatorPlaneTranslatorActive, |
| 129 |
translator.yzTranslator.translatorActive |
| 130 |
translator.xzTranslator.translatorActive |
| 131 |
translator.xyTranslator.translatorActive, |
| 132 |
"yellow sun shape", |
| 133 |
"shown during planar dragging in the yz, xz, |
| 134 |
and xy planes respectively." |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
DRAGGER_RESOURCE { |
| 139 |
directionalLightTranslatorLineTranslator, |
| 140 |
translator.xTranslator.translator |
| 141 |
translator.yTranslator.translator |
| 142 |
translator.zTranslator.translator, |
| 143 |
"white cylinder", |
| 144 |
"picking these parts initiates dragging |
| 145 |
in the x, y, and z linear draggers respectively." |
| 146 |
} |
| 147 |
|
| 148 |
DRAGGER_RESOURCE { |
| 149 |
directionalLightTranslatorLineTranslatorActive, |
| 150 |
translator.xTranslator.translatorActive |
| 151 |
translator.yTranslator.translatorActive |
| 152 |
translator.zTranslator.translatorActive, |
| 153 |
"yellow cylinder", |
| 154 |
"shown during linear dragging in the x, y, |
| 155 |
and z directions respectively." |
| 156 |
} |
| 157 |
|
| 158 |
ALSO { |
| 159 |
SoInteractionKit, |
| 160 |
SoDragger, |
| 161 |
SoCenterballDragger, |
| 162 |
SoDragPointDragger, |
| 163 |
SoHandleBoxDragger, |
| 164 |
SoJackDragger, |
| 165 |
SoPointLightDragger, |
| 166 |
SoRotateCylindricalDragger, |
| 167 |
SoRotateDiscDragger, |
| 168 |
SoRotateSphericalDragger, |
| 169 |
SoScale1Dragger, |
| 170 |
SoScale2Dragger, |
| 171 |
SoScale2UniformDragger, |
| 172 |
SoScaleUniformDragger, |
| 173 |
SoSpotLightDragger, |
| 174 |
SoTabBoxDragger, |
| 175 |
SoTabPlaneDragger, |
| 176 |
SoTrackballDragger, |
| 177 |
SoTransformBoxDragger, |
| 178 |
SoTransformerDragger, |
| 179 |
SoTranslate1Dragger, |
| 180 |
SoTranslate2Dragger |
| 181 |
} |
| 182 |
|