# SoVRMLInline.h

    00001 /**************************************************************************\
    00002  *
    00003  *  This file is part of the Coin 3D visualization library.
    00004  *  Copyright (C) 1998-2003 by Systems in Motion.  All rights reserved.
    00005  *
    00006  *  This library is free software; you can redistribute it and/or
    00007  *  modify it under the terms of the GNU General Public License
    00008  *  ("GPL") version 2 as published by the Free Software Foundation.
    00009  *  See the file LICENSE.GPL at the root directory of this source
    00010  *  distribution for additional information about the GNU GPL.
    00011  *
    00012  *  For using Coin with software that can not be combined with the GNU
    00013  *  GPL, and for taking advantage of the additional benefits of our
    00014  *  support services, please contact Systems in Motion about acquiring
    00015  *  a Coin Professional Edition License.
    00016  *
    00017  *  See <URL:http://www.coin3d.org> for  more information.
    00018  *
    00019  *  Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY.
    00020  *  <URL:http://www.sim.no>.
    00021  *
    00022 \**************************************************************************/
    00023
    00024 #ifndef COIN_SOVRMLINLINE_H
    00025 #define COIN_SOVRMLINLINE_H
    00026
    00027 #include <Inventor/nodes/SoSubNode.h>
    00028 #include <Inventor/nodes/SoNode.h>
    00029 #include <Inventor/fields/SoSFVec3f.h>
    00030 #include <Inventor/fields/SoMFString.h>
    00031
    00032 class SbColor;
    00033 class SoVRMLInline;
    00034 class SoVRMLInlineP;
    00035 class SoGroup;
    00036 class SoSensor;
    00037
    00038 typedef void SoVRMLInlineFetchURLCB(const SbString &, void *, SoVRMLInline *);
    00039
    00040 class COIN_DLL_API SoVRMLInline : public SoNode
    00041 {
    00042   typedef SoNode inherited;
    00043   SO_NODE_HEADER(SoVRMLInline);
    00044
    00045 public:
    00046   static void initClass(void);
    00047   SoVRMLInline(void);
    00048
    00049   enum BboxVisibility {
    00050     NEVER,
    00051     UNTIL_LOADED,
    00052     ALWAYS
    00053   };
    00054
    00055   SoSFVec3f bboxCenter;
    00056   SoSFVec3f bboxSize;
    00057   SoMFString url;
    00058
    00059   void setFullURLName(const SbString & url);
    00060   const SbString & getFullURLName(void);
    00061
    00062   SoGroup * copyChildren(void) const;
    00063   void requestURLData(void);
    00064   SbBool isURLDataRequested(void) const;
    00065   SbBool isURLDataHere(void) const;
    00066
    00067   void cancelURLDataRequest(void);
    00068   void setChildData(SoNode * urlData);
    00069   SoNode * getChildData(void) const;
    00070
    00071   static void setFetchURLCallBack(SoVRMLInlineFetchURLCB * f, void * closure);
    00072   static void setBoundingBoxVisibility(BboxVisibility b);
    00073   static BboxVisibility getBoundingBoxVisibility(void);
    00074   static void setBoundingBoxColor(SbColor & color);
    00075   static SbColor & getBoundingBoxColor(void);
    00076   static void setReadAsSoFile(SbBool enable);
    00077   static SbBool getReadAsSoFile(void);
    00078
    00079   virtual void doAction(SoAction * action);
    00080   virtual void callback(SoCallbackAction * action);
    00081   virtual void GLRender(SoGLRenderAction * action);
    00082   virtual void getBoundingBox(SoGetBoundingBoxAction * action);
    00083   virtual void getMatrix(SoGetMatrixAction * action);
    00084   virtual void handleEvent(SoHandleEventAction * action);
    00085   virtual void search(SoSearchAction * action);
    00086   virtual void pick(SoPickAction * action);
    00087   virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
    00088   virtual SoChildList * getChildren(void) const;
    00089
    00090 private:
    00091   virtual ~SoVRMLInline();
    00092
    00093   virtual void addBoundingBoxChild(SbVec3f center, SbVec3f size);
    00094   virtual SbBool readInstance(SoInput * in, unsigned short flags);
    00095   virtual void copyContents(const SoFieldContainer * from, SbBool copyconn);
    00096   virtual SbBool readLocalFile(SoInput * in);
    00097
    00098   static void urlFieldModified(void * userdata, SoSensor * sensor);
    00099
    00100   SoVRMLInlineP * pimpl;
    00101 };
    00102
    00103 #endif // ! COIN_SOVRMLINLINE_H
    00104
    00105