SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SmTooltipKit.h
1#ifndef SMALLCHANGE_SMTOOLTIPKIT_H
2#define SMALLCHANGE_SMTOOLTIPKIT_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
36#include <Inventor/nodekits/SoSubKit.h>
37#include <Inventor/nodekits/SoBaseKit.h>
38#include <Inventor/fields/SoSFBool.h>
39#include <Inventor/fields/SoSFTime.h>
40#include <Inventor/fields/SoSFInt32.h>
41#include <Inventor/fields/SoSFVec2s.h>
42#include <Inventor/fields/SoMFString.h>
43#include <Inventor/SbVec2f.h>
44#include <SmallChange/basic.h>
45
46class SmTooltipKitP;
47class SoSensor;
48class SoPickedPoint;
49class SbViewportRegion;
50
51class SMALLCHANGE_DLL_API SmTooltipKit : public SoBaseKit {
52 typedef SoBaseKit inherited;
53
54 SO_KIT_HEADER(SmTooltipKit);
55
56 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
57 SO_KIT_CATALOG_ENTRY_HEADER(resetTransform);
58 SO_KIT_CATALOG_ENTRY_HEADER(position);
59 SO_KIT_CATALOG_ENTRY_HEADER(depthBuffer);
60 SO_KIT_CATALOG_ENTRY_HEADER(lightModel);
61 SO_KIT_CATALOG_ENTRY_HEADER(camera);
62 SO_KIT_CATALOG_ENTRY_HEADER(texture);
63 SO_KIT_CATALOG_ENTRY_HEADER(shapeHints);
64 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
65 SO_KIT_CATALOG_ENTRY_HEADER(materialBinding);
66 SO_KIT_CATALOG_ENTRY_HEADER(backgroundColor);
67 SO_KIT_CATALOG_ENTRY_HEADER(justification);
68 SO_KIT_CATALOG_ENTRY_HEADER(backgroundShape);
69 SO_KIT_CATALOG_ENTRY_HEADER(textColor);
70 SO_KIT_CATALOG_ENTRY_HEADER(textShape);
71
72public:
73 SmTooltipKit(void);
74 static void initClass(void);
75
76 virtual void GLRender(SoGLRenderAction * action);
77 virtual void handleEvent(SoHandleEventAction * action);
78 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
79 virtual void search(SoSearchAction * action);
80 virtual void callback(SoCallbackAction * action);
81 virtual void getMatrix(SoGetMatrixAction * action);
82 virtual void pick(SoPickAction * action);
83 virtual void rayPick(SoRayPickAction * action);
84 virtual void audioRender(SoAudioRenderAction * action);
85 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
86
87protected:
88 virtual ~SmTooltipKit();
89 virtual SbBool affectsState(void) const;
90
91public:
92
93 void setPickedPoint(const SoPickedPoint * pp, const SbViewportRegion & vp);
94 void setPickedPosition(const SbVec2f & pos, const SbViewportRegion & vp);
95 void setViewportRegion(const SbViewportRegion & vp);
96
97 SoSFBool autoTrigger;
99 SoSFBool isActive;
100 SoMFString description;
101 SoSFInt32 frameSize;
102 SoSFVec2s offset;
103
104private:
105
106 void updateBackground(void);
107
108 static void tooltip_changed_cb(void * closure, SoSensor * s);
109 static void alarm_cb(void * closure, SoSensor * s);
110 friend class SmTooltipKitP;
111 SmTooltipKitP * pimpl;
112};
113
114
115#endif // SMALLCHANGE_SMTOOLTIPKIT_H
Definition misc/SbList.h:69
The SmTooltipKit class...
Definition SmTooltipKit.h:51
SoSFBool isActive
Definition SmTooltipKit.h:99
SoSFInt32 frameSize
Definition SmTooltipKit.h:101
SoSFBool autoTrigger
Definition SmTooltipKit.h:97
SoMFString description
Definition SmTooltipKit.h:100
SoSFTime autoTriggerTime
Definition SmTooltipKit.h:98