Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoMenuBar.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2018 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2002)
22**=======================================================================*/
23#ifndef _SO_MENU_BAR_
24#define _SO_MENU_BAR_
25
26#include <DialogViz/dialog/SoTopComponent.h>
27#include <DialogViz/dialog/SoMenuPopup.h>
28
29class SoDialogAuditor;
30
77{
78 SO_DG_HEADER(SoMenuBar);
79
80 public:
81
86
91
96
102
106 virtual void addChild(SoMenuPopup *child);
107
111 virtual void insertChild(SoMenuPopup *child, int newChildIndex);
112
116 virtual SoNode *getChild(int index) const;
117
121 virtual int getNumChildren() const;
122
126 virtual int findChild(const SoMenuPopup *child) const;
127
131 virtual void removeChild(int index);
132
136 virtual void removeChild(SoMenuPopup *child);
137
141 virtual void removeAllChildren();
142
146 virtual void replaceChild(int index, SoMenuPopup *newChild);
147
151 virtual void replaceChild(SoMenuPopup *oldChild, SoMenuPopup *newChild);
152
153/*==============================================================================*/
154private:
155 virtual SoChildList *getChildren() const;
156
157 virtual void buildWidget(SoWidget parent, SbVec2i32 &, SbVec2i32 & pos, SbBool isActive2d);
158 virtual void destroyWidget();
159 static void initClass();
160 static void exitClass();
161 virtual void updateFromSensor(SoSensor* sensor);
162 void* getMenu(void* parent);
163 void destroyNoDeleteMenuItems();
164 void updateChildren();
165 virtual void updateAfterSceneGraphChange();
166
167 // Internal child management following inheritance of classes.
168 virtual void internalRemoveChild( int index ) { removeChild(index); }
169 virtual void internalRemoveChild( SoNode *child ) { removeChild(findChild(dynamic_cast<SoMenuPopup*>(child))); }
170 virtual void internalRemoveAllChildren() { removeAllChildren(); }
171 virtual void internalAddChild( SoNode *child ) { addChild(dynamic_cast<SoMenuPopup*>(child)); }
172 virtual int internalFindChild( const SoNode *child ) const { return findChild(dynamic_cast<const SoMenuPopup*>(child)); }
173 virtual void internalInsertChild( SoNode *child, int newChildIndex ) { insertChild(dynamic_cast<SoMenuPopup*>(child), newChildIndex); }
174 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
175 virtual void internalReplaceChild( int index, SoNode *newChild) { replaceChild(index, dynamic_cast<SoMenuPopup*>(newChild)); }
176 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(dynamic_cast<SoMenuPopup*>(oldChild),dynamic_cast<SoMenuPopup*>(newChild)); }
177
178private:
179
180 // Reads stuff into instance of SoGroup. Returns FALSE on error
181 virtual SbBool readInstance(SoInput *in, unsigned short flags);
182
183 // Reads just the children into instance of SoGroup. Returns FALSE on error
184 virtual SbBool readChildren(SoInput *in);
185
186 virtual ~SoMenuBar();
187 virtual void getSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
188
189 private:
190 int m_numberOfChildren;
191 void* m_menuBarWin;
192 SbBool m_firstBuild;
193
194 void createMenuBar(SoWidget parent);
195 SbBool existMenuBar();
196 void updateMenuBar();
197 virtual void changeEnable();
198 virtual void applyAuditor(SoDialogViz* dlgCpt);
199
201// 3D methods
202private:
203 static char* MenuBar; //Internal default skin.
204 static void change3DSkin();
205 static SbBool isSkinLoaded();
206 static void setSkinLoaded(SbBool loaded);
207
208 virtual void show3D(SbBool show);
209 void show3DChildren(SbBool show);
210 virtual void set3DParentTranslation(SbVec3f& tsl);
211 void update3DChildrenSize();
212
213private:
214 SO_DG_CATALOG_ENTRY_HEADER( frameSep );
215 SO_DG_CATALOG_ENTRY_HEADER( frame );
216
217 SoScale* menuBarFrameScale;
218 SoTranslation* menuBarFrameTranslation;
219 SoTransform* menuBarFrameTransform;
220
221private:
222 static SbBool m_isSkinLoaded;
223 float m_mBarCachedDepth;
224
225 void create3DBar();
226 void update3DBar();
227 void update3DChildren();
228 virtual void change3DPosition();
229
230private:
231 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
232 virtual void rayPick(SoRayPickAction *action);
233 virtual void search(SoSearchAction *action);
234 virtual void write(SoWriteAction *action);
235
237
238};
239
240#endif // _SO_MENU_BAR_
241
242
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:517
3D vector class.
Definition SbVec.h:932
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog auditor
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Computes bounding box of a scene.
Used to read Open Inventor data files.
Definition SoInput.h:363
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Menu bar node.
Definition SoMenuBar.h:77
SoDialogViz * searchForAuditorId(SbString id)
Retrieves the DialogViz object from the specified auditorID field in an SoMenuBar structure.
virtual void addChild(SoMenuPopup *child)
Adds a child as last one in group.
virtual int findChild(const SoMenuPopup *child) const
Finds index of given child within group.
virtual void replaceChild(int index, SoMenuPopup *newChild)
Replaces child with given index with new child.
virtual void replaceChild(SoMenuPopup *oldChild, SoMenuPopup *newChild)
Replaces first instance of given child with new child.
virtual void removeChild(SoMenuPopup *child)
Removes first instance of given child from group.
virtual void insertChild(SoMenuPopup *child, int newChildIndex)
Adds a child so that it becomes the one with the given index.
virtual void removeAllChildren()
Removes all children from group.
virtual SoNode * getChild(int index) const
Returns pointer to child node with the given index.
SoMenuBar()
Constructor.
void addAuditor(SoDialogAuditor *auditor)
Adds a DialogAuditor to current menu bar component.
virtual int getNumChildren() const
Returns number of children.
void removeAuditor(SoDialogAuditor *auditor)
Removes the specified DialogAuditor from the auditor list.
virtual void removeChild(int index)
Removes child with given index from group.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Menu Popup node.
Definition SoMenuPopup.h:65
Abstract base class for all database nodes.
Definition SoNode.h:145
friend class SoChildList
Definition SoNode.h:473
Intersects objects with a ray cast into scene.
Node representing a 3D geometric scaling.
Definition SoScale.h:96
Searches for nodes in a scene graph.
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract Class f...
General 3D geometric transformation node.
Node representing a 3D translation.
Writes a scene graph to a file.
int SbBool
Boolean type.
Definition SbBase.h:87