Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HIOUtilityPointCloud.h
1 // Copyright (c) 1998-2014 by 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 
24 class MVO_API HPointCloudOptions {
25 public:
29  HPointCloudOptions () { Defaults(); }
30  ~HPointCloudOptions () {}
31 
35  void Defaults () {
36  m_numBuckets = 512;
37  m_lowIntensityValue = 0;
38  m_highIntensityValue = 0;
39  m_maxShellSize = 10000;
40  m_minShellSize = 2000;
41  }
42 
47  unsigned int m_numBuckets;
66 };
67 
68 #include "vbsp.h"
69 
70 class PCPoint;
71 class RGBColor;
72 class BSPData;
73 class HBaseView;
74 typedef DefaultBSPNodeItemContainer<PCPoint *> PCPointContainer;
75 
91 enum PointCloudFileType {
92  NONE,
93  UNKNOWN,
94  PTS,
95  PTX,
96  XYZ
97 };
98 
99 class MVO_API HIOUtilityPointCloud : public HInputHandler
100 {
101 public:
104 
112  HFileInputResult FileInputByKey ( const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options );
113  HFileInputResult FileInputByKey ( const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options ){
114  H_UTF16 utf16;
115  utf16.encodedText(filename);
116  return FileInputByKey(H_WCS(utf16).encodedText(), key, options);
117  };
118  HFileInputResult FileInputByKey ( const char * filename, HC_KEY key, HInputHandlerOptions * options ) {
119  return FileInputByKey(H_WCS(filename).encodedText(), key, options);
120  };
121 
124  const char * GetInputName() { return "HIOUtilityPointCloud"; }
125 
129  const char * GetInputTypesString ();
135 
136 private:
137  bool Initialize ( const __wchar_t * filename );
138  HFileInputResult SpatiallySortPointCloud ( HC_KEY seg_key );
139 
140  float GetScaledIntensity ( PCPoint * cpt );
141 
142  // functions when walking the hash
143  static void DeleteBSPs ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
144  static void WriteShellsToFile ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
145 
146  // function when walking the BSP
147  static VBSPStatus GetShellsFromBSP ( PCPointContainer * container, void * user_data );
148 
149  bool InsertShells ( BSPData * bsp_data );
150 
151  FILE * m_file;
152  size_t m_file_size;
153  wchar_t m_bin_file_name[MVO_BUFFER_SIZE];
154  FILE * m_bin_file;
155 
156  PointCloudFileType m_point_cloud_file_type;
157  unsigned long m_num_points;
158  float m_std_bbox[6];
159  float m_matrix[16];
160  int m_min_intensity;
161  int m_max_intensity;
162 
163  HBaseView * m_pHView;
164  HPointCloudOptions * m_point_cloud_options;
165 };
166 
167 
168 #ifdef H_PACK_8
169 #pragma pack(pop)
170 #endif
171 
172 #endif
int m_minShellSize
Definition: HIOUtilityPointCloud.h:65
virtual void RegisterInputHandlerTypes()=0
Specifies an HInputHandler for model data.
Definition: HIOManager.h:225
int m_lowIntensityValue
Definition: HIOUtilityPointCloud.h:52
virtual HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:671
#define HC_KEY
HFileInputResult FileInputByKey(const unsigned short *filename, HC_KEY key, HInputHandlerOptions *options)
Definition: HIOUtilityPointCloud.h:113
int m_highIntensityValue
Definition: HIOUtilityPointCloud.h:57
Definition: HIOUtilityPointCloud.h:24
Definition: HIOUtilityPointCloud.h:99
HPointCloudOptions()
Definition: HIOUtilityPointCloud.h:29
HInputHandlerStyle
Definition: HIOManager.h:224
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
int m_maxShellSize
Definition: HIOUtilityPointCloud.h:61
void Defaults()
Definition: HIOUtilityPointCloud.h:35
HInputHandlerStyle GetInputStyle()
Definition: HIOUtilityPointCloud.h:130
unsigned int m_numBuckets
Definition: HIOUtilityPointCloud.h:47
const char * GetInputName()
Definition: HIOUtilityPointCloud.h:124
Definition: HIOManager.h:245
HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
Definition: HIOUtilityPointCloud.h:118
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
virtual const char * GetInputTypesString()=0