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

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

#include <ossimLasPointRecord3.h>

Inheritance diagram for ossimLasPointRecord3:
ossimLasPointRecordInterface

Classes

union  BitFlags
 
struct  ossimLasPointRecord3Data
 

Public Member Functions

 ossimLasPointRecord3 ()
 default constructor More...
 
 ossimLasPointRecord3 (const ossimLasPointRecord3 &obj)
 
const ossimLasPointRecord3operator= (const ossimLasPointRecord3 &copy_this)
 
virtual ~ossimLasPointRecord3 ()
 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

ossimLasPointRecord3Data m_record
 

Detailed Description

Container class for LAS point record type 3.

Definition at line 23 of file ossimLasPointRecord3.h.

Constructor & Destructor Documentation

◆ ossimLasPointRecord3() [1/2]

ossimLasPointRecord3::ossimLasPointRecord3 ( )

default constructor

Definition at line 84 of file ossimLasPointRecord3.cpp.

85  :
86  m_record()
87 {
88 }
ossimLasPointRecord3Data m_record

◆ ossimLasPointRecord3() [2/2]

ossimLasPointRecord3::ossimLasPointRecord3 ( const ossimLasPointRecord3 obj)

Definition at line 90 of file ossimLasPointRecord3.cpp.

91  :
92  m_record(obj.m_record)
93 {
94 }
ossimLasPointRecord3Data m_record

◆ ~ossimLasPointRecord3()

ossimLasPointRecord3::~ossimLasPointRecord3 ( )
virtual

destructor

Definition at line 105 of file ossimLasPointRecord3.cpp.

106 {
107 }

Member Function Documentation

◆ getBlue()

ossim_uint16 ossimLasPointRecord3::getBlue ( ) const
virtual
Returns
blue

Implements ossimLasPointRecordInterface.

Definition at line 161 of file ossimLasPointRecord3.cpp.

162 {
163  return 0;
164 }

◆ getEdgeFlag()

ossim_uint8 ossimLasPointRecord3::getEdgeFlag ( ) const
virtual

◆ getGreen()

ossim_uint16 ossimLasPointRecord3::getGreen ( ) const
virtual
Returns
green

Implements ossimLasPointRecordInterface.

Definition at line 156 of file ossimLasPointRecord3.cpp.

157 {
158  return 0;
159 }

◆ getIntensity()

ossim_uint16 ossimLasPointRecord3::getIntensity ( ) const
virtual
Returns
intensity

Implements ossimLasPointRecordInterface.

Definition at line 167 of file ossimLasPointRecord3.cpp.

References ossimLasPointRecord3::ossimLasPointRecord3Data::m_intensity, and m_record.

168 {
169  return m_record.m_intensity;
170 }
ossimLasPointRecord3Data m_record

◆ getNumberOfReturns()

ossim_uint8 ossimLasPointRecord3::getNumberOfReturns ( ) const
virtual

◆ getRed()

ossim_uint16 ossimLasPointRecord3::getRed ( ) const
virtual
Returns
red

Implements ossimLasPointRecordInterface.

Definition at line 151 of file ossimLasPointRecord3.cpp.

152 {
153  return 0;
154 }

◆ getReturnNumber()

ossim_uint8 ossimLasPointRecord3::getReturnNumber ( ) const
virtual

◆ getX()

ossim_int32 ossimLasPointRecord3::getX ( ) const
virtual
Returns
x

Implements ossimLasPointRecordInterface.

Definition at line 136 of file ossimLasPointRecord3.cpp.

References m_record, and ossimLasPointRecord3::ossimLasPointRecord3Data::m_x.

137 {
138  return m_record.m_x;
139 }
ossimLasPointRecord3Data m_record

◆ getY()

ossim_int32 ossimLasPointRecord3::getY ( ) const
virtual
Returns
y

Implements ossimLasPointRecordInterface.

Definition at line 141 of file ossimLasPointRecord3.cpp.

References m_record, and ossimLasPointRecord3::ossimLasPointRecord3Data::m_y.

142 {
143  return m_record.m_y;
144 }
ossimLasPointRecord3Data m_record

◆ getZ()

ossim_int32 ossimLasPointRecord3::getZ ( ) const
virtual
Returns
z

Implements ossimLasPointRecordInterface.

Definition at line 146 of file ossimLasPointRecord3.cpp.

References m_record, and ossimLasPointRecord3::ossimLasPointRecord3Data::m_z.

147 {
148  return m_record.m_z;
149 }
ossimLasPointRecord3Data m_record

◆ operator=()

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

Definition at line 96 of file ossimLasPointRecord3.cpp.

References m_record.

97 {
98  if (this != &copy_this)
99  {
100  m_record = copy_this.m_record;
101  }
102  return *this;
103 }
ossimLasPointRecord3Data m_record

◆ print()

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

Implements ossimLasPointRecordInterface.

Definition at line 187 of file ossimLasPointRecord3.cpp.

References getEdgeFlag(), getNumberOfReturns(), getReturnNumber(), ossimLasPointRecord3::ossimLasPointRecord3Data::m_bitFlags, ossimLasPointRecord3::ossimLasPointRecord3Data::m_blue, ossimLasPointRecord3::ossimLasPointRecord3Data::m_classification, ossimLasPointRecord3::ossimLasPointRecord3Data::m_gpsTime, ossimLasPointRecord3::ossimLasPointRecord3Data::m_green, ossimLasPointRecord3::ossimLasPointRecord3Data::m_intensity, ossimLasPointRecord3::ossimLasPointRecord3Data::m_pointSourceId, m_record, ossimLasPointRecord3::ossimLasPointRecord3Data::m_red, ossimLasPointRecord3::ossimLasPointRecord3Data::m_scanAngleRank, ossimLasPointRecord3::BitFlags::m_scanDirection, ossimLasPointRecord3::ossimLasPointRecord3Data::m_userData, ossimLasPointRecord3::ossimLasPointRecord3Data::m_x, ossimLasPointRecord3::ossimLasPointRecord3Data::m_y, and ossimLasPointRecord3::ossimLasPointRecord3Data::m_z.

188 {
189  // Capture the original flags.
190  std::ios_base::fmtflags f = out.flags();
191 
192  out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
193 
194  out << "x: " << m_record.m_x
195  << "\ny: " << m_record.m_y
196  << "\nz: " << m_record.m_z
197  << "\nintensity: " << m_record.m_intensity
198  << "\nreturn: " << int(getReturnNumber())
199  << "\nnumber_of_returns: " << int(getNumberOfReturns())
200  << "\nedge: " << (getEdgeFlag()?"true":"false")
201  << "\nscan_direction: " << int(m_record.m_bitFlags.m_scanDirection)
202  << "\nclassification: " << m_record.m_classification
203  << "\nscan_angle_rank: " << int(m_record.m_scanAngleRank)
204  << "\nuser_data: " << m_record.m_userData
205  << "\npoint_source_id: " << m_record.m_pointSourceId
206  << "\ngrs_time: " << m_record.m_gpsTime
207  << "\nred: " << m_record.m_red
208  << "\ngreen: " << m_record.m_green
209  << "\nblue: " << m_record.m_blue
210  << std::endl;
211 
212  // Reset flags.
213  out.setf(f);
214  return out;
215 }
virtual ossim_uint8 getEdgeFlag() const
ossimLasPointRecord3Data m_record
virtual ossim_uint8 getReturnNumber() const
virtual ossim_uint8 getNumberOfReturns() const

◆ readStream()

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

Initialize record from stream.

Implements ossimLasPointRecordInterface.

Definition at line 109 of file ossimLasPointRecord3.cpp.

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

110 {
111  in.read((char*)&m_record, sizeof(ossimLasPointRecord3Data));
112 
114  {
115  swap();
116  }
117 }
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossimLasPointRecord3Data m_record
void swap()
Performs a swap if system byte order is not little endian.

◆ swap()

void ossimLasPointRecord3::swap ( )
private

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

Definition at line 217 of file ossimLasPointRecord3.cpp.

References ossimLasPointRecord3::ossimLasPointRecord3Data::m_blue, ossimLasPointRecord3::ossimLasPointRecord3Data::m_gpsTime, ossimLasPointRecord3::ossimLasPointRecord3Data::m_green, ossimLasPointRecord3::ossimLasPointRecord3Data::m_intensity, ossimLasPointRecord3::ossimLasPointRecord3Data::m_pointSourceId, m_record, ossimLasPointRecord3::ossimLasPointRecord3Data::m_red, ossimLasPointRecord3::ossimLasPointRecord3Data::m_x, ossimLasPointRecord3::ossimLasPointRecord3Data::m_y, ossimLasPointRecord3::ossimLasPointRecord3Data::m_z, and ossimEndian::swap().

Referenced by readStream(), and writeStream().

218 {
219  ossimEndian endian;
220  endian.swap(m_record.m_x);
221  endian.swap(m_record.m_y);
222  endian.swap(m_record.m_z);
223  endian.swap(m_record.m_intensity);
224  endian.swap(m_record.m_pointSourceId);
225  endian.swap(m_record.m_gpsTime);
226  endian.swap(m_record.m_red);
227  endian.swap(m_record.m_green);
228  endian.swap(m_record.m_blue);
229 }
ossimLasPointRecord3Data m_record
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26

◆ writeStream()

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

Writes record to stream.

Implements ossimLasPointRecordInterface.

Definition at line 119 of file ossimLasPointRecord3.cpp.

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

120 {
122  {
123  // Write little endian per spec:
124  swap();
125  }
126 
127  out.write((char*)&m_record, sizeof(ossimLasPointRecord3Data));
128 
130  {
131  // Swap back to native byte order if needed:
132  swap();
133  }
134 }
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossimLasPointRecord3Data m_record
void swap()
Performs a swap if system byte order is not little endian.

Member Data Documentation

◆ m_record

ossimLasPointRecord3Data ossimLasPointRecord3::m_record
private

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