diff options
author | Marius Kintel <marius@kintel.net> | 2012-04-24 02:18:29 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-04-24 02:18:29 (GMT) |
commit | 04947a8905f8c6a722669c9cdfd465b54a44b0f6 (patch) | |
tree | 81ad1de59457db2586e4dfc788f8a443264552d7 /src | |
parent | cab12ccb86e03535cdafc7357dbbc0b5d2ba1fa2 (diff) | |
parent | f5a7e92367adb7bbadaff8d27ff1610d91034b6a (diff) |
Merge branch 'master' into value
Diffstat (limited to 'src')
-rw-r--r-- | src/CGALEvaluator.cc | 5 | ||||
-rw-r--r-- | src/OpenCSGWarningDialog.cc | 2 | ||||
-rw-r--r-- | src/PolySetCGALEvaluator.cc | 11 | ||||
-rw-r--r-- | src/csgtermnormalizer.cc | 4 | ||||
-rw-r--r-- | src/glview.cc | 24 | ||||
-rw-r--r-- | src/mainwin.cc | 7 |
6 files changed, 25 insertions, 28 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 0e849a8..46f4cfa 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -43,11 +43,8 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const AbstractNode &node) Traverser evaluate(*this, node, Traverser::PRE_AND_POSTFIX); evaluate.execute(); return this->root; - assert(this->visitedchildren.empty()); - } - else { - return CGALCache::instance()->get(this->tree.getIdString(node)); } + return CGALCache::instance()->get(this->tree.getIdString(node)); } bool CGALEvaluator::isCached(const AbstractNode &node) const diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc index fdaaa50..5648576 100644 --- a/src/OpenCSGWarningDialog.cc +++ b/src/OpenCSGWarningDialog.cc @@ -1,7 +1,7 @@ #include "OpenCSGWarningDialog.h" #include "Preferences.h" -OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget *parent) +OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*) { setupUi(this); diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index 6ed1ab4..1cc6b16 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -454,15 +454,10 @@ PolySet *PolySetCGALEvaluator::rotateDxfData(const RotateExtrudeNode &node, DxfD } for (int j = 0; j < fragments; j++) { - double a = (j*2*M_PI) / fragments; + double a = (j*2*M_PI) / fragments - M_PI/2; // start on the X axis for (size_t k = 0; k < dxf.paths[i].indices.size(); k++) { - if (dxf.points[dxf.paths[i].indices[k]][0] == 0) { - points[j][k][0] = 0; - points[j][k][1] = 0; - } else { - points[j][k][0] = dxf.points[dxf.paths[i].indices[k]][0] * sin(a); - points[j][k][1] = dxf.points[dxf.paths[i].indices[k]][0] * cos(a); - } + points[j][k][0] = dxf.points[dxf.paths[i].indices[k]][0] * sin(a); + points[j][k][1] = dxf.points[dxf.paths[i].indices[k]][0] * cos(a); points[j][k][2] = dxf.points[dxf.paths[i].indices[k]][1]; } } diff --git a/src/csgtermnormalizer.cc b/src/csgtermnormalizer.cc index b4bfa4c..6600758 100644 --- a/src/csgtermnormalizer.cc +++ b/src/csgtermnormalizer.cc @@ -46,8 +46,8 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term) if (!term || term->type == CSGTerm::TYPE_PRIMITIVE) return term; if (term->left) term->left = normalizePass(term->left); } while (term->type != CSGTerm::TYPE_UNION && - (term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE || - term->left && term->left->type == CSGTerm::TYPE_UNION)); + ((term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE) || + (term->left && term->left->type == CSGTerm::TYPE_UNION))); term->right = normalizePass(term->right); // FIXME: Do we need to take into account any transformation of item here? diff --git a/src/glview.cc b/src/glview.cc index 0f9ec5b..12657b8 100644 --- a/src/glview.cc +++ b/src/glview.cc @@ -393,8 +393,6 @@ void GLView::paintGL() glRotated(object_rot_y, 0.0, 1.0, 0.0); glRotated(object_rot_z, 0.0, 0.0, 1.0); - glTranslated(object_trans_x, object_trans_y, object_trans_z); - // FIXME: Crosshairs and axes are lighted, this doesn't make sense and causes them // to change color based on view orientation. if (showcrosshairs) @@ -412,6 +410,8 @@ void GLView::paintGL() glEnd(); } + glTranslated(object_trans_x, object_trans_y, object_trans_z); + // Large gray axis cross inline with the model // FIXME: This is always gray - adjust color to keep contrast with background if (showaxes) @@ -589,14 +589,21 @@ void GLView::mouseMoveEvent(QMouseEvent *event) normalizeAngle(object_rot_y); normalizeAngle(object_rot_z); } else { - // Right button pans - // Shift-right zooms + // Right button pans in the xz plane + // Middle button pans in the xy plane + // Shift-right and Shift-middle zooms if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { viewer_distance += (GLdouble)dy; } else { double mx = +(dx) * viewer_distance/1000; - double my = -(dy) * viewer_distance/1000; + double mz = -(dy) * viewer_distance/1000; + + double my = 0; + if (event->buttons() & Qt::MiddleButton) { + my = mz; + mz = 0; + } Matrix3d aax, aay, aaz, tm3; aax = Eigen::AngleAxisd(-(object_rot_x/180) * M_PI, Vector3d::UnitX()); @@ -612,15 +619,10 @@ void GLView::mouseMoveEvent(QMouseEvent *event) Matrix4d vec; vec << 0, 0, 0, mx, - 0, 0, 0, 0, 0, 0, 0, my, + 0, 0, 0, mz, 0, 0, 0, 1 ; - if ((QApplication::keyboardModifiers() & Qt::ShiftModifier) != 0) { - vec(0,3) = 0; - vec(1,3) = my; - vec(2,3) = 0; - } tm = tm * vec; object_trans_x += tm(0,3); object_trans_y += tm(1,3); diff --git a/src/mainwin.cc b/src/mainwin.cc index daea6e3..30e1a17 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -95,6 +95,10 @@ #endif // ENABLE_CGAL +#ifndef OPENCSG_VERSION_STRING +#define OPENCSG_VERSION_STRING "unknown, <1.3.2" +#endif + // Global application state unsigned int GuiLocker::gui_locked = 0; @@ -1031,8 +1035,7 @@ bool MainWindow::compileTopLevelDocument(bool reload) { bool shouldcompiletoplevel = !reload; - if (reload && - (fileChangedOnDisk() && checkEditorModified()) || + if ((reload && fileChangedOnDisk() && checkEditorModified()) || includesChanged()) { shouldcompiletoplevel = true; refreshDocument(); |