qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
|
Standard parameters for GL displays/viewports. More...
#include <ccViewportParameters.h>
Public Member Functions | |
ccViewportParameters () | |
Default constructor. | |
ccViewportParameters (const ccViewportParameters ¶ms) | |
Copy constructor. | |
bool | isSerializable () const override |
Returns whether object is serializable of not. More... | |
bool | toFile (QFile &out) const override |
Saves data to binary stream. More... | |
bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
Loads data from binary stream. More... | |
void | setPivotPoint (const CCVector3d &P, bool autoUpdateFocal) |
Sets the pivot point (for object-centered view mode) | |
const CCVector3d & | getPivotPoint () const |
Returns the pivot point (for object-centered view mode) | |
void | setCameraCenter (const CCVector3d &C, bool autoUpdateFocal) |
Sets the camera center. | |
const CCVector3d & | getCameraCenter () const |
Returns the camera center. | |
void | setFocalDistance (double distance) |
Sets the 'focal' distance. More... | |
double | getFocalDistance () const |
Computes the 'focal' distance. | |
ccGLMatrixd | computeViewMatrix () const |
Computes the view matrix. | |
ccGLMatrixd | computeScaleMatrix (const QRect &glViewport) const |
Computes the scale matrix. | |
CCVector3d | getViewDir () const |
Returns the viewing direction. More... | |
CCVector3d | getUpDir () const |
Returns the up direction. More... | |
const CCVector3d & | getRotationCenter () const |
Returns the view rotation 'center'. More... | |
double | computeDistanceToHalfWidthRatio () const |
Computes the ratio 'distance to half width' (based on the current FOV) More... | |
double | computeDistanceToWidthRatio () const |
Computes the ratio 'distance to width' (based on the current FOV) More... | |
double | computeWidthAtFocalDist () const |
Computes the object 'width' at the 'focal' distance. | |
double | computePixelSize (int glWidth) const |
Computes the pixel size at the 'focal' distance. | |
Public Member Functions inherited from ccSerializableObject | |
virtual | ~ccSerializableObject ()=default |
Destructor. | |
virtual bool | isSerializable () const |
Returns whether object is serializable of not. More... | |
virtual bool | toFile (QFile &out) const |
Saves data to binary stream. More... | |
virtual bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
Loads data from binary stream. More... | |
Static Public Member Functions | |
static double | IncrementToZNearCoef (int i, int iMax) |
Helper: converts an integer (increment) in [0 iMax] to a double (zNear) value in [0.001 1]. | |
static int | ZNearCoefToIncrement (double coef, int iMax) |
Helper: converts a double (zNear) value in ]0 1] to integer increments in [0 iMax]. | |
Static Public Member Functions inherited from ccSerializableObject | |
static bool | WriteError () |
Sends a custom error message (write error) and returns 'false'. More... | |
static bool | ReadError () |
Sends a custom error message (read error) and returns 'false'. More... | |
static bool | MemoryError () |
Sends a custom error message (not enough memory) and returns 'false'. More... | |
static bool | CorruptError () |
Sends a custom error message (corrupted file) and returns 'false'. More... | |
Public Attributes | |
ccGLMatrixd | viewMat |
Visualization matrix (rotation only) | |
float | defaultPointSize |
Point size. | |
float | defaultLineWidth |
Line width. | |
bool | perspectiveView |
Perspective view state. | |
bool | objectCenteredView |
Whether view is centered on displayed scene (true) or on the user eye (false) More... | |
double | zNearCoef |
Theoretical perspective 'zNear' relative position. | |
double | zNear |
Actual perspective 'zNear' value. | |
double | zFar |
Actual perspective 'zFar' value. | |
float | fov_deg |
Camera F.O.V. (field of view) in degrees. | |
float | cameraAspectRatio |
Camera aspect ratio. | |
Protected Attributes | |
double | focalDistance |
Focal distance. | |
CCVector3d | pivotPoint |
Rotation pivot point (for object-centered view modes) | |
CCVector3d | cameraCenter |
Camera center. | |
Additional Inherited Members | |
Public Types inherited from ccSerializableObject | |
enum | DeserializationFlags { DF_POINT_COORDS_64_BITS = 1 , DF_SCALAR_VAL_32_BITS = 2 } |
Deserialization flags (bit-field) More... | |
typedef QMultiMap< unsigned, unsigned > | LoadedIDMap |
Map of loaded unique IDs (old ID --> new ID) | |
Standard parameters for GL displays/viewports.
double ccViewportParameters::computeDistanceToHalfWidthRatio | ( | ) | const |
Computes the ratio 'distance to half width' (based on the current FOV)
Half width = ratio * distance = tan(fov / 2) * distance
double ccViewportParameters::computeDistanceToWidthRatio | ( | ) | const |
Computes the ratio 'distance to width' (based on the current FOV)
Width = ratio * distance = (2 * tan(fov / 2)) * distance
|
overridevirtual |
Loads data from binary stream.
in | input file (already opened) |
dataVersion | file version |
flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
oldToNewIDMap | map to link old IDs with new IDs |
Reimplemented from ccSerializableObject.
const CCVector3d & ccViewportParameters::getRotationCenter | ( | ) | const |
Returns the view rotation 'center'.
The rotation center is defined as:
CCVector3d ccViewportParameters::getUpDir | ( | ) | const |
Returns the up direction.
This is the vertical direction of the screen (pointing 'upward') in the world coordinate system.
CCVector3d ccViewportParameters::getViewDir | ( | ) | const |
Returns the viewing direction.
This is the direction normal to the screen (pointing 'forward') in the world coordinate system.
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSerializableObject.
void ccViewportParameters::setFocalDistance | ( | double | distance | ) |
Sets the 'focal' distance.
|
overridevirtual |
Saves data to binary stream.
out | output file (already opened) |
Reimplemented from ccSerializableObject.
bool ccViewportParameters::objectCenteredView |
Whether view is centered on displayed scene (true) or on the user eye (false)
Always true for ortho. mode.