add method multVec to MatrixPy class for better consistency

This commit is contained in:
wmayer
2019-01-22 15:57:10 +01:00
parent c6537c14a9
commit 8345b0c1c3
2 changed files with 19 additions and 1 deletions

View File

@@ -67,6 +67,14 @@ Multiply a matrix or vector with this matrix
</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>
multVec(Vector) -> Vector
Compute the transformed vector using the matrix
</UserDocu>
</Documentation>
</Methode>
<Methode Name="invert">
<Documentation>
<UserDocu>
@@ -242,4 +250,4 @@ Analyzes the type of transformation.
{ return *(getMatrixPtr()); }
</ClassDeclarations>
</PythonExport>
</GenerateModel>
</GenerateModel>

View File

@@ -387,6 +387,16 @@ PyObject* MatrixPy::multiply(PyObject * args)
return 0;
}
PyObject* MatrixPy::multVec(PyObject * args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &obj))
return NULL;
Base::Vector3d vec(static_cast<VectorPy*>(obj)->value());
getMatrixPtr()->multVec(vec, vec);
return new VectorPy(new Vector3d(vec));
}
PyObject* MatrixPy::invert(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))