void MorphingWrapper::doLinearMorphing(double *paras, int n_paras) { if (n_paras != meshes.size()) { std::cout<<"Warning: num of control parameters isn't match with internal number of meshes\n"; return; } vtkSmartPointer<vtkPolyData> mesh_data = meshes[0]->getMeshData(); vtkSmartPointer<vtkPoints> new_points = mesh_data->GetPoints(); Eigen::VectorXd m_result(3*new_points->GetNumberOfPoints()); m_result.setZero(); for (size_t i_mesh = 0; i_mesh < meshes.size(); ++i_mesh) { std::vector<double> &temp_mesh_vec = morphing_handler->getMeshVec(i_mesh); Eigen::Map<Eigen::VectorXd>cur_mesh(&temp_mesh_vec[0], temp_mesh_vec.size()); m_result += paras[i_mesh]*cur_mesh; } if (new_points->GetNumberOfPoints() == m_result.size()/3) { for (size_t i = 0; i != new_points->GetNumberOfPoints(); ++i) { new_points->SetPoint(i, m_result[3*i], m_result[3*i+1], m_result[3*i+2]); } new_points->Modified(); meshes[0]->resetMesh(mesh_data); meshes[0]->setMeshCenter(); } }
mass<FOD, T> operator()(const mass<FOD, T>& m1, const mass<FOD, T>& m2) const { // compute canonical disjunctive decompositions v_1(A), v_2(A) disjunctive_decomposition decomposition; const bft_function<FOD, T> v1 = m1.apply(decomposition); const bft_function<FOD, T> v2 = m2.apply(decomposition); // find minimum weight decomposition v_1(A) \vee v_2(A) bft_function<FOD, T> v_min12 = min(v1, v2); // compute disjunctive combination of GSBBA A^{v_1(A) \vee v_2(A)} mass<FOD, T> m_result(degenerate); rule_disjunctive rule; for (std::size_t A = 1; A < FOD::powerset_size; ++A) { if (detail::is_small(1 - v_min12[A], detail::tolerance)) { continue; } m_result = m_result.apply( rule, mass<FOD, T>::create_mass_from_disjunctive_weight( A, v_min12[A])); } return m_result; }