Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

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