qCC_io version 2.13.alpha (Qt) - 31 May 2022
CloudCompare standard I/O filters (file readers & writers)
Classes | Public Types | Static Public Member Functions | Static Protected Attributes | List of all members
ccGlobalShiftManager Class Reference

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

#include <ccGlobalShiftManager.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.
 

Static Public Member Functions

static bool Handle (const CCVector3d &P, double diagonal, Mode mode, bool useInputCoordinatesShiftIfPossible, CCVector3d &coordinatesShift, bool *_preserveCoordinateShift=nullptr, double *_coordinatesScale=nullptr, bool *_applyAll=nullptr)
 Handles coordinates shift/scale given the first 3D point and current related parameters.
 
static bool NeedShift (const CCVector3d &P)
 Returns whether a particular point (coordinates) is too big or not.
 
static bool NeedShift (double d)
 Returns whether a particular point coordinate is too big or not.
 
static bool NeedRescale (double d)
 Returns whether a particular dimension (e.g. diagonal) is too big or not.
 
static CCVector3d BestShift (const CCVector3d &P)
 Suggests a shift for a given point expressed in global coordinate space.
 
static double BestScale (double d)
 Suggests a scale for a given dimension (e.g. diagonal) in global coordinate space.
 
static double MaxCoordinateAbsValue ()
 Returns the max coordinate (absolute) value.
 
static void SetMaxCoordinateAbsValue (double value)
 Sets the max coordinate (absolute) value.
 
static double MaxBoundgBoxDiagonal ()
 Returns max bounding-box diagonal.
 
static void SetMaxBoundgBoxDiagonal (double value)
 Sets the max bounding-box diagonal.
 
static void StoreShift (const CCVector3d &shift, double scale, bool preserve=true)
 Adds a new shift / scale couple.
 
static const std::vector< ShiftInfo > & GetLast ()
 Returns the default and last input shift/scale entries.
 
static bool LoadInfoFromFile (QString filename, std::vector< ShiftInfo > &infos)
 Tries to load ShiftInfo data from a (text) file. More...
 

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 Function Documentation

◆ LoadInfoFromFile()

bool ccGlobalShiftManager::LoadInfoFromFile ( QString  filename,
std::vector< ShiftInfo > &  infos 
)
static

Tries to load ShiftInfo data from a (text) file.

Parameters
[in]filenamefilename
[out]infosread information
Returns
success

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