diff --git a/Common/Context.h b/Common/Context.h index d468499801a0aba3f6a3320f97d390994795b154..b7b176c0cf72d781aae4faa9a29218b8d1a1f8fd 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -149,8 +149,8 @@ class CTX { // small axes options int smallAxes, smallAxesSize, smallAxesPos[2]; // large axes options - int axes, axesAutoPosition, axesTics[3], axesMikado; - double axesPosition[6]; + int axes, axesAutoPosition, axesTics[3], axesMikado, axesForceValue; + double axesPosition[6], axesValue[6]; std::string axesLabel[3], axesFormat[3]; // simple dynamic lock (should be a mutex) int lock; diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index e77f9987552a90952e511161665901d16b3975e8..4fc98a964c5070ac8be8c78efed005ffdb184770 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -238,6 +238,8 @@ StringXNumber GeneralOptions_Number[] = { "Mikado axes style" }, { F|O, "AxesAutoPosition" , opt_general_axes_auto_position , 1. , "Position the axes automatically" }, + { F|O, "AxesForceValue" , opt_general_axes_force_value , 0. , + "Force values on axes (otherwise use natural coordinates)" }, { F|O, "AxesMaxX" , opt_general_axes_xmax , 1. , "Maximum X-axis coordinate" }, { F|O, "AxesMaxY" , opt_general_axes_ymax , 1. , @@ -256,6 +258,18 @@ StringXNumber GeneralOptions_Number[] = { "Number of tics on the Y-axis" }, { F|O, "AxesTicsZ" , opt_general_axes_tics2 , 5. , "Number of tics on the Z-axis" }, + { F|O, "AxesValueMaxX" , opt_general_axes_value_xmax , 1. , + "Maximum X-axis forced value" }, + { F|O, "AxesValueMaxY" , opt_general_axes_value_ymax , 1. , + "Maximum Y-axis forced value" }, + { F|O, "AxesValueMaxZ" , opt_general_axes_value_zmax , 1. , + "Maximum Z-axis forced value" }, + { F|O, "AxesValueMinX" , opt_general_axes_value_xmin , 0. , + "Minimum X-axis forced value" }, + { F|O, "AxesValueMinY" , opt_general_axes_value_ymin , 0. , + "Minimum Y-axis forced value" }, + { F|O, "AxesValueMinZ" , opt_general_axes_value_zmin , 0. , + "Minimum Z-axis forced value" }, { F|O, "BackgroundGradient" , opt_general_background_gradient , 1. , "Draw background gradient (0=none, 1=vertical, 2=horizontal, 3=radial)" }, @@ -1146,7 +1160,8 @@ StringXNumber ViewOptions_Number[] = { "Minimum display size of arrows (in pixels)" }, { F|O, "AutoPosition" , opt_view_auto_position , 1. , "Position the scale or 2D plot automatically (0: manual, 1: automatic, 2: top left, " - "3: top right, 4: bottom left, 5: bottom right, 6: top, 7: bottom, 8: left, 9: right)" }, + "3: top right, 4: bottom left, 5: bottom right, 6: top, 7: bottom, 8: left, 9: right, " + "10: top 1/3)" }, { F|O, "Axes" , opt_view_axes , 0 , "Axes (0=none, 1=simple axes, 2=box, 3=full grid, 4=open grid, 5=ruler)" }, { F|O, "AxesMikado" , opt_view_axes_mikado , 0. , diff --git a/Common/Options.cpp b/Common/Options.cpp index e8b3f4d2ed44fce641a79da851adbc5483537743..48f617ed24ba3eba3305553aebff30dafd7830ce 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -2680,6 +2680,55 @@ double opt_general_axes_zmax(OPT_ARGS_NUM) return CTX::instance()->axesPosition[5]; } +double opt_general_axes_force_value(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesForceValue = (int)val; + return CTX::instance()->axesForceValue; +} + +double opt_general_axes_value_xmin(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[0] = val; + return CTX::instance()->axesValue[0]; +} + +double opt_general_axes_value_xmax(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[1] = val; + return CTX::instance()->axesValue[1]; +} + +double opt_general_axes_value_ymin(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[2] = val; + return CTX::instance()->axesValue[2]; +} + +double opt_general_axes_value_ymax(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[3] = val; + return CTX::instance()->axesValue[3]; +} + +double opt_general_axes_value_zmin(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[4] = val; + return CTX::instance()->axesValue[4]; +} + +double opt_general_axes_value_zmax(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->axesValue[5] = val; + return CTX::instance()->axesValue[5]; +} + double opt_general_small_axes(OPT_ARGS_NUM) { if(action & GMSH_SET) @@ -6532,7 +6581,7 @@ double opt_view_auto_position(OPT_ARGS_NUM) GET_VIEW(0.); if(action & GMSH_SET) { opt->autoPosition = (int)val; - if(opt->autoPosition < 0 || opt->autoPosition > 9) + if(opt->autoPosition < 0 || opt->autoPosition > 10) opt->autoPosition = 0; } #if defined(HAVE_FLTK) diff --git a/Common/Options.h b/Common/Options.h index 4c31caedef2b333fdbdf0d4779589fc7a2a29d71..782a6c2acaa8b2bafc68e8b2686e96ce1cf1220b 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -197,6 +197,13 @@ double opt_general_axes_zmax(OPT_ARGS_NUM); double opt_general_axes_tics0(OPT_ARGS_NUM); double opt_general_axes_tics1(OPT_ARGS_NUM); double opt_general_axes_tics2(OPT_ARGS_NUM); +double opt_general_axes_force_value(OPT_ARGS_NUM); +double opt_general_axes_value_xmin(OPT_ARGS_NUM); +double opt_general_axes_value_xmax(OPT_ARGS_NUM); +double opt_general_axes_value_ymin(OPT_ARGS_NUM); +double opt_general_axes_value_ymax(OPT_ARGS_NUM); +double opt_general_axes_value_zmin(OPT_ARGS_NUM); +double opt_general_axes_value_zmax(OPT_ARGS_NUM); double opt_general_small_axes(OPT_ARGS_NUM); double opt_general_small_axes_position0(OPT_ARGS_NUM); double opt_general_small_axes_position1(OPT_ARGS_NUM); diff --git a/Graphics/drawAxes.cpp b/Graphics/drawAxes.cpp index 35af73e127a7a309e1a90135cd420ce1a2a69646..59a7b63ea6848a4342f19273569775b2dbefe87d 100644 --- a/Graphics/drawAxes.cpp +++ b/Graphics/drawAxes.cpp @@ -16,12 +16,16 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, std::string &label, double p1[3], double p2[3], - double perp[3], int mikado, double pixelfact) + double perp[3], int mikado, double pixelfact, + double value_p1[3], double value_p2[3]) { // draws n tic marks (in direction perp) and labels along the line p1->p2 double t[3] = {p2[0] - p1[0], p2[1] - p1[1], p2[2] - p1[2]}; double l = norme(t); + double value_t[3] = {value_p2[0] - value_p1[0], value_p2[1] - value_p1[1], + value_p2[2] - value_p1[2]}; + double value_l = norme(value_t); double w = 10 * pixelfact; // big tics 10 pixels double w2 = 5 * pixelfact; // small tics 5 pixels @@ -49,6 +53,7 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, if(n * tmp > l) n = 2; double step = l / (double)(n - 1); + double value_step = value_l / (double)(n - 1); for(int i = 0; i < n; i++){ double d = i * step; @@ -60,6 +65,11 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, p[1] + perp[1] * w * 1.4, p[2] + perp[2] * w * 1.4 }; + double value_d = i * value_step; + double value_p[3] = {value_p1[0] + value_t[0] * value_d, + value_p1[1] + value_t[1] * value_d, + value_p1[2] + value_t[2] * value_d}; + glBegin(GL_LINES); glVertex3d(p[0], p[1], p[2]); glVertex3d(q[0], q[1], q[2]); @@ -83,9 +93,9 @@ static int drawTics(drawContext *ctx, int comp, int n, std::string &format, char str[256]; if(comp < 0) // display the length (ruler) - sprintf(str, format.c_str(), d); + sprintf(str, format.c_str(), value_d); else // display the coordinate - sprintf(str, format.c_str(), p[comp]); + sprintf(str, format.c_str(), value_p[comp]); double winp[3], winr[3]; ctx->world2Viewport(p, winp); ctx->world2Viewport(r, winr); @@ -174,7 +184,8 @@ void drawContext::drawAxis(double xmin, double ymin, double zmin, } void drawContext::drawAxes(int mode, int tics[3], std::string format[3], - std::string label[3], double bb[6], int mikado) + std::string label[3], double bb[6], int mikado, + double value_bb[6]) { // mode 0: nothing // 1: axes @@ -191,11 +202,16 @@ void drawContext::drawAxes(int mode, int tics[3], std::string format[3], double zmin = bb[4], zmax = bb[5]; double orig[3] = {xmin, ymin, zmin}; + double value_xmin = value_bb[0], value_xmax = value_bb[1]; + double value_ymin = value_bb[2], value_ymax = value_bb[3]; + double value_zmin = value_bb[4], value_zmax = value_bb[5]; + double value_orig[3] = {value_xmin, value_ymin, value_zmin}; + double pixelfact = pixel_equiv_x / s[0]; if(mode == 5){ // draw ruler from xyz_min to xyz_max double end[3] = {xmax, ymax, zmax}; - double dir[3] = {xmax-xmin, ymax-ymin, zmax-zmin}; + double dir[3] = {xmax - xmin, ymax - ymin, zmax - zmin}; double perp[3]; if((fabs(dir[0]) >= fabs(dir[1]) && fabs(dir[0]) >= fabs(dir[2])) || (fabs(dir[1]) >= fabs(dir[0]) && fabs(dir[1]) >= fabs(dir[2]))){ @@ -204,23 +220,28 @@ void drawContext::drawAxes(int mode, int tics[3], std::string format[3], else{ perp[0] = 0.; perp[1] = dir[2]; perp[2] = -dir[1]; } - drawTics(this, -1, tics[0], format[0], label[0], orig, end, perp, mikado, pixelfact); + double value_end[3] = {value_xmax, value_ymax, value_zmax}; + drawTics(this, -1, tics[0], format[0], label[0], orig, end, perp, mikado, + pixelfact, value_orig, value_end); drawAxis(xmin, ymin, zmin, xmax, ymax, zmax, tics[0], mikado); return; } double xx[3] = {xmax, ymin, zmin}; double yy[3] = {xmin, ymax, zmin}; double zz[3] = {xmin, ymin, zmax}; + double value_xx[3] = {value_xmax, value_ymin, value_zmin}; + double value_yy[3] = {value_xmin, value_ymax, value_zmin}; + double value_zz[3] = {value_xmin, value_ymin, value_zmax}; double dxm[3] = {0., (ymin != ymax) ? -1. : 0., (zmin != zmax) ? -1. : 0.}; double dym[3] = {(xmin != xmax) ? -1. : 0., 0., (zmin != zmax) ? -1. : 0.}; double dzm[3] = {(xmin != xmax) ? -1. : 0., (ymin != ymax) ? -1. : 0., 0.}; - int nx = (xmin != xmax) ? - drawTics(this, 0, tics[0], format[0], label[0], orig, xx, dxm, mikado, pixelfact) : 0; - int ny = (ymin != ymax) ? - drawTics(this, 1, tics[1], format[1], label[1], orig, yy, dym, mikado, pixelfact) : 0; - int nz = (zmin != zmax) ? - drawTics(this, 2, tics[2], format[2], label[2], orig, zz, dzm, mikado, pixelfact) : 0; + int nx = (xmin != xmax) ? drawTics(this, 0, tics[0], format[0], label[0], orig, xx, dxm, + mikado, pixelfact, value_orig, value_xx) : 0; + int ny = (ymin != ymax) ? drawTics(this, 1, tics[1], format[1], label[1], orig, yy, dym, + mikado, pixelfact, value_orig, value_yy) : 0; + int nz = (zmin != zmax) ? drawTics(this, 2, tics[2], format[2], label[2], orig, zz, dzm, + mikado, pixelfact, value_orig, value_zz) : 0; drawAxis(xmin, ymin, zmin, xmax, ymin, zmin, nx, mikado); drawAxis(xmin, ymin, zmin, xmin, ymax, zmin, ny, mikado); @@ -261,12 +282,16 @@ void drawContext::drawAxes(int mode, int tics[3], std::string format[3], } void drawContext::drawAxes(int mode, int tics[3], std::string format[3], - std::string label[3], SBoundingBox3d &bb, int mikado) + std::string label[3], SBoundingBox3d &bb, int mikado, + SBoundingBox3d &value_bb) { double bbox[6] = {bb.min().x(), bb.max().x(), bb.min().y(), bb.max().y(), bb.min().z(), bb.max().z()}; - drawAxes(mode, tics, format, label, bbox, mikado); + double value_bbox[6] = {value_bb.min().x(), value_bb.max().x(), + value_bb.min().y(), value_bb.max().y(), + value_bb.min().z(), value_bb.max().z()}; + drawAxes(mode, tics, format, label, bbox, mikado, value_bbox); } void drawContext::drawAxes() @@ -304,7 +329,9 @@ void drawContext::drawAxes() if(!CTX::instance()->axesAutoPosition){ drawAxes(CTX::instance()->axes, CTX::instance()->axesTics, CTX::instance()->axesFormat, CTX::instance()->axesLabel, - CTX::instance()->axesPosition, CTX::instance()->axesMikado); + CTX::instance()->axesPosition, CTX::instance()->axesMikado, + CTX::instance()->axesForceValue ? CTX::instance()->axesValue : + CTX::instance()->axesPosition); } else if(geometryExists){ double bb[6] = @@ -312,7 +339,8 @@ void drawContext::drawAxes() CTX::instance()->max[1], CTX::instance()->min[2], CTX::instance()->max[2]}; drawAxes(CTX::instance()->axes, CTX::instance()->axesTics, CTX::instance()->axesFormat, CTX::instance()->axesLabel, - bb, CTX::instance()->axesMikado); + bb, CTX::instance()->axesMikado, CTX::instance()->axesForceValue ? + CTX::instance()->axesValue : bb); } } diff --git a/Graphics/drawContext.h b/Graphics/drawContext.h index ac1c6670716ee3ffb71e61dc4f2816f4552b2bdb..0c2c03b717822f4102bb1a6ed308ecb1c4624739 100644 --- a/Graphics/drawContext.h +++ b/Graphics/drawContext.h @@ -78,7 +78,7 @@ class drawTransformScaled : public drawTransform { z += _tra[2]; } }; - + // global drawing functions, which need to be redefined for each // widget toolkit (FLTK, Qt, etc.) class drawContextGlobal { @@ -113,14 +113,14 @@ class drawContext { public: Camera camera; - double r[3]; // current Euler angles (in degrees!) - double t[3], s[3]; // current translation and scale + double r[3]; // current Euler angles (in degrees!) + double t[3], s[3]; // current translation and scale double quaternion[4]; // current quaternion used for "trackball" rotation - int viewport[4]; // current viewport - double rot[16]; // current rotation matrix + int viewport[4]; // current viewport + double rot[16]; // current rotation matrix double t_init[3]; // initial translation before applying modelview transform - double vxmin, vxmax, vymin, vymax; // current viewport in real coordinates - double pixel_equiv_x, pixel_equiv_y; // approx equiv model length of a pixel + double vxmin, vxmax, vymin, vymax; // current viewport in real coordinates + double pixel_equiv_x, pixel_equiv_y; // approx equiv model length of a pixel double model[16], proj[16]; // the modelview and projection matrix as they were // at the time of the last InitPosition() call enum RenderMode {GMSH_RENDER=1, GMSH_SELECT=2, GMSH_FEEDBACK=3}; @@ -133,28 +133,28 @@ class drawContext { void setTransform(drawTransform *transform){ _transform = transform; } drawTransform *getTransform(){ return _transform; } void transform(double &x, double &y, double &z) - { - if(_transform) _transform->transform(x, y, z); + { + if(_transform) _transform->transform(x, y, z); } void transformOneForm(double &x, double &y, double &z) { - if(_transform) _transform->transformOneForm(x, y, z); + if(_transform) _transform->transformOneForm(x, y, z); } void transformTwoForm(double &x, double &y, double &z) { - if(_transform) _transform->transformTwoForm(x, y, z); + if(_transform) _transform->transformTwoForm(x, y, z); } void hide(GModel *m){ _hiddenModels.insert(m); } void hide(PView *v){ _hiddenViews.insert(v); } void show(GModel *m) - { + { std::set<GModel*>::iterator it = _hiddenModels.find(m); - if(it != _hiddenModels.end()) _hiddenModels.erase(it); + if(it != _hiddenModels.end()) _hiddenModels.erase(it); } void show(PView *v) - { + { std::set<PView*>::iterator it = _hiddenViews.find(v); - if(it != _hiddenViews.end()) _hiddenViews.erase(it); + if(it != _hiddenViews.end()) _hiddenViews.erase(it); } void showAll(){ _hiddenModels.clear(); _hiddenViews.clear(); } bool isVisible(GModel *m){ return (_hiddenModels.find(m) == _hiddenModels.end()); } @@ -172,8 +172,8 @@ class drawContext { void unproject(double x, double y, double p[3], double d[3]); void viewport2World(double win[3], double xyz[3]); void world2Viewport(double xyz[3], double win[3]); - bool select(int type, bool multiple, bool mesh, int x, int y, int w, int h, - std::vector<GVertex*> &vertices, std::vector<GEdge*> &edges, + bool select(int type, bool multiple, bool mesh, int x, int y, int w, int h, + std::vector<GVertex*> &vertices, std::vector<GEdge*> &edges, std::vector<GFace*> &faces, std::vector<GRegion*> ®ions, std::vector<MElement*> &elements); int fix2dCoordinates(double *x, double *y); @@ -187,17 +187,17 @@ class drawContext { void drawText2d(); void drawGraph2d(); void drawAxis(double xmin, double ymin, double zmin, - double xmax, double ymax, double zmax, + double xmax, double ymax, double zmax, int nticks, int mikado); void drawAxes(int mode, int tics[3], std::string format[3], - std::string label[3], double bb[6], int mikado); - void drawAxes(int mode, int tics[3], std::string format[3], - std::string label[3], SBoundingBox3d &bb, int mikado); + std::string label[3], double bb[6], int mikado, double value_bb[6]); + void drawAxes(int mode, int tics[3], std::string format[3], + std::string label[3], SBoundingBox3d &bb, int mikado, SBoundingBox3d &value_bb); void drawAxes(); void drawSmallAxes(); void drawTrackball(); void drawScales(); - void drawString(const std::string &s, const std::string &font_name, int font_enum, + void drawString(const std::string &s, const std::string &font_name, int font_enum, int font_size, int align); void drawString(const std::string &s); void drawStringCenter(const std::string &s); @@ -208,10 +208,10 @@ class drawContext { void drawEllipse(double x, double y, double z, float v0[3], float v1[3], int light); void drawSphere(double size, double x, double y, double z, int light); void drawCylinder(double width, double *x, double *y, double *z, int light); - void drawTaperedCylinder(double width, double val1, double val2, - double ValMin, double ValMax, + void drawTaperedCylinder(double width, double val1, double val2, + double ValMin, double ValMax, double *x, double *y, double *z, int light); - void drawArrow3d(double x, double y, double z, double dx, double dy, double dz, + void drawArrow3d(double x, double y, double z, double dx, double dy, double dz, double length, int light); void drawVector(int Type, int Fill, double x, double y, double z, double dx, double dy, double dz, int light); @@ -254,10 +254,10 @@ class mousePosition { win[1] = (double)y; win[2] = 0.; - wnr[0] = - (ctx->vxmin + win[0] / (double)ctx->viewport[2] * (ctx->vxmax - ctx->vxmin)) + wnr[0] = + (ctx->vxmin + win[0] / (double)ctx->viewport[2] * (ctx->vxmax - ctx->vxmin)) / ctx->s[0] - ctx->t[0] + ctx->t_init[0] / ctx->s[0]; - wnr[1] = + wnr[1] = (ctx->vymax - win[1] / (double)ctx->viewport[3] * (ctx->vymax - ctx->vymin)) / ctx->s[1] - ctx->t[1] + ctx->t_init[1] / ctx->s[1]; wnr[2] = 0.; diff --git a/Graphics/drawGraph2d.cpp b/Graphics/drawGraph2d.cpp index 9b0de6a8b168688a28da1cbb9368481abb243e53..dcfd0f0e4f01e6cd3e25e21ca28b497a0884ae45 100644 --- a/Graphics/drawGraph2d.cpp +++ b/Graphics/drawGraph2d.cpp @@ -525,16 +525,16 @@ void drawContext::drawGraph2d() drawGraph(this, p, x + 0.95 * xsep, viewport[3] - (y + 0.4 * ysep), w, h); } } - else if(opt->autoPosition >= 2 && opt->autoPosition <= 9){ + else if(opt->autoPosition >= 2 && opt->autoPosition <= 10){ // top left (2), top right (3), bottom left (4), bottom right (5), top - // half (6), bottom half (7), left half (8), right half (9) + // half (6), bottom half (7), left half (8), right half (9), top 1/3 (10) double winw = viewport[2] - viewport[0]; double winh = viewport[3] - viewport[1]; double fracw = 0.85, frach = 0.85; int a = opt->autoPosition; double wd = (a <= 5 || a == 8 || a == 9) ? 2. : 1.; double w = fracw * winw / wd - xsep; - double hd = (a <= 5 || a == 6 || a == 7) ? 2. : 1.; + double hd = (a == 10) ? 3. : (a <= 5 || a == 6 || a == 7) ? 2. : 1.; double h = frach * winh / hd - ysep; double x = viewport[0] + (1 - fracw) / 3. * winw; if(a == 3 || a == 5 || a == 9) diff --git a/Graphics/drawPost.cpp b/Graphics/drawPost.cpp index 63362c939b6e9019ad8c0d2f5fadec33c44b00ad..1106c665b591b973d2e459080372ba0ddd2be2ec 100644 --- a/Graphics/drawPost.cpp +++ b/Graphics/drawPost.cpp @@ -23,7 +23,7 @@ #include <FL/gl.h> #endif -static void drawArrays(drawContext *ctx, PView *p, VertexArray *va, GLint type, +static void drawArrays(drawContext *ctx, PView *p, VertexArray *va, GLint type, bool useNormalArray) { if(!va || !va->getNumVertices()) return; @@ -99,7 +99,7 @@ static void drawEllipseArray(drawContext *ctx, PView *p, VertexArray *va) if(!va || va->getNumVerticesPerElement() != 4) return; PViewOptions *opt = p->getOptions(); - + for(int i = 0; i < va->getNumVertices(); i += 4) { float *s = va->getVertexArray(3 * i); float vv[3][3]; @@ -127,7 +127,7 @@ static void drawVectorArray(drawContext *ctx, PView *p, VertexArray *va) if(!va || va->getNumVerticesPerElement() != 2) return; PViewOptions *opt = p->getOptions(); - + for(int i = 0; i < va->getNumVertices(); i += 2){ float *s = va->getVertexArray(3 * i); float *v = va->getVertexArray(3 * (i + 1)); @@ -137,9 +137,9 @@ static void drawVectorArray(drawContext *ctx, PView *p, VertexArray *va) if((l || opt->vectorType == 6) && lmax){ double scale = (opt->arrowSizeMax - opt->arrowSizeMin) / lmax; // log scaling - if(opt->scaleType == PViewOptions::Logarithmic && + if(opt->scaleType == PViewOptions::Logarithmic && opt->tmpMin > 0 && opt->tmpMax > opt->tmpMin && l != opt->tmpMin){ - scale = (opt->arrowSizeMax - opt->arrowSizeMin) / l * + scale = (opt->arrowSizeMax - opt->arrowSizeMin) / l * log10(l / opt->tmpMin) / log10(opt->tmpMax / opt->tmpMin); } if(opt->arrowSizeMin && l) scale += opt->arrowSizeMin / l; @@ -165,7 +165,7 @@ static void drawVectorArray(drawContext *ctx, PView *p, VertexArray *va) } } -static std::string stringValue(int numComp, double d[9], double norm, +static std::string stringValue(int numComp, double d[9], double norm, const char *format) { char label[100]; @@ -183,7 +183,7 @@ static std::string stringValue(int numComp, double d[9], double norm, return std::string(label); } -static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numComp, +static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numComp, double **xyz, double **val) { PViewOptions *opt = p->getOptions(); @@ -230,7 +230,7 @@ static void drawNumberGlyphs(drawContext *ctx, PView *p, int numNodes, int numCo } } -static void drawNormalVectorGlyphs(drawContext *ctx, PView *p, int numNodes, +static void drawNormalVectorGlyphs(drawContext *ctx, PView *p, int numNodes, double **xyz, double **val) { PViewOptions *opt = p->getOptions(); @@ -265,7 +265,7 @@ static void drawTangentVectorGlyphs(drawContext *ctx, PView *p, int numNodes, for(int i = 0; i < 3; i++) t[i] *= opt->tangents * ctx->pixel_equiv_x / ctx->s[i]; glColor4ubv((GLubyte *) & opt->color.tangents); - ctx->drawVector(CTX::instance()->vectorType, 0, pc[0], pc[1], pc[2], t[0], t[1], t[2], + ctx->drawVector(CTX::instance()->vectorType, 0, pc[0], pc[1], pc[2], t[0], t[1], t[2], opt->light); } @@ -361,7 +361,7 @@ static void drawGlyphs(drawContext *ctx, PView *p) if(dim == 2 && opt->normals) drawNormalVectorGlyphs(ctx, p, numNodes, xyz, val); else if(dim == 1 && opt->tangents) - drawTangentVectorGlyphs(ctx, p, numNodes, xyz, val); + drawTangentVectorGlyphs(ctx, p, numNodes, xyz, val); } } for(int j = 0; j < NMAX; j++){ @@ -397,15 +397,15 @@ class drawPView { if(data->getDirty() || !data->getNumTimeSteps()) return; if(!opt->visible || opt->type != PViewOptions::Plot3D) return; if(!_ctx->isVisible(p)) return; - + glPointSize((float)opt->pointSize); - gl2psPointSize((float)(opt->pointSize * + gl2psPointSize((float)(opt->pointSize * CTX::instance()->print.epsPointSizeFactor)); - + glLineWidth((float)opt->lineWidth); gl2psLineWidth((float)(opt->lineWidth * CTX::instance()->print.epsLineWidthFactor)); - + if(opt->lightTwoSide) glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else @@ -414,16 +414,16 @@ class drawPView { if(opt->axes && opt->type == PViewOptions::Plot3D){ glColor4ubv((GLubyte *) & opt->color.axes); glLineWidth((float)CTX::instance()->lineWidth); - gl2psLineWidth((float)(CTX::instance()->lineWidth * + gl2psLineWidth((float)(CTX::instance()->lineWidth * CTX::instance()->print.epsLineWidthFactor)); if(!opt->axesAutoPosition) _ctx->drawAxes(opt->axes, opt->axesTics, opt->axesFormat, opt->axesLabel, - opt->axesPosition, opt->axesMikado); + opt->axesPosition, opt->axesMikado, opt->axesPosition); else if(!opt->tmpBBox.empty()) _ctx->drawAxes(opt->axes, opt->axesTics, opt->axesFormat, opt->axesLabel, - opt->tmpBBox, opt->axesMikado); + opt->tmpBBox, opt->axesMikado, opt->tmpBBox); } - + if(!CTX::instance()->clipWholeElements){ for(int i = 0; i < 6; i++) if(opt->clip & (1 << i)) @@ -446,7 +446,7 @@ class drawPView { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // glBlendEquation(GL_FUNC_ADD); glEnable(GL_BLEND); - if(p->va_triangles && p->va_triangles->getNumVertices() && + if(p->va_triangles && p->va_triangles->getNumVertices() && eyeChanged(_ctx, p)){ Msg::Debug("Sorting View[%d] for transparency", p->getIndex()); p->va_triangles->sort(p->getEye().x(), p->getEye().y(), p->getEye().z()); @@ -494,7 +494,7 @@ class drawPView { _ctx->drawString(str, style); } } - + if(CTX::instance()->alpha){ glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); @@ -522,7 +522,7 @@ class drawPViewBoundingBox { glColor4ubv((GLubyte *) & CTX::instance()->color.fg); glLineWidth((float)CTX::instance()->lineWidth); - gl2psLineWidth((float)(CTX::instance()->lineWidth * + gl2psLineWidth((float)(CTX::instance()->lineWidth * CTX::instance()->print.epsLineWidthFactor)); _ctx->drawBox(bb.min().x(), bb.min().y(), bb.min().z(), @@ -532,9 +532,9 @@ class drawPViewBoundingBox { if(opt->clip & (1 << i)) _ctx->drawPlaneInBoundingBox(bb.min().x(), bb.min().y(), bb.min().z(), bb.max().x(), bb.max().y(), bb.max().z(), - CTX::instance()->clipPlane[i][0], - CTX::instance()->clipPlane[i][1], - CTX::instance()->clipPlane[i][2], + CTX::instance()->clipPlane[i][0], + CTX::instance()->clipPlane[i][1], + CTX::instance()->clipPlane[i][2], CTX::instance()->clipPlane[i][3]); } };