Open Inventor Reference
SoLocateHighlight.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (C) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
27 * Mountain View, CA 94043, or:
28 *
29 * http://www.sgi.com
30 *
31 * For further information regarding this notice, see:
32 *
33 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
34 *
35 */
36
37
38/*
39 * Copyright (C) 1995-96 Silicon Graphics, Inc.
40 *
41 _______________________________________________________________________
42 ______________ S I L I C O N G R A P H I C S I N C . ____________
43 |
44 | $Revision: 1.1.1.1 $
45 |
46 | Description:
47 | This file defines the SoLocateHighlight node class.
48 |
49 | It has two fields,
50 | color and style
51 |
52 | When the cursor is over the stuff below this node,
53 | it will be redrawn (to the front buffer) with the color
54 | emissive and/or diffuse in the state and the override flag ON.
55 |
56 | Author(s) : Alain Dumesny, Paul Isaacs
57 |
58 ______________ S I L I C O N G R A P H I C S I N C . ____________
59 _______________________________________________________________________
60 */
61
62#ifndef _SO_LOCATE_HIGHLIGHT_
63#define _SO_LOCATE_HIGHLIGHT_
64
70
71class SoAction;
74class SoFullPath;
75class SoColorPacker;
76
77
78
81
125
127
129
130 public:
131
133 enum Styles {
135 EMISSIVE_DIFFUSE
136 };
137
139 enum Modes {
142 OFF
143 };
144
146
147
150
153
156
158
161
162 SoEXTENDER public:
166 virtual void handleEvent( SoHandleEventAction *action );
167 virtual void GLRenderBelowPath(SoGLRenderAction *action);
168 virtual void GLRenderInPath(SoGLRenderAction *action);
169
170 SoINTERNAL public:
171 static void initClass();
172
179
180 protected:
182
185 virtual void redrawHighlighted(SoAction *act, bool flag);
186
187 private:
189 bool highlightingPass;
190 static SoFullPath *currentHighlightPath;
191 bool isHighlighted(SoAction *action);
192 bool preRender(SoGLRenderAction *act, GLint &oldDepthFunc);
193 SoColorPacker *colorPacker;
194};
195
196
197#endif /* _SO_LOCATE_HIGHLIGHT_ */
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition SbBasic.h:154
#define SoINTERNAL
Definition SbBasic.h:155
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition SbSystem.h:77
#define SO_NODE_HEADER(className)
Non-abstract classes have everything abstract classes have, plus a way to create an instance.
Definition SoSubNode.h:170
Abstract base class for all actions.
Definition SoAction.h:179
This class is meant to be used by all property nodes that set either a diffuse color or transparency ...
This SoEXTENDER class allows expert users to examine "hidden" children in paths.
Definition SoPath.h:299
Renders a scene graph using OpenGL.
Allows nodes in a graph to receive input events.
Special separator that performs locate highlighting.
SoSFColor color
Highlighting color - default [.3, .3, .3].
Modes
Possible values for the mode.
@ AUTO
highlight when mouse is over (default)
@ ON
always highlight
SoLocateHighlight()
Creates a LocateHighlight node with default settings.
virtual void handleEvent(SoHandleEventAction *action)
Override handleEvent to look for mouse motion, to do a pick and highlight if mouse is over us.
SoSFEnum style
Highlighting draw style - default EMISSIVE.
virtual void GLRenderInPath(SoGLRenderAction *action)
virtual void redrawHighlighted(SoAction *act, bool flag)
This is called when this nodes needs to highlight or de-highlight.
virtual ~SoLocateHighlight()
static void turnOffCurrentHighlight(SoGLRenderAction *action)
This will de-highlight the currently highlighted node if any.
SoSFEnum mode
Whether to highlight or not - default AUTO.
virtual void GLRenderBelowPath(SoGLRenderAction *action)
These methods make render traversal faster by implementing different rendering paths corresponding to...
static void initClass()
initialize the class
Styles
Possible values for draw style.
@ EMISSIVE
changes emissive color only (default)
Field containing an RGB color.
Definition SoSFColor.h:82
Field containing an enumerated value.
Definition SoSFEnum.h:93
Group node that saves and restores traversal state.