OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPointBlock.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 #ifndef ossimPointBlock_HEADER
9 #define ossimPointBlock_HEADER 1
10 
12 #include <ossim/base/ossimCommon.h> /* for ossim::isnan */
14 #include <ossim/base/ossimRefPtr.h>
15 #include <ossim/base/ossimGrect.h>
17 #include <vector>
18 
19 class ossimSource;
20 
21 /***************************************************************************************************
22  * Base class for all Point Cloud data sources, including input file handlers and processing nodes.
23  **************************************************************************************************/
25 {
26 public:
27  typedef std::vector< ossimRefPtr<ossimPointRecord> > PointList;
28 
29  explicit ossimPointBlock(ossimSource* owner=0, ossim_uint32 fields=0);
30 
31  ~ossimPointBlock();
32 
34  virtual ossim_uint32 size() const { return (ossim_uint32)m_pointList.size(); }
35 
36  bool empty() const { return (size() == 0); }
37 
41  ossim_uint32 getFieldCode() const;
42  vector<ossimPointRecord::FIELD_CODES> getFieldCodesAsList() const;
43 
49  void setFieldCode(ossim_uint32 code);
50 
52  virtual void addPoint(ossimPointRecord* point);
53 
54  virtual const ossimPointRecord* getPoint(ossim_uint32 point_offset) const;
55  virtual ossimPointRecord* getPoint(ossim_uint32 point_offset);
56 
57  const ossimPointRecord* operator[](ossim_uint32 i) const { return getPoint(i); }
58  ossimPointRecord* operator[](ossim_uint32 i) { return getPoint(i); }
59 
60  virtual const PointList& getPoints() const { return m_pointList; }
61  virtual PointList& getPoints() { return m_pointList; }
62 
63  void getFieldMin(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
64  void getFieldMax(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
65  void getBounds(ossimGrect& block_bounds) const;
66 
67  virtual const ossimPointBlock& operator=(const ossimPointBlock &rhs);
68 
69  virtual ossimObject* dup() const;
70 
72  virtual void clear() { m_pointList.clear(); m_isNormalized = false; m_minMaxValid = false;}
73 
77  virtual bool isEqualTo(const ossimDataObject& /*rhs*/, bool /*deep_copy*/) const { return false; }
78  virtual ossim_uint32 getHashId() const { return 0; }
79  virtual ossim_uint32 getDataSizeInBytes() const { return 0; };
80  virtual void initialize() {};
81 
82 protected:
83  ossimPointBlock(const ossimPointBlock& /* rhs */) {}
84  void scanForMinMax() const;
85 
89  mutable bool m_minMaxValid;
91  mutable ossim_uint32 m_fieldCode; // OR'd mash-up of ossimPointRecord::FIELD_CODES
93 
95 };
96 
97 #endif /* #ifndef ossimPointBlock_HEADER */
ossimPointRecord m_nullPCR
std::vector< ossimRefPtr< ossimPointRecord > > PointList
#define OSSIMDLLEXPORT
const ossimPointRecord * operator[](ossim_uint32 i) const
virtual PointList & getPoints()
float ossim_float32
ossimPointRecord * operator[](ossim_uint32 i)
virtual const ossimDataObject * operator=(const ossimDataObject *rhs)
virtual ossim_uint32 getHashId() const
virtual void clear()
Resets any storage to empty.
yy_size_t size
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual bool isEqualTo(const ossimDataObject &, bool) const
Fulfills base class pure virtual.
PointList m_pointList
virtual void initialize()
Will allow derived classes to initialize their buffers.
unsigned int ossim_uint32
bool empty() const
virtual ossim_uint32 size() const
Returns allocated size.
ossimPointRecord m_minRecord
ossimPointBlock(const ossimPointBlock &)
ossim_uint32 m_fieldCode
virtual ossim_uint32 getDataSizeInBytes() const
virtual ossimObject * dup() const
Definition: ossimObject.cpp:29
ossimPointRecord m_maxRecord
virtual const PointList & getPoints() const