Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoNodeVisualize.h
00001 #ifndef COIN_SONODEVISUALIZE_H
00002 #define COIN_SONODEVISUALIZE_H
00003 
00004 /**************************************************************************\
00005  *
00006  *  This file is part of the Coin 3D visualization library.
00007  *  Copyright (C) by Kongsberg Oil & Gas Technologies.
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU General Public License
00011  *  ("GPL") version 2 as published by the Free Software Foundation.
00012  *  See the file LICENSE.GPL at the root directory of this source
00013  *  distribution for additional information about the GNU GPL.
00014  *
00015  *  For using Coin with software that can not be combined with the GNU
00016  *  GPL, and for taking advantage of the additional benefits of our
00017  *  support services, please contact Kongsberg Oil & Gas Technologies
00018  *  about acquiring a Coin Professional Edition License.
00019  *
00020  *  See http://www.coin3d.org/ for more information.
00021  *
00022  *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
00023  *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
00024  *
00025 \**************************************************************************/
00026 
00027 #include <Inventor/nodekits/SoBaseKit.h>
00028 #include <Inventor/nodes/SoSeparator.h>
00029 #include <Inventor/lists/SoNodeList.h>
00030 #include <Inventor/tools/SbPimplPtr.h>
00031 #include <Inventor/SbVec2s.h>
00032 #include <Inventor/SbVec3f.h>
00033 
00034 // *************************************************************************
00035 
00036 // FIXME: i don't like the name of this class. "SoScenegraphStructure"
00037 // or some such would be better.  -mortene.
00038 
00039 class SoProfilerStats;
00040 
00041 class COIN_DLL_API SoNodeVisualize : public SoBaseKit
00042 {
00043   typedef SoBaseKit inherited;
00044 
00045   SO_KIT_HEADER(SoNodeVisualize);
00046   SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
00047   SO_KIT_CATALOG_ENTRY_HEADER(childrenVisible);
00048   SO_KIT_CATALOG_ENTRY_HEADER(color);
00049   SO_KIT_CATALOG_ENTRY_HEADER(texture);
00050   SO_KIT_CATALOG_ENTRY_HEADER(textureTransform);
00051   SO_KIT_CATALOG_ENTRY_HEADER(shape);
00052   SO_KIT_CATALOG_ENTRY_HEADER(rotSwitch);
00053   SO_KIT_CATALOG_ENTRY_HEADER(rotation);
00054   SO_KIT_CATALOG_ENTRY_HEADER(childGeometry);
00055   SO_KIT_CATALOG_ENTRY_HEADER(translation);
00056   SO_KIT_CATALOG_ENTRY_HEADER(lines);
00057   SO_KIT_CATALOG_ENTRY_HEADER(lineSep);
00058 
00059 public:
00060   static void initClass(void);
00061   static void cleanClass(void);
00062 
00063   SoNodeVisualize * visualize(SoNode *);
00064   static SoNodeVisualize* visualizeTree(SoNode * node,int depth=-1);
00065   bool clicked();
00066   void setAlternate(bool alternating=true);
00067   bool nodeHasChildren();
00068   unsigned int nodeNumChildren();
00069   bool isAlternating() const;
00070 
00071   virtual void handleEvent(SoHandleEventAction * action);
00072 
00073   void traverse(SoProfilerStats * stats);
00074 
00075 protected:
00076   SoNodeVisualize(void);
00077   virtual ~SoNodeVisualize();
00078   SbVec2s getWidth() ;
00079 
00080   void setupChildCatalog(SoNode * node, int depth);
00081   void visualizeSubTree(SoNode * node,int depth=-1);
00082   void recalculate();
00083   SbVec2s recalculateWidth();
00084   SoNodeVisualize* getSoNodeVisualizeRoot();
00085   void internalAlternating(bool alternating, int direction);
00086   void reset();
00087   SoNodeList * getChildGeometry();
00088 
00089  private:
00090   SbPimplPtr<class SoNodeVisualizeP> pimpl;
00091 
00092   // NOT IMPLEMENTED
00093   SoNodeVisualize(const SoNodeVisualize &);
00094   SoNodeVisualize & operator = (const SoNodeVisualize &);
00095 
00096   bool dirty;
00097   SbVec2s width;
00098   SoNodeVisualize *parent;
00099 
00100   SoNode *node;
00101 };
00102 
00103 #endif // !COIN_SONODEVISUALIZE_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen 1.7.5.1.