Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoBoxHighlightRenderAction.h
1 #ifndef COIN_SOBOXHIGHLIGHTRENDERACTION_H
2 #define COIN_SOBOXHIGHLIGHTRENDERACTION_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
37 #include <Inventor/SbColor.h>
38 
39 class SoBoxHighlightRenderActionP;
40 
41 class COIN_DLL_API SoBoxHighlightRenderAction : public SoGLRenderAction {
43 
44  SO_ACTION_HEADER(SoBoxHighlightRenderAction);
45 
46 public:
47  static void initClass(void);
48 
50  SoBoxHighlightRenderAction(const SbViewportRegion & viewportregion);
51  virtual ~SoBoxHighlightRenderAction(void);
52 
53  virtual void apply(SoNode * node);
54  virtual void apply(SoPath * path);
55  virtual void apply(const SoPathList & pathlist, SbBool obeysrules = FALSE);
56  void setVisible(const SbBool visible);
57  SbBool isVisible(void) const;
58  void setColor(const SbColor & color);
59  const SbColor & getColor(void);
60  void setLinePattern(unsigned short pattern);
61  unsigned short getLinePattern(void) const;
62  void setLineWidth(const float width);
63  float getLineWidth(void) const;
64 
65 protected:
66  SbBool hlVisible;
67 
68  // Some protected members are missing compared to OIV here.
69  // I doubt that anyone will use them though, since it looked
70  // like they should have been private. We chose to implement this
71  // action in a different manner. But, if you need the protected members
72  // provided by OIV here, contact us any we'll consider reimplementing
73  // the action to conform more to OIV. pederb, 20000222
74 
75 private:
76  void init(void);
77  void drawBoxes(SoPath * pathtothis, const SoPathList * pathlist);
78 
79 private:
81 
82  // NOT IMPLEMENTED:
84  SoBoxHighlightRenderAction & operator = (const SoBoxHighlightRenderAction & rhs);
85 }; // SoBoxHighlightRenderAction
86 
87 #endif // !COIN_SOBOXHIGHLIGHTRENDERACTION_H
The SbColor class contains the red, green and blue components which make up a color value...
Definition: SbColor.h:39
The SoPathList class is a container for pointers to SoPath objects.
Definition: SoPathList.h:40
SbBool hlVisible
Definition: SoBoxHighlightRenderAction.h:66
The SoNode class is the base class for nodes used in scene graphs.
Definition: SoNode.h:56
The SoPath class is a container class for traversal path descriptions.
Definition: SoPath.h:52
The SoBoxHighlightRenderAction class renders the scene with highlighted boxes around selections...
Definition: SoBoxHighlightRenderAction.h:41
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:40
virtual void apply(SoNode *root)
Definition: SoAction.cpp:463
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:50