(#168) (#695) Wip: Refactoring the ResInsight nav policies to make bugfixing simpler

This commit is contained in:
Jacob Støren
2015-12-09 15:51:38 +01:00
parent f3eb304d66
commit 5874df7cc9
6 changed files with 65 additions and 352 deletions

View File

@@ -19,37 +19,14 @@
#pragma once
#include "cvfBase.h"
#include "cafNavigationPolicy.h"
#include "cvfManipulatorTrackball.h"
#include "cvfRay.h"
#include "cafTrackBallBasedNavigation.h"
class RiuGeoQuestNavigation : public caf::NavigationPolicy
class RiuGeoQuestNavigation : public caf::TrackBallBasedNavigation
{
public:
RiuGeoQuestNavigation();
virtual ~RiuGeoQuestNavigation();
protected:
// General navigation policy overrides
virtual void init();
virtual bool handleInputEvent(QInputEvent* inputEvent);
virtual void setView( const cvf::Vec3d& alongDirection, const cvf::Vec3d& upDirection );
virtual cvf::Vec3d pointOfInterest();
virtual void setPointOfInterest(cvf::Vec3d poi);
// PdvNavigation specific
void initializeRotationCenter();
cvf::ref<cvf::ManipulatorTrackball> m_trackball;
bool m_isRotCenterInitialized;
cvf::Vec3d m_pointOfInterest;
bool m_isNavigating;
bool m_hasMovedMouseDuringNavigation;
// Handle mid mouse button zoom
void zoomAlongRay( cvf::Ray* ray, int delta );
bool m_isZooming;
cvf::ref<cvf::Ray> m_zoomRay;
int m_lastPosX; /// Previous mouse position
int m_lastPosY;
virtual bool handleInputEvent(QInputEvent* inputEvent);
};