SoFCSelection.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GUI_SOFCSELECTION_H
00024 #define GUI_SOFCSELECTION_H
00025
00026 # ifdef FC_OS_MACOSX
00027 # include <OpenGL/gl.h>
00028 # else
00029 # ifdef FC_OS_WIN32
00030 # include <windows.h>
00031 # endif
00032 # include <GL/gl.h>
00033 # endif
00034
00035 #include <Inventor/nodes/SoSubNode.h>
00036 #include <Inventor/nodes/SoGroup.h>
00037 #include <Inventor/fields/SoSFColor.h>
00038 #include <Inventor/fields/SoSFEnum.h>
00039 #include <Inventor/fields/SoSFString.h>
00040 #include <Inventor/nodes/SoLightModel.h>
00041
00042 class SoFullPath;
00043 class SoPickedPoint;
00044
00045
00046 namespace Gui {
00047
00048
00053 class GuiExport SoFCSelection : public SoGroup {
00054 typedef SoGroup inherited;
00055
00056 SO_NODE_HEADER(Gui::SoFCSelection);
00057
00058 public:
00059 static void initClass(void);
00060 static void finish(void);
00061 SoFCSelection(void);
00062
00063 enum HighlightModes {
00064 AUTO, ON, OFF
00065 };
00066
00067 enum SelectionModes {
00068 SEL_ON, SEL_OFF
00069 };
00070
00071 enum Selected {
00072 NOTSELECTED, SELECTED
00073 };
00074
00075 enum Styles {
00076 EMISSIVE, EMISSIVE_DIFFUSE, BOX
00077 };
00078
00079 SbBool isHighlighted(void) const {return highlighted;}
00080
00081 SoSFColor colorHighlight;
00082 SoSFColor colorSelection;
00083 SoSFEnum style;
00084 SoSFEnum selected;
00085 SoSFEnum highlightMode;
00086 SoSFEnum selectionMode;
00087
00088 SoSFString documentName;
00089 SoSFString objectName;
00090 SoSFString subElementName;
00091
00092 virtual void doAction(SoAction *action);
00093 virtual void GLRender(SoGLRenderAction * action);
00094
00095 virtual void handleEvent(SoHandleEventAction * action);
00096 virtual void GLRenderBelowPath(SoGLRenderAction * action);
00097 virtual void GLRenderInPath(SoGLRenderAction * action);
00098 static void turnOffCurrentHighlight(SoGLRenderAction * action);
00099
00100 protected:
00101 virtual ~SoFCSelection();
00102 virtual void redrawHighlighted(SoAction * act, SbBool flag);
00103 virtual SbBool readInstance(SoInput * in, unsigned short flags);
00104
00105 private:
00106 static int getPriority(const SoPickedPoint*);
00107 static void turnoffcurrent(SoAction * action);
00108 void setOverride(SoGLRenderAction * action);
00109 SbBool isHighlighted(SoAction *action);
00110 SbBool preRender(SoGLRenderAction *act, GLint &oldDepthFunc);
00111 const SoPickedPoint* getPickedPoint(SoHandleEventAction*) const;
00112
00113 static SoFullPath * currenthighlight;
00114
00115 SbBool highlighted;
00116 SoColorPacker colorpacker;
00117
00118 SbBool bShift;
00119 SbBool bCtrl;
00120 };
00121
00122
00123 }
00124
00125 #endif // !GUI_SOFCSELECTION_H