Skip to content
Snippets Groups Projects
Commit 30c0415b authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

layout

parent caf4b647
No related branches found
No related tags found
No related merge requests found
...@@ -147,9 +147,8 @@ int plot_data( CPlot* plot, ROld fd, int k, int j, int pstyle ) ...@@ -147,9 +147,8 @@ int plot_data( CPlot* plot, ROld fd, int k, int j, int pstyle )
if ( !plot->Y.force ) if ( !plot->Y.force )
continue; continue;
} }
if ( np==plot->maxpoints && np<n ) { if ( np==plot->maxpoints && np<n )
cout << "reached maxpoints at " << s->x[i] << "\n"; cout << "reached maxpoints at " << s->x[i] << "\n";
}
xp.push_back( x ); xp.push_back( x );
yp.push_back( y ); yp.push_back( y );
if ( s->has_dy() ) if ( s->has_dy() )
...@@ -203,8 +202,7 @@ int plot_curve_convolved( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -203,8 +202,7 @@ int plot_curve_convolved( CPlot* plot, ROlc fc, int k, int j, int cstyle )
yo.push_back( yp ); yo.push_back( yp );
} }
if ( xo.size()==0 ){ if ( xo.size()==0 ){
cout << "curve k="<<S(k)<<", j="<<S(j)<< cout << "curve k="<<S(k)<<", j="<<S(j)<< " has no points in plot window\n";
" has no points in plot window\n";
} }
plot->add_spec( true, true, cstyle, xo, yo, novec, fc->V[j]->z_str(), plot->add_spec( true, true, cstyle, xo, yo, novec, fc->V[j]->z_str(),
fc->xco.str_std(), fc->yco.str_std(), fc->xco.str_std(), fc->yco.str_std(),
...@@ -285,8 +283,7 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -285,8 +283,7 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle )
if ( !xc.size() ){ if ( !xc.size() ){
if ( !iref ) if ( !iref )
throw S("BUG: plot_curve_refine called with xc.size()=0"); throw S("BUG: plot_curve_refine called with xc.size()=0");
else break; // regular exit
break; // regular exit
} }
// evaluate curve for grid xc: // evaluate curve for grid xc:
RObjVecDbl cu = PCAST<const CObjVecDbl>( fc->eval_curve( xc, k, j, false ) ); RObjVecDbl cu = PCAST<const CObjVecDbl>( fc->eval_curve( xc, k, j, false ) );
...@@ -322,11 +319,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -322,11 +319,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle )
} }
xn = xa; yn = ya; xn = xa; yn = ya;
} }
// cout << "DEB merger -> " << xn.size() << "\n";
// for ( int i=0; i<xn.size(); ++i )
// printf ("DEB xn yn %12.6g %12.6g\n", xn[i], yn[i] );
// end of loop
if ( iref>=10 || xn.size()>=plot->maxpoints ) if ( iref>=10 || xn.size()>=plot->maxpoints )
break; // alternate exit: too many refinements or too many points break; // alternate exit: too many refinements or too many points
...@@ -354,9 +346,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -354,9 +346,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle )
xa.push_back( xn.back() ); xa.push_back( xn.back() );
ya.push_back( yn.back() ); ya.push_back( yn.back() );
xn = xa; yn = ya; xn = xa; yn = ya;
// cout << "DEB within frame -> " << xn.size() << "\n";
// for ( int i=0; i<xn.size(); ++i )
// printf ("DEB xy %12.6g %12.6g\n", xn[i], yn[i] );
// set additional base points: // set additional base points:
bool insert_next = false; bool insert_next = false;
...@@ -368,22 +357,17 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -368,22 +357,17 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle )
(xn[i+1]-xn[i-1]); (xn[i+1]-xn[i-1]);
if ( !plot->Y.close_enough( yn[i], yi, 0.005 ) ) { if ( !plot->Y.close_enough( yn[i], yi, 0.005 ) ) {
xc.push_back( (xn[i-1] + xn[i])/2 ); xc.push_back( (xn[i-1] + xn[i])/2 );
// cout << "DEB disc " << xc.back() << "\n";
insert_next = true; insert_next = true;
continue; continue;
} }
} }
if ( insert_next ) { if ( insert_next ) {
xc.push_back( (xn[i-1] + xn[i])/2 ); xc.push_back( (xn[i-1] + xn[i])/2 );
// cout << "DEB next " << xc.back() << "\n";
insert_next = false; insert_next = false;
continue; continue;
} }
if ( ( plot->Y.contains(yn[i]) && if ( ( plot->Y.contains(yn[i]) && !plot->Y.contains(yn[i-1]) ) ||
!plot->Y.contains(yn[i-1]) ) || ( !plot->Y.contains(yn[i]) && plot->Y.contains(yn[i-1]) ) ) {
( !plot->Y.contains(yn[i]) &&
plot->Y.contains(yn[i-1]) ) ) {
// cout << "DEB edge " << xc.back() << "\n";
xc.push_back( (xn[i-1] + xn[i])/2 ); xc.push_back( (xn[i-1] + xn[i])/2 );
continue; continue;
} }
...@@ -407,7 +391,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) ...@@ -407,7 +391,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle )
if ( !plot->Y.contains(yn[i]) || i==xn.size()-1 ) { if ( !plot->Y.contains(yn[i]) || i==xn.size()-1 ) {
npts += xa.size(); npts += xa.size();
if ( xa.size() ){ if ( xa.size() ){
// cout << "DEB segment -> " << xa.size() << "\n";
plot->add_spec( plot->add_spec(
true, first_seg, cstyle, xa, ya, novec, fc->V[j]->z_str(), true, first_seg, cstyle, xa, ya, novec, fc->V[j]->z_str(),
fc->xco.str_std(), fc->yco.str_std(), fc->xco.str_std(), fc->yco.str_std(),
...@@ -490,7 +473,6 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode ) ...@@ -490,7 +473,6 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode )
if ( fd ) { if ( fd ) {
if ( !plot_data( plot, fd, k, j, pstyle ) ) if ( !plot_data( plot, fd, k, j, pstyle ) )
continue; continue;
} else if ( fc ) { } else if ( fc ) {
if ( fc->kconv!=-1 ) { if ( fc->kconv!=-1 ) {
if ( !plot_curve_convolved( plot, fc, k, j, cstyle ) ) if ( !plot_curve_convolved( plot, fc, k, j, cstyle ) )
...@@ -505,10 +487,8 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode ) ...@@ -505,10 +487,8 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode )
if ( !plot_curve_refine( plot, fc, k, j, cstyle ) ) if ( !plot_curve_refine( plot, fc, k, j, cstyle ) )
continue; continue;
} }
} else
} else {
throw S("PROGRAM ERROR plot: unexpected file type"); throw S("PROGRAM ERROR plot: unexpected file type");
}
if ( fd ) { if ( fd ) {
plot->doc_PtTxLine( " " + f->info_line( j ), pstyle ); plot->doc_PtTxLine( " " + f->info_line( j ), pstyle );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment