OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DragController Class Reference

Auxiliary class to control dragger speed. The idea is that slowly moving the mouse forces the dragger to move only one inl/crl/z per (few) pixel(s), while moving it fast can have it cover many lines per pixel. More...

Public Member Functions

 DragController ()
 
 ~DragController ()
 
void init (const Coord &mousepos, double scalefactor=1.0, const Coord3 &dragdir=Coord3(0.0, 0.0, 0.0))
 
void setFastMaxDragToMouseRatio (float distanceperpixel)
 
float getFastMaxDragToMouseRatio () const
 
void setSlowMaxDragToMouseRatio (float distanceperpixel)
 
float getSlowMaxDragToMouseRatio () const
 
void setFastMinDragToMouseRatio (float distanceperpixel)
 
float getFastMinDragToMouseRatio () const
 
void setSlowMinDragToMouseRatio (float distanceperpixel)
 
float getSlowMinDragToMouseRatio () const
 
void setFastMouseSpeed (float pixelspersecond)
 
float getFastMouseSpeed () const
 
void setSlowMouseSpeed (float pixelspersecond)
 
float getSlowMouseSpeed () const
 
void setLinearBackDragFrac (float fraction)
 
float getLinearBackDragFrac () const
 
void transform (double &dragval, const Coord &mousepos, double maxdragdist=mUdf(double))
 
void transform (Coord3 &dragvec, const Coord &mousepos, double maxdragdist=mUdf(double))
 
void dragInScreenSpace (bool fromstart, const Coord &projvec)
 

Protected Member Functions

void reInit (const Coord &mousepos)
 
void manageScreenDragging (double &dragval, const Coord &mousepos)
 
double absTransform (double dragval, const Coord &mousepos, double maxdragdist=mUdf(double))
 

Protected Attributes

float fastmaxdragtomouseratio_
 
float slowmaxdragtomouseratio_
 
float fastmindragtomouseratio_
 
float slowmindragtomouseratio_
 
float fastmousespeed_
 
float slowmousespeed_
 
float linearbackdragfrac_
 
Coord initmousepos_
 
Coord3 dragdir_
 
int prevdragtime_
 
bool screendragmode_
 
float screendragfactor_
 
Coord screendragprojvec_
 
Coord prevmousepos_
 
double prevdragval_
 
double prevtransval_
 
double maxdragval_
 
int dragsign_
 
double scalefactor_
 

Detailed Description

Auxiliary class to control dragger speed. The idea is that slowly moving the mouse forces the dragger to move only one inl/crl/z per (few) pixel(s), while moving it fast can have it cover many lines per pixel.

Constructor & Destructor Documentation

DragController::DragController ( )
DragController::~DragController ( )

Member Function Documentation

double DragController::absTransform ( double  dragval,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)
protected
void DragController::dragInScreenSpace ( bool  fromstart,
const Coord projvec 
)
float DragController::getFastMaxDragToMouseRatio ( ) const
float DragController::getFastMinDragToMouseRatio ( ) const
float DragController::getFastMouseSpeed ( ) const
float DragController::getLinearBackDragFrac ( ) const

If moving back towards initial position, 'fraction' defines where the dragger starts acting linear to reach its origin at the same time as the mouse pointer.

float DragController::getSlowMaxDragToMouseRatio ( ) const
float DragController::getSlowMinDragToMouseRatio ( ) const
float DragController::getSlowMouseSpeed ( ) const
void DragController::init ( const Coord mousepos,
double  scalefactor = 1.0,
const Coord3 dragdir = Coord3(0.0, 0.0, 0.0) 
)
void DragController::manageScreenDragging ( double &  dragval,
const Coord mousepos 
)
protected
void DragController::reInit ( const Coord mousepos)
protected
void DragController::setFastMaxDragToMouseRatio ( float  distanceperpixel)
void DragController::setFastMinDragToMouseRatio ( float  distanceperpixel)
void DragController::setFastMouseSpeed ( float  pixelspersecond)
void DragController::setLinearBackDragFrac ( float  fraction)
void DragController::setSlowMaxDragToMouseRatio ( float  distanceperpixel)
void DragController::setSlowMinDragToMouseRatio ( float  distanceperpixel)
void DragController::setSlowMouseSpeed ( float  pixelspersecond)
void DragController::transform ( double &  dragval,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)
void DragController::transform ( Coord3 dragvec,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)

Member Data Documentation

Coord3 DragController::dragdir_
protected
int DragController::dragsign_
protected
float DragController::fastmaxdragtomouseratio_
protected
float DragController::fastmindragtomouseratio_
protected
float DragController::fastmousespeed_
protected
Coord DragController::initmousepos_
protected
float DragController::linearbackdragfrac_
protected
double DragController::maxdragval_
protected
int DragController::prevdragtime_
protected
double DragController::prevdragval_
protected
Coord DragController::prevmousepos_
protected
double DragController::prevtransval_
protected
double DragController::scalefactor_
protected
float DragController::screendragfactor_
protected
bool DragController::screendragmode_
protected
Coord DragController::screendragprojvec_
protected
float DragController::slowmaxdragtomouseratio_
protected
float DragController::slowmindragtomouseratio_
protected
float DragController::slowmousespeed_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019