1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: SoDetectorTreeKit.h,v 1.5 2006/06/29 21:21:16 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: HEAD $ |
---|
29 | // |
---|
30 | /*-----------------------------HEPVis----------------------------------------*/ |
---|
31 | /* */ |
---|
32 | /* Node: SoDetectorTreeKit */ |
---|
33 | /* Description: Easy way of browsing through a tree of detectors */ |
---|
34 | /* Author: Joe Boudreau Nov 11 1996 */ |
---|
35 | /* */ |
---|
36 | /*---------------------------------------------------------------------------*/ |
---|
37 | #ifndef HEPVis_SoDetectorTreeKit_h |
---|
38 | #define HEPVis_SoDetectorTreeKit_h |
---|
39 | |
---|
40 | // Inheritance : |
---|
41 | #include <Inventor/nodekits/SoBaseKit.h> |
---|
42 | |
---|
43 | class SoEventCallback; |
---|
44 | class SoSeparator; |
---|
45 | |
---|
46 | #define SoDetectorTreeKit Geant4_SoDetectorTreeKit |
---|
47 | |
---|
48 | |
---|
49 | class SoDetectorTreeKit:public SoBaseKit { |
---|
50 | |
---|
51 | // The following is required: |
---|
52 | SO_KIT_HEADER(SoDetectorTreeKit); |
---|
53 | //////////////////////////////////////////// |
---|
54 | public: |
---|
55 | SoSFNode alternateRep; //public in order to query if alternateRep done. |
---|
56 | private: |
---|
57 | //////////////////////////////////////////// |
---|
58 | SO_KIT_CATALOG_ENTRY_HEADER(callbackList); |
---|
59 | SO_KIT_CATALOG_ENTRY_HEADER(topSeparator); |
---|
60 | SO_KIT_CATALOG_ENTRY_HEADER(pickStyle); |
---|
61 | SO_KIT_CATALOG_ENTRY_HEADER(appearance); |
---|
62 | SO_KIT_CATALOG_ENTRY_HEADER(units); |
---|
63 | SO_KIT_CATALOG_ENTRY_HEADER(transform); |
---|
64 | SO_KIT_CATALOG_ENTRY_HEADER(texture2Transform); |
---|
65 | SO_KIT_CATALOG_ENTRY_HEADER(childList); |
---|
66 | SO_KIT_CATALOG_ENTRY_HEADER(previewSeparator); |
---|
67 | SO_KIT_CATALOG_ENTRY_HEADER(fullSeparator); |
---|
68 | |
---|
69 | |
---|
70 | public: |
---|
71 | |
---|
72 | // Constructor, required |
---|
73 | SoDetectorTreeKit(); |
---|
74 | |
---|
75 | // This is required |
---|
76 | virtual SbBool affectsState() const; |
---|
77 | |
---|
78 | // Class Initializer, required |
---|
79 | static void initClass(); |
---|
80 | |
---|
81 | // Turn the preview on or off |
---|
82 | virtual void setPreview(SbBool Flag); |
---|
83 | |
---|
84 | // Return the preview state |
---|
85 | virtual SbBool getPreview() const; |
---|
86 | |
---|
87 | // Set SoSwitch::whichChild = SO_SWITCH_ALL |
---|
88 | void setPreviewAndFull(); |
---|
89 | |
---|
90 | // Return the preview Separator |
---|
91 | virtual SoSeparator *getPreviewSeparator() const; |
---|
92 | |
---|
93 | // Return the full Separator |
---|
94 | virtual SoSeparator *getFullSeparator() const; |
---|
95 | |
---|
96 | // Generate AlternateRep, required. Generating an alternate representation |
---|
97 | // must be done upon users request. It allows an Inventor program to read |
---|
98 | // back the file without requiring *this* code to be dynamically linked. |
---|
99 | // If the users expects that *this* code will be dynamically linked, he |
---|
100 | // need not invoke this method. |
---|
101 | virtual void generateAlternateRep(); |
---|
102 | |
---|
103 | // We better be able to clear it, too! |
---|
104 | virtual void clearAlternateRep(); |
---|
105 | |
---|
106 | protected: |
---|
107 | |
---|
108 | // Destructor. |
---|
109 | virtual ~SoDetectorTreeKit(); |
---|
110 | |
---|
111 | virtual void doAction(SoAction*); |
---|
112 | private: |
---|
113 | |
---|
114 | // This is needed as well |
---|
115 | void createInitialTree(); |
---|
116 | |
---|
117 | // This is the callback function that will be |
---|
118 | // added to the callback list |
---|
119 | static void expand (void *userData, SoEventCallback *eventCB); |
---|
120 | static void contract (void *userData, SoEventCallback *eventCB); |
---|
121 | }; |
---|
122 | |
---|
123 | #endif |
---|