* Removed bgcontrast
* Added new `Color4f axescolor` obtained by `ColorMap::getColor(...,
AXES_COLOR)`
* Switched showAxes and showScalemarkers to `axescolor`
modified: src/GLView.cc
The added function takes the length of the axis (l), the currrent position on the axis (i) and the size of the divisions between i and uses a variety of arrays to decode the characters of the position into GL_LINES, GL_LINE_STRIPs, GL_LINE_LOOPs as appropriate. The various orientations required by the axis are handled by abstracting the line vertex sequences into arrays (set per axis.)
Tim Deagan 12/26/2014
While add-on rulers can be extremely useful, there are many times that a quick scaling marker would be handy. This feature generates tics every 10 units, driven off the log10 of the l variable defining axes length. As you zoom in or out, the tics automatically re-scale themselves. Every tenth tic is slightly larger. A menu item is added to the view menu to enable or disable the feature.
I experimented with menu driven scaling (.01, .1, 1, 10, etc.), but using small increments when zoomed out brought the app to it's knees. Adding a visual indicator of the current scaling might be nice, but I'm nto sure where to put it (possibly below the small axes,) since it changes as zooming and would clutter the console.
Changes to be committed:
new file: images/scalemarkers.png
modified: openscad.qrc
modified: src/GLView.cc
modified: src/GLView.h
modified: src/MainWindow.h
modified: src/MainWindow.ui
modified: src/QGLView.h
modified: src/mainwin.cc
- Draw negative part of the axis with stippled lines
- Calculate contrast color for axis based on background color
- Disable lighting for axis / crosshair
building and working on Windows 7 compiled with Visual Studio Express 2012.
A couple of things needed changing :
* MSVC 2012 has no trunc or round, i have added those to mathc99 and included mathc99 to the files needed.
The implementations were taken from boost.
* MSVC 2012 stl does now allow accessing out of bounds elements in std:vector as an array, so "chain->objects[i]" will
fail in "OpenCSGRenderer::renderCSGChain". Whatever the platform, it will me a good idea to change this
code to something that does not trigger undefined behavior.
* MSVC 2012 cannot figure out the types involved in "if (file_size == 80 + 4 + 50*facenum) {", i have added
a cast to force it to "if (file_size == static_cast<std::streamoff>(80 + 4 + 50*facenum)) {".
The next round would be regression testing and debugging and possibly more changes to the OpenSCAD main code.
The round after that would be changing the .pro and .pri files to create correct visual studio solutions.