43 #include <pybind11/include/pybind11/pybind11.h> 44 #include <pybind11/include/pybind11/embed.h> 47 #include <MovePlugin.hh> 48 #include <OpenFlipper/BasePlugin/PythonFunctions.hh> 49 #include <OpenFlipper/PythonInterpreter/PythonTypeConversions.hh> 53 PYBIND11_EMBEDDED_MODULE(Move, m) {
55 QObject* pluginPointer = getPluginPointer(
"Move");
58 std::cerr <<
"Error Getting plugin pointer for Plugin-Move" << std::endl;
65 std::cerr <<
"Error converting plugin pointer for Plugin-Move" << std::endl;
71 py::class_< MovePlugin,std::unique_ptr<MovePlugin, py::nodelete> > move(m,
"Move");
76 move.def(py::init([plugin]() {
return plugin; }));
79 QCoreApplication::translate(
"PythonDocMove",
"Move all target Meshes cog to the origin").toLatin1().data() );
82 QCoreApplication::translate(
"PythonDocMove",
"Unify bounding box diagonal of all target meshes").toLatin1().data() );
85 QCoreApplication::translate(
"PythonDocMove",
"Scale bounding box of all target meshes such that longest axis has unit size (keeps aspect ratio)").toLatin1().data() );
88 QCoreApplication::translate(
"PythonDocMove",
"Scale bounding box of all target meshes such that all axis have unit size").toLatin1().data() );
91 QCoreApplication::translate(
"PythonDocMove",
"Translate object by given vector.").toLatin1().data(),
92 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
93 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
96 QCoreApplication::translate(
"PythonDocMove",
"Translate vertices of an object by given vector.").toLatin1().data(),
97 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
98 py::arg(QCoreApplication::translate(
"PythonDocMove",
"List of vertex indices to be moved").toLatin1().data()),
99 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
102 QCoreApplication::translate(
"PythonDocMove",
"Translate current vertex selection of an object by given vector.").toLatin1().data(),
103 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
104 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
109 QCoreApplication::translate(
"PythonDocMove",
"Translate current face selection of an object by given vector.").toLatin1().data(),
110 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
111 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
114 QCoreApplication::translate(
"PythonDocMove",
"Translate current edge selection of an object by given vector.").toLatin1().data(),
115 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
116 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
119 QCoreApplication::translate(
"PythonDocMove",
"Transform an object with a 4x4 matrix").toLatin1().data(),
120 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
121 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
124 QCoreApplication::translate(
"PythonDocMove",
"Transform an object with a 4x4 matrix").toLatin1().data(),
125 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
126 py::arg(QCoreApplication::translate(
"PythonDocMove",
"List of vertex handles to move").toLatin1().data()),
127 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
130 QCoreApplication::translate(
"PythonDocMove",
"Transform selected vertices by given matrix.").toLatin1().data(),
131 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
132 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
136 QCoreApplication::translate(
"PythonDocMove",
"Transform selected faces by given matrix.").toLatin1().data(),
137 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
138 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
141 QCoreApplication::translate(
"PythonDocMove",
"Transform selected edges by given matrix.").toLatin1().data(),
142 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
143 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
146 QCoreApplication::translate(
"PythonDocMove",
"Transform selected cells by given matrix.").toLatin1().data(),
147 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
148 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
151 QCoreApplication::translate(
"PythonDocMove",
"Transform handle region by given matrix.").toLatin1().data(),
152 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
153 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Transformation matrix").toLatin1().data()) );
156 QCoreApplication::translate(
"PythonDocMove",
"Set the position of the manipulator.").toLatin1().data(),
157 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
158 py::arg(QCoreApplication::translate(
"PythonDocMove",
"3D position").toLatin1().data()) );
161 QCoreApplication::translate(
"PythonDocMove",
"Get the position of the manipulator.").toLatin1().data(),
162 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()) );
165 QCoreApplication::translate(
"PythonDocMove",
"Set the direction of the manipulator.").toLatin1().data(),
166 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
167 py::arg(QCoreApplication::translate(
"PythonDocMove",
"X-Axis direction").toLatin1().data()),
168 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Y-Axis direction").toLatin1().data()));
171 QCoreApplication::translate(
"PythonDocMove",
"Get the x-direction of an object's manipulator.").toLatin1().data(),
172 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()) );
175 QCoreApplication::translate(
"PythonDocMove",
"Get the y-direction of an object's manipulator.").toLatin1().data(),
176 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()) );
179 QCoreApplication::translate(
"PythonDocMove",
"Get the z-direction of an object's manipulator.").toLatin1().data(),
180 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()) );
183 QCoreApplication::translate(
"PythonDocMove",
"Resets the objects rendering matrix to identity.").toLatin1().data(),
184 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()) );
187 QCoreApplication::translate(
"PythonDocMove",
"Adds a scaling factor to the Object rendering Matrix in the scenegraph.").toLatin1().data(),
188 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
189 py::arg(QCoreApplication::translate(
"PythonDocMove",
"scaling factor").toLatin1().data()) );
192 QCoreApplication::translate(
"PythonDocMove",
"Adds a translation to the Object rendering Matrix in the scenegraph.").toLatin1().data(),
193 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
194 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Translation vector").toLatin1().data()) );
197 QCoreApplication::translate(
"PythonDocMove",
"Adds a rotation to the Object rendering Matrix in the scenegraph.").toLatin1().data(),
198 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()),
199 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Rotation axis").toLatin1().data()),
200 py::arg(QCoreApplication::translate(
"PythonDocMove",
"Rotation angle").toLatin1().data()) );
203 QCoreApplication::translate(
"PythonDocMove",
"Returns the current object transformation matrix from the Scenegraph.").toLatin1().data(),
204 py::arg(QCoreApplication::translate(
"PythonDocMove",
"ID of an object").toLatin1().data()));
void translate(int _objectId, Vector _vector)
translate an Object by a given vector
void translateEdgeSelection(int _objectId, Vector _vector)
translate current edge selection of an Object by a given vector
void slotUnifyBoundingBoxDiagonal()
Scale Boundingbox Diagonal to unit size.
Vector manipulatorDirectionX(int _objectId)
Get the x-direction of the manipulator.
void objectRenderingMatrixRotate(int _objectId, Vector _axis, double _angle)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
void translateVertexSelection(int _objectId, Vector _vector)
translate current vertex selection of an Object by a given vector
void transform(int _objectId, Matrix4x4 _matrix)
transform an Object by a given matrix
Vector manipulatorPosition(int _objectId)
Get the position of the manipulator.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void slotUnifyBoundingBoxLongestAxis()
Scale Boundingbox longest axis to unit size (keeps aspect ratio)
void slotMoveToOrigin()
Move target Meshes cog to the origin.
Vector manipulatorDirectionY(int _objectId)
Get the y-direction of the manipulator.
bool transformVertexSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
void objectRenderingMatrixScale(int _objectId, double _s)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
bool transformCellSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
void setManipulatorDirection(int _objectId, Vector _directionX, Vector _directionY)
Set the direction of the manipulator.
void setManipulatorPosition(int _objectId, Vector _position)
Set the position of the manipulator.
void objectRenderingMatrixTranslate(int _objectId, Vector _translation)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
Vector manipulatorDirectionZ(int _objectId)
Get the z-direction of the manipulator.
bool transformFaceSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
void translateFaceSelection(int _objectId, Vector _vector)
translate current face selection of an Object by a given vector
Matrix4x4 getObjectRenderingMatrix(int _objectId)
Gets the Object Matrix in the scenegraph.
void transformHandleRegion(int _objectId, Matrix4x4 _matrix)
Transform handle region using the given transformation matrix.
void slotUnifyBoundingBoxAllAxis()
Scale all Boundingbox axis to unit size.
void objectRenderingMatrixIdentity(int _objectId)
Sets the Object Matrix in the scenegraph to identity.
bool transformEdgeSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix