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

SoNodeVisualize.h
1 #ifndef COIN_SONODEVISUALIZE_H
2 #define COIN_SONODEVISUALIZE_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/nodekits/SoBaseKit.h>
28 #include <Inventor/nodes/SoSeparator.h>
29 #include <Inventor/lists/SoNodeList.h>
30 #include <Inventor/tools/SbPimplPtr.h>
31 #include <Inventor/SbVec2s.h>
32 #include <Inventor/SbVec3f.h>
33 
34 // *************************************************************************
35 
36 // FIXME: i don't like the name of this class. "SoScenegraphStructure"
37 // or some such would be better. -mortene.
38 
39 class SoProfilerStats;
40 
41 class COIN_DLL_API SoNodeVisualize : public SoBaseKit
42 {
43  typedef SoBaseKit inherited;
44 
45  SO_KIT_HEADER(SoNodeVisualize);
46  SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
47  SO_KIT_CATALOG_ENTRY_HEADER(childrenVisible);
48  SO_KIT_CATALOG_ENTRY_HEADER(color);
49  SO_KIT_CATALOG_ENTRY_HEADER(texture);
50  SO_KIT_CATALOG_ENTRY_HEADER(textureTransform);
51  SO_KIT_CATALOG_ENTRY_HEADER(shape);
52  SO_KIT_CATALOG_ENTRY_HEADER(rotSwitch);
53  SO_KIT_CATALOG_ENTRY_HEADER(rotation);
54  SO_KIT_CATALOG_ENTRY_HEADER(childGeometry);
55  SO_KIT_CATALOG_ENTRY_HEADER(translation);
56  SO_KIT_CATALOG_ENTRY_HEADER(lines);
57  SO_KIT_CATALOG_ENTRY_HEADER(lineSep);
58 
59 public:
60  static void initClass(void);
61  static void cleanClass(void);
62 
63  SoNodeVisualize * visualize(SoNode *);
64  static SoNodeVisualize* visualizeTree(SoNode * node,int depth=-1);
65  bool clicked();
66  void setAlternate(bool alternating=true);
67  bool nodeHasChildren();
68  unsigned int nodeNumChildren();
69  bool isAlternating() const;
70 
71  virtual void handleEvent(SoHandleEventAction * action);
72 
73  void traverse(SoProfilerStats * stats);
74 
75 protected:
76  SoNodeVisualize(void);
77  virtual ~SoNodeVisualize();
78  SbVec2s getWidth() ;
79 
80  void setupChildCatalog(SoNode * node, int depth);
81  void visualizeSubTree(SoNode * node,int depth=-1);
82  void recalculate();
83  SbVec2s recalculateWidth();
84  SoNodeVisualize* getSoNodeVisualizeRoot();
85  void internalAlternating(bool alternating, int direction);
86  void reset();
87  SoNodeList * getChildGeometry();
88 
89  private:
90  SbPimplPtr<class SoNodeVisualizeP> pimpl;
91 
92  // NOT IMPLEMENTED
93  SoNodeVisualize(const SoNodeVisualize &);
94  SoNodeVisualize & operator = (const SoNodeVisualize &);
95 
96  bool dirty;
97  SbVec2s width;
98  SoNodeVisualize *parent;
99 
100  SoNode *node;
101 };
102 
103 #endif // !COIN_SONODEVISUALIZE_H
The SoBaseKit class is the toplevel superclass for nodekits.Node kits are collections of nodes and ot...
Definition: SoBaseKit.h:57
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoProfilerStats class is a node for exposing profiling results gathered by SoProfilerElement.
Definition: SoProfilerStats.h:38
virtual void handleEvent(SoHandleEventAction *action)
Definition: SoBaseKit.cpp:1065
The SoHandleEventAction class distributes user events to the scene.This is the action used by the GUI...
Definition: SoHandleEventAction.h:37
The SoNodeList class is a container for pointers to SoNode objects.
Definition: SoNodeList.h:31
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41

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

Generated on Wed Feb 7 2018 for Coin by Doxygen 1.8.14.