Add optional argument moveToCenter (by default false) to avoid to move camera when using standard views

This commit is contained in:
wmayer
2012-07-09 13:38:21 +02:00
parent 49483307fa
commit 572008b297
5 changed files with 20 additions and 17 deletions

View File

@@ -464,7 +464,8 @@ Py::Object View3DInventorPy::viewRotateRight(const Py::Tuple& args)
Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
{
PyObject* o;
if (!PyArg_ParseTuple(args.ptr(), "O!", &PyTuple_Type, &o))
PyObject* m;
if (!PyArg_ParseTuple(args.ptr(), "O!|O!", &PyTuple_Type, &o, &PyBool_Type, &m))
throw Py::Exception();
try {
@@ -473,7 +474,7 @@ Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
float q1 = (float)Py::Float(tuple[1]);
float q2 = (float)Py::Float(tuple[2]);
float q3 = (float)Py::Float(tuple[3]);
_view->getViewer()->setCameraOrientation(SbRotation(q0, q1, q2, q3));
_view->getViewer()->setCameraOrientation(SbRotation(q0, q1, q2, q3), m==Py_True);
}
catch (const Base::Exception& e) {
throw Py::Exception(e.what());