//----------------------------------------------------------------------------- void MGL_EXPORT mgl_cont_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt) { long n=a->GetNx(),m=a->GetNy(); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContZ"); return; } gr->SaveState(opt); if(mgl_isnan(sv)) sv = gr->GetOrgZ('z'); if(sv<gr->Min.z || sv>gr->Max.z) { gr->SetWarn(mglWarnSlc,"ContZ"); gr->LoadState(); return; } static int cgid=1; gr->StartGroup("ContZ",cgid++); mglDataV xx,yy,zz; mglData aa; int text=0; if(mglchr(sch,'t')) text=1; if(mglchr(sch,'T')) text=2; long ss=gr->AddTexture(sch); gr->SetPenPal(sch); a = fill_slice_z(gr,sv,a,xx,yy,zz,aa); #pragma omp parallel for for(long i=0;i<v->GetNx();i++) { mreal v0 = v->v(i); mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); } gr->EndGroup(); }
//----------------------------------------------------------------------------- void MGL_EXPORT mgl_dens_z(HMGL gr, HCDT a, const char *sch, double sv, const char *opt) { long n=a->GetNx(),m=a->GetNy(); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"DensZ"); return; } gr->SaveState(opt); if(mgl_isnan(sv)) sv = gr->GetOrgZ('z'); if(sv<gr->Min.z || sv>gr->Max.z) { gr->SetWarn(mglWarnSlc,"DensZ"); gr->LoadState(); return; } mglDataV xx,yy,zz; mglData aa; a = fill_slice_z(gr,sv,a,xx,yy,zz,aa); mgl_surf_gen(gr, &xx,&yy,&zz,a, 0, sch); }
//----------------------------------------------------------------------------- // // Dots series // //----------------------------------------------------------------------------- void MGL_EXPORT mgl_dots_ca(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT c, HCDT a, const char *sch, const char *opt) { long n = x->GetNN(), d, k=1; if(x->GetNz()>1) k=3; else if(x->GetNy()>1) k=2; if(y->GetNN()!=n || z->GetNN()!=n || c->GetNN()!=n || (a && a->GetNN()!=n)) { gr->SetWarn(mglWarnDim,"Dots"); return; } gr->SaveState(opt); d = gr->MeshNum>0 ? mgl_ipow(gr->MeshNum+1,k) : n; d = n>d ? n/d:1; static int cgid=1; gr->StartGroup("Dots",cgid++); char mk=gr->SetPenPal(sch); long ss=gr->AddTexture(sch); if(mk==0) mk='.'; gr->Reserve(n); for(long i=0;i<n;i+=d) { mglPoint p = mglPoint(x->vthr(i),y->vthr(i),z->vthr(i)); long pp = gr->AddPnt(p,gr->GetC(ss,c->vthr(i)),mglPoint(NAN),a?gr->GetA(a->vthr(i)):-1); gr->mark_plot(pp, mk); } gr->EndGroup(); }
//----------------------------------------------------------------------------- // // Crust series // //----------------------------------------------------------------------------- void MGL_EXPORT mgl_crust(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) { if(y->GetNx()!=x->GetNx() || z->GetNx()!=x->GetNx()) { gr->SetWarn(mglWarnDim,"Crust"); return; } HMDT nums = mgl_triangulation_3d(x, y, z); mgl_triplot_xyzc(gr,nums,x,y,z,z,sch,opt); mgl_delete_data(nums); }
//----------------------------------------------------------------------------- void MGL_EXPORT mgl_contf_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt) { long n=a->GetNx(),m=a->GetNy(); if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFY"); return; } gr->SaveState(opt); if(mgl_isnan(sv)) sv = gr->GetOrgY('y'); if(sv<gr->Min.y || sv>gr->Max.y) { gr->SetWarn(mglWarnSlc,"ContFY"); gr->LoadState(); return; } static int cgid=1; gr->StartGroup("ContFY",cgid++); mglDataV xx,yy,zz; mglData aa; long ss=gr->AddTexture(sch); a = fill_slice_y(gr,sv,a,xx,yy,zz,aa); #pragma omp parallel for for(long i=0;i<v->GetNx()-1;i++) { mreal v0 = v->v(i); mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); } gr->EndGroup(); }
void MGL_EXPORT mgl_set_warn(HMGL gr, int code, const char *txt) { gr->SetWarn(code,txt); }