HIOUtilityPointCloud.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef _HIOUTILITYPOINTCLOUD_H
11 #define _HIOUTILITYPOINTCLOUD_H
12 
13 #ifdef H_PACK_8
14 #pragma pack(push)
15 #pragma pack(8)
16 #endif
17 
22 #include "HIOManager.h"
23 #include <stdint.h>
24 
25 class MVO_API HPointCloudOptions {
26 public:
30  HPointCloudOptions () { Defaults(); }
31  ~HPointCloudOptions () {}
32 
36  void Defaults () {
37  m_numBuckets = 512;
38  m_lowIntensityValue = 0;
39  m_highIntensityValue = 0;
40  m_maxShellSize = 10000;
41  m_minShellSize = 2000;
42  }
43 
48  unsigned int m_numBuckets;
67 };
68 
69 #include "vbsp.h"
70 
71 class PCPoint;
72 class RGBColor;
73 class BSPData;
74 class HBaseView;
75 typedef DefaultBSPNodeItemContainer<PCPoint *> PCPointContainer;
76 
92 enum PointCloudFileType {
93  NONE,
94  UNKNOWN,
95  PTS,
96  PTX,
97  XYZ
98 };
99 
100 class MVO_API HIOUtilityPointCloud : public HInputHandler
101 {
102 public:
105 
113  HFileInputResult FileInputByKey ( const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options );
114  HFileInputResult FileInputByKey ( const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options ){
115  H_UTF16 utf16;
116  utf16.encodedText(filename);
117  return FileInputByKey(H_WCS(utf16).encodedText(), key, options);
118  };
119  HFileInputResult FileInputByKey ( const char * filename, HC_KEY key, HInputHandlerOptions * options ) {
120  return FileInputByKey(H_WCS(filename).encodedText(), key, options);
121  };
122 
125  const char * GetInputName() { return "HIOUtilityPointCloud"; }
126 
130  const char * GetInputTypesString ();
136 
137 private:
138  bool Initialize ( const __wchar_t * filename );
139  HFileInputResult SpatiallySortPointCloud ( HC_KEY seg_key );
140 
141  float GetScaledIntensity ( PCPoint const * cpt );
142 
143  // functions when walking the hash
144  static void DeleteBSPs ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
145  static void WriteShellsToFile ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
146 
147  // function when walking the BSP
148  static VBSPStatus GetShellsFromBSP ( PCPointContainer * container, void * user_data );
149 
150  bool InsertShells ( BSPData * bsp_data );
151 
152  FILE * m_file;
153  int64_t m_file_size;
154  wchar_t m_bin_file_name[MVO_BUFFER_SIZE];
155  FILE * m_bin_file;
156 
157  PointCloudFileType m_point_cloud_file_type;
158  unsigned long m_num_points;
159  double m_std_bbox[6];
160  float m_matrix[16];
161  int m_min_intensity;
162  int m_max_intensity;
163 
164  HBaseView * m_pHView;
165  HPointCloudOptions * m_point_cloud_options;
166 };
167 
168 
169 #ifdef H_PACK_8
170 #pragma pack(pop)
171 #endif
172 
173 #endif
int m_minShellSize
Definition: HIOUtilityPointCloud.h:66
virtual void RegisterInputHandlerTypes()=0
Specifies an HInputHandler for model data.
Definition: HIOManager.h:226
int m_lowIntensityValue
Definition: HIOUtilityPointCloud.h:53
virtual HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:655
int m_highIntensityValue
Definition: HIOUtilityPointCloud.h:58
Definition: HIOUtilityPointCloud.h:25
Definition: HIOUtilityPointCloud.h:100
HPointCloudOptions()
Definition: HIOUtilityPointCloud.h:30
HInputHandlerStyle
Definition: HIOManager.h:225
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
int m_maxShellSize
Definition: HIOUtilityPointCloud.h:62
void Defaults()
Definition: HIOUtilityPointCloud.h:36
HInputHandlerStyle GetInputStyle()
Definition: HIOUtilityPointCloud.h:131
unsigned int m_numBuckets
Definition: HIOUtilityPointCloud.h:48
const char * GetInputName()
Definition: HIOUtilityPointCloud.h:125
Definition: HIOManager.h:246
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
virtual const char * GetInputTypesString()=0