Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoDialogCheckBox.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-2014 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_CHECK_BOX_
24#define _SO_DIALOG_CHECK_BOX_
25
26#include <DialogViz/dialog/SoDialogComponent.h>
27
29class SoText3;
30class SoSeparator;
31class SoSwitch;
32
112{
113 SO_DG_HEADER(SoDialogCheckBox);
114
115 public:
116
121
126
131
136
141
146
147 /*==============================================================================*/
148
149 private:
150 static void initClass();
151 static void exitClass();
152 virtual void buildWidget(SoWidget parent, SbVec2i32 &rSize, SbVec2i32 & pos, SbBool isActive2d);
153 virtual void destroyWidget();
154 virtual void eventNotify(unsigned int event, uintptr_t param);
155 virtual SoWidget getLabelWidget();
156 virtual void updateFromSensor(SoSensor* sensor);
157
158 void updateLabelWidget();
159 void updateCheckBoxWidget();
160
161 void applyDlgCptAuditor();
162
163 private:
164 SoWidget m_checkBoxWidget;
165
166 virtual ~SoDialogCheckBox();
167
168 /* === FIELDS DECLARATION === */
169 FIELD_SENSOR(state);
170 FIELD_SENSOR(onString);
171 FIELD_SENSOR(offString);
172
173 // local change methods
174 void changeOnOffString();
175
176 private:
177
178 SbVec2i32 m_oonSize, m_ooffSize, m_olSize;
179
180
181 /* === SIZE COMPUTING METHODS === */
182 virtual SbVec2i32 getComponentInitSize();
183 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
184
185 /* === CREATION METHODS === */
186 void createLabelWidget();
187 void createCheckBoxWidget();
188
189 // local change methods
190 void changeState();
191
192 // inherited change methods from SoDialogComponent
193 virtual void changeLabelVisibility();
194 virtual void changeEdgeStyle();
195
196 // inherited change methods from SoDialogViz
197 virtual void changeEnable();
198 virtual void changeWidgetEnable(SbBool state);
199 virtual void changeLabel();
200 virtual void changeLabelAlignment();
201
203// 3D methods
204private:
205 static char* DialogCheckBox; // Internal default skins.
206 static void change3DSkin();
207 static SbBool isSkinLoaded();
208 static void setSkinLoaded(SbBool loaded);
209
210private:
211 SO_DG_CATALOG_ENTRY_HEADER(frameSep);
212 SO_DG_CATALOG_ENTRY_HEADER(frame);
213 SO_DG_CATALOG_ENTRY_HEADER(stateSep);
214 SO_DG_CATALOG_ENTRY_HEADER(stateSwitch);
215 SO_DG_CATALOG_ENTRY_HEADER(stateOn);
216 SO_DG_CATALOG_ENTRY_HEADER(stateOff);
217 SO_DG_CATALOG_ENTRY_HEADER(labelSep);
218 SO_DG_CATALOG_ENTRY_HEADER(labelSwitch);
219 SO_DG_CATALOG_ENTRY_HEADER(labelProp);
220 SO_DG_CATALOG_ENTRY_HEADER(onOffStringSep);
221 SO_DG_CATALOG_ENTRY_HEADER(onOffStringProp);
222
223 SoText3 *checkBoxString, *checkBoxLabel;
224 SoTranslation *checkBoxLabelTranslation, *checkBoxButtonTranslation;
225 SoTranslation *checkBoxStringTranslation, *checkBoxFrameTranslation;
226 SoScale *checkBoxFrameScale;
227 SoTransform *checkBoxFrameTransform;
228
229 virtual void change3DState();
230 void change3DOnOffString();
231
232private:
233 SbBox3f m_checkStringCachedBBox;
234
235 void create3DDialogCheckBox();
236 void update3DCheckBox();
237 void update3DLabel();
238
239 virtual void change3DLabelVisibility();
240 void change3DLabel();
241 virtual void change3DLabelAlignment();
242
243 static void finishCB3D( void *, SoDragger *inDragger );
244 virtual void draggerFinishCallback3D();
245
246 static SbBool m_isSkinLoaded;
247
249
250};
251
252#endif // _SO_DIALOG_CHECK_BOX_
253
254
3D box class.
Definition SbBox.h:649
2D vector class.
Definition SbVec.h:517
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog CheckBox ...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Dialog CheckBox ...
SoDialogCheckBox()
Constructor.
SoSFString offString
String used for state FALSE.
SoSFBool state
State of the check button.
void addAuditor(SoDialogCheckBoxAuditor *auditor)
Adds a dialogCheckBoxAuditor to current CheckBox component.
SoSFString onString
String used for state TRUE.
void removeAuditor(SoDialogCheckBoxAuditor *auditor)
Removes the specified checkBoxAuditor from the auditor list.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Base class for nodekits that move in response to click-drag-release mouse events.
Definition SoDragger.h:537
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a string.
Definition SoSFString.h:117
Node representing a 3D geometric scaling.
Definition SoScale.h:96
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:100
Group node that saves and restores traversal state.
Group node that traverses one chosen child.
Definition SoSwitch.h:179
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