00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef _SO_VRMLINLINE_
00053 #define _SO_VRMLINLINE_
00054
00055 #include <Inventor/misc/SoChildList.h>
00056 #include <Inventor/nodes/SoNode.h>
00057 #include <Inventor/fields/SoMFString.h>
00058 #include <Inventor/fields/SoMFFilePathString.h>
00059 #include <Inventor/fields/SoSFVec3f.h>
00060 #include <Inventor/VRMLnodes/SoVRMLNode.h>
00061
00062 #include <Inventor/actions/SoCallbackAction.h>
00063
00064
00065 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00066 #include <SoDeprecationRules.h>
00067 #pragma push_macro("SoDEPRECATED_CLASS")
00068 #pragma push_macro("SoDEPRECATED_TYPEDEF")
00069 #undef SoDEPRECATED_CLASS
00070 #undef SoDEPRECATED_TYPEDEF
00071 #define SoDEPRECATED_CLASS(x,y)
00072 #define SoDEPRECATED_TYPEDEF(x,y)
00073 #endif
00074
00075 class SoVRMLInline;
00076 class SoGroup;
00077 class SoWriteAction;
00078
00083 typedef SoDEPRECATED void SoVRMLInlineFetchURLCB(
00084 const SbString &url, void *userData, SoVRMLInline *node);
00085
00086
00088
00089
00090
00092 class SoDEPRECATED SoVRMLInline : public SoVRMLNode {
00177
00178 SO_NODE_HEADER(SoVRMLInline);
00179
00180 public:
00184 SoVRMLInline();
00185
00187 enum BboxVisibility {
00191 NEVER,
00195 UNTIL_LOADED,
00199 ALWAYS
00200 };
00201
00206 SoSFVec3f bboxCenter;
00213 SoSFVec3f bboxSize;
00220 SoMFFilePathString url;
00232 SoSFBool load;
00233
00240 void setFullURLName(const SbString &urlin) { fullURL = urlin; }
00245 const SbString & getFullURLName();
00246
00250 SoGroup *copyChildren() const;
00251
00255 void requestURLData()
00256 { if (! kidsRequested) requestChildrenFromURL(); }
00260 SbBool isURLDataRequested() const { return kidsRequested; }
00264 SbBool isURLDataHere() const { return kidsAreHere; }
00268 void cancelURLDataRequest()
00269 { if (!kidsAreHere) kidsRequested = FALSE; }
00270
00275 void setChildData(SoNode *urlData);
00280 SoNode * getChildData() const;
00281
00285 static void setFetchURLCallBack(SoVRMLInlineFetchURLCB *f, void *userData);
00286
00290 static void setBoundingBoxVisibility(BboxVisibility b) { bboxVisibility = b; }
00294 static BboxVisibility getBoundingBoxVisibility() { return bboxVisibility; }
00295
00299 static void setBoundingBoxColor(SbColor &c) { bboxColor = c; }
00303 static const SbColor &getBoundingBoxColor() { return bboxColor; }
00304
00310 static void setReadAsSoFile(SbBool onOff) { readAsSoFile = onOff; };
00314 static SbBool getReadAsSoFile() { return readAsSoFile; };
00315
00316 private:
00317
00318 virtual void doAction(SoAction *action);
00319 virtual void doActionOnKidsOrBox(SoAction *action);
00320 virtual void callback(SoCallbackAction *action);
00321 virtual void GLRender(SoGLRenderAction *action);
00322 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00323 virtual void getMatrix(SoGetMatrixAction *action);
00324 virtual void handleEvent(SoHandleEventAction *action);
00325 virtual void search(SoSearchAction *action);
00326 virtual void pick(SoPickAction *action);
00327 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00328
00329 private:
00330 static void initClass();
00331 static void exitClass();
00332 const SbString & getBasePath() { return basePath; }
00333 void setBasePath( const SbString &path ) { basePath = path; }
00334
00335
00336 virtual SoChildList *getChildren() const;
00337
00338 private:
00339 virtual ~SoVRMLInline();
00340
00341 virtual void addBoundingBoxChild(SbVec3f center, SbVec3f size);
00342
00343
00344 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00345
00346
00347
00348 virtual void copyContents(const SoFieldContainer *fromFC,
00349 SbBool copyConnections);
00350
00351 private:
00352 SbString basePath;
00353 void requestChildrenFromURL();
00354
00355 SoChildList *children;
00356 SbBool kidsRequested;
00357 SbBool kidsAreHere;
00358 SbString fullURL;
00359
00360 static SbColor bboxColor;
00361 static BboxVisibility bboxVisibility;
00362
00363
00364 static SoVRMLInlineFetchURLCB *fetchURLcb;
00365 static void *fetchURLdata;
00366
00367
00368
00369 static SbBool readAsSoFile;
00370
00371 };
00372
00373
00374
00375
00376 #if defined(OIV_IGNORE_VRML_DEPRECATED)
00377 #pragma pop_macro("SoDEPRECATED_TYPEDEF")
00378 #pragma pop_macro("SoDEPRECATED_CLASS")
00379 #endif
00380
00381 #endif
00382