本文整理汇总了C++中base::Rotation::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Rotation::getValue方法的具体用法?C++ Rotation::getValue怎么用?C++ Rotation::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base::Rotation
的用法示例。
在下文中一共展示了Rotation::getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyInit
// constructor method
int RotationPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject* o;
if (PyArg_ParseTuple(args, "")) {
return 0;
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "O!", &(Base::RotationPy::Type), &o)) {
Base::Rotation *rot = static_cast<Base::RotationPy*>(o)->getRotationPtr();
getRotationPtr()->setValue(rot->getValue());
return 0;
}
PyErr_Clear();
double angle;
if (PyArg_ParseTuple(args, "O!d", &(Base::VectorPy::Type), &o, &angle)) {
// NOTE: The last parameter defines the rotation angle in degree.
getRotationPtr()->setValue(static_cast<Base::VectorPy*>(o)->value(), Base::toRadians<double>(angle));
return 0;
}
PyErr_Clear();
double q0, q1, q2, q3;
if (PyArg_ParseTuple(args, "dddd", &q0, &q1, &q2, &q3)) {
getRotationPtr()->setValue(q0, q1, q2, q3);
return 0;
}
PyErr_Clear();
double y, p, r;
if (PyArg_ParseTuple(args, "ddd", &y, &p, &r)) {
getRotationPtr()->setYawPitchRoll(y, p, r);
return 0;
}
PyErr_Clear();
PyObject *v1, *v2;
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &v1,
&(Base::VectorPy::Type), &v2)) {
Py::Vector from(v1, false);
Py::Vector to(v2, false);
getRotationPtr()->setValue(from.toVector(), to.toVector());
return 0;
}
PyErr_SetString(PyExc_Exception, "empty parameter list, four floats or Vector and float");
return -1;
}
示例2: applyRotation
void ComplexGeoData::applyRotation(const Base::Rotation& rot)
{
Base::Matrix4D mat;
rot.getValue(mat);
setTransform(mat * getTransform());
}
示例3: PyInit
// constructor method
int RotationPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject* o;
if (PyArg_ParseTuple(args, "")) {
return 0;
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "O!", &(Base::RotationPy::Type), &o)) {
Base::Rotation *rot = static_cast<Base::RotationPy*>(o)->getRotationPtr();
getRotationPtr()->setValue(rot->getValue());
return 0;
}
PyErr_Clear();
double angle;
if (PyArg_ParseTuple(args, "O!d", &(Base::VectorPy::Type), &o, &angle)) {
// NOTE: The last parameter defines the rotation angle in degree.
getRotationPtr()->setValue(static_cast<Base::VectorPy*>(o)->value(), Base::toRadians<double>(angle));
return 0;
}
PyErr_Clear();
if (PyArg_ParseTuple(args, "O!d", &(Base::MatrixPy::Type), &o, &angle)) {
// NOTE: The last parameter defines the rotation angle in degree.
getRotationPtr()->setValue(static_cast<Base::MatrixPy*>(o)->value());
return 0;
}
PyErr_Clear();
double q0, q1, q2, q3;
if (PyArg_ParseTuple(args, "dddd", &q0, &q1, &q2, &q3)) {
getRotationPtr()->setValue(q0, q1, q2, q3);
return 0;
}
PyErr_Clear();
double y, p, r;
if (PyArg_ParseTuple(args, "ddd", &y, &p, &r)) {
getRotationPtr()->setYawPitchRoll(y, p, r);
return 0;
}
double a11 = 1.0, a12 = 0.0, a13 = 0.0, a14 = 0.0;
double a21 = 0.0, a22 = 1.0, a23 = 0.0, a24 = 0.0;
double a31 = 0.0, a32 = 0.0, a33 = 1.0, a34 = 0.0;
double a41 = 0.0, a42 = 0.0, a43 = 0.0, a44 = 1.0;
// try read a 4x4 matrix
PyErr_Clear();
if (PyArg_ParseTuple(args, "dddddddddddddddd",
&a11, &a12, &a13, &a14,
&a21, &a22, &a23, &a24,
&a31, &a32, &a33, &a34,
&a41, &a42, &a43, &a44))
{
Matrix4D mtx(a11, a12, a13, a14,
a21, a22, a23, a24,
a31, a32, a33, a34,
a41, a42, a43, a44);
getRotationPtr()->setValue(mtx);
return 0;
}
// try read a 3x3 matrix
PyErr_Clear();
if (PyArg_ParseTuple(args, "ddddddddd",
&a11, &a12, &a13,
&a21, &a22, &a23,
&a31, &a32, &a33))
{
Matrix4D mtx(a11, a12, a13, a14,
a21, a22, a23, a24,
a31, a32, a33, a34,
a41, a42, a43, a44);
getRotationPtr()->setValue(mtx);
return 0;
}
PyErr_Clear();
PyObject *v1, *v2;
if (PyArg_ParseTuple(args, "O!O!", &(Base::VectorPy::Type), &v1,
&(Base::VectorPy::Type), &v2)) {
Py::Vector from(v1, false);
Py::Vector to(v2, false);
getRotationPtr()->setValue(from.toVector(), to.toVector());
return 0;
}
PyErr_Clear();
PyObject *v3;
char *priority = nullptr;
if (PyArg_ParseTuple(args, "O!O!O!|s", &(Base::VectorPy::Type), &v1,
&(Base::VectorPy::Type), &v2,
&(Base::VectorPy::Type), &v3,
&priority )) {
Py::Vector xdir(v1, false);
Py::Vector ydir(v2, false);
//.........这里部分代码省略.........