Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

BPointCloud.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 BBINFILETK_BPOINTCLOUD
00011 #define BBINFILETK_BPOINTCLOUD
00012 #include "BStreamFileToolkit.h"
00013 
00014 
00015 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00016 
00021 class BPointCloud
00022 #ifdef HPS_CORE_BUILD
00023     : public CMO
00024 #endif
00025 {
00026   private:
00027     class BKDTree *m_kd;            //private helper class defined in BPointCloud.cpp
00028     class BStreamFileToolkit *m_tk;
00029     int m_resolution;               //total bits per vertex, i.e. 3 * bits_per_sample
00030     int m_max_val;                  //(1 << bits_per_sample) - 1
00031     float m_bbox[6];
00032     float m_cell_size[3];           //bbox size / m_max_val
00033     int m_original_point_count;     //the number of points in the original shell (and hence the point map length)
00034     int m_point_count;              //the number of unique points (possibly less than original shell)
00035     float *m_points;                //points list, stored in the order intrinsic to the kd tree, not the original shell
00036     int *m_point_map;
00037     int m_next_id;
00038     unsigned char m_scheme;         //format identifier
00039 
00040     void put( class BKDTree *kd, class BPack *pack, int num_bits );
00041     TK_Status get( class BKDTree *b, class BPack *pack, int num_bits, int i, int j, int k, int span ); 
00042 
00043 
00044   public:
00046     BPointCloud( class BStreamFileToolkit *tk );
00047     ~BPointCloud();
00048 
00050     enum scheme {                   
00051         TKPC_Explicit       = 0x0001
00052     };    
00053 
00054     //write time functions
00055     TK_Status InitWrite( int resolution, const float *bbox, int original_point_count, const float *points );
00056     int GetSizeUpperBound() const;
00057     void Generate( unsigned char *buffer, int bytes_allocated, int *bytes_used );
00058 
00059     //read time functions
00060     TK_Status InitRead( int resolution, const float *bbox, int original_point_count );
00061     TK_Status Parse( const unsigned char *buffer, int size );
00062     TK_Status GetPoints( float points[] );
00063 
00064 };
00065 
00066 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00067 #endif /* BBINFILETK_BPOINTCLOUD */
00068 
00069