ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvGlobalShiftManager Class Reference

#include <ecvGlobalShiftManager.h>

Classes

struct  ShiftInfo
 Shift and scale info. More...
 

Public Types

enum  Mode { NO_DIALOG, NO_DIALOG_AUTO_SHIFT, DIALOG_IF_NECESSARY, ALWAYS_DISPLAY_DIALOG }
 Strategy to handle coordinates shift/scale. More...
 

Static Public Member Functions

static bool Handle (const CCVector3d &P, double diagonal, Mode mode, bool useInputCoordinatesShiftIfPossible, CCVector3d &coordinatesShift, bool *preserveCoordinateShift, double *coordinatesScale, bool *applyAll=0)
 
static bool NeedShift (const CCVector3d &P)
 Returns whether a particular point (coordinates) is too big or not. More...
 
static bool NeedShift (double d)
 Returns whether a particular point coordinate is too big or not. More...
 
static bool NeedRescale (double d)
 Returns whether a particular dimension (e.g. diagonal) is too big or not. More...
 
static CCVector3d BestShift (const CCVector3d &P)
 Suggests a shift for a given point expressed in global coordinate space. More...
 
static double BestScale (double d)
 
static double MaxCoordinateAbsValue ()
 Returns the max coordinate (absolute) value. More...
 
static void SetMaxCoordinateAbsValue (double value)
 Sets the max coordinate (absolute) value. More...
 
static double MaxBoundgBoxDiagonal ()
 Returns max bounding-box diagonal. More...
 
static void SetMaxBoundgBoxDiagonal (double value)
 Sets the max bounding-box diagonal. More...
 
static void StoreShift (const CCVector3d &shift, double scale, bool preserve=true)
 Adds a new shift / scale couple. More...
 
static bool GetLast (ShiftInfo &info)
 
static bool GetLast (std::vector< ShiftInfo > &infos)
 

Static Protected Attributes

static double MAX_COORDINATE_ABS_VALUE = 1.0e4
 
static double MAX_DIAGONAL_LENGTH = 1.0e6
 

Detailed Description

Helper class to handle big coordinates shift/scale (typically while loading entities)

Member Enumeration Documentation

◆ Mode

Strategy to handle coordinates shift/scale.

Enumerator
NO_DIALOG 
NO_DIALOG_AUTO_SHIFT 
DIALOG_IF_NECESSARY 
ALWAYS_DISPLAY_DIALOG 

Member Function Documentation

◆ BestScale()

double ecvGlobalShiftManager::BestScale ( double  d)
static

Suggests a scale for a given dimension (e.g. diagonal) in global coordinate space

References cloudViewer::utility::ceil(), and MAX_DIAGONAL_LENGTH.

Referenced by Handle().

◆ BestShift()

CCVector3d ecvGlobalShiftManager::BestShift ( const CCVector3d &  P)
static

Suggests a shift for a given point expressed in global coordinate space.

References MAX_COORDINATE_ABS_VALUE, NeedShift(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by Handle().

◆ GetLast() [1/2]

bool ecvGlobalShiftManager::GetLast ( ShiftInfo &  info)
static

References s_lastInfoBuffer.

◆ GetLast() [2/2]

bool ecvGlobalShiftManager::GetLast ( std::vector< ShiftInfo > &  infos)
static

◆ Handle()

◆ MaxBoundgBoxDiagonal()

static double ecvGlobalShiftManager::MaxBoundgBoxDiagonal ( )
inlinestatic

Returns max bounding-box diagonal.

Referenced by InitEnvironment(), and main().

◆ MaxCoordinateAbsValue()

static double ecvGlobalShiftManager::MaxCoordinateAbsValue ( )
inlinestatic

Returns the max coordinate (absolute) value.

Referenced by InitEnvironment(), and main().

◆ NeedRescale()

bool ecvGlobalShiftManager::NeedRescale ( double  d)
static

Returns whether a particular dimension (e.g. diagonal) is too big or not.

References MAX_DIAGONAL_LENGTH.

Referenced by Handle(), and ecvShiftAndScaleCloudDlg::updateLocalSystem().

◆ NeedShift() [1/2]

bool ecvGlobalShiftManager::NeedShift ( const CCVector3d &  P)
static

◆ NeedShift() [2/2]

bool ecvGlobalShiftManager::NeedShift ( double  d)
static

Returns whether a particular point coordinate is too big or not.

References MAX_COORDINATE_ABS_VALUE.

◆ SetMaxBoundgBoxDiagonal()

static void ecvGlobalShiftManager::SetMaxBoundgBoxDiagonal ( double  value)
inlinestatic

Sets the max bounding-box diagonal.

Referenced by InitEnvironment().

◆ SetMaxCoordinateAbsValue()

static void ecvGlobalShiftManager::SetMaxCoordinateAbsValue ( double  value)
inlinestatic

Sets the max coordinate (absolute) value.

Referenced by InitEnvironment().

◆ StoreShift()

void ecvGlobalShiftManager::StoreShift ( const CCVector3d &  shift,
double  scale,
bool  preserve = true 
)
static

Member Data Documentation

◆ MAX_COORDINATE_ABS_VALUE

double ecvGlobalShiftManager::MAX_COORDINATE_ABS_VALUE = 1.0e4
staticprotected

Referenced by BestShift(), and NeedShift().

◆ MAX_DIAGONAL_LENGTH

double ecvGlobalShiftManager::MAX_DIAGONAL_LENGTH = 1.0e6
staticprotected

Referenced by BestScale(), and NeedRescale().


The documentation for this class was generated from the following files: