25# include <Inventor/Qt/SoQtColorEditor.h>
27# include <Inventor/Win/SoWinColorEditor.h>
30#ifndef _SO_XT_COLOR_EDITOR_
31#define _SO_XT_COLOR_EDITOR_
34#include <Inventor/SbColor.h>
35#include <Inventor/misc/SoCallbackList.h>
36#include <Inventor/Xt/SoXtComponent.h>
51struct _ColorEditorCBData;
140 const char *name = NULL,
141 SbBool buildInsideParent = TRUE);
189 inline void addColorChangedCallback(SoXtColorEditorCB *f,
void *userData = NULL);
193 inline void removeColorChangedCallback(SoXtColorEditorCB *f,
void *userData = NULL);
249 SoXtColorEditor(SoWidget parent,
255 virtual SbString getDefaultWidgetName()
const;
256 virtual SbString getDefaultTitle()
const;
257 virtual SbString getDefaultIconTitle()
const;
262 SoWidget buildWidget(SoWidget parent);
263 static void visibilityChangeCB(
void *pt,
SbBool visible);
268 Sliders whichSliders;
272 SoXtColorSlider *sliders[6];
273 SoXtColorWheel *wheel;
274 SoXtColorPatch *current, *previous;
275 _ColorEditorCBData *dataId;
277 SoXtColorEditor::UpdateFrequency updateFreq;
294 SoXtClipboard *clipboard;
295 void copy(Time eventTime);
296 void paste(Time eventTime);
298 static void pasteDoneCB(
void *userData,
SoPathList *pathList);
301 SoWidget acceptButton, slidersForm, buttonsForm, wheelForm;
304 SoWidget buildPulldownMenu(SoWidget parent);
305 SoWidget buildControls(SoWidget parent);
306 SoWidget buildSlidersForm(SoWidget parent);
308 void doSliderLayout();
309 void doDynamicTopLevelLayout();
310 int numberOfSliders(SoXtColorEditor::Sliders slider);
317 static void fieldChangedCB(
void *,
SoSensor *);
320 static void wheelCallback(
void *,
const float hsv[3]);
321 void wheelChanged(
const float hsv[3]);
322 static void sliderCallback(
void *,
float);
323 void sliderChanged(
short id,
float value);
324 static void buttonsCallback(SoWidget, _ColorEditorCBData *, XtPointer);
325 void buttonPressed(
short id);
326 static void editMenuCallback(SoWidget, _ColorEditorCBData *, XmAnyCallbackStruct *);
327 static void sliderMenuCallback(SoWidget, _ColorEditorCBData *, XtPointer);
329 static void menuDisplay(SoWidget, SoXtColorEditor *editor, XtPointer);
332 void constructorCommon(
SbBool buildNow);
334 void initStrings(
void );
342 callbackList->addCallback((SoCallbackListCB *)f, userData);
348 callbackList->removeCallback((SoCallbackListCB *)f, userData);
List of generic (void *) pointers.
Class for smart character strings.
Base class for all nodes, paths, and engines.
Manages a list of callbacks and associated data.
Multiple-value field containing any number of RGB colors stored as three floats.
Multiple-value field containing any number of uint32_t integers.
Sensor class that can be attached to Open Inventor nodes.
Maintains a list of pointers to paths.
Field containing an RGB color.
Abstract base class for Open Inventor sensors.
const SbColor & getColor()
Gets the current color value.
void attach(SoMFColor *color, int index, SoBase *node)
Attaches the editor to a color node and edits the color of the given index.
SoXtColorEditor::UpdateFrequency getUpdateFrequency()
Gets the update frequency.
void SoXtColorEditorCB(void *userData, const SbColor *color)
Sliders
list of possible slider combinations, which is used to specify which sliders should be displayed at a...
@ INTENSITY
Display intensity slider (default)
@ RGB_V
Display RGB and value sliders.
@ RGB
Display RGB sliders.
@ HSV
Display HSV sliders.
@ NONE
Display no sliders.
@ RGB_HSV
Display RGB and HSV sliders.
void attach(SoMFUInt32 *color, int index, SoBase *node)
Attaches the editor to a color node and edits the color of the given index.
SoXtColorEditor::Sliders getCurrentSliders()
Gets which slider(s) should be displayed.
void setWYSIWYG(SbBool trueOrFalse)
Sets the WYSIWYG (what-you-see-is-what-you-get) mode on/off for the colored backgrounds of the slider...
void setUpdateFrequency(SoXtColorEditor::UpdateFrequency freq)
Sets the update frequency.
void attach(SoSFColor *color, SoBase *node)
Attaches the editor to a color node and edits the specified color.
SbBool isWYSIWYG()
Gets the WYSIWYG mode.
~SoXtColorEditor()
Destructor.
void removeColorChangedCallback(SoXtColorEditorCB *f, void *userData=NULL)
Removes colorChanged callback.
void setCurrentSliders(SoXtColorEditor::Sliders whichSliders)
Sets which slider(s) should be displayed.
SbBool isAttached()
Returns TRUE if the editor is attached.
void detach()
Detaches the editor from a color node.
SoXtColorEditor(SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE)
Constructor.
UpdateFrequency
UpdateFrequency is how often new values should be sent to the node or the callback routine.
@ CONTINUOUS
Send updates with every mouse motion.
@ AFTER_ACCEPT
Only send updates after user hits accept button.
void setColor(const SbColor &color)
Sets a new color value.
void addColorChangedCallback(SoXtColorEditorCB *f, void *userData=NULL)
Additional way of using the color editor, by registering a callback which will be called whenever the...