Open Inventor Reference
SoBoxHighlightRenderAction.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) 1990-93 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  |
45  | $Revision: 1.1.1.1 $
46  |
47  | Description:
48  | This is the SoBoxHighlightRenderAction class, used to highlight
49  | the selection by drawing a wireframe box around the selected shapes.
50  |
51  | Classes : SoBoxHighlightRenderAction
52  |
53  | Author(s) : David Mott
54  |
55  ______________ S I L I C O N G R A P H I C S I N C . ____________
56  _______________________________________________________________________
57  */
58 
59 
60 #ifndef _SO_BOX_HIGHLIGHT_RENDER_ACTION_
61 #define _SO_BOX_HIGHLIGHT_RENDER_ACTION_
62 
64 
65 class SbColor;
66 class SoSeparator;
67 class SoLightModel;
68 class SoBaseColor;
69 class SoDrawStyle;
70 class SoTexture2;
71 class SoTranslation;
72 class SoMatrixTransform;
73 class SoCube;
74 
81 
84 
104 
107  public:
108 
111 
114 
115 
117 
121  virtual void apply(SoNode *node);
122 
126  virtual void apply(SoPath *path);
130  virtual void apply(const SoPathList &pathList,
131  bool obeysRules = FALSE);
132 
139  void setVisible(bool b) { hlVisible = b; }
141  bool isVisible() const { return hlVisible; }
142 
146  void setColor( const SbColor &c );
148  const SbColor & getColor();
154  void setLinePattern( unsigned short pattern );
156  unsigned short getLinePattern();
158  void setLineWidth( float width );
160  float getLineWidth();
161 
162  SoINTERNAL public:
163  static void initClass();
164 
165  protected:
166  void updateBbox(SoPath *p);
167 
177 
178  bool hlVisible;
179 
182 
183  private:
184  void constructorCommon();
185 };
186 
187 #endif /* _SO_BOX_HIGHLIGHT_RENDER_ACTION_ */
188 
#define FALSE
Definition: SbBasic.h:79
#define SoINTERNAL
Definition: SbBasic.h:155
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Definition: SbSystem.h:81
#define SO_ACTION_HEADER(className)
Macros to be called within the class definition header for an action subclass:
Definition: SoSubAction.h:87
Color vector class.
Definition: SbColor.h:84
Class for representing a viewport.
Node that defines an object's base color.
Definition: SoBaseColor.h:94
Box highlight - a subclass of SoGLRenderAction which renders the scene graph, then renders wireframe ...
void setLinePattern(unsigned short pattern)
Set the line pattern of the highlight.
SoBoxHighlightRenderAction(const SbViewportRegion &viewportRegion)
Constructor.
bool isVisible() const
Returns whether highlights will be rendered or not.
float getLineWidth()
Get the line width.
const SbColor & getColor()
Get the color of the highlight.
SoPath * selPath
Cached path to selection so we don't search every time.
unsigned short getLinePattern()
Get the line pattern of the highlight.
virtual void apply(const SoPathList &pathList, bool obeysRules=FALSE)
This renders the passed scene graph, and also renders wireframe boxes around selected objects as spec...
void updateBbox(SoPath *p)
virtual void apply(SoPath *path)
This renders the passed scene graph, and also renders wireframe boxes around selected objects as spec...
void setVisible(bool b)
This provides a convenient mechansim for turning highlights off or on.
virtual void apply(SoNode *node)
This renders the passed scene graph, and also renders wireframe boxes around selected objects as spec...
void setColor(const SbColor &c)
Set the color of the highlight.
virtual ~SoBoxHighlightRenderAction()
void setLineWidth(float width)
Set the line width.
SoSeparator * localRoot
Nodes which comprise the local highlight graph.
SoBoxHighlightRenderAction()
Constructor.
Cube shape node.
Definition: SoCube.h:119
Node that defines the style to use when rendering.
Definition: SoDrawStyle.h:101
Renders a scene graph using OpenGL.
Node that defines the lighting model to use when rendering.
Definition: SoLightModel.h:92
Node that specifies a 3D geometric transformation as a matrix.
Abstract base class for all database nodes.
Definition: SoNode.h:103
Maintains a list of pointers to paths.
Definition: SoLists.h:212
Path that points to a list of hierarchical nodes.
Definition: SoPath.h:109
Group node that saves and restores traversal state.
Definition: SoSeparator.h:118
Texture mapping node.
Definition: SoTexture2.h:143
Node representing a 3D translation.
Definition: SoTranslation.h:91