OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ossimLasPointRecord4 Class Reference

Container class for LAS point record type 4. More...

#include <ossimLasPointRecord4.h>

Inheritance diagram for ossimLasPointRecord4:
ossimLasPointRecordInterface

Classes

union  BitFlags
 
struct  ossimLasPointRecord4Data
 

Public Member Functions

 ossimLasPointRecord4 ()
 default constructor More...
 
 ossimLasPointRecord4 (const ossimLasPointRecord4 &obj)
 
const ossimLasPointRecord4operator= (const ossimLasPointRecord4 &copy_this)
 
virtual ~ossimLasPointRecord4 ()
 destructor More...
 
virtual void readStream (std::istream &in)
 Initialize record from stream. More...
 
virtual void writeStream (std::ostream &out)
 Writes record to stream. More...
 
virtual ossim_int32 getX () const
 
virtual ossim_int32 getY () const
 
virtual ossim_int32 getZ () const
 
virtual ossim_uint16 getRed () const
 
virtual ossim_uint16 getGreen () const
 
virtual ossim_uint16 getBlue () const
 
virtual ossim_uint16 getIntensity () const
 
virtual ossim_uint8 getReturnNumber () const
 
virtual ossim_uint8 getNumberOfReturns () const
 
virtual ossim_uint8 getEdgeFlag () const
 
virtual std::ostream & print (std::ostream &out) const
 
- Public Member Functions inherited from ossimLasPointRecordInterface
virtual ~ossimLasPointRecordInterface ()
 Virtual destructor defined to squash compiler errors. More...
 

Private Member Functions

void swap ()
 Performs a swap if system byte order is not little endian. More...
 

Private Attributes

ossimLasPointRecord4Data m_record
 

Detailed Description

Container class for LAS point record type 4.

Definition at line 23 of file ossimLasPointRecord4.h.

Constructor & Destructor Documentation

◆ ossimLasPointRecord4() [1/2]

ossimLasPointRecord4::ossimLasPointRecord4 ( )

default constructor

Definition at line 96 of file ossimLasPointRecord4.cpp.

97  :
98  m_record()
99 {
100 }
ossimLasPointRecord4Data m_record

◆ ossimLasPointRecord4() [2/2]

ossimLasPointRecord4::ossimLasPointRecord4 ( const ossimLasPointRecord4 obj)

Definition at line 102 of file ossimLasPointRecord4.cpp.

103  :
104  m_record(obj.m_record)
105 {
106 }
ossimLasPointRecord4Data m_record

◆ ~ossimLasPointRecord4()

ossimLasPointRecord4::~ossimLasPointRecord4 ( )
virtual

destructor

Definition at line 117 of file ossimLasPointRecord4.cpp.

118 {
119 }

Member Function Documentation

◆ getBlue()

ossim_uint16 ossimLasPointRecord4::getBlue ( ) const
virtual
Returns
blue

Implements ossimLasPointRecordInterface.

Definition at line 173 of file ossimLasPointRecord4.cpp.

174 {
175  return 0;
176 }

◆ getEdgeFlag()

ossim_uint8 ossimLasPointRecord4::getEdgeFlag ( ) const
virtual

◆ getGreen()

ossim_uint16 ossimLasPointRecord4::getGreen ( ) const
virtual
Returns
green

Implements ossimLasPointRecordInterface.

Definition at line 168 of file ossimLasPointRecord4.cpp.

169 {
170  return 0;
171 }

◆ getIntensity()

ossim_uint16 ossimLasPointRecord4::getIntensity ( ) const
virtual
Returns
intensity

Implements ossimLasPointRecordInterface.

Definition at line 178 of file ossimLasPointRecord4.cpp.

References ossimLasPointRecord4::ossimLasPointRecord4Data::m_intensity, and m_record.

179 {
180  return m_record.m_intensity;
181 }
ossimLasPointRecord4Data m_record

◆ getNumberOfReturns()

ossim_uint8 ossimLasPointRecord4::getNumberOfReturns ( ) const
virtual

◆ getRed()

ossim_uint16 ossimLasPointRecord4::getRed ( ) const
virtual
Returns
red

Implements ossimLasPointRecordInterface.

Definition at line 163 of file ossimLasPointRecord4.cpp.

164 {
165  return 0;
166 }

◆ getReturnNumber()

