Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HIOUtilityPointCloud.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: 9f5329173d31ac5998354992c21f2a1cefa623ff $
13 //
14 
15 #ifndef _HIOUTILITYPOINTCLOUD_H
16 #define _HIOUTILITYPOINTCLOUD_H
17 
18 #ifdef H_PACK_8
19 #pragma pack(push)
20 #pragma pack(8)
21 #endif
22 
27 #include "HIOManager.h"
28 
29 class MVO_API HPointCloudOptions {
30 public:
34  HPointCloudOptions () { Defaults(); }
35  ~HPointCloudOptions () {}
36 
40  void Defaults () {
41  m_numBuckets = 512;
42  m_lowIntensityValue = 0;
43  m_highIntensityValue = 0;
44  m_maxShellSize = 10000;
45  m_minShellSize = 2000;
46  }
47 
52  unsigned int m_numBuckets;
71 };
72 
73 #include "vbsp.h"
74 
75 class PCPoint;
76 class RGBColor;
77 class BSPData;
78 class HBaseView;
79 typedef DefaultBSPNodeItemContainer<PCPoint *> PCPointContainer;
80 
96 enum PointCloudFileType {
97  NONE,
98  UNKNOWN,
99  PTS,
100  PTX,
101  XYZ
102 };
103 
104 class MVO_API HIOUtilityPointCloud : public HInputHandler
105 {
106 public:
109 
117  HFileInputResult FileInputByKey ( const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options );
118  HFileInputResult FileInputByKey ( const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options ){
119  H_UTF16 utf16;
120  utf16.encodedText(filename);
121  return FileInputByKey(H_WCS(utf16).encodedText(), key, options);
122  };
123  HFileInputResult FileInputByKey ( const char * filename, HC_KEY key, HInputHandlerOptions * options ) {
124  return FileInputByKey(H_WCS(filename).encodedText(), key, options);
125  };
126 
129  const char * GetInputName() { return "HIOUtilityPointCloud"; }
130 
134  const char * GetInputTypesString ();
140 
141 private:
142  bool Initialize ( const __wchar_t * filename );
143  HFileInputResult SpatiallySortPointCloud ( HC_KEY seg_key );
144 
145  float GetScaledIntensity ( PCPoint * cpt );
146 
147  // functions when walking the hash
148  static void DeleteBSPs ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
149  static void WriteShellsToFile ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data );
150 
151  // function when walking the BSP
152  static VBSPStatus GetShellsFromBSP ( PCPointContainer * container, void * user_data );
153 
154  bool InsertShells ( BSPData * bsp_data );
155 
156  FILE * m_file;
157  size_t m_file_size;
158  wchar_t m_bin_file_name[MVO_BUFFER_SIZE];
159  FILE * m_bin_file;
160 
161  PointCloudFileType m_point_cloud_file_type;
162  unsigned long m_num_points;
163  float m_std_bbox[6];
164  float m_matrix[16];
165  int m_min_intensity;
166  int m_max_intensity;
167 
168  HBaseView * m_pHView;
169  HPointCloudOptions * m_point_cloud_options;
170 };
171 
172 
173 #ifdef H_PACK_8
174 #pragma pack(pop)
175 #endif
176 
177 #endif
int m_minShellSize
Definition: HIOUtilityPointCloud.h:70
virtual void RegisterInputHandlerTypes()=0
Specifies an HInputHandler for model data.
Definition: HIOManager.h:227
int m_lowIntensityValue
Definition: HIOUtilityPointCloud.h:57
virtual HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:667
#define HC_KEY
HFileInputResult FileInputByKey(const unsigned short *filename, HC_KEY key, HInputHandlerOptions *options)
Definition: HIOUtilityPointCloud.h:118
int m_highIntensityValue
Definition: HIOUtilityPointCloud.h:62
Definition: HIOUtilityPointCloud.h:29
Definition: HIOUtilityPointCloud.h:104
HPointCloudOptions()
Definition: HIOUtilityPointCloud.h:34
HInputHandlerStyle
Definition: HIOManager.h:226
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:337
int m_maxShellSize
Definition: HIOUtilityPointCloud.h:66
void Defaults()
Definition: HIOUtilityPointCloud.h:40
HInputHandlerStyle GetInputStyle()
Definition: HIOUtilityPointCloud.h:135
unsigned int m_numBuckets
Definition: HIOUtilityPointCloud.h:52
const char * GetInputName()
Definition: HIOUtilityPointCloud.h:129
Definition: HIOManager.h:247
HFileInputResult FileInputByKey(const char *filename, HC_KEY key, HInputHandlerOptions *options)
Definition: HIOUtilityPointCloud.h:123
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
virtual const char * GetInputTypesString()=0