Open Inventor Reference
SoWWWInline.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 *
40 _______________________________________________________________________
41 ______________ S I L I C O N G R A P H I C S I N C . ____________
42 |
43 | $Revision: 1.1.1.1 $
44 |
45 | Description:
46 | Defines the SoWWWInline class
47 |
48 | Author(s): Gavin Bell, David Mott, Jim Kent
49 |
50 ______________ S I L I C O N G R A P H I C S I N C . ____________
51 _______________________________________________________________________
52 */
53
54#ifndef _SO_WWWINLINE_
55#define _SO_WWWINLINE_
56
62
64
65class SoWWWInline;
66class SoGroup;
67class SoWriteAction;
68
72 const SbString &url, void *userData, SoWWWInline *node);
73
74
75
78
95
97
99
100 public:
101
104
108 ALWAYS
109 };
110
115
117 void setFullURLName(const SbString &url) { fullURL = url; }
125
128
133 { if (! kidsRequested) requestChildrenFromURL(); }
136 bool isURLDataRequested() const { return kidsRequested; }
139 bool isURLDataHere() const { return kidsAreHere; }
142 { if (!kidsAreHere) kidsRequested = FALSE; }
143
146 void setChildData(SoNode *urlData);
150
154 static void setFetchURLCallBack(SoWWWInlineFetchURLCB *f, void *userData);
155
160 static void setBoundingBoxVisibility(BboxVisibility b) { bboxVisibility = b; }
162 static BboxVisibility getBoundingBoxVisibility() { return bboxVisibility; }
163
165 static void setBoundingBoxColor(SbColor &c) { bboxColor = c; }
167 static const SbColor &getBoundingBoxColor() { return bboxColor; }
168
169
170 SoEXTENDER public:
172 virtual void doAction(SoAction *action);
173 virtual void doActionOnKidsOrBox(SoAction *action);
174 virtual void callback(SoCallbackAction *action);
175 virtual void GLRender(SoGLRenderAction *action);
177 virtual void getMatrix(SoGetMatrixAction *action);
178 virtual void handleEvent(SoHandleEventAction *action);
179 virtual void search(SoSearchAction *action);
180 virtual void pick(SoPickAction *action);
181
182 SoINTERNAL public:
183 static void initClass();
184
186 virtual SoChildList *getChildren() const;
187
188 protected:
189 virtual ~SoWWWInline();
190
191 virtual void addBoundingBoxChild(SbVec3f center, SbVec3f size);
192
194 virtual bool readInstance(SoInput *in, unsigned short flags);
195
198 virtual void copyContents(const SoFieldContainer *fromFC,
199 bool copyConnections);
200
201 private:
202 void requestChildrenFromURL();
203
204 SoChildList *children;
205 bool kidsRequested;
206 bool kidsAreHere;
207 SbString fullURL;
208
209 static SbColor bboxColor;
210 static BboxVisibility bboxVisibility;
211
213 static SoWWWInlineFetchURLCB *fetchURLcb;
214 static void *fetchURLdata;
215};
216
217#endif /* _SO_WWWINLINE_ */
218
#define SoEXTENDER
Provide inline template functions for abs, swap, min, max, and clamp.
Definition SbBasic.h:154
#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:77
#define SO_NODE_HEADER(className)
Non-abstract classes have everything abstract classes have, plus a way to create an instance.
Definition SoSubNode.h:170
void INVENTOR_API SoWWWInlineFetchURLCB(const SbString &url, void *userData, SoWWWInline *node)
This is the format for callbacks that will get URL data for us.
Definition SoWWWInline.h:71
Color vector class.
Definition SbColor.h:84
Class for smart character strings.
Definition SbString.h:85
3D vector class.
Definition SbLinear.h:120
Abstract base class for all actions.
Definition SoAction.h:179
Performs a generic traversal of the scene graph.
This class maintains a list of child nodes for any node.
Definition SoChildList.h:83
Abstract base class for objects that contain fields.
Renders a scene graph using OpenGL.
Computes bounding box of a scene.
Computes transformation matrix for subgraph.
Base class for all group nodes.
Definition SoGroup.h:104
Allows nodes in a graph to receive input events.
Used to read Inventor data files.
Definition SoInput.h:128
Abstract base class for all database nodes.
Definition SoNode.h:103
Abstract base class for picking objects in a scene.
Field containing a pointer to a node.
Definition SoSFNode.h:92
Field containing a string.
Definition SoSFString.h:88
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:79
Searches for nodes in a scene graph.
Node that refers to children through a URL.
Definition SoWWWInline.h:96
const SbString & getFullURLName()
If the name field contains a relative URL (e.g.
SoGroup * copyChildren() const
Return (hidden) children as Group.
virtual void pick(SoPickAction *action)
virtual void callback(SoCallbackAction *action)
virtual void handleEvent(SoHandleEventAction *action)
virtual ~SoWWWInline()
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
static const SbColor & getBoundingBoxColor()
This allows the application to specify the color of bounding boxes displayed.
SoSFString name
URL specifying children (might be relative)
@ NEVER
Do not show bounding box.
@ UNTIL_LOADED
Show bounding box (if specified) until data is loaded.
void requestURLData()
Request that URL data be fetched.
static void setBoundingBoxColor(SbColor &c)
This allows the application to specify the color of bounding boxes displayed.
void setChildData(SoNode *urlData)
Set/get the child data the inline should display.
SoSFNode alternateRep
Child data if app cannot fetch URL.
virtual void doActionOnKidsOrBox(SoAction *action)
static void setFetchURLCallBack(SoWWWInlineFetchURLCB *f, void *userData)
Application callbacks invoked when the inline needs its URL data fetched.
SoNode * getChildData() const
Set/get the child data the inline should display.
virtual void GLRender(SoGLRenderAction *action)
These virtual functions implement all of the actions for nodes, Most of the default implementations d...
virtual void doAction(SoAction *action)
Traversal methods for all the actions:
void cancelURLDataRequest()
Cancel the active URL data fetch request.
virtual void copyContents(const SoFieldContainer *fromFC, bool copyConnections)
Copies the child data as well as the rest of the node (if the child data has been set)
static BboxVisibility getBoundingBoxVisibility()
Get the bounding boxes visibility.
virtual void search(SoSearchAction *action)
bool isURLDataRequested() const
Return whether URL data has been requested and whether that data is here (i.e.
static void initClass()
bool isURLDataHere() const
Return whether URL data has been requested and whether that data is here (i.e.
virtual void addBoundingBoxChild(SbVec3f center, SbVec3f size)
SoWWWInline()
Creates an inline node with default settings.
virtual SoChildList * getChildren() const
Returns pointer to children, or NULL if none.
virtual bool readInstance(SoInput *in, unsigned short flags)
Reads into instance of SoWWWInline. Returns FALSE on error.
SoSFVec3f bboxCenter
Bounding box center.
void setFullURLName(const SbString &url)
SoSFVec3f bboxSize
Bounding box size.
static void setBoundingBoxVisibility(BboxVisibility b)
This allows the application to specify when bounding boxes are displayed.
virtual void getMatrix(SoGetMatrixAction *action)
Writes a scene graph to a file.