Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoWWWAnchor.h
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-2024 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
55#include <Inventor/fields/SoSFString.h>
56#include <Inventor/fields/SoSFFilePathString.h>
57#include <Inventor/nodes/SoLocateHighlight.h>
58
59class SoWWWAnchor;
60
70typedef void SoWWWAnchorCB(const SbString &url, void *userData, SoWWWAnchor *node);
71
72
74//
75// Class: SoWWWAnchor
76//
78
117
118 SO_NODE_HEADER(SoWWWAnchor);
119
120 public:
125
127 enum Mapping {
131 POINT
132 };
133
157
165 void setFullURLName(const SbString &url) { fullURL = url; }
171
176 static void setFetchURLCallBack( SoWWWAnchorCB *f, void *userData);
177
183 static void setHighlightURLCallBack( SoWWWAnchorCB *f, void *userData);
184
185 // Need to enable or disable event handling so the geometry
186 // contained therein can be picked, manipulated, etc.
187 static void enableEvents(SbBool OnOffFlag);
188
189 private:
190 // Override handleEvent to look for left-mouse clicks, to do a
191 // pick:
192 virtual void handleEvent(SoHandleEventAction *action);
193
194 private:
195 static void initClass();
196 static void exitClass();
197
198 private:
199 virtual ~SoWWWAnchor();
200
201 // redefine this to also invoke the app callbacks...
202 // This is called when the locate highlight status of this node changes.
203 virtual void redrawHighlighted(SoAction *act, SbBool isNowHighlighting);
204
205 static SoWWWAnchorCB *fetchURLcb;
206 static void *fetchURLdata;
207 static SoWWWAnchorCB *highlightURLcb;
208 static void *highlightURLdata;
209 static SbString emptyString;
210
211 private:
212 SbString fullURL;
213 static SbBool enableEventsFlag;
214
215};
216
217#endif /* _SO_WWWANCHOR_ */
218
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.
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:70
int SbBool
Boolean type.
Definition SbBase.h:87