ossim_uint8 ossimLasPointRecord4::getReturnNumber ( ) const
virtual

◆ getX()

ossim_int32 ossimLasPointRecord4::getX ( ) const
virtual
Returns
x

Implements ossimLasPointRecordInterface.

Definition at line 148 of file ossimLasPointRecord4.cpp.

References m_record, and ossimLasPointRecord4::ossimLasPointRecord4Data::m_x.

149 {
150  return m_record.m_x;
151 }
ossimLasPointRecord4Data m_record

◆ getY()

ossim_int32 ossimLasPointRecord4::getY ( ) const
virtual
Returns
y

Implements ossimLasPointRecordInterface.

Definition at line 153 of file ossimLasPointRecord4.cpp.

References m_record, and ossimLasPointRecord4::ossimLasPointRecord4Data::m_y.

154 {
155  return m_record.m_y;
156 }
ossimLasPointRecord4Data m_record

◆ getZ()

ossim_int32 ossimLasPointRecord4::getZ ( ) const
virtual
Returns
z

Implements ossimLasPointRecordInterface.

Definition at line 158 of file ossimLasPointRecord4.cpp.

References m_record, and ossimLasPointRecord4::ossimLasPointRecord4Data::m_z.

159 {
160  return m_record.m_z;
161 }
ossimLasPointRecord4Data m_record

◆ operator=()

const ossimLasPointRecord4 & ossimLasPointRecord4::operator= ( const ossimLasPointRecord4 copy_this)

Definition at line 108 of file ossimLasPointRecord4.cpp.

References m_record.

109 {
110  if (this != &copy_this)
111  {
112  m_record = copy_this.m_record;
113  }
114  return *this;
115 }
ossimLasPointRecord4Data m_record

◆ print()

std::ostream & ossimLasPointRecord4::print ( std::ostream &  out) const
virtual

Implements ossimLasPointRecordInterface.

Definition at line 198 of file ossimLasPointRecord4.cpp.

References getEdgeFlag(), getNumberOfReturns(), getReturnNumber(), ossimLasPointRecord4::ossimLasPointRecord4Data::m_bitFlags, ossimLasPointRecord4::ossimLasPointRecord4Data::m_blue, ossimLasPointRecord4::ossimLasPointRecord4Data::m_byteOffsetToWaveformData, ossimLasPointRecord4::ossimLasPointRecord4Data::m_classification, ossimLasPointRecord4::ossimLasPointRecord4Data::m_gpsTime, ossimLasPointRecord4::ossimLasPointRecord4Data::m_green, ossimLasPointRecord4::ossimLasPointRecord4Data::m_intensity, ossimLasPointRecord4::ossimLasPointRecord4Data::m_pointSourceId, m_record, ossimLasPointRecord4::ossimLasPointRecord4Data::m_red, ossimLasPointRecord4::ossimLasPointRecord4Data::m_returnPointWaveformLocation, ossimLasPointRecord4::ossimLasPointRecord4Data::m_scanAngleRank, ossimLasPointRecord4::BitFlags::m_scanDirection, ossimLasPointRecord4::ossimLasPointRecord4Data::m_userData, ossimLasPointRecord4::ossimLasPointRecord4Data::m_waveformPacketSizeInBytes, ossimLasPointRecord4::ossimLasPointRecord4Data::m_wavePacketDescriptorIndex, ossimLasPointRecord4::ossimLasPointRecord4Data::m_x, ossimLasPointRecord4::ossimLasPointRecord4Data::m_y, and ossimLasPointRecord4::ossimLasPointRecord4Data::m_z.

