+ implement command to view sketch perpendicular to sketch plane
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5046 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
@@ -92,6 +92,7 @@ void View3DInventorPy::init_type()
|
||||
add_varargs_method("getCameraNode",&View3DInventorPy::getCameraNode,"getCameraNode()");
|
||||
add_varargs_method("getViewDirection",&View3DInventorPy::getViewDirection,"getViewDirection()");
|
||||
add_varargs_method("setCamera",&View3DInventorPy::setCamera,"setCamera()");
|
||||
add_varargs_method("setCameraOrientation",&View3DInventorPy::setCameraOrientation,"setCameraOrientation()");
|
||||
add_varargs_method("getCameraType",&View3DInventorPy::getCameraType,"getCameraType()");
|
||||
add_varargs_method("setCameraType",&View3DInventorPy::setCameraType,"setCameraType()");
|
||||
add_varargs_method("listCameraTypes",&View3DInventorPy::listCameraTypes,"listCameraTypes()");
|
||||
@@ -399,6 +400,33 @@ Py::Object View3DInventorPy::viewAxometric(const Py::Tuple& args)
|
||||
return Py::None();
|
||||
}
|
||||
|
||||
Py::Object View3DInventorPy::setCameraOrientation(const Py::Tuple& args)
|
||||
{
|
||||
PyObject* o;
|
||||
if (!PyArg_ParseTuple(args.ptr(), "O!", &PyTuple_Type, &o))
|
||||
throw Py::Exception();
|
||||
|
||||
try {
|
||||
Py::Tuple tuple(o);
|
||||
float q0 = (float)Py::Float(tuple[0]);
|
||||
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));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Py::Exception(e.what());
|
||||
}
|
||||
catch(...) {
|
||||
throw Py::Exception("Unknown C++ exception");
|
||||
}
|
||||
|
||||
return Py::None();
|
||||
}
|
||||
|
||||
Py::Object View3DInventorPy::viewPosition(const Py::Tuple& args)
|
||||
{
|
||||
PyObject* p=0;
|
||||
|
||||
Reference in New Issue
Block a user