![]() |
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.
| typedef QMultiMap<unsigned, unsigned> ccSerializableObject::LoadedIDMap |
Map of loaded unique IDs (old ID --> new ID)
|
virtualdefault |
Destructor.
|
inlinestatic |
Sends a custom error message (corrupted file) and returns 'false'.
Shortcut for returning a standardized error message in the fromFile method.
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 ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, ccHObject, ccPointCloud::Grid, ccColorScale, ccMaterial, ccScalarField, ccObject, ccWaveform, ccIndexedTransformation, WaveformDescriptor, and ecvViewportParameters.
Referenced by define_ccSerializableObject().
|
inlinevirtual |
Returns whether object is serializable of not.
Reimplemented in ccGLMatrixTpl< T >, ccHObject, ccPointCloud::Grid, ccColorScale, cloudViewer::geometry::Octree, ccGenericPointCloud, ccMaterial, ccScalarField, ccCameraSensor, ccWaveform, ccMesh, ccMeshGroup, ccArray< Type, N, ComponentType >, ccIndexedTransformation, cloudViewer::geometry::VoxelGrid, cloudViewer::geometry::Image, ccMaterialSet, cloudViewer::geometry::HalfEdgeTriangleMesh, ccBBox, ccFacet, ecvOrientedBBox, ccGBLSensor, cloudViewer::geometry::TetraMesh, cloudViewer::geometry::ecvMeshBase, ccPolyline, cloudViewer::geometry::LineSet, cloudViewer::geometry::RGBDImage, ccGenericMesh, cloudViewer::visualization::SelectionPolygon, ccSensor, WaveformDescriptor, cc2DLabel, ccIndexedTransformationBuffer, ccSubMesh, cloudViewer::visualization::PointCloudPicker, ccImage, ecvViewportParameters, ccCustomHObject, cc2DViewportObject, and cc2DViewportLabel.
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.
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 ccGLMatrixTpl< T >, ccHObject, ccPointCloud::Grid, ccColorScale, ccMaterial, ccScalarField, ccObject, ccWaveform, ccIndexedTransformation, WaveformDescriptor, and ecvViewportParameters.
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.
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 ccGLMatrixTpl< T >, ccGLMatrixTpl< double >, ccGLMatrixTpl< float >, ccHObject, ccPointCloud::Grid, ccColorScale, ccMaterial, ccScalarField, ccObject, ccWaveform, ccIndexedTransformation, WaveformDescriptor, and ecvViewportParameters.
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.
References CVLog::Error().
Referenced by define_ccSerializableObject().