Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoWWWAnchor.h
Go to the documentation of this file.
1/*=======================================================================
2 * Copyright 1991-1996, Silicon Graphics, Inc.
3 * ALL RIGHTS RESERVED
4 *
5 * UNPUBLISHED -- Rights reserved under the copyright laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
8 *
9 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
10 * Use, duplication or disclosure by the Government is subject to restrictions
11 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
12 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
13 * in similar or successor clauses in the FAR, or the DOD or NASA FAR
14 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
15 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
16 *
17 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
18 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
19 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
20 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
21 * GRAPHICS, INC.
22**=======================================================================*/
23/*=======================================================================
24** Author : David Mott (MMM yyyy)
25** Modified by : Jim Kent (MMM yyyy)
26** Modified by : Gavin Bell (MMM yyyy)
27**=======================================================================*/
28/*=======================================================================
29 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
30 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
31 *** ***
32 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
33 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
34 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
35 *** ***
36 *** RESTRICTED RIGHTS LEGEND ***
37 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
38 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
39 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
40 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
41 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
42 *** ***
43 *** COPYRIGHT (C) 1996-2023 BY FEI S.A.S, ***
44 *** BORDEAUX, FRANCE ***
45 *** ALL RIGHTS RESERVED ***
46**=======================================================================*/
47/*=======================================================================
48** Modified by : VSG (MMM YYYY)
49**=======================================================================*/
50
51
52#ifndef _SO_WWWANCHOR_
53#define _SO_WWWANCHOR_
54
58
59class SoWWWAnchor;
60
67typedef void SoWWWAnchorCB(const SbString &url, void *userData, SoWWWAnchor *node);
68
69
71//
72// Class: SoWWWAnchor
73//
75
114
116
117 public:
122
124 enum Mapping {
128 POINT
129 };
130
154
162 void setFullURLName(const SbString &url) { fullURL = url; }
168
173 static void setFetchURLCallBack( SoWWWAnchorCB *f, void *userData);
174
180 static void setHighlightURLCallBack( SoWWWAnchorCB *f, void *userData);
181
182 // Need to enable or disable event handling so the geometry
183 // contained therein can be picked, manipulated, etc.
184 static void enableEvents(SbBool OnOffFlag);
185
186 private:
187 // Override handleEvent to look for left-mouse clicks, to do a
188 // pick:
189 virtual void handleEvent(SoHandleEventAction *action);
190
191 private:
192 static void initClass();
193 static void exitClass();
194
195 private:
196 virtual ~SoWWWAnchor();
197
198 // redefine this to also invoke the app callbacks...
199 // This is called when the locate highlight status of this node changes.
200 virtual void redrawHighlighted(SoAction *act, SbBool isNowHighlighting);
201
202 static SoWWWAnchorCB *fetchURLcb;
203 static void *fetchURLdata;
204 static SoWWWAnchorCB *highlightURLcb;
205 static void *highlightURLdata;
206 static SbString emptyString;
207
208 private:
209 SbString fullURL;
210 static SbBool enableEventsFlag;
211
212};
213
214#endif /* _SO_WWWANCHOR_ */
215
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
void SoWWWAnchorCB(const SbString &url, void *userData, SoWWWAnchor *node)
This is the format for callbacks during anchor activation (left mouse click) and highlight (move over...
Definition SoWWWAnchor.h:67
Class for smart character strings.
Definition SbString.h:202
Abstract base class for all actions.
Definition SoAction.h:132
Allows nodes in a graph to receive input events.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Special separato...
Field containing an enumerated value.
Definition SoSFEnum.h:89
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Field containing...
Field containing a string.
Definition SoSFString.h:117
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Separator group ...
SoSFEnum map
Specifies what additional information should be added to the end of the URL when passed back to the a...
static void setHighlightURLCallBack(SoWWWAnchorCB *f, void *userData)
Application callbacks invoked when the mouse is moved over an anchor so that the app can provide feed...
Mapping
Mapping.
@ POINT
Add object-space coordinates to URL.
@ NONE
Do no add information to the URL
SoSFString description
A description of the URL which may make more sense to users than the URL itself (e....
void setFullURLName(const SbString &url)
If the name field contains a relative URL (e.g., "foo.wrl" instead of "http://bogus....
SoWWWAnchor()
Creates an anchor node with default settings.
static void setFetchURLCallBack(SoWWWAnchorCB *f, void *userData)
Application callback invoked when the mouse is clicked on an anchor so that the application can fetch...
static void enableEvents(SbBool OnOffFlag)
SoSFFilePathString name
URL which the application will be called back to fetch when this node is activated by a left mouse cl...
const SbString & getFullURLName()
Returns the full URL set by setFullURLName(), or if not set, returns the contents of the name field.
int SbBool
Boolean type.
Definition SbBase.h:87