strech.h

来自「任意给定三维空间的点集」· C头文件 代码 · 共 110 行

H
110
字号
/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* * strech.h - *     \*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/#ifndef  __STRECH__H#define  __STRECH__Hclass  FaceIds{public:    int   a, b, c;};void   ThreeDs_get_stats( char  * filename );void   ply_get_stats( char  * filename );bool  str_prefix_eq( char  * line, char  * prefix );class  ArrFaceIds : public Array<FaceIds> {};#define  BBOX_CHUNK   1000class ArrBBox3d : public Array<BBox3d> {};class  PolyModel{public:    ArrPoint3d   vertices;    ArrFaceIds   faces;    ArrBBox3d    vert_bboxes;    double   * p_dist_nn;    double   * p_longest_edge;    double  longest_edge, shortest_edge;    int  boxes_num;    int  vertices_num, faces_num;    bool  f_first_edge_registeration;    double  global_ratio, edge_ratio;    int  worst_vertex;    BBox3d   modelBB;public:    void  init() {        f_first_edge_registeration = true;        worst_vertex = -1;    }    Point3d   getWorstVertex() const {        assert( worst_vertex >= 0 );        return  vertices[ worst_vertex ];    }    int   getFacesNum() {        return  faces.size();    }    void   computeBBox();    FaceIds  getFace( int  ind ) {        return  faces[ ind ];    }    ArrPoint3d  & getVertices() {        return  vertices;    }    BBox3d  & getVertexBBox( int  id ) {        return  vert_bboxes[ id / BBOX_CHUNK ];    }    int  getBBoxStart( int  bind ) {        return  bind  * BBOX_CHUNK;            }    int  getBBoxEnd( int  bind ) {        int  lim;        lim = (bind + 1) * BBOX_CHUNK - 1;        if  ( lim >= vertices_num )            return  vertices_num - 1;        return  lim;    }    void  read_poly_file( const char  * filename );    void  init_vertices_bboxes();    void  compute_longest_edges();    double  find_nn( int  vert_id );    void    find_nn_all();        void  register_edge( int  a, int  b );    void  print_stat( const char  * filename );    void  find_bbox_nn( Point3d  & pnt, int  vert_id,                           double  & curr, int  bbox_ind );};#else   /* __STRECH__H */#error  Header file strech.h included twice#endif  /* __STRECH__H *//* strech.h - End of File ------------------------------------------*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?