Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoQtColorSlider.h
Go to the documentation of this file.
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 : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _SO_QT_COLOR_SLIDER_
25#define _SO_QT_COLOR_SLIDER_
26
29
31// Class: SoQtColorSlider
32//
33// This class defines the color slider which is a set of predefined
34// sliders (R, G, B, H, S, V,..) with special behaviors.
35
36{
37 Q_OBJECT
38
39 public:
40 // list of color sliders types
41 enum Type {
42 RED_SLIDER,
43 GREEN_SLIDER,
44 BLUE_SLIDER,
45 HUE_SLIDER,
46 SATURATION_SLIDER,
47 VALUE_SLIDER,
48 INTENSITY_SLIDER // independent of the slider value
49 };
50
51 // Constructor/Destructor
52 SoQtColorSlider(QWidget* parent = NULL,
53 const char *name = NULL,
54 SbBool buildInsideParent = TRUE,
55 Type type = INTENSITY_SLIDER);
56
57 // Routine used to specify the slider value and also the top region
58 // color (WYSIWYGmode in most cases). Users should call this routine
59 // instead of the base class setValue() routine if they want the color
60 // slider top region to correctly reflect the current color.
61 // (code is optimized for WYSIWYGmode off)
62 //
63 // NOTE: routine expects
64 // an rgb color for R, G or B slider type
65 // an hsv color for H, S, or V slider type
66 // an rgb color for Intensity slider type
67 //
68 // NOTE: if calling setBaseColor() changes the thumb position the
69 // valueChanged callbacks will be called with the new value.
70 void setBaseColor(const float rgbOrHsv[3]);
71 const float *getBaseColor();
72
73 // This routine sets the WYSIWYG (What You See Is What You Get) mode
74 // to be true or false (default FALSE). Immediate mode.
75 // This has no effect on monochrome sliders.
76 void setWYSIWYG(SbBool trueOrFalse = TRUE); // default FALSE
78
79 // returns the type of the slider
80 SoQtColorSlider::Type getType();
81
82 private:
83 // This constructor takes a boolean whether to build the widget now.
84 // Subclasses can pass FALSE, then call SoQtSlider::buildWidget()
85 // when they are ready for it to be built.
86 SoEXTENDER SoQtColorSlider (QWidget* parent,
87 const char *name,
88 SbBool buildInsideParent,
89 Type type,
90 SbBool buildNow);
91
92 private:
93 // local vars
94 SoQtBasicSlider::Type type;
95 void constructorCommon(SoQtColorSlider::Type type, SbBool buildNow);
96};
97
98
99#endif /* _SO_QT_COLOR_SLIDER_ */
100
101
#define SoEXTENDER
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
const float * getBaseColor()
SoQtColorSlider(QWidget *parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE, Type type=INTENSITY_SLIDER)
SoQtColorSlider::Type getType()
Returns the type of device.
SbBool isWYSIWYG()
void setWYSIWYG(SbBool trueOrFalse=TRUE)
void setBaseColor(const float rgbOrHsv[3])
int SbBool
Boolean type.
Definition SbBase.h:87