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

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

#include <ossimLasPointRecord1.h>

Inheritance diagram for ossimLasPointRecord1:
ossimLasPointRecordInterface

Classes

struct  ossimLasPointRecord1Data
 

Public Member Functions

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

ossimLasPointRecord1Data m_record
 

Detailed Description

Container class for LAS point record type 1.

Definition at line 23 of file ossimLasPointRecord1.h.

Constructor & Destructor Documentation

◆ ossimLasPointRecord1() [1/2]

ossimLasPointRecord1::ossimLasPointRecord1 ( )

default constructor

Definition at line 75 of file ossimLasPointRecord1.cpp.

76  :
77  m_record()
78 {
79 }
ossimLasPointRecord1Data m_record

◆ ossimLasPointRecord1() [2/2]

ossimLasPointRecord1::ossimLasPointRecord1 ( const ossimLasPointRecord1 obj)

Definition at line 81 of file ossimLasPointRecord1.cpp.

82  :
83  m_record(obj.m_record)
84 {
85 }
ossimLasPointRecord1Data m_record

◆ ~ossimLasPointRecord1()

ossimLasPointRecord1::~ossimLasPointRecord1 ( )
virtual

destructor

Definition at line 96 of file ossimLasPointRecord1.cpp.

97 {
98 }

Member Function Documentation

◆ getBlue()

ossim_uint16 ossimLasPointRecord1::getBlue ( ) const
virtual
Returns
blue

Implements ossimLasPointRecordInterface.

Definition at line 152 of file ossimLasPointRecord1.cpp.

153 {
154  return 0;
155 }

◆ getEdgeFlag()

ossim_uint8 ossimLasPointRecord1::getEdgeFlag ( ) const
virtual

Implements ossimLasPointRecordInterface.

Definition at line 172 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_returnByte.

Referenced by print().

173 {
174  return (0x40 & m_record.m_returnByte);
175 }
ossimLasPointRecord1Data m_record

◆ getGreen()

ossim_uint16 ossimLasPointRecord1::getGreen ( ) const
virtual
Returns
green

Implements ossimLasPointRecordInterface.

Definition at line 147 of file ossimLasPointRecord1.cpp.

148 {
149  return 0;
150 }

◆ getIntensity()

ossim_uint16 ossimLasPointRecord1::getIntensity ( ) const
virtual
Returns
intensity

Implements ossimLasPointRecordInterface.

Definition at line 157 of file ossimLasPointRecord1.cpp.

References ossimLasPointRecord1::ossimLasPointRecord1Data::m_intensity, and m_record.

158 {
159  return m_record.m_intensity;
160 }
ossimLasPointRecord1Data m_record

◆ getNumberOfReturns()

ossim_uint8 ossimLasPointRecord1::getNumberOfReturns ( ) const
virtual

Implements ossimLasPointRecordInterface.

Definition at line 167 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_returnByte.

Referenced by print().

168 {
169  return (0x34 & m_record.m_returnByte);
170 }
ossimLasPointRecord1Data m_record

◆ getRed()

ossim_uint16 ossimLasPointRecord1::getRed ( ) const
virtual
Returns
red

Implements ossimLasPointRecordInterface.

Definition at line 142 of file ossimLasPointRecord1.cpp.

143 {
144  return 0;
145 }

◆ getReturnNumber()

ossim_uint8 ossimLasPointRecord1::getReturnNumber ( ) const
virtual
Returns
return number

Implements ossimLasPointRecordInterface.

Definition at line 162 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_returnByte.

Referenced by print().

163 {
164  return (0x07 & m_record.m_returnByte);
165 }
ossimLasPointRecord1Data m_record

◆ getX()

ossim_int32 ossimLasPointRecord1::getX ( ) const
virtual
Returns
x

Implements ossimLasPointRecordInterface.

Definition at line 127 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_x.

128 {
129  return m_record.m_x;
130 }
ossimLasPointRecord1Data m_record

◆ getY()

ossim_int32 ossimLasPointRecord1::getY ( ) const
virtual
Returns
y

Implements ossimLasPointRecordInterface.

Definition at line 132 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_y.

133 {
134  return m_record.m_y;
135 }
ossimLasPointRecord1Data m_record

◆ getZ()

ossim_int32 ossimLasPointRecord1::getZ ( ) const
virtual
Returns
z

