MeVisLab Toolbox Reference
mlR2SonicWCLoader.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
5
12//----------------------------------------------------------------------------------
13
14#pragma once
15
16// Local includes
18
19// ML includes
20#include <mlRefCountedBase.h>
21#include <mlByteDataReader.h>
23
25
26// Forward to the module class using this loader.
27class PCLR2SonicWCLoader;
28
30namespace R2SonicWC {
31
34{
35public:
38
42 void open() override;
43
52 MLuint64 workMemoryHint=5000000000);
53
55 ~R2SonicWCLoader() override;
56
58 void reset();
59
72 std::string getStringDump(const MLint maxPackets=-1,
73 const MLint maxBeams=-1,
74 const MLint maxSamplesPerBeam=-1,
75 const std::string &prefix="",
76 const std::string &sep=" ",
77 const bool showFirstOfEachPacketTypeOnly=false) const;
78
81 virtual std::string getAsString(const std::string &prefix="",
82 const std::string &sep=", ",
83 const size_t maxNumBinaryEntries=8,
84 const size_t maxNumStringEntries=20) const override;
85
86
90
91protected:
101
102private:
103
105 MLuint64 _overallFileSize;
106
108 MLuint64 _fileReadPos;
109
111 WaterColumnDataSet _waterColumnPackage;
112
115};
116
117}
118
120
122MLPCLR2SonicWCLoader_EXPORT std::ostream& operator<<(std::ostream& os, const ML_NAMESPACE::R2SonicWC::R2SonicWCLoader &obj);
Project global and OS specific declarations.
#define MLPCLR2SonicWCLoader_EXPORT
DLL export macro definition.
Base class to implement raw data loaders which need byte swapping and basic file access on byte or ra...
ML Module class to load a point cloud from the Point Cloud Library from a file.
Class to read R2Sonic water column sonar data.
MLErrorCode loadWaterColumnPackage(PCLR2SonicWCLoader &updateObject, MLuint64 workMemoryHint=5000000000)
After opening the file this loads all WaterColumnPackages of the file into memory.
void reset()
Closes and resets internals.
~R2SonicWCLoader() override
Destructor.
void open() override
Opens the file if possible, isGood() will return true on success, otherwise false; if byte swapping m...
MLErrorCode loadWaterColumnPackage(MLuint64 &waterColumnDataBaseOffset, WaterColumnDataSet &waterColumnPackage)
Loads a WaterColumnPackage from the file position WaterColumnPackageBaseOffset.
virtual std::string getAsString(const std::string &prefix="", const std::string &sep=", ", const size_t maxNumBinaryEntries=8, const size_t maxNumStringEntries=20) const override
Default implementation of virtual base class method which uses getStringDump with maxNumBinaryEntries...
std::string getStringDump(const MLint maxPackets=-1, const MLint maxBeams=-1, const MLint maxSamplesPerBeam=-1, const std::string &prefix="", const std::string &sep=" ", const bool showFirstOfEachPacketTypeOnly=false) const
Convert content to a human readable string with the prefix prefix before all lines and separator sep ...
const WaterColumnDataSet & getLoadedWaterColumnPackage() const
Returns the read-only pointer to the currently loaded WaterColumnDataSet if there is one or nullptr o...
R2SonicWCLoader()
Default constructor creating an instance with empty fileName and closed loader.
Class describing the common data header of a WaterColumn data package.
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:716
Basic binary data loader class.
MLPCLR2SonicWCLoader_EXPORT std::ostream & operator<<(std::ostream &os, const ml::R2SonicWC::R2SonicWCLoader &obj)
Output to std::ostream.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Definition mlTypeDefs.h:425
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490
Structures describing the R2Sonic .wc water column data format.