![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Serializable object interface. More...
#include <ecvSerializableObject.h>

Public Types | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS , 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) More... | |
Public Member Functions | |
| virtual | ~ccSerializableObject ()=default |
| Destructor. More... | |
| virtual bool | isSerializable () const |
| Returns whether object is serializable of not. More... | |
| virtual bool | toFile (QFile &out, short dataVersion) const |
| Saves data to binary stream. More... | |
| virtual short | minimumFileVersion () const =0 |
| Returns the minimum file version required to save this instance. More... | |
| virtual bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
| Loads data from binary stream. More... | |
Static Public Member Functions | |
| 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... | |
Serializable object interface.
Definition at line 25 of file ecvSerializableObject.h.
| typedef QMultiMap<unsigned, unsigned> ccSerializableObject::LoadedIDMap |
Map of loaded unique IDs (old ID --> new ID)
Definition at line 61 of file ecvSerializableObject.h.
Deserialization flags (bit-field)
| Enumerator | |
|---|---|
| DF_POINT_COORDS_64_BITS | Point coordinates are stored as 64 bits double (otherwise 32 bits floats) |
| DF_SCALAR_VAL_32_BITS | Scalar values are stored as 32 bits floats (otherwise 64 bits double) |
Definition at line 51 of file ecvSerializableObject.h.
|
virtualdefault |
Destructor.
|
inlinestatic |
Sends a custom error message (corrupted file) and returns 'false'.
Shortcut for returning a standardized error message in the fromFile method.
Definition at line 113 of file ecvSerializableObject.h.
References CVLog::Error().
Referenced by define_ccSerializableObject().
|
inlinevirtual |
Loads data from binary stream.
| in | input file (already opened) |
| dataVersion | file version (for version-specific deserialization) |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
Note: When implementing, use dataVersion checks to handle differentversions:
Reimplemented in ccWaveform, WaveformDescriptor, ecvViewportParameters, ccScalarField, ccPointCloud::Grid, ccObject, ccMaterial, ccIndexedTransformation, ccHObject, ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, and ccColorScale.
Definition at line 75 of file ecvSerializableObject.h.
Referenced by define_ccSerializableObject().
|
inlinevirtual |
Returns whether object is serializable of not.
Reimplemented in cloudViewer::geometry::VoxelGrid, cloudViewer::geometry::RGBDImage, cloudViewer::geometry::Octree, cloudViewer::geometry::LineSet, cloudViewer::geometry::Image, cloudViewer::geometry::HalfEdgeTriangleMesh, ccWaveform, WaveformDescriptor, ecvViewportParameters, cloudViewer::geometry::TetraMesh, ccSubMesh, ccSensor, ccScalarField, ccPolyline, ccPointCloud::Grid, ecvOrientedBBox, ccMeshGroup, cloudViewer::geometry::ecvMeshBase, ccMesh, ccMaterialSet, ccMaterial, ccIndexedTransformationBuffer, ccIndexedTransformation, ccImage, ccHObject, ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, ccGenericPointCloud, ccGenericMesh, ccGBLSensor, ccFacet, ccCustomHObject, ccColorScale, ccCameraSensor, ccBBox, ccArray< Type, N, ComponentType >, ccArray< CompressedNormType, 1, CompressedNormType >, ccArray< TexCoords2D, 2, float >, ccArray< ecvColor::Rgba, 4, ColorCompType >, ccArray< CCVector3, 3, PointCoordinateType >, ccArray< ecvColor::Rgb, 3, ColorCompType >, cc2DViewportObject, cc2DViewportLabel, cc2DLabel, cloudViewer::visualization::SelectionPolygon, and cloudViewer::visualization::PointCloudPicker.
Definition at line 31 of file ecvSerializableObject.h.
Referenced by define_ccSerializableObject().
|
inlinestatic |
Sends a custom error message (not enough memory) and returns 'false'.
Shortcut for returning a standardized error message in the fromFile method.
Definition at line 104 of file ecvSerializableObject.h.
References CVLog::Error().
Referenced by define_ccSerializableObject().
|
pure virtual |
Returns the minimum file version required to save this instance.
To be overridden by subclasses to indicate their minimum required version. This enables the system to determine:
Implemented in ccWaveform, WaveformDescriptor, ecvViewportParameters, ccScalarField, ccPointCloud::Grid, ccObject, ccMaterial, ccIndexedTransformation, ccHObject, ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, and ccColorScale.
Referenced by define_ccSerializableObject().
|
inlinestatic |
Sends a custom error message (read error) and returns 'false'.
Shortcut for returning a standardized error message in the fromFile method.
Definition at line 95 of file ecvSerializableObject.h.
References CVLog::Error().
Referenced by define_ccSerializableObject().
|
inlinevirtual |
Saves data to binary stream.
| out | output file (already opened) |
| dataVersion | target file version (for forward/backward compatibility) |
Reimplemented in ccWaveform, WaveformDescriptor, ecvViewportParameters, ccScalarField, ccPointCloud::Grid, ccObject, ccMaterial, ccIndexedTransformation, ccHObject, ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, and ccColorScale.
Definition at line 38 of file ecvSerializableObject.h.
Referenced by define_ccSerializableObject().
|
inlinestatic |
Sends a custom error message (write error) and returns 'false'.
Shortcut for returning a standardized error message in the toFile method.
Definition at line 86 of file ecvSerializableObject.h.
References CVLog::Error().
Referenced by define_ccSerializableObject().