Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoDialogComponent.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_DIALOG_COMPONENT_
24#define _SO_DIALOG_COMPONENT_
25
26#include <DialogViz/dialog/SoTopComponent.h>
27#include <Inventor/fields/SoSFEnum.h>
28#include <Inventor/fields/SoSFInt32.h>
29
30class SoTransform ;
31class SoTranslation;
32class SoScale;
33
74{
75 SO_DG_HEADER(SoDialogComponent);
76
77 public:
78
85
92
98
104
110
116
122
128
137
142
148
149
150/*==============================================================================*/
151private:
152
153 static void initClass();
154 static void exitClass();
155 virtual void buildWidget(SoWidget parent, SbVec2i32 & rSize, SbVec2i32 & pos, SbBool isActive2d);
156 virtual void destroyWidget();
157 virtual SoWidget getLabelWidget();
158 virtual void eventNotify(unsigned int event, uintptr_t param);
159 virtual void updateFromSensor(SoSensor* sensor);
160 virtual void setLabelSize(SbVec2i32& size);
161 virtual void setComponentSize(SbVec2i32 &size);
162 virtual SbVec2i32 getComponentInitSize();
163 virtual SbVec2i32 getLabelInitSize();
164 virtual void setFocus() {};
165 virtual void changeWidgetEnable(SbBool state);
166 virtual void resetSize();
167 void getSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
168 SoWidget getWidget();
169 void get2DComponentSize(SbVec2i32& size, SbVec2i32 &pos);
170 void get3DComponentSize(SbVec2i32& size, SbVec2i32 &pos);
171 void* getLayout();
172
173private:
174
175 SoWidget m_labelWidget;
176 bool m_ownLabelWidget;
177
178 SoWidget m_componentWidget;
179
180 void * m_layout;
181 void * m_spacer;
182 SbVec2i32 m_componentSize;
183 SbVec2i32 m_labelSize;
184 SbVec2i32 m_componentInitSize; // keep component init size to speed up computing.
185 SbVec2i32 m_labelInitSize; // keep component init size to speed up computing.
186 SbVec2i32 m_olSize;
187
189 virtual ~SoDialogComponent();
190 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
191 void getDefaultState(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
192
193 virtual void changeLabelVisibility() {};
194 virtual void changeLabelAlignment();
195 virtual void changeEdgeStyle();
196 virtual void updateComponentWidget();
197 virtual void changeEnable();
198 virtual void changeWidth();
199 virtual void changeHeight();
200 virtual void changeMinMaxSize();
201
202private:
203
204 SbVec2i32 m_pos;
205 SbVec2i32 m_initSize;
206 SbVec2i32 m_initMinSize;
207 SbVec2i32 m_initMaxSize;
208 SbBool m_isFirstBuild;
209
210 FIELD_SENSOR(edgeStyle);
211 FIELD_SENSOR(labelVisibility);
212 FIELD_SENSOR(width);
213 FIELD_SENSOR(height);
214 FIELD_SENSOR(minWidth);
215 FIELD_SENSOR(minHeight);
216 FIELD_SENSOR(maxWidth);
217 FIELD_SENSOR(maxHeight);
218
219 void createComponentWidget(SoWidget parent);
220 void setSize(int32_t sw, int32_t sh, int32_t smw, int32_t smh, int32_t smmw, int32_t smmh);
221 void setDefaultState();
222
224// 3D methods
225private:
226 static char* DialogComponent; // Internal default skins.
227 static void change3DSkin();
228 static SbBool isSkinLoaded();
229 static void setSkinLoaded(SbBool loaded);
230
231 SO_DG_CATALOG_ENTRY_HEADER(mainCptSeparator);
232 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleSwitch);
233 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleNone);
234 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleShadowIn);
235 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleShadowOut);
236
237 SoTranslation *componentTranslation; // need this translation to be reported to children
238 SoTransform *componentTransform;
239
240 private:
241
242 SoScale* componentScale;
243 float m_mComponentCachedDepth;
244
245 virtual void change3DLabelVisibility() {};
246 virtual void change3DEdgeStyle();
247
248 private:
249
250 void update3DDialogComponent();
251 void create3DDialogComponent();
252
253 static SbBool m_isSkinLoaded;
254
255private:
256 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
257
259};
260
261#endif // _SO_DIALOG_COMPONENT_
262
263
2D vector class.
Definition SbVec.h:517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
SoSFBool fixedWidth
When set to FALSE, this allows the component to be resized in the width direction.
SoSFBool fixedHeight
When set to FALSE, this allows the component to be resized in the height direction.
SoSFInt32 height
Preferred height of the element.
SoSFEnum edgeStyle
Controls the appearance of the edges of the component.
@ NONE
The component does not have any border (default).
@ SHADOW_OUT
The component edge appears raised (sticks out).
@ SHADOW_IN
The component edge appears depressed (goes in).
SoSFInt32 maxHeight
Sets maximum component height.
SoSFInt32 minHeight
Sets minimum component height.
SoSFInt32 minWidth
Sets minimum component width.
SoSFInt32 width
Preferred width of the element.
SoSFBool labelVisibility
Specifies if the label of the component defined in SoDialogViz is visible or not.
SoSFInt32 maxWidth
Sets maximum component width.
Computes bounding box of a scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
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> Abstract Class f...
General 3D geometric transformation node.
Node representing a 3D translation.
int SbBool
Boolean type.
Definition SbBase.h:87