OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPointRecord.h
Go to the documentation of this file.
1 //**************************************************************************************************
2 //
3 // OSSIM (http://trac.osgeo.org/ossim/)
4 //
5 // License: MIT -- See LICENSE.txt file in the top level directory for more details.
6 //
7 //**************************************************************************************************
8 // $Id: ossimPointRecord.h 23352 2015-05-29 17:38:12Z okramer $
9 
10 #ifndef ossimPointCloudRecord_HEADER
11 #define ossimPointCloudRecord_HEADER
12 
14 #include <ossim/base/ossimCommon.h>
16 #include <ossim/base/ossimGpt.h>
17 #include <vector>
18 #include <map>
19 
20 /***************************************************************************************************
21  * This class represents a single sample (point) in a point cloud.
22  **************************************************************************************************/
24 {
25 public:
26  // Field codes intended to be OR'd to indicate fields present in point record. All point records
27  // have at least an X, Y, Z position so those fields are implied.
28  enum FIELD_CODES // and associated types
29  {
30  Intensity = 0x0008, // float 32
31  ReturnNumber = 0x0010, // unsigned int 32
32  NumberOfReturns = 0x0020, // unsigned int 32
33  Red = 0x0040, // float 32
34  Green = 0x0080, // float 32
35  Blue = 0x0100, // float 32
36  GpsTime = 0x0200, // unsigned long Unix epoch (microsec from 01/01/1970)
37  Infrared = 0x0400, // float 32
38  All = 0x0777
39  };
40 
41  ossimPointRecord(ossim_uint32 fields_code=0);
43  ossimPointRecord(const ossimGpt& pos);
44 
47 
49 
50  ossim_uint32 getPointId() const { return m_pointId; }
51  void setPointId(ossim_uint32 id) {m_pointId = id; }
52 
59  const ossimGpt& getPosition() const { return m_position; }
60  void setPosition(const ossimGpt& p) { m_position = p; }
61 
64  virtual bool hasFields(ossim_uint32 code_mashup) const;
65 
67  virtual ossim_uint32 getFieldCode() const;
68 
70  ossim_float32 getField(FIELD_CODES fc) const;
71 
72  const std::map<FIELD_CODES, ossim_float32>& getFieldMap() const { return m_fieldMap; }
73 
74  void setField(FIELD_CODES fc, ossim_float32 value);
75 
76  friend std::ostream& operator << (std::ostream& ostr, const ossimPointRecord& p);
77 
81  void clear();
82  bool isValid() const;
83 
84 protected:
87  std::map<FIELD_CODES, ossim_float32> m_fieldMap;
88 };
89 
90 #endif /* ossimPointCloudRecord_HEADER */
const std::map< FIELD_CODES, ossim_float32 > & getFieldMap() const
#define OSSIMDLLEXPORT
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
float ossim_float32
ossim_uint32 m_pointId
ossim_uint32 getPointId() const
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
unsigned int ossim_uint32
ossimReferenced & operator=(const ossimReferenced &)
const ossimGpt & getPosition() const
Returns the 3D position vector in the dataset&#39;s coodinate reference system (available from the ossimP...
void setPosition(const ossimGpt &p)
void setPointId(ossim_uint32 id)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
std::map< FIELD_CODES, ossim_float32 > m_fieldMap