| 1 |
NAME SoLineHighlightRenderAction "SoLineHLRenderAct" "" { selection highlight style } |
| 2 |
|
| 3 |
INCLUDE actions/SoLineHighlightRenderAction.h |
| 4 |
|
| 5 |
DESC { \cSoLineHighlightRenderAction\. is a render action which |
| 6 |
renders the specified scene graph, then renders each selected object |
| 7 |
again in wireframe. |
| 8 |
Selected objects are specified by the first \cSoSelection\. |
| 9 |
node in the scene to which this action is applied. |
| 10 |
If there is no renderable geometry in a selected object, |
| 11 |
no highlight is rendered for that object. |
| 12 |
A highlight render action can be passed to |
| 13 |
\+the \msetGLRenderAction()\. method of |
| 14 |
\cSoXtRenderArea\.\.\-\mSoXtRASetGLRenderAct()\.\. |
| 15 |
to have an affect on scene graphs. |
| 16 |
} |
| 17 |
|
| 18 |
METHOD "" SoLineHighlightRenderAction() { Constructor. } |
| 19 |
|
| 20 |
METHOD "" virtual void apply(SoNode *node) { |
| 21 |
This renders the passed scene graph, and also renders each selected object |
| 22 |
in wireframe, as specified by the first |
| 23 |
\cSoSelection\. node found in the scene graph. |
| 24 |
} |
| 25 |
|
| 26 |
METHOD "" void setVisible(SbBool b) { |
| 27 |
This provides a convenient mechansim for turning highlights off |
| 28 |
or back on. When FALSE is passed, subsequent calls to |
| 29 |
\+apply()\. |
| 30 |
\-SoLineHLRenderActApply()\. |
| 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 |
The application is responsible for forcing a redraw of the |
| 44 |
scene to see the affects 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 more information. |
| 52 |
The application is responsible for forcing a redraw of the |
| 53 |
scene to see the affects 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 |
The application is responsible for forcing a redraw of the |
| 60 |
scene to see the affects of this change. |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
MISC EXAMPLE { |
| 65 |
Here is an example of how a line highlight can be specified |
| 66 |
for a particular selection node and render area. |
| 67 |
\b\k |
| 68 |
\+ |
| 69 |
SoXtRenderArea *myRenderArea; |
| 70 |
SoSelection *mySelection; |
| 71 |
|
| 72 |
// Set the highlight render action |
| 73 |
myRenderArea->setGLRenderAction( |
| 74 |
new SoLineHighlightRenderAction()); |
| 75 |
|
| 76 |
// Automatic redraw on selection changes |
| 77 |
myRenderArea->redrawOnSelectionChange(mySelection); |
| 78 |
\. |
| 79 |
\- |
| 80 |
SoXtRenderArea *myRenderArea; |
| 81 |
SoSelection *mySelection; |
| 82 |
|
| 83 |
/* Set the highlight render action */ |
| 84 |
SoXtRASetGLRenderAct(myRenderArea, |
| 85 |
(SoGLRenderAction *) SoLineHLRenderActCreate()); |
| 86 |
|
| 87 |
/* Automatic redraw on selection changes */ |
| 88 |
SoXtRARedrawOnSelChange(myRenderArea, mySelection); |
| 89 |
\. |
| 90 |
\.\. |
| 91 |
} |
| 92 |
|
| 93 |
ALSO { SoBoxHighlightRenderAction, SoGLRenderAction, SoSelection, |
| 94 |
SoXtRenderArea, SoDrawStyle, SoInteraction } |
| 95 |
|
| 96 |
|
| 97 |
|