| 3427 | |
| 3428 | st << arrow_head_x + AH_SIZE*cos(theta-AH_ANGLE) << ' ' << arrow_head_y + AH_SIZE*sin(theta-AH_ANGLE) << " m " |
| 3429 | << arrow_head_x << ' ' << arrow_head_y << " l " |
| 3430 | << arrow_head_x + AH_SIZE*cos(theta+AH_ANGLE) << ' ' << arrow_head_y + AH_SIZE*sin(theta+AH_ANGLE) << " l S" << std::endl; |
| 3431 | } |
| 3432 | |
| 3433 | return; |
| 3434 | } |
| 3435 | |
| 3436 | void plot_vector2flow( std::stringstream &Content, const Fem2D::Mesh &Th, |
| 3437 | const KN<double> &fx, const KN<double> &fy, |
| 3438 | const KN<double> &f2, const KN<double> &f2m, const bool isolineP2, |
| 3439 | const bool fromVertex, const KNM<double> &palette, |
| 3440 | const double alength_scale, const bool unit_arrow, |
| 3441 | const double linewidth, const double ahead_scale, |
| 3442 | const int nbarrow, const KN<double> *const varrow, |
| 3443 | const int sizex, const int sizey, const double scale, const double ar, |
| 3444 | const double x0, const double y0, const double y1, |
| 3445 | const int marginl, const int marginb, |
| 3446 | const double textfontsize, const bool monochrome, |
| 3447 | const bool legend, const int prec, const bool logscale, |
| 3448 | const double withmesh, |
| 3449 | const long nbfill, const KN<double> *const frange, const string &fetype, |
| 3450 | const bool isoline, const int NISOLINES, const KN<double>*const viso ) |
| 3451 | { |
| 3452 | const double EPS = 1e-10; |
| 3453 | |
| 3454 | const int &nVertices = Th.nv; |
| 3455 | const int &nTriangles = Th.nt; |
| 3456 | const int &nEdges = Th.neb; |
| 3457 | const double &r = scale; |
| 3458 | |
| 3459 | const double fmax = (frange)? (*frange)[1]: f2.max(); |
| 3460 | const double fmin = (frange)? (*frange)[0]: f2.min(); |
| 3461 | |
| 3462 | const double df = (logscale)? |
| 3463 | exp( (static_cast<double>(1)/nbfill)*(log(fmax/fmin)) ): |
| 3464 | (fmax - fmin)/nbfill; |
| 3465 | |
| 3466 | if( varrow ) |
| 3467 | std::cout << "plotPDF(): Option 'varrow' is not implemented yet." << endl; |
| 3468 | if( nbarrow != 0 ) |
| 3469 | std::cout << "plotPDF(): Option 'nbarrow' is not implemented yet." << endl; |
| 3470 | |
| 3471 | std::stringstream &st = Content; |
| 3472 | st.str(""); |
| 3473 | |
| 3474 | if( 0 < withmesh ) |
| 3475 | overlayMesh( st, Th, withmesh, scale, ar, x0, y0, marginl, marginb ); |
| 3476 | |
| 3477 | drawBoundary( st, Th, scale, ar, x0, y0, marginl, marginb ); |
| 3478 | |
| 3479 | if( legend ) |
| 3480 | drawLegend_fill( st, nbfill, df, prec, palette, fmin, fmax, monochrome, logscale, |
| 3481 | sizex, textfontsize, scale, y1, y0, marginl, marginb ); |
| 3482 | |
| 3483 | //------------------------------ |
| 3484 | // isoline |
| 3485 | //------------------------------ |
| 3486 |
no test coverage detected