15 #include "../tools/errorhandler.hpp" 17 #include "../tools/toolbox.hpp" 28 , m_scanNumber(0x0000)
46 return (
sizeof(*
this) +
153 throw std::out_of_range (
"Scan::resize was called with new size larger than what fits into UINT16: " +
toString(new_size) +
" but only 65536 is allowed!");
156 m_points.resize(new_size, default_point);
163 throw std::out_of_range (
"Scan::reserve was called with new capacity larger than what fits into UINT16: " +
toString(new_capacity) +
" but only 65536 is allowed!");
181 if (inVehicleCoordinates)
203 point->addCartesianOffset(offsetX, offsetY, offsetZ);
209 point->addPolarOffset(distOffset, hAngleOffset, vAngleOffset);
216 std::set<UINT8> availableDevicesOnce;
217 std::set<UINT8> availableDevicesTwice;
218 for (ScannerInfoVector::const_iterator it = v.begin();
225 if (availableDevicesOnce.count(deviceID) == 0)
228 availableDevicesOnce.insert(deviceID);
233 throw std::logic_error(
"Scan::setScannerInfos called with a list (size=" +
234 ::
toString(v.size()) +
") that contains two ScannerInfos with device ID " +
236 ". This is not allowed - for each scanner at most one ScannerInfo may be stored in the ScannerInfoVector.");
313 ") has empty ScannerInfos - no conversion possible, aborting!");
324 Point3D pt = sptIt->toPoint3D();
326 sptIt->setPoint3D(pt);
362 for (ScannerInfoVector::const_iterator it =
m_scannerInfos.begin();
366 if ((*it).getDeviceID() == id)
375 UINT32 test = ~(scanFlag);
void clear()
Resets all members of this object.
std::string toString(const PositionWGS84::PositionWGS84SourceType &type)
const_iterator end() const
ScannerInfoVector m_scannerInfos
The ScannerInfo collection.
virtual const UINT32 getUsedMemory() const
void setVehicleCoordinates(bool inVehicleCoordinates)
Set whether the scanpoints are given in vehicle coordinates.
This class defines a point in the three-dimensional plane.
PointList::size_type size_type
A Position with orientation.
UINT8 getDeviceID() const
Returns the ID of the device that has recorded this scan.
PointList::const_iterator getPointListEnd() const
Scan(size_type maxPoints=5280)
bool transformToVehicleCoordinates()
Transforms this scan (i.e. the scan points) to the vehicle coordinates.
size_type capacity() const
void setScannerInfos(const ScannerInfoVector &v)
UINT8 getScannerType() const
void reserve(size_type new_capacity)
Allocates memory for a total of new_capacity points.
UINT16 getNumPoints() const
static std::string scannerTypeToString(UINT8 st)
UINT16 getScanNumber() const
ScanPoint & addNewPoint()
const ScannerInfoVector & getScannerInfos() const
static bool isDescendingAngle(const ScanPoint &P1, const ScanPoint &P2)
PointList::const_iterator getPointListBegin() const
void addPolarOffset(double distOffset, double hAngleOffset, double vAngleOffset)
UINT32 getScanFlags() const
bool transformToVehicle(Point3D *pt)
PointList::iterator iterator
const ScannerInfo * getScannerInfoByDeviceId(UINT8 id) const
const_iterator begin() const
Scan & copy(const Scan &)
void resize(size_type new_size, const ScanPoint &default_point=ScanPoint())
Resizes the scan to the specified number of points.
std::vector< ScannerInfo > ScannerInfoVector
void setScanFlags(UINT32 flags)
void addCartesianOffset(double offsetX, double offsetY, double offsetZ)
void clearLabelFlag(Scan::ScanFlags scanFlag)
UINT32 getTotalObjectSize()
~Scan()
Default destructor.
void setFlags(UINT32 val)
Bit 11: Scanpoint coordinate system; 0 = scanner coordinates, 1 = vehicle / reference coordinates...
void printWarning(std::string message)
Scan & operator=(const Scan &)
bool transformToVehicleCoordinatesUnsorted()
Transforms this scan (i.e. the scan points) to the vehicle coordinates.