| 27 | |
| 28 | |
| 29 | void update_directional_field() |
| 30 | { |
| 31 | using namespace Eigen; |
| 32 | using namespace std; |
| 33 | VectorXd rotationAngles; |
| 34 | Eigen::VectorXi presSingIndices; |
| 35 | presSingIndices=VectorXi::Zero(field.tb->cycles.rows()); |
| 36 | for (int i=0;i<singVertices.size();i++) |
| 37 | presSingIndices(singVertices[i])=singIndices[i]; |
| 38 | |
| 39 | double IPError; |
| 40 | Eigen::VectorXi currIndices; |
| 41 | directional::index_prescription(presSingIndices,N,globalRotation, field, rotationAngles, IPError); |
| 42 | |
| 43 | if (viewingMode==TRIVIAL_PRINCIPAL_MATCHING) |
| 44 | directional::principal_matching(field); |
| 45 | |
| 46 | if (viewingMode==IMPLICIT_FIELD){ |
| 47 | bc.conservativeResize(b.rows(),3); |
| 48 | for (int i=0;i<b.size();i++) |
| 49 | bc.row(i)<<field.extField.block(b(i),0,1,3).normalized(); |
| 50 | |
| 51 | directional::CartesianField powerField; |
| 52 | directional::power_field(ftb, b, bc, Eigen::VectorXd::Constant(b.size(),-1), N,powerField); |
| 53 | directional::power_to_raw(powerField, N, field,true); |
| 54 | directional::principal_matching(field); |
| 55 | } |
| 56 | |
| 57 | viewer.set_cartesian_field(field); |
| 58 | |
| 59 | if (viewingMode==TRIVIAL_ONE_SING) |
| 60 | viewer.set_singularities(field, singVertices, singIndices); |
| 61 | |
| 62 | if ((viewingMode==TRIVIAL_PRINCIPAL_MATCHING)||(viewingMode==IMPLICIT_FIELD)) |
| 63 | viewer.set_singularities(field, field.singLocalCycles, field.singIndices); |
| 64 | |
| 65 | } |
| 66 | |
| 67 | |
| 68 | void callbackFunc() { |
no test coverage detected