Implements ossimLasPointRecordInterface.

Definition at line 137 of file ossimLasPointRecord1.cpp.

References m_record, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_z.

138 {
139  return m_record.m_z;
140 }
ossimLasPointRecord1Data m_record

◆ operator=()

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

Definition at line 87 of file ossimLasPointRecord1.cpp.

References m_record.

88 {
89  if (this != &copy_this)
90  {
91  m_record = copy_this.m_record;
92  }
93  return *this;
94 }
ossimLasPointRecord1Data m_record

◆ print()

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

Implements ossimLasPointRecordInterface.

Definition at line 177 of file ossimLasPointRecord1.cpp.

References getEdgeFlag(), getNumberOfReturns(), getReturnNumber(), ossimLasPointRecord1::ossimLasPointRecord1Data::m_classification, ossimLasPointRecord1::ossimLasPointRecord1Data::m_gpsTime, ossimLasPointRecord1::ossimLasPointRecord1Data::m_intensity, ossimLasPointRecord1::ossimLasPointRecord1Data::m_pointSourceID, m_record, ossimLasPointRecord1::ossimLasPointRecord1Data::m_scanAngleRank, ossimLasPointRecord1::ossimLasPointRecord1Data::m_userData, ossimLasPointRecord1::ossimLasPointRecord1Data::m_x, ossimLasPointRecord1::ossimLasPointRecord1Data::m_y, and ossimLasPointRecord1::ossimLasPointRecord1Data::m_z.

178 {
179  // Capture the original flags.
180  std::ios_base::fmtflags f = out.flags();
181 
182  out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
183 
184  out << "x: " << m_record.m_x
185  << "\ny: " << m_record.m_y
186  << "\nz: " << m_record.m_z
187  << "\nintensity: " << m_record.m_intensity
188  << "\nreturn: " << int(getReturnNumber())
189  << "\nnumber_of_returns: " << int(getNumberOfReturns())
190  << "\nedge: " << (getEdgeFlag()?"true":"false")
191  << "\nclassification: " << m_record.m_classification
192  << "\nscan_angle_rank: " << int(m_record.m_scanAngleRank)
193  << "\nuser_data: " << m_record.m_userData
194  << "\npoint_source_id: " << m_record.m_pointSourceID
195  << "\ngps_time: " << m_record.m_gpsTime
196  << std::endl;
197 
198  // Reset flags.
199  out.setf(f);
200  return out;
201 }
virtual ossim_uint8 getReturnNumber() const
virtual ossim_uint8 getEdgeFlag() const
ossimLasPointRecord1Data m_record
virtual ossim_uint8 getNumberOfReturns() const

◆ readStream()

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

Initialize record from stream.

Implements ossimLasPointRecordInterface.

Definition at line 100 of file ossimLasPointRecord1.cpp.

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

101 {
102  in.read((char*)&m_record, 28);
103 
105  {
106  swap();
107  }
108 }
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
void swap()
Performs a swap if system byte order is not little endian.
ossimLasPointRecord1Data m_record

◆ swap()

void ossimLasPointRecord1::swap ( )
private

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

Definition at line 203 of file ossimLasPointRecord1.cpp.

References ossimLasPointRecord1::ossimLasPointRecord1Data::m_gpsTime, ossimLasPointRecord1::ossimLasPointRecord1Data::m_intensity, ossimLasPointRecord1::ossimLasPointRecord1Data::m_pointSourceID, m_record, ossimLasPointRecord1::ossimLasPointRecord1Data::m_x, ossimLasPointRecord1::ossimLasPointRecord1Data::m_y, ossimLasPointRecord1::ossimLasPointRecord1Data::m_z, and ossimEndian::swap().

Referenced by readStream(), and writeStream().

◆ writeStream()

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

Writes record to stream.

Implements ossimLasPointRecordInterface.

Definition at line 110 of file ossimLasPointRecord1.cpp.

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

111 {
113  {
114  // Write little endian per spec:
115  swap();
116  }
117 
118  out.write((char*)&m_record, 28);
119 
121  {
122  // Swap back to native byte order if needed:
123  swap();
124  }
125 }
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
void swap()
Performs a swap if system byte order is not little endian.
ossimLasPointRecord1Data m_record

Member Data Documentation

◆ m_record

ossimLasPointRecord1Data ossimLasPointRecord1::m_record
private

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