| 1 |
NAME SoBoxHighlightRenderAction "SoBoxHLRenderAct" "" { a selection highlight style } |
| 2 |
|
| 3 |
INCLUDE actions/SoBoxHighlightRenderAction.h |
| 4 |
|
| 5 |
DESC { \cSoBoxHighlightRenderAction\. is a render action which |
| 6 |
renders the specified scene graph, then renders wireframe boxes surrounding |
| 7 |
each selected object. |
| 8 |
Selected objects are specified by the first \cSoSelection\. |
| 9 |
node in the scene to which this action is applied. |
| 10 |
If an \cSoGetBoundingBoxAction\. applied to a selected object |
| 11 |
produces an empty bounding box, no highlight is rendered |
| 12 |
for that object. |
| 13 |
A highlight render action can be passed to |
| 14 |
\+the \msetGLRenderAction()\. method of \cSoXtRenderArea\.\. |
| 15 |
\-\mSoXtRASetGLRenderAct()\.\. |
| 16 |
to have an effect on scene graphs. |
| 17 |
} |
| 18 |
|
| 19 |
METHOD "" SoBoxHighlightRenderAction() { Constructor. } |
| 20 |
|
| 21 |
METHOD "" virtual void apply(SoNode *node) { |
| 22 |
This renders the passed scene graph, and also renders wireframe |
| 23 |
boxes around selected objects as specified by the first |
| 24 |
\cSoSelection\. node found in the scene graph. |
| 25 |
} |
| 26 |
|
| 27 |
METHOD "" void setVisible(SbBool b) { |
| 28 |
This provides a convenient mechansim for turning highlights off |
| 29 |
or on. When \eFALSE\. is passed, subsequent calls to |
| 30 |
\+\mapply()\.\.\-\mSoBoxHLRenderActApply()\.\. |
| 31 |
render the scene graph without rendering highlights. |
| 32 |
The application is responsible for forcing a redraw of the |
| 33 |
scene after changing this state. The default visibility is on. |
| 34 |
} |
| 35 |
|
| 36 |
METHOD "" SbBool isVisible() const { |
| 37 |
Returns whether highlights will be rendered or not. |
| 38 |
} |
| 39 |
|
| 40 |
METHOD "setCol" void setColor(const SbColor &c) {} |
| 41 |
METHOD "getCol" SbColor & getColor() { |
| 42 |
Set and get the color of the highlight. Default is red \e(1,0,0)\.. |
| 43 |
Application is responsible for forcing a redraw of the |
| 44 |
scene to see the effects of this change. |
| 45 |
} |
| 46 |
|
| 47 |
METHOD "setLinePat" void setLinePattern(unsigned short pattern) {} |
| 48 |
METHOD "getLinePat" unsigned short getLinePattern() { |
| 49 |
Set and get the line pattern of the highlight. Default is solid, \e0xffff\.. |
| 50 |
The pattern of bits in the passed variable specifies the pattern of the line. |
| 51 |
See \cSoDrawStyle\. for a description. |
| 52 |
Application is responsible for forcing a redraw of the |
| 53 |
scene to see the effects of this change. |
| 54 |
} |
| 55 |
|
| 56 |
METHOD "" void setLineWidth(float width) {} |
| 57 |
METHOD "" float getLineWidth(){ |
| 58 |
Set and get the line width of the highlight. Default is \e3\.. |
| 59 |
Application is responsible for forcing a redraw of the |
| 60 |
scene to see the effects of this change. |
| 61 |
} |
| 62 |
|
| 63 |
MISC EXAMPLE { |
| 64 |
Here is an example of how a box highlight can be specified |
| 65 |
for a particular selection node and render area. |
| 66 |
\b\k |
| 67 |
\+ |
| 68 |
SoXtRenderArea *myRenderArea; |
| 69 |
SoSelection *mySelection; |
| 70 |
|
| 71 |
// Set the highlight render action |
| 72 |
myRenderArea->setGLRenderAction( |
| 73 |
new SoBoxHighlightRenderAction()); |
| 74 |
|
| 75 |
// Automatic redraw on selection changes |
| 76 |
myRenderArea->redrawOnSelectionChange(mySelection); |
| 77 |
\. |
| 78 |
\- |
| 79 |
SoXtRenderArea *myRenderArea; |
| 80 |
SoSelection *mySelection; |
| 81 |
|
| 82 |
/* Set the highlight render action */ |
| 83 |
SoXtRASetGLRenderAct(myRenderArea, |
| 84 |
(SoGLRenderAction *) SoBoxHLRenderActCreate()); |
| 85 |
|
| 86 |
/* Automatic redraw on selection changes */ |
| 87 |
SoXtRARedrawOnSelChange(myRenderArea, mySelection); |
| 88 |
\. |
| 89 |
\.\. |
| 90 |
} |
| 91 |
|
| 92 |
ALSO { SoLineHighlightRenderAction, SoGLRenderAction, SoSelection, |
| 93 |
SoXtRenderArea, SoDrawStyle, SoInteraction } |
| 94 |
|
| 95 |
|
| 96 |
|