00001 // 00002 // Copyright (c) 2000 by Tech Soft 3D, LLC. 00003 // The information contained herein is confidential and proprietary to 00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 // civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 // and criminal remedies in the event of unauthorized use or misappropriation 00007 // of its trade secrets. Use of this information by anyone other than 00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 // written non-disclosure agreement, expressly prescribing the scope and 00010 // manner of such use. 00011 // 00012 // $Id: 9f5329173d31ac5998354992c21f2a1cefa623ff $ 00013 // 00014 00015 #ifndef _HIOUTILITYPOINTCLOUD_H 00016 #define _HIOUTILITYPOINTCLOUD_H 00017 00018 #ifdef H_PACK_8 00019 #pragma pack(push) 00020 #pragma pack(8) 00021 #endif 00022 00027 #include "HIOManager.h" 00028 00029 class MVO_API HPointCloudOptions { 00030 public: 00034 HPointCloudOptions () { Defaults(); } 00035 ~HPointCloudOptions () {} 00036 00040 void Defaults () { 00041 m_numBuckets = 512; 00042 m_lowIntensityValue = 0; 00043 m_highIntensityValue = 0; 00044 m_maxShellSize = 10000; 00045 m_minShellSize = 2000; 00046 } 00047 00052 unsigned int m_numBuckets; 00057 int m_lowIntensityValue; 00062 int m_highIntensityValue; 00066 int m_maxShellSize; 00070 int m_minShellSize; 00071 }; 00072 00073 #include "vbsp.h" 00074 00075 class PCPoint; 00076 class RGBColor; 00077 class BSPData; 00078 class HBaseView; 00079 typedef DefaultBSPNodeItemContainer<PCPoint *> PCPointContainer; 00080 00096 enum PointCloudFileType { 00097 NONE, 00098 UNKNOWN, 00099 PTS, 00100 PTX, 00101 XYZ 00102 }; 00103 00104 class MVO_API HIOUtilityPointCloud : public HInputHandler 00105 { 00106 public: 00107 HIOUtilityPointCloud (); 00108 ~HIOUtilityPointCloud (); 00109 00117 HFileInputResult FileInputByKey ( const __wchar_t * filename, HC_KEY key, HInputHandlerOptions * options ); 00118 HFileInputResult FileInputByKey ( const unsigned short * filename, HC_KEY key, HInputHandlerOptions * options ){ 00119 H_UTF16 utf16; 00120 utf16.encodedText(filename); 00121 return FileInputByKey(H_WCS(utf16).encodedText(), key, options); 00122 }; 00123 HFileInputResult FileInputByKey ( const char * filename, HC_KEY key, HInputHandlerOptions * options ) { 00124 return FileInputByKey(H_WCS(filename).encodedText(), key, options); 00125 }; 00126 00129 const char * GetInputName() { return "HIOUtilityPointCloud"; } 00130 00134 const char * GetInputTypesString (); 00135 HInputHandlerStyle GetInputStyle () { return HInputHandlerStyleModel; }; 00139 void RegisterInputHandlerTypes (); 00140 00141 private: 00142 bool Initialize ( const __wchar_t * filename ); 00143 HFileInputResult SpatiallySortPointCloud ( HC_KEY seg_key ); 00144 00145 float GetScaledIntensity ( PCPoint * cpt ); 00146 00147 // functions when walking the hash 00148 static void DeleteBSPs ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data ); 00149 static void WriteShellsToFile ( VBSP<PCPoint *> * bsp, int bucket, const void * const user_data ); 00150 00151 // function when walking the BSP 00152 static VBSPStatus GetShellsFromBSP ( PCPointContainer * container, void * user_data ); 00153 00154 bool InsertShells ( BSPData * bsp_data ); 00155 00156 FILE * m_file; 00157 size_t m_file_size; 00158 wchar_t m_bin_file_name[MVO_BUFFER_SIZE]; 00159 FILE * m_bin_file; 00160 00161 PointCloudFileType m_point_cloud_file_type; 00162 unsigned long m_num_points; 00163 float m_std_bbox[6]; 00164 float m_matrix[16]; 00165 int m_min_intensity; 00166 int m_max_intensity; 00167 00168 HBaseView * m_pHView; 00169 HPointCloudOptions * m_point_cloud_options; 00170 }; 00171 00172 00173 #ifdef H_PACK_8 00174 #pragma pack(pop) 00175 #endif 00176 00177 #endif