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