![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: $ $Revision: $ $State: $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvCore/vrvCore.h> 00016 #include <vrvUtil/signalslib.h> 00017 #include <vrvCore/DtEventProcessorInterface.h> 00018 #include <vrvCore/DtSelectionManager.h> 00019 #include <vrvCore/DtIntersector.h> 00020 #include <vrvUtil/DtVirtualBaseClass.h> 00021 00022 #include <matrix/vlVector.h> 00023 00024 namespace makVrv 00025 { 00026 class DtInputDriver; 00027 class DtDe; 00028 class DtMouseEvent; 00029 00049 class DT_DLL_VRVCORE DtBasicEditingEventProcessor : public DtEventProcessorInterface 00050 { 00051 public: 00052 00056 DtBasicEditingEventProcessor(DtInputDriver& inputDriver, DtDe& de, const std::string& className); 00057 00059 virtual ~DtBasicEditingEventProcessor(); 00060 00063 virtual const std::string& className(); 00064 00065 double currentAltitude() const; 00066 void setCurrentAltitude(double); 00067 void setCurrentGroundLocation(const DtVector&); 00068 00070 virtual void changeAltitude( double mouseX, double mouseY ); 00071 00073 virtual void changeAltitudeWithWheel( int wheelSteps ); 00074 00076 virtual bool dragging() const; 00077 00082 virtual void setAllowDragDrop(bool); 00083 bool allowDragDrop() const; 00084 00086 virtual void setCreating(bool); 00087 bool creating() const; 00088 00090 virtual bool allowEdit(const DtSelectionManager::IdSet&, bool doubleClick) const; 00091 00094 virtual bool allowContinueDrag(const DtVector&) const; 00095 00097 virtual void cancel(); 00098 00100 virtual void setEnabled(bool); 00101 00103 double mouseX() const; 00104 double mouseY() const; 00105 00108 boost::signal<void (DtVector, double altAboveGround)> signal_locationChanged; 00109 00111 boost::signal<void ()> signal_cancel; 00112 00115 boost::signal<void (DtUniqueID, DtVector, double altAboveGround)> signal_place; 00116 00118 boost::signal<void (DtVector, double)> signal_altitudeChanged; 00119 00121 boost::signal<void (const DtSelectionManager::IdSet&, const DtVector&)> signal_dragStart; 00122 00124 boost::signal<void (bool)> signal_altitudeIsDragging; 00125 00126 protected: 00127 00131 virtual bool processMouseEvent( const DtMouseEvent& ev, DtChannel& channel); 00132 00136 virtual bool processKeyboardEvent( const DtKeyEvent& ev, DtChannel& channel); 00137 00138 virtual void processMouseMove(DtChannel& channel, const DtMouseEvent& ev); 00139 00141 virtual bool pick(DtChannel& channel, double x, double y, DtIntersectorResult& result, 00142 DtIntersector::IntersectProperties props) const; 00143 00144 protected: 00145 DtDe& myDe; 00146 DtInputDriver& myInputDriver; 00147 std::string myClassName; 00148 bool myIsAltitudeDragging; 00149 DtVector myCurrentGroundLocation; 00150 double myCurrentAltitude; 00151 bool myDragging; 00152 bool myAllowDragDrop; 00153 00154 double myLastMouseX; 00155 double myLastMouseY; 00156 00157 // These are used for dragging 00158 double myMousePositionX; 00159 double myMousePositionY; 00160 00161 bool myCreating; 00162 }; 00163 }