OpendTect  7.0
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 dragInScreenSpace (bool fromstart, const Coord &projvec)
 
float getFastMaxDragToMouseRatio () const
 
float getFastMinDragToMouseRatio () const
 
float getFastMouseSpeed () const
 
float getLinearBackDragFrac () const
 
float getSlowMaxDragToMouseRatio () const
 
float getSlowMinDragToMouseRatio () const
 
float getSlowMouseSpeed () const
 
void init (const Coord &mousepos, double scalefactor=1.0, const Coord3 &dragdir=Coord3(0.0, 0.0, 0.0))
 
void setFastMaxDragToMouseRatio (float distanceperpixel)
 
void setFastMinDragToMouseRatio (float distanceperpixel)
 
void setFastMouseSpeed (float pixelspersecond)
 
void setLinearBackDragFrac (float fraction)
 
void setSlowMaxDragToMouseRatio (float distanceperpixel)
 
void setSlowMinDragToMouseRatio (float distanceperpixel)
 
void setSlowMouseSpeed (float pixelspersecond)
 
void transform (Coord3 &dragvec, const Coord &mousepos, double maxdragdist=mUdf(double))
 
void transform (double &dragval, const Coord &mousepos, double maxdragdist=mUdf(double))
 

Protected Member Functions

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

Protected Attributes

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

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()

DragController::~DragController ( )

Member Function Documentation

◆ absTransform()

double DragController::absTransform ( double  dragval,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)
protected

◆ dragInScreenSpace()

void DragController::dragInScreenSpace ( bool  fromstart,
const Coord projvec 
)

◆ getFastMaxDragToMouseRatio()

float DragController::getFastMaxDragToMouseRatio ( ) const

◆ getFastMinDragToMouseRatio()

float DragController::getFastMinDragToMouseRatio ( ) const

◆ getFastMouseSpeed()

float DragController::getFastMouseSpeed ( ) const

◆ getLinearBackDragFrac()

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.

◆ getSlowMaxDragToMouseRatio()

float DragController::getSlowMaxDragToMouseRatio ( ) const

◆ getSlowMinDragToMouseRatio()

float DragController::getSlowMinDragToMouseRatio ( ) const

◆ getSlowMouseSpeed()

float DragController::getSlowMouseSpeed ( ) const

◆ init()

void DragController::init ( const Coord mousepos,
double  scalefactor = 1.0,
const Coord3 dragdir = Coord3(0.0, 0.0, 0.0) 
)

◆ manageScreenDragging()

void DragController::manageScreenDragging ( double &  dragval,
const Coord mousepos 
)
protected

◆ reInit()

void DragController::reInit ( const Coord mousepos)
protected

◆ setFastMaxDragToMouseRatio()

void DragController::setFastMaxDragToMouseRatio ( float  distanceperpixel)

◆ setFastMinDragToMouseRatio()

void DragController::setFastMinDragToMouseRatio ( float  distanceperpixel)

◆ setFastMouseSpeed()

void DragController::setFastMouseSpeed ( float  pixelspersecond)

◆ setLinearBackDragFrac()

void DragController::setLinearBackDragFrac ( float  fraction)

◆ setSlowMaxDragToMouseRatio()

void DragController::setSlowMaxDragToMouseRatio ( float  distanceperpixel)

◆ setSlowMinDragToMouseRatio()

void DragController::setSlowMinDragToMouseRatio ( float  distanceperpixel)

◆ setSlowMouseSpeed()

void DragController::setSlowMouseSpeed ( float  pixelspersecond)

◆ transform() [1/2]

void DragController::transform ( Coord3 dragvec,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)

◆ transform() [2/2]

void DragController::transform ( double &  dragval,
const Coord mousepos,
double  maxdragdist = mUdf(double) 
)

Member Data Documentation

◆ dragdir_

Coord3 DragController::dragdir_
protected

◆ dragsign_

int DragController::dragsign_
protected

◆ fastmaxdragtomouseratio_

float DragController::fastmaxdragtomouseratio_
protected

◆ fastmindragtomouseratio_

float DragController::fastmindragtomouseratio_
protected

◆ fastmousespeed_

float DragController::fastmousespeed_
protected

◆ initmousepos_

Coord DragController::initmousepos_
protected

◆ linearbackdragfrac_

float DragController::linearbackdragfrac_
protected

◆ maxdragval_

double DragController::maxdragval_
protected

◆ prevdragtime_

int DragController::prevdragtime_
protected

◆ prevdragval_

double DragController::prevdragval_
protected

◆ prevmousepos_

Coord DragController::prevmousepos_
protected

◆ prevtransval_

double DragController::prevtransval_
protected

◆ scalefactor_

double DragController::scalefactor_
protected

◆ screendragfactor_

float DragController::screendragfactor_
protected

◆ screendragmode_

bool DragController::screendragmode_
protected

◆ screendragprojvec_

Coord DragController::screendragprojvec_
protected

◆ slowmaxdragtomouseratio_

float DragController::slowmaxdragtomouseratio_
protected

◆ slowmindragtomouseratio_

float DragController::slowmindragtomouseratio_
protected

◆ slowmousespeed_

float DragController::slowmousespeed_
protected

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