#ifndef SSP_COLLAPSE_EDGE_H #define SSP_COLLAPSE_EDGE_H // #include // what Derek included #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #include #include #include #include #include // namespace igl // { // Assumes (V,F) is a closed manifold mesh (except for previously collapsed // faces which should be set to: // [IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL]. // Collapses exactly two faces and exactly 3 edges from E (e and one side of // each face gets collapsed to the other). This is implemented in a way that // it can be repeatedly called until satisfaction and then the garbage in F // can be collected by removing NULL faces. // // Inputs: // e index into E of edge to try to collapse. E(e,:) = [s d] or [d s] so // that sj) is the edge of // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) " // e=(j->i) // EI #E by 2 list of edge flap corners (see above). // e1 index into E of edge collpased on left // e2 index into E of edge collpased on right // f1 index into F of face collpased on left // f2 index into F of face collpased on right // Returns true if edge was collapsed #define IGL_COLLAPSE_EDGE_NULL 0 // bool SSP_collapse_edge( // const int e, // const Eigen::RowVectorXd & p, // Eigen::MatrixXd & V, // Eigen::MatrixXi & F, // Eigen::MatrixXi & E, // Eigen::VectorXi & EMAP, // Eigen::MatrixXi & EF, // Eigen::MatrixXi & EI, // int & e1, // int & e2, // int & f1, // int & f2); // Inputs: bool SSP_collapse_edge( const int e, const Eigen::RowVectorXd & p, /*const*/ std::vector & Nsv, const std::vector & Nsf, /*const*/ std::vector & Ndv, const std::vector & Ndf, Eigen::MatrixXd & V, Eigen::MatrixXi & F, Eigen::MatrixXi & E, Eigen::VectorXi & EMAP, Eigen::MatrixXi & EF, Eigen::MatrixXi & EI, int & e1, int & e2, int & f1, int & f2, std::vector & decInfo, std::vector> & decIM, single_collapse_data & data, Eigen::VectorXi & FIdx_onering_pre); // bool SSP_collapse_edge( // const int e, // const Eigen::RowVectorXd & p, // Eigen::MatrixXd & V, // Eigen::MatrixXi & F, // Eigen::MatrixXi & E, // Eigen::VectorXi & EMAP, // Eigen::MatrixXi & EF, // Eigen::MatrixXi & EI); // // Collapse least-cost edge from a priority queue and update queue // // // // Inputs/Outputs: // // cost_and_placement function computing cost of collapsing an edge and 3d // // position where it should be placed: // // cost_and_placement(V,F,E,EMAP,EF,EI,cost,placement); // // **If the edges is collapsed** then this function will be called on all // // edges of all faces previously incident on the endpoints of the // // collapsed edge. // // Q queue containing pairs of costs and edge indices and insertion "time" // // EQ #E list of "time" of last time pushed into Q // // C #E by dim list of stored placements // bool SSP_collapse_edge( // const decimate_cost_and_placement_func & cost_and_placement, // Eigen::MatrixXd & V, // Eigen::MatrixXi & F, // Eigen::MatrixXi & E, // Eigen::VectorXi & EMAP, // Eigen::MatrixXi & EF, // Eigen::MatrixXi & EI, // igl::min_heap< std::tuple > & Q, // Eigen::VectorXi & EQ, // Eigen::MatrixXd & C); // // Inputs: // // pre_collapse callback called with index of edge whose collapse is about // // to be attempted. This function should return whether to **proceed** // // with the collapse: returning true means "yes, try to collapse", // // returning false means "No, consider this edge 'uncollapsable', behave // // as if collapse_edge(e) returned false. // // post_collapse callback called with index of edge whose collapse was // // just attempted and a flag revealing whether this was successful. // bool SSP_collapse_edge( // const decimate_cost_and_placement_func & cost_and_placement, // const decimate_pre_collapse_func & pre_collapse, // const decimate_post_collapse_func & post_collapse, // Eigen::MatrixXd & V, // Eigen::MatrixXi & F, // Eigen::MatrixXi & E, // Eigen::VectorXi & EMAP, // Eigen::MatrixXi & EF, // Eigen::MatrixXi & EI, // igl::min_heap< std::tuple > & Q, // Eigen::VectorXi & EQ, // Eigen::MatrixXd & C); bool SSP_collapse_edge( const decimate_cost_and_placement_func & cost_and_placement, const decimate_pre_collapse_func & pre_collapse, const decimate_post_collapse_func & post_collapse, Eigen::MatrixXd & V, Eigen::MatrixXi & F, Eigen::MatrixXi & E, Eigen::VectorXi & EMAP, Eigen::MatrixXi & EF, Eigen::MatrixXi & EI, min_heap< std::tuple > & Q, Eigen::VectorXi & EQ, Eigen::MatrixXd & C, int & e, int & e1, int & e2, int & f1, int & f2, std::vector & decInfo, std::vector> & decIM); // } #endif