Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoTabDialog.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-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2002)
22**=======================================================================*/
23#ifndef _SO_TAB_DIALOG_
24#define _SO_TAB_DIALOG_
25
26#include <DialogViz/dialog/SoDialogGroup.h>
27#include <DialogViz/SoDialogWidgetList.h>
28#include <Inventor/fields/SoMFVec2f.h>
29
30class SoClipPlane;
31class SoNodeSensor;
33
94{
95 SO_DG_HEADER(SoTabDialog);
96
97 public:
98
111
116
121
126
131
136
137 /*==============================================================================*/
138 private:
139 virtual void buildWidget(SoWidget parent, SbVec2i32& rSize, SbVec2i32& pos, SbBool isActive2d);
140 virtual void eventNotify(unsigned int event, uintptr_t param);
141 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
142 static void initClass();
143 static void exitClass();
144 virtual void updateFromSensor(SoSensor* sensor);
145 virtual void destroyWidget();
146
147 void GLRender(SoGLRenderAction* action);
148
149 SoDialogWidgetList m_tabPageWidgetsList;
150 SoDialogWidgetList m_tabPageButtonsList;
151
152 void changeTabSelectedPage(SoWidget widg);
153 void changeEnableChild(int index);
154 void changePageLabel(int index);
155 void updateSelectedPage();
156 void updateTabPageWidget(int index);
157 void updateTabWidget();
158
159 /* === CHILDREN MANAGEMENT === */
160 virtual void addChild(SoDialogComponent *child);
161 virtual void removeChild(int index);
162 virtual void removeChild(SoDialogComponent *child) { removeChild(findChild(child)); }
163 virtual void removeAllChildren();
164 virtual void insertChild(SoDialogComponent *child, int newChildIndex);
165 virtual void replaceChild(int index, SoDialogComponent *newChild);
166 virtual void replaceChild(SoDialogComponent *oldChild, SoDialogComponent *newChild) { replaceChild(findChild(oldChild), newChild); }
167 virtual void updateAfterSceneGraphChange();
168
169 // Internal child management following inheritance of classes.
170 virtual void internalRemoveChild( int index ) { removeChild(index); }
171 virtual void internalRemoveChild( SoNode *child ) { removeChild(findChild(dynamic_cast<SoDialogComponent*>(child))); }
172 virtual void internalRemoveAllChildren() { removeAllChildren(); }
173 virtual void internalAddChild( SoNode *child ) { SoDialogGroup::internalAddChild(child); }
174 virtual int internalFindChild( const SoNode *child ) const { return SoDialogGroup::internalFindChild(child); }
175 virtual void internalInsertChild( SoNode *child, int newChildIndex ) { SoDialogGroup::internalInsertChild(child, newChildIndex); }
176 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
177 virtual void internalReplaceChild( int index, SoNode *newChild) { SoDialogGroup::internalReplaceChild(index, dynamic_cast<SoDialogComponent*>(newChild)); }
178 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(dynamic_cast<SoDialogComponent*>(oldChild),dynamic_cast<SoDialogComponent*>(newChild)); }
179
180 void* getLayout(int index);
181
182 private:
183 virtual ~SoTabDialog();
184 virtual void fixSizeWithBorder(SbVec2i32 &size, int revert = 1);
185
186 private:
187 int m_numChildren;
188 int m_firstPage;
189 int m_previousSelected;
190 SoWidget m_tabWidget;
191 SoWidget m_arrowLeft;
192 SoWidget m_arrowRight;
193 SoWidget m_tabContainer;
194 SoWidget m_maskLine;
195
196 void createTabWidget();
197 void createTabPageWidget(int index);
198 void changeArrowState();
199 void updateMaskLine();
200
201 void drawItem(uintptr_t param);
202
203 virtual SbVec2i32 getComponentInitSize();
204 virtual void setChildrenComponentSize();
205 virtual void setChildrenLabelSize();
206
207 void changeFirstPageRight();
208 void changeFirstPageLeft();
209 virtual void changeSelectedPage();
210 virtual void changeEnable();
211 virtual void changeWidgetEnable(SbBool state);
212
213 static void childrenSensor(void *data, SoSensor *sensor);
214
215 FIELD_SENSOR(selectedPage);
216 // FIELD_SENSOR(tabsLocation);
217
219// 3D methods
220private:
221 static char* TabDialog; //Internal default skin.
222 static void change3DSkin();
223 static SbBool isSkinLoaded();
224 static void setSkinLoaded(SbBool loaded);
225 void change3DPages();
226 void applyDlgCptAuditor();
227
228private:
229 SO_DG_CATALOG_ENTRY_HEADER( pagesSep );
230 SO_DG_CATALOG_ENTRY_HEADER( pageSep );
231 SO_DG_CATALOG_ENTRY_HEADER( pageSwitch );
232 SO_DG_CATALOG_ENTRY_HEADER( labelSep );
233 SO_DG_CATALOG_ENTRY_HEADER( labelSwitch );
234 SO_DG_CATALOG_ENTRY_HEADER( selected );
235 SO_DG_CATALOG_ENTRY_HEADER( unselected );
236 SO_DG_CATALOG_ENTRY_HEADER( textSep );
237 SO_DG_CATALOG_ENTRY_HEADER( textProp );
238 SO_DG_CATALOG_ENTRY_HEADER( buttonsSep );
239 SO_DG_CATALOG_ENTRY_HEADER( lButtonSep );
240 SO_DG_CATALOG_ENTRY_HEADER( lButtonSwtch );
241 SO_DG_CATALOG_ENTRY_HEADER( lButtonPressed );
242 SO_DG_CATALOG_ENTRY_HEADER( lButtonReleased );
243 SO_DG_CATALOG_ENTRY_HEADER( rButtonSep );
244 SO_DG_CATALOG_ENTRY_HEADER( rButtonSwtch );
245 SO_DG_CATALOG_ENTRY_HEADER( rButtonPressed );
246 SO_DG_CATALOG_ENTRY_HEADER( rButtonReleased );
247 SO_DG_CATALOG_ENTRY_HEADER( frameSep );
248 SO_DG_CATALOG_ENTRY_HEADER( frame );
249
250 SoScale *tabFrameScale, *tabButtonsScale, *tabLabelFrameScale;
251 SoText3 *tabText;
252 SoTransform *tabLabelFrameTransform;
253 SoTranslation *tabFrameTranslation, *tabButtonsTranslation, *tabPageTranslation, *tabTextTranslation;
254 SoClipPlane *m_clipWidth, *m_clipHeight;
255
256private:
257 SoNodeList m_childSwitchList;
258 SoNodeList m_labelSwitchList;
259 SoNodeList m_labelSepList;
260 SoNodeList m_labelTransfList;
261 SoNodeList m_labelTranslList;
262 SoNodeList m_tabTextList;
263 SoNodeList m_tabLabelScaleList;
264 SoNodeList m_tabTextTranslList;
265
266 SoMFVec2f m_labelDim;
267 float m_mTabCacheDepth;
268 int m_prevNumOfChildren;
269 int m_frameLabelHeight;
270 SbBool m_isUsedClipPlane;
271 SbBool m_changeComeFromCB;
272 static SbBool m_isSkinLoaded;
273
274 void create3DTabDialog();
275 void update3DTabDialog();
276 void change3DSelectedPage();
277 void update3DTabDialogPage(int index);
278 void change3DFirstPageRight();
279 void change3DFirstPageLeft();
280
281 virtual void change3DPosition();
282
283 virtual void show3D(SbBool show);
284 static void startCB3D( void *, SoDragger *inDragger );
285 static void finishCB3D( void *, SoDragger *inDragger );
286 void draggerStartCallback3D();
287 void draggerFinishCallback3D();
288
289 SoNodeSensor* m_thisNodeSensor;
290
292
293};
294
295#endif // _SO_TAB_DIALOG_
296
297
2D vector class.
Definition SbVec.h:517
Clipping plane node.
Definition SoClipPlane.h:94
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
virtual int findChild(const SoDialogComponent *child) const
Finds index of given child within group.
virtual SoNode * getChild(int index) const
Returns pointer to child node with the given index.
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:537
Renders a scene graph using Open Inventor's Render Engine.
Multiple-value field containing any number of two-dimensional vectors.
Definition SoMFVec2f.h:89
Abstract base class for all database nodes.
Definition SoNode.h:145
Maintains a list of pointers to nodes.
Definition SoNodeList.h:74
Sensor class that can be attached to Open Inventor nodes.
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Node representing a 3D geometric scaling.
Definition SoScale.h:96
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> Tab Dialog audit...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Class that creat...
Definition SoTabDialog.h:94
SoSFEnum tabsLocation
Specifies location of the tabs.
@ LEFT
Tabs appear vertically on the left side of controls.
@ BOTTOM
Tabs appear at the bottom of the control.
@ RIGHT
Tabs appear vertically on the right side of controls.
@ TOP
Tabs appear at the top of the control (default).
void removeAuditor(SoTabDialogAuditor *auditor)
Removes the specified TabDialogAuditor from the auditor list.
SoSFInt32 selectedPage
Specifies currently selected tab page.
SoTabDialog()
Constructor.
void addAuditor(SoTabDialogAuditor *auditor)
Adds a TabDialogAuditor to current TabDialog component.
3D text shape node.
Definition SoText3.h:204
General 3D geometric transformation node.
Node representing a 3D translation.
int SbBool
Boolean type.
Definition SbBase.h:87