VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtControlPointWidget.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtControlPointWidget.h,v $ $Revision: 1.5 $ $State: Exp $
00007 ******************************************************************************/
00008 
00012 
00013 #ifndef DtControlPointWidget_H_
00014 #define DtControlPointWidget_H_
00015 
00016 #include <vrvCore/vrvCore.h>
00017 #include <vrvCore/DtUniqueID.h>
00018 #include <vrvCore/DtAgentManagerInterface.h>
00019 #include <vrvCore/DtMouseState.h>
00020 #include <boost/signal.hpp>
00021 
00022 namespace makVrv
00023 {
00024    class DtAgentManagerInterface;
00025    class DtProjectedWidgetModelAgent;
00026    class DtWidgetAgent;
00027    class DtWidgetLabelAgent;
00028    class DtModelAgent;
00029    class DtWidgetInstanceSignaler;
00030    class DtWidgetSignaler;
00031    class DtWidgetEventSignals;
00032    
00036    class DT_DLL_VRVCORE DtControlPointWidget
00037    {
00038    public:
00040       enum ControlPointState
00041       {
00042          Normal, // inactive, not selected
00043          Active, // e.g. mouseover
00044          Selected, // The only selected object
00045          MultiSelected, // Part of a group of selected control points
00046       };
00047 
00048       DtControlPointWidget(int modelSet, DtAgentManagerInterface& sceneInterface);
00049 
00050       virtual ~DtControlPointWidget();
00051 
00053       virtual void setModelDefinitions(
00054          const std::string& emptyTheme = "ControlPointTheme",
00055          const std::string& normalTheme = "ControlPointTheme",
00056          const std::string& activeTheme = "ControlPointPinnedTheme",
00057          const std::string& normalPointTheme = "ControlPointPinnedTheme",
00058          const std::string& selectedPointTheme = "ControlPointPinnedTheme");
00059       
00061       virtual void setState(ControlPointState state);
00062 
00064       virtual void setColor(float r, float g, float b);
00065 
00067       virtual void setDimensions(int height, int width);
00068 
00070       DtModelAgent* model();
00071 
00073       ControlPointState state();
00074 
00076       virtual void setEventsEnabled(bool enabled);
00077 
00079       DtWidgetEventSignals& eventSignals(DtWidgetSignaler& signaler);
00080 
00081    public:
00082 
00083       boost::signal< void(bool) > signal_mouseInChanged;
00084 
00085       typedef boost::signal< void(DtMouseState& mouseState,
00086          const std::string& displayEngineName,
00087          const std::string& windowName,
00088          const std::string& channelName)>
00089          WidgetMouseEventSignal;
00090       
00091       WidgetMouseEventSignal signal_mouseDown;
00092       WidgetMouseEventSignal signal_mouseUp;
00093       WidgetMouseEventSignal signal_mouseDblClick;
00094 
00095    protected:
00096 
00097       void onMouseEnter(DtUniqueID id);
00098       void onMouseLeave(DtUniqueID id);
00099       void onMouseDown(DtUniqueID id, double x, double y, int button,
00100          const std::string& displayEngineName,
00101          const std::string& windowName,
00102          const std::string& channelName);
00103       void onMouseUp(DtUniqueID id, double x, double y, int button,
00104          const std::string& displayEngineName,
00105          const std::string& windowName,
00106          const std::string& channelName);
00107       void onMouseDblClick(DtUniqueID id, double x, double y, int button,
00108          const std::string& displayEngineName,
00109          const std::string& windowName,
00110          const std::string& channelName);
00111 
00112    protected:
00113 
00114       int myModelSet;
00115       DtAgentManagerInterface& mySceneInterface;
00116       DtProjectedWidgetModelAgent* myProjectedWidgetModelAgent;
00117       DtWidgetAgent* myWidgetAgent;
00118       DtWidgetAgent* myPointWidgetAgent;
00119       DtWidgetInstanceSignaler* myWidgetSignaler;
00120       
00121       std::string myEmptyTheme;
00122       std::string myNormalTheme;
00123       std::string myActiveTheme;
00124       std::string mySelectedPointTheme;
00125       std::string myMultiSelectedPointTheme;
00126 
00127       int myHeight;
00128       int myWidth;
00129 
00130       ControlPointState myState;
00131       bool myEventsEnabled;
00132 
00133       bool mySelected;
00134    };
00135 }
00136 
00137 #endif
00138 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)