199 {
200  // Capture the original flags.
201  std::ios_base::fmtflags f = out.flags();
202 
203  out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
204 
205  out << "x: " << m_record.m_x
206  << "\ny: " << m_record.m_y
207  << "\nz: " << m_record.m_z
208  << "\nintensity: " << m_record.m_intensity
209  << "\nreturn: " << int(getReturnNumber())
210  << "\nnumber_of_returns: " << int(getNumberOfReturns())
211  << "\nedge: " << (getEdgeFlag()?"true":"false")
212  << "\nscan_direction: " << int(m_record.m_bitFlags.m_scanDirection)
213  << "\nclassification: " << m_record.m_classification
214  << "\nscan_angle_rank: " << int(m_record.m_scanAngleRank)
215  << "\nuser_data: " << m_record.m_userData
216  << "\npoint_source_id: " << m_record.m_pointSourceId
217  << "\ngrs_time: " << m_record.m_gpsTime
218  << "\nwave_packet_descriptor_index: " << m_record.m_wavePacketDescriptorIndex
219  << "\nbyte_offset_to_waveform_data: " << m_record.m_byteOffsetToWaveformData
220  << "\nwaveform_packet_size_in_bytes: " << m_record.m_waveformPacketSizeInBytes
221  << "\nm_returnPointWaveformLocation: " << m_record.m_returnPointWaveformLocation
222  << "\nred: " << m_record.m_red
223  << "\ngreen: " << m_record.m_green
224  << "\nblue: " << m_record.m_blue
225  << std::endl;
226 
227  // Reset flags.
228  out.setf(f);
229  return out;
230 }
virtual ossim_uint8 getReturnNumber() const
ossimLasPointRecord4Data m_record
virtual ossim_uint8 getEdgeFlag() const
virtual ossim_uint8 getNumberOfReturns() const

◆ readStream()

void ossimLasPointRecord4::readStream ( std::istream &  in)
virtual

Initialize record from stream.

Implements ossimLasPointRecordInterface.

Definition at line 121 of file ossimLasPointRecord4.cpp.

References ossim::byteOrder(), m_record, OSSIM_BIG_ENDIAN, and swap().

122 {
123  in.read((char*)&m_record, sizeof(ossimLasPointRecord4Data));
124 
126  {
127  swap();
128  }
129 }
ossimLasPointRecord4Data m_record
void swap()
Performs a swap if system byte order is not little endian.
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54

◆ swap()

void ossimLasPointRecord4::swap ( )
private

Performs a swap if system byte order is not little endian.

Definition at line 232 of file ossimLasPointRecord4.cpp.

References ossimLasPointRecord4::ossimLasPointRecord4Data::m_blue, ossimLasPointRecord4::ossimLasPointRecord4Data::m_byteOffsetToWaveformData, ossimLasPointRecord4::ossimLasPointRecord4Data::m_gpsTime, ossimLasPointRecord4::ossimLasPointRecord4Data::m_green, ossimLasPointRecord4::ossimLasPointRecord4Data::m_intensity, ossimLasPointRecord4::ossimLasPointRecord4Data::m_pointSourceId, m_record, ossimLasPointRecord4::ossimLasPointRecord4Data::m_red, ossimLasPointRecord4::ossimLasPointRecord4Data::m_returnPointWaveformLocation, ossimLasPointRecord4::ossimLasPointRecord4Data::m_waveformPacketSizeInBytes, ossimLasPointRecord4::ossimLasPointRecord4Data::m_x, ossimLasPointRecord4::ossimLasPointRecord4Data::m_y, ossimLasPointRecord4::ossimLasPointRecord4Data::m_z, and ossimEndian::swap().

Referenced by readStream(), and writeStream().

233 {
234  ossimEndian endian;
235  endian.swap(m_record.m_x);
236  endian.swap(m_record.m_y);
237  endian.swap(m_record.m_z);
238  endian.swap(m_record.m_intensity);
239  endian.swap(m_record.m_pointSourceId);
240  endian.swap(m_record.m_gpsTime);
244  endian.swap(m_record.m_red);
245  endian.swap(m_record.m_green);
246  endian.swap(m_record.m_blue);
247 }
ossimLasPointRecord4Data m_record
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

◆ writeStream()

void ossimLasPointRecord4::writeStream ( std::ostream &  out)
virtual

Writes record to stream.

Implements ossimLasPointRecordInterface.

Definition at line 131 of file ossimLasPointRecord4.cpp.

References ossim::byteOrder(), m_record, OSSIM_BIG_ENDIAN, and swap().

132 {
134  {
135  // Write little endian per spec:
136  swap();
137  }
138 
139  out.write((char*)&m_record, sizeof(ossimLasPointRecord4Data));
140 
142  {
143  // Swap back to native byte order if needed:
144  swap();
145  }
146 }
ossimLasPointRecord4Data m_record
void swap()
Performs a swap if system byte order is not little endian.
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54

Member Data Documentation

◆ m_record

ossimLasPointRecord4Data ossimLasPointRecord4::m_record
private

The documentation for this class was generated from the following files: