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

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

#include <ossimLasPointRecord2.h>

Inheritance diagram for ossimLasPointRecord2:
ossimLasPointRecordInterface

Classes

union  BitFlags
 
struct  ossimLasPointRecord2Data
 

Public Member Functions

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

ossimLasPointRecord2Data m_record
 

Detailed Description

Container class for LAS point record type 2.

Definition at line 23 of file ossimLasPointRecord2.h.

Constructor & Destructor Documentation

◆ ossimLasPointRecord2() [1/2]

ossimLasPointRecord2::ossimLasPointRecord2 ( )

default constructor

Definition at line 81 of file ossimLasPointRecord2.cpp.

82  :
83  m_record()
84 {
85 }
ossimLasPointRecord2Data m_record

◆ ossimLasPointRecord2() [2/2]

ossimLasPointRecord2::ossimLasPointRecord2 ( const ossimLasPointRecord2 obj)

Definition at line 87 of file ossimLasPointRecord2.cpp.

88  :
89  m_record(obj.m_record)
90 {
91 }
ossimLasPointRecord2Data m_record

◆ ~ossimLasPointRecord2()

ossimLasPointRecord2::~ossimLasPointRecord2 ( )
virtual

destructor

Definition at line 102 of file ossimLasPointRecord2.cpp.

103 {
104 }

Member Function Documentation

◆ getBlue()

ossim_uint16 ossimLasPointRecord2::getBlue ( ) const
virtual
Returns
blue

Implements ossimLasPointRecordInterface.

Definition at line 158 of file ossimLasPointRecord2.cpp.

References ossimLasPointRecord2::ossimLasPointRecord2Data::m_blue, and m_record.

159 {
160  return m_record.m_blue;
161 }
ossimLasPointRecord2Data m_record

◆ getEdgeFlag()

ossim_uint8 ossimLasPointRecord2::getEdgeFlag ( ) const
virtual

◆ getGreen()

ossim_uint16 ossimLasPointRecord2::getGreen ( ) const
virtual
Returns
green

Implements ossimLasPointRecordInterface.

Definition at line 153 of file ossimLasPointRecord2.cpp.

References ossimLasPointRecord2::ossimLasPointRecord2Data::m_green, and m_record.

154 {
155  return m_record.m_green;
156 }
ossimLasPointRecord2Data m_record

◆ getIntensity()

ossim_uint16 ossimLasPointRecord2::getIntensity ( ) const
virtual
Returns
intensity

Implements ossimLasPointRecordInterface.

Definition at line 163 of file ossimLasPointRecord2.cpp.

References ossimLasPointRecord2::ossimLasPointRecord2Data::m_intensity, and m_record.

164 {
165  return m_record.m_intensity;
166 }
ossimLasPointRecord2Data m_record

◆ getNumberOfReturns()

ossim_uint8 ossimLasPointRecord2::getNumberOfReturns ( ) const
virtual

◆ getRed()

ossim_uint16 ossimLasPointRecord2::getRed ( ) const
virtual
Returns
red

Implements ossimLasPointRecordInterface.

Definition at line 148 of file ossimLasPointRecord2.cpp.

References m_record, and ossimLasPointRecord2::ossimLasPointRecord2Data::m_red.

149 {
150  return m_record.m_red;
151 }
ossimLasPointRecord2Data m_record

◆ getReturnNumber()

ossim_uint8 ossimLasPointRecord2::getReturnNumber ( ) const
virtual

◆ getX()

ossim_int32 ossimLasPointRecord2::getX ( ) const
virtual
Returns
x

Implements ossimLasPointRecordInterface.

Definition at line 133 of file ossimLasPointRecord2.cpp.

References m_record, and ossimLasPointRecord2::ossimLasPointRecord2Data::m_x.

134 {
135  return m_record.m_x;
136 }
ossimLasPointRecord2Data m_record

◆ getY()

ossim_int32 ossimLasPointRecord2::getY ( ) const
virtual
Returns
y

Implements ossimLasPointRecordInterface.

Definition at line 138 of file ossimLasPointRecord2.cpp.

References m_record, and ossimLasPointRecord2::ossimLasPointRecord2Data::m_y.

139 {
140  return m_record.m_y;
141 }
ossimLasPointRecord2Data m_record

◆ getZ()

ossim_int32 ossimLasPointRecord2::getZ ( ) const
virtual
Returns
z

Implements ossimLasPointRecordInterface.

Definition at line 143 of file ossimLasPointRecord2.cpp.

References m_record, and ossimLasPointRecord2::ossimLasPointRecord2Data::m_z.

144 {
145  return m_record.m_z;
146 }
ossimLasPointRecord2Data m_record

◆ operator=()

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

Definition at line 93 of file ossimLasPointRecord2.cpp.

References m_record.

94 {
95  if (this != &copy_this)
96  {
97  m_record = copy_this.m_record;
98  }
99  return *this;
100 }
ossimLasPointRecord2Data m_record

◆ print()

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

Implements ossimLasPointRecordInterface.

Definition at line 183 of file ossimLasPointRecord2.cpp.

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

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

◆ readStream()

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

Initialize record from stream.

Implements ossimLasPointRecordInterface.

Definition at line 106 of file ossimLasPointRecord2.cpp.

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

107 {
108  in.read((char*)&m_record, 26); // sizeof reports 28 due to actual space used for STRUCT //sizeof(ossimLasPointRecord2Data));
109 
111  {
112  swap();
113  }
114 }
ossimLasPointRecord2Data m_record
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
void swap()
Performs a swap if system byte order is not little endian.

◆ swap()

void ossimLasPointRecord2::swap ( )
private

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

Definition at line 212 of file ossimLasPointRecord2.cpp.

References ossimLasPointRecord2::ossimLasPointRecord2Data::m_blue, ossimLasPointRecord2::ossimLasPointRecord2Data::m_green, ossimLasPointRecord2::ossimLasPointRecord2Data::m_intensity, ossimLasPointRecord2::ossimLasPointRecord2Data::m_pointSourceId, m_record, ossimLasPointRecord2::ossimLasPointRecord2Data::m_red, ossimLasPointRecord2::ossimLasPointRecord2Data::m_x, ossimLasPointRecord2::ossimLasPointRecord2Data::m_y, ossimLasPointRecord2::ossimLasPointRecord2Data::m_z, and ossimEndian::swap().

Referenced by readStream(), and writeStream().

◆ writeStream()

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

Writes record to stream.

Implements ossimLasPointRecordInterface.

Definition at line 116 of file ossimLasPointRecord2.cpp.

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

117 {
119  {
120  // Write little endian per spec:
121  swap();
122  }
123 
124  out.write((char*)&m_record, 26); // sizeof reports 28 due to actual space used for STRUCT //sizeof(ossimLasPointRecord2Data));
125 
127  {
128  // Swap back to native byte order if needed:
129  swap();
130  }
131 }
ossimLasPointRecord2Data m_record
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
void swap()
Performs a swap if system byte order is not little endian.

Member Data Documentation

◆ m_record

ossimLasPointRecord2Data ossimLasPointRecord2::m_record
private

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