50 #include "MovePlugin.hh" 52 #ifdef ENABLE_POLYLINE_SUPPORT 55 #ifdef ENABLE_TSPLINEMESH_SUPPORT 56 #include <ObjectTypes/TSplineMesh/TSplineMesh.hh> 60 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 63 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 66 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 75 emit setSlotDescription(
"translate(int,Vector)",tr(
"Translate object by given vector."),
76 QString(tr(
"objectId,Vector")).split(
","), QString(tr(
"ID of an object, translation vector")).split(
","));
78 emit setSlotDescription(
"translate(int,idList,Vector)",tr(
"Translate vertices by given vector."),
79 QString(tr(
"objectId,VertexHandles,Vector")).split(
","),
80 QString(tr(
"ID of an object, List of vertex handles, translation vector")).split(
","));
82 emit setSlotDescription(
"translateVertexSelection(int,Vector)",tr(
"Translate current vertex selection of an object by given vector."),
83 QString(tr(
"objectId,Vector")).split(
","), QString(tr(
"ID of an object, translation vector")).split(
","));
85 emit setSlotDescription(
"translateFaceSelection(int,Vector)",tr(
"Translate current face selection of an object by given vector."),
86 QString(tr(
"objectId,Vector")).split(
","), QString(tr(
"ID of an object, translation vector")).split(
","));
88 emit setSlotDescription(
"translateEdgeSelection(int,Vector)",tr(
"Translate current edge selection of an object by given vector."),
89 QString(tr(
"objectId,Vector")).split(
","), QString(tr(
"ID of an object, translation vector")).split(
","));
91 emit setSlotDescription(
"transformHandleRegion(int,Matrix4x4)",tr(
"Transform handle region using the specified matrix."),
92 QString(tr(
"objectId,Matrix")).split(
","), QString(tr(
"ID of an object, transformation matrix")).split(
","));
94 emit setSlotDescription(
"transform(int,Matrix4x4)",tr(
"transform object by given matrix."),
95 QString(tr(
"objectId,Matrix")).split(
","), QString(tr(
"ID of an object, transformation matrix")).split(
","));
97 emit setSlotDescription(
"transform(int,IdList,Matrix4x4)",tr(
"transform vertices by given matrix."),
98 QString(tr(
"objectId,VertexHandles,Matrix")).split(
","),
99 QString(tr(
"ID of an object, List of vertex handles, transformation matrix")).split(
","));
101 emit setSlotDescription(
"transformSelection(int,Matrix4x4)",tr(
"transform current selection of an object by given matrix."),
102 QString(tr(
"objectId,Matrix")).split(
","), QString(tr(
"ID of an object, transformation matrix")).split(
","));
104 emit setSlotDescription(
"transformCellSelection(int,Matrix4x4)",tr(
"transform selected cells by given matrix."),
105 QString(tr(
"objectId,Matrix")).split(
","),
106 QString(tr(
"ID of an object, transformation matrix")).split(
","));
108 emit setSlotDescription(
"transformVertexSelection(int,Matrix4x4)",tr(
"transform selected vertices by given matrix."),
109 QString(tr(
"objectId,Matrix")).split(
","),
110 QString(tr(
"ID of an object, transformation matrix")).split(
","));
112 emit setSlotDescription(
"transformFaceSelection(int,Matrix4x4)",tr(
"transform selected faces by given matrix."),
113 QString(tr(
"objectId,Matrix")).split(
","),
114 QString(tr(
"ID of an object, transformation matrix")).split(
","));
116 emit setSlotDescription(
"transformEdgeSelection(int,Matrix4x4)",tr(
"transform selected edges by given matrix."),
117 QString(tr(
"objectId,Matrix")).split(
","),
118 QString(tr(
"ID of an object, transformation matrix")).split(
","));
120 emit setSlotDescription(
"setManipulatorPosition(int,Vector)",tr(
"Set the position of the manipulator."),
121 QString(tr(
"objectId,Position")).split(
","), QString(tr(
"ID of an object, 3D point")).split(
","));
123 emit setSlotDescription(
"setManipulatorDirection(int,Vector, Vector)",tr(
"Set the direction of the manipulator."),
124 QString(tr(
"objectId,Direction, Direction")).split(
","), QString(tr(
"ID of an object, x-direction, y-direction")).split(
","));
126 emit setSlotDescription(
"manipulatorPosition(int)",tr(
"Returns the position of an object's manipulator."),
127 QStringList(tr(
"objectId")), QStringList(tr(
"ID of an object")));
129 emit setSlotDescription(
"manipulatorDirectionX(int)",tr(
"Returns the x-direction of an object's manipulator."),
130 QStringList(tr(
"objectId")), QStringList(tr(
"ID of an object")));
132 emit setSlotDescription(
"manipulatorDirectionY(int)",tr(
"Returns the y-direction of an object's manipulator."),
133 QStringList(tr(
"objectId")), QStringList(tr(
"ID of an object")));
135 emit setSlotDescription(
"manipulatorDirectionZ(int)",tr(
"Returns the z-direction of an object's manipulator."),
136 QStringList(tr(
"objectId")), QStringList(tr(
"ID of an object")));
139 emit setSlotDescription(
"objectRenderingMatrixIdentity(int)",tr(
"Resets the objects rendering matrix to identity."),
140 QStringList(tr(
"objectId")), QStringList(tr(
"ID of an object")));
143 emit setSlotDescription(
"objectRenderingMatrixScale(int,double)",tr(
"Adds a scaling factor to the Object rendering Matrix in the scenegraph."),
144 QStringList(tr(
"objectId;Scaling Factor").split(
";")), QStringList(tr(
"ID of an object; Scaling factor").split(
";")));
146 emit setSlotDescription(
"objectRenderingMatrixTranslate(int,Vector)",tr(
"Adds a translation to the Object rendering Matrix in the scenegraph."),
147 QStringList(tr(
"objectId;translation vector").split(
";")), QStringList(tr(
"ID of an object;Translation vector").split(
";")));
149 emit setSlotDescription(
"objectRenderingMatrixRotate(int,Vector,double)",tr(
"Adds a Rotation to the Object rendering Matrix in the scenegraph."),
150 QStringList(tr(
"objectId;rotation axis;angle").split(
";")), QStringList(tr(
"ID of an object;Rotation axis;angle").split(
";")));
152 emit setSlotDescription(
"getObjectRenderingMatrix(int)",tr(
"Returns the current object transformation matrix from the scenegraph."),
153 QStringList(tr(
"objectId").split(
";")), QStringList(tr(
"ID of an object").split(
";")));
170 emit log(
LOGERR,tr(
"translate : unable to get object") );
177 TriMesh::VertexIter v_it = mesh.vertices_begin();
178 TriMesh::VertexIter v_end = mesh.vertices_end();
179 for (; v_it!=v_end; ++v_it)
180 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
185 PolyMesh::VertexIter v_it = mesh.vertices_begin();
186 PolyMesh::VertexIter v_end = mesh.vertices_end();
187 for (; v_it!=v_end; ++v_it)
188 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
191 #ifdef ENABLE_TSPLINEMESH_SUPPORT 192 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
194 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
195 TSplineMesh::VertexIter v_it = mesh.vertices_begin();
196 TSplineMesh::VertexIter v_end = mesh.vertices_end();
197 for (; v_it!=v_end; ++v_it)
198 mesh.set_point(v_it,mesh.point(v_it) + _vector );
202 #ifdef ENABLE_POLYLINE_SUPPORT 207 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
211 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 217 for (; v_it != v_end; ++v_it)
221 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 222 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
224 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
227 for (; v_it != v_end; ++v_it)
228 mesh.set_vertex(*v_it, mesh.vertex(*v_it) + _vector );
231 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 237 for (; v_it != v_end; ++v_it)
241 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 243 std::cerr <<
"Todo : translate BSplineCurve" << std::endl;
249 emit scriptInfo(
"translate( ObjectId , Vector(" +
250 QString::number( _vector[0] ) +
" , " +
251 QString::number( _vector[1] ) +
" , " +
252 QString::number( _vector[2] ) +
" ) )" );
267 emit log(
LOGERR,tr(
"translate : unable to get object") );
275 for (uint i=0; i < _vHandles.size(); i++){
277 mesh.set_point(vh ,mesh.point( vh ) + _vector );
284 for (uint i=0; i < _vHandles.size(); i++){
286 mesh.set_point(vh ,mesh.point( vh ) + _vector );
289 #ifdef ENABLE_TSPLINEMESH_SUPPORT 290 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
292 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
294 for (uint i=0; i < _vHandles.size(); i++){
295 TSplineMesh::VertexHandle vh( _vHandles[i] );
296 mesh.set_point(vh ,mesh.point( vh ) + _vector );
300 #ifdef ENABLE_POLYLINE_SUPPORT 307 for (
unsigned int i = 0 ; i < _vHandles.size(); ++i )
308 if ( (_vHandles[i] > 0) && ( _vHandles[i] < max ) )
309 line.
point( _vHandles[i] ) = line.
point( _vHandles[i] ) + _vector;
312 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 316 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
322 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 323 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
325 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
326 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
328 mesh.set_vertex(v, mesh.vertex(v) + _vector );
332 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 336 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
342 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 344 std::cerr <<
"Todo : translate BSplineCurve" << std::endl;
350 emit scriptInfo(
"translate( ObjectId , Vector(" +
351 QString::number( _vector[0] ) +
" , " +
352 QString::number( _vector[1] ) +
" , " +
353 QString::number( _vector[2] ) +
" ) )" );
369 emit log(
LOGERR,tr(
"translate : unable to get object" ));
373 bool noneSelected =
true;
378 TriMesh::VertexIter v_it = mesh.vertices_begin();
379 TriMesh::VertexIter v_end = mesh.vertices_end();
380 for (; v_it!=v_end; ++v_it)
381 if ( mesh.status(*v_it).selected() ) {
382 noneSelected =
false;
383 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
389 PolyMesh::VertexIter v_it = mesh.vertices_begin();
390 PolyMesh::VertexIter v_end = mesh.vertices_end();
391 for (; v_it!=v_end; ++v_it)
392 if ( mesh.status(*v_it).selected() ) {
393 noneSelected =
false;
394 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
397 #ifdef ENABLE_TSPLINEMESH_SUPPORT 398 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
400 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
401 TSplineMesh::VertexIter v_it = mesh.vertices_begin();
402 TSplineMesh::VertexIter v_end = mesh.vertices_end();
403 for (; v_it!=v_end; ++v_it)
404 if ( mesh.status(v_it).selected() ) {
405 noneSelected =
false;
406 mesh.set_point(v_it,mesh.point(v_it) + _vector );
410 #ifdef ENABLE_POLYLINE_SUPPORT 415 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
416 if ( line.vertex_selection(i) ) {
417 noneSelected =
false;
422 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 429 for (; v_it != v_end; ++v_it)
430 if (statusAttrib[*v_it].selected()) {
431 noneSelected =
false;
436 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 437 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
439 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
443 for (; v_it != v_end; ++v_it)
444 if (statusAttrib[*v_it].selected()) {
445 noneSelected =
false;
446 mesh.set_vertex(*v_it, mesh.vertex(*v_it) + _vector );
450 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 457 for (; v_it != v_end; ++v_it)
458 if (statusAttrib[*v_it].selected()) {
459 noneSelected =
false;
464 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 466 std::cerr <<
"Todo : translate BSplineCurve" << std::endl;
475 emit scriptInfo(
"translate( ObjectId , Vector(" +
476 QString::number( _vector[0] ) +
" , " +
477 QString::number( _vector[1] ) +
" , " +
478 QString::number( _vector[2] ) +
" ) )" );
493 emit log(
LOGERR,tr(
"translate : unable to get object" ));
497 bool noneSelected =
true;
504 TriMesh::VertexIter v_it, v_end( mesh.vertices_end() );
505 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
506 mesh.status(*v_it).set_tagged(
false);
508 TriMesh::FaceIter f_it = mesh.faces_begin();
509 TriMesh::FaceIter f_end = mesh.faces_end();
510 for (; f_it!=f_end; ++f_it)
511 if ( mesh.status(*f_it).selected() )
513 for(TriMesh::FVIter fv_it = mesh.fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
514 noneSelected =
false;
515 mesh.status(*fv_it).set_tagged(
true);
522 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
523 if ( mesh.status(*v_it).tagged() )
524 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
531 PolyMesh::VertexIter v_it, v_end( mesh.vertices_end() );
532 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
533 mesh.status(*v_it).set_tagged(
false);
535 PolyMesh::FaceIter f_it = mesh.faces_begin();
536 PolyMesh::FaceIter f_end = mesh.faces_end();
537 for (; f_it!=f_end; ++f_it)
538 if ( mesh.status(*f_it).selected() )
540 for(TriMesh::FVIter fv_it = mesh.fv_iter(*f_it); fv_it.is_valid(); ++fv_it) {
541 noneSelected =
false;
542 mesh.status(*fv_it).set_tagged(
true);
549 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
550 if ( mesh.status(*v_it).tagged() )
551 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
553 #ifdef ENABLE_TSPLINEMESH_SUPPORT 554 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
556 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
559 TSplineMesh::VertexIter v_it, v_end( mesh.vertices_end() );
560 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
561 mesh.status(*v_it).set_tagged(
false);
563 TSplineMesh::FaceIter f_it = mesh.faces_begin();
564 TSplineMesh::FaceIter f_end = mesh.faces_end();
565 for (; f_it!=f_end; ++f_it)
566 if ( mesh.status(f_it).selected() )
568 for(TriMesh::FVIter fv_it = mesh.fv_iter(f_it); fv_it; ++fv_it) {
569 noneSelected =
false;
570 mesh.status(fv_it).set_tagged(
true);
577 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
578 if ( mesh.status(v_it).tagged() )
579 mesh.set_point(v_it,mesh.point(v_it) + _vector );
583 #ifdef ENABLE_POLYLINE_SUPPORT 588 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
589 if ( line.vertex_selection(i) ) {
590 noneSelected =
false;
598 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 600 std::cerr <<
"Todo : translate BSplineCurve" << std::endl;
606 emit scriptInfo(
"translate( ObjectId , Vector(" +
607 QString::number( _vector[0] ) +
" , " +
608 QString::number( _vector[1] ) +
" , " +
609 QString::number( _vector[2] ) +
" ) )" );
625 emit log(
LOGERR,tr(
"translate : unable to get object" ));
629 bool noneSelected =
true;
636 TriMesh::VertexIter v_it, v_end( mesh.vertices_end() );
637 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
638 mesh.status(*v_it).set_tagged(
false);
640 TriMesh::EdgeIter e_it = mesh.edges_begin();
641 TriMesh::EdgeIter e_end = mesh.edges_end();
642 for (; e_it!=e_end; ++e_it)
643 if ( mesh.status(*e_it).selected() )
645 noneSelected =
false;
646 TriMesh::HalfedgeHandle hh = mesh.halfedge_handle( *e_it, 0 );
648 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
649 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
655 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
656 if ( mesh.status(*v_it).tagged() ){
657 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
665 PolyMesh::VertexIter v_it, v_end( mesh.vertices_end() );
666 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
667 mesh.status(*v_it).set_tagged(
false);
669 PolyMesh::EdgeIter e_it = mesh.edges_begin();
670 PolyMesh::EdgeIter e_end = mesh.edges_end();
671 for (; e_it!=e_end; ++e_it)
672 if ( mesh.status(*e_it).selected() )
674 noneSelected =
false;
675 PolyMesh::HalfedgeHandle hh = mesh.halfedge_handle( *e_it, 0 );
677 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
678 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
684 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
685 if ( mesh.status(*v_it).tagged() ){
686 mesh.set_point(*v_it,mesh.point(*v_it) + _vector );
689 #ifdef ENABLE_TSPLINEMESH_SUPPORT 690 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
692 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
695 TSplineMesh::VertexIter v_it, v_end( mesh.vertices_end() );
696 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
697 mesh.status(v_it).set_tagged(
false);
699 TSplineMesh::EdgeIter e_it = mesh.edges_begin();
700 TSplineMesh::EdgeIter e_end = mesh.edges_end();
701 for (; e_it!=e_end; ++e_it)
702 if ( mesh.status(e_it).selected() )
704 noneSelected =
false;
705 PolyMesh::HalfedgeHandle hh = mesh.halfedge_handle( e_it, 0 );
707 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
708 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
714 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
715 if ( mesh.status(v_it).tagged() ){
716 mesh.set_point(v_it,mesh.point(v_it) + _vector );
721 #ifdef ENABLE_POLYLINE_SUPPORT 726 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
727 if ( line.vertex_selection(i) ) {
728 noneSelected =
false;
736 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 738 std::cerr <<
"Todo : translate BSplineCurve" << std::endl;
744 emit scriptInfo(
"translate( ObjectId , Vector(" +
745 QString::number( _vector[0] ) +
" , " +
746 QString::number( _vector[1] ) +
" , " +
747 QString::number( _vector[2] ) +
" ) )" );
756 emit log(
LOGERR, tr(
"transformHandleRegion: Unable to get object!"));
787 emit log(
LOGERR,tr(
"transform : unable to get object" ));
798 TriMesh::VertexIter v_it = mesh.vertices_begin();
799 TriMesh::VertexIter v_end = mesh.vertices_end();
800 for (; v_it!=v_end; ++v_it){
801 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
802 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
808 PolyMesh::VertexIter v_it = mesh.vertices_begin();
809 PolyMesh::VertexIter v_end = mesh.vertices_end();
810 for (; v_it!=v_end; ++v_it){
811 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
812 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
815 #ifdef ENABLE_TSPLINEMESH_SUPPORT 816 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
818 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
819 TSplineMesh::VertexIter v_it = mesh.vertices_begin();
820 TSplineMesh::VertexIter v_end = mesh.vertices_end();
821 for (; v_it!=v_end; ++v_it){
827 #ifdef ENABLE_POLYLINE_SUPPORT 832 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
836 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 843 for (; v_it != v_end; ++v_it) {
849 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 850 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
852 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
856 for (; v_it != v_end; ++v_it) {
857 mesh.set_vertex(*v_it, _matrix.
transform_point ( mesh.vertex(*v_it) ) );
862 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 869 for (; v_it != v_end; ++v_it) {
875 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 877 std::cerr <<
"Todo : transform BSplineCurve" << std::endl;
884 for (
int i=0; i < 4; i++)
885 for (
int j=0; j < 4; j++)
886 matString +=
" , " + QString::number( _matrix(i,j) );
888 matString = matString.right( matString.length()-3 );
890 emit scriptInfo(
"transform( ObjectId , Matrix4x4(" + matString +
" ) )" );
906 emit log(
LOGERR,tr(
"transform : unable to get object" ));
918 for (uint i=0; i < _vHandles.size(); i++){
928 for (uint i=0; i < _vHandles.size(); i++){
934 #ifdef ENABLE_TSPLINEMESH_SUPPORT 935 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
937 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
939 for (uint i=0; i < _vHandles.size(); i++){
940 TSplineMesh::VertexHandle vh( _vHandles[i] );
946 #ifdef ENABLE_POLYLINE_SUPPORT 953 for (
unsigned int i = 0 ; i < _vHandles.size(); ++i )
954 if ( (_vHandles[i] > 0) && ( _vHandles[i] < max ) )
959 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 964 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
971 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 972 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
974 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
976 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
983 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 988 for (
unsigned int i = 0; i < _vHandles.size(); ++i) {
995 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 997 std::cerr <<
"Todo : transform BSplineCurve" << std::endl;
1004 for (
int i=0; i < 4; i++)
1005 for (
int j=0; j < 4; j++)
1006 matString +=
" , " + QString::number( _matrix(i,j) );
1008 matString = matString.right( matString.length()-3 );
1010 emit scriptInfo(
"transform( ObjectId , Matrix4x4(" + matString +
" ) )" );
1027 emit log(
LOGERR,tr(
"transform : unable to get object") );
1035 bool noneSelected =
true;
1039 TriMesh::VertexIter v_it = mesh.vertices_begin();
1040 TriMesh::VertexIter v_end = mesh.vertices_end();
1041 for (; v_it!=v_end; ++v_it)
1042 if ( mesh.status(*v_it).selected() )
1044 noneSelected =
false;
1045 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1046 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1052 PolyMesh::VertexIter v_it = mesh.vertices_begin();
1053 PolyMesh::VertexIter v_end = mesh.vertices_end();
1054 for (; v_it!=v_end; ++v_it)
1055 if ( mesh.status(*v_it).selected() )
1057 noneSelected =
false;
1058 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1059 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1062 #ifdef ENABLE_TSPLINEMESH_SUPPORT 1063 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
1065 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
1066 TSplineMesh::VertexIter v_it = mesh.vertices_begin();
1067 TSplineMesh::VertexIter v_end = mesh.vertices_end();
1068 for (; v_it!=v_end; ++v_it)
1069 if ( mesh.status(v_it).selected() )
1071 noneSelected =
false;
1073 mesh.set_normal(v_it, normalMatrix.
transform_vector( mesh.normal(v_it) ) );
1077 #ifdef ENABLE_POLYLINE_SUPPORT 1082 for (
int i = 0 ; i < (int)line.
n_vertices(); ++i )
1083 if ( line.vertex_selection(i) ) {
1084 noneSelected =
false;
1089 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 1091 std::cerr <<
"Todo : transform BSplineCurve" << std::endl;
1094 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 1101 for (; v_it!=v_end; ++v_it)
1102 if ( statusAttrib[*v_it].selected() )
1104 noneSelected =
false;
1106 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1110 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 1111 else if ( object->
dataType(DATA_TETRAHEDRAL_MESH) ) {
1112 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
1117 for (; v_it!=v_end; ++v_it)
1118 if ( statusAttrib[*v_it].selected() )
1120 noneSelected =
false;
1121 mesh.set_vertex(*v_it, _matrix.
transform_point ( mesh.vertex(*v_it) ) );
1122 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1126 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 1133 for (; v_it!=v_end; ++v_it)
1134 if ( statusAttrib[*v_it].selected() )
1136 noneSelected =
false;
1138 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1149 for (
int i=0; i < 4; i++)
1150 for (
int j=0; j < 4; j++)
1151 matString +=
" , " + QString::number( _matrix(i,j) );
1153 matString = matString.right( matString.length()-3 );
1155 emit scriptInfo(
"transformVertexSelection( ObjectId , Matrix4x4(" + matString +
" ) )" );
1173 emit log(
LOGERR,tr(
"transform : unable to get object") );
1181 bool noneSelected =
true;
1187 TriMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1188 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1189 mesh.status(*v_it).set_tagged(
false);
1191 TriMesh::FaceIter f_it = mesh.faces_begin();
1192 TriMesh::FaceIter f_end = mesh.faces_end();
1193 for (; f_it!=f_end; ++f_it)
1194 if ( mesh.status(*f_it).selected() )
1196 noneSelected =
false;
1197 for(TriMesh::FVIter fv_it = mesh.fv_iter(*f_it); fv_it.is_valid(); ++fv_it)
1198 mesh.status(*fv_it).set_tagged(
true);
1201 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1202 if ( mesh.status(*v_it).tagged() ){
1203 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1204 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1212 PolyMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1213 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1214 mesh.status(*v_it).set_tagged(
false);
1216 PolyMesh::FaceIter f_it = mesh.faces_begin();
1217 PolyMesh::FaceIter f_end = mesh.faces_end();
1218 for (; f_it!=f_end; ++f_it)
1219 if ( mesh.status(*f_it).selected() )
1221 noneSelected =
false;
1222 for(PolyMesh::FVIter fv_it = mesh.fv_iter(*f_it); fv_it.is_valid(); ++fv_it)
1223 mesh.status(*fv_it).set_tagged(
true);
1226 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1227 if ( mesh.status(*v_it).tagged() ){
1228 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1229 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1232 #ifdef ENABLE_TSPLINEMESH_SUPPORT 1233 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
1235 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
1238 TSplineMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1239 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1240 mesh.status(v_it).set_tagged(
false);
1242 TSplineMesh::FaceIter f_it = mesh.faces_begin();
1243 TSplineMesh::FaceIter f_end = mesh.faces_end();
1244 for (; f_it!=f_end; ++f_it)
1245 if ( mesh.status(f_it).selected() )
1247 noneSelected =
false;
1248 for(TSplineMesh::FVIter fv_it = mesh.fv_iter(f_it); fv_it; ++fv_it)
1249 mesh.status(fv_it).set_tagged(
true);
1252 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1253 if ( mesh.status(v_it).tagged() ){
1255 mesh.set_normal(v_it, normalMatrix.
transform_vector( mesh.normal(v_it) ) );
1259 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 1270 statusAttrib[*v_it].set_tagged(
false);
1274 for (; f_it!=f_end; ++f_it)
1275 if ( statusAttrib[*f_it].selected() )
1277 noneSelected =
false;
1279 statusAttrib[*hfv_it].set_tagged(
true);
1283 if ( statusAttrib[*v_it].tagged() )
1286 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1291 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 1292 if ( object->
dataType( DATA_TETRAHEDRAL_MESH ) ) {
1294 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
1302 statusAttrib[*v_it].set_tagged(
false);
1306 for (; f_it!=f_end; ++f_it)
1307 if ( statusAttrib[*f_it].selected() )
1309 noneSelected =
false;
1311 statusAttrib[*hfv_it].set_tagged(
true);
1315 if ( statusAttrib[*v_it].tagged() )
1317 mesh.set_vertex(*v_it, _matrix.
transform_point ( mesh.vertex(*v_it) ) );
1318 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1323 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 1334 statusAttrib[*v_it].set_tagged(
false);
1338 for (; f_it!=f_end; ++f_it)
1339 if ( statusAttrib[*f_it].selected() )
1341 noneSelected =
false;
1343 statusAttrib[*hfv_it].set_tagged(
true);
1347 if ( statusAttrib[*v_it].tagged() )
1350 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1361 for (
int i=0; i < 4; i++)
1362 for (
int j=0; j < 4; j++)
1363 matString +=
" , " + QString::number( _matrix(i,j) );
1365 matString = matString.right( matString.length()-3 );
1367 emit scriptInfo(
"transformFaceSelection( ObjectId , Matrix4x4(" + matString +
" ) )" );
1385 emit log(
LOGERR,tr(
"transform : unable to get object" ) );
1393 bool noneSelected =
true;
1399 TriMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1400 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1401 mesh.status(*v_it).set_tagged(
false);
1403 TriMesh::EdgeIter e_it = mesh.edges_begin();
1404 TriMesh::EdgeIter e_end = mesh.edges_end();
1405 for (; e_it!=e_end; ++e_it)
1406 if ( mesh.status(*e_it).selected() )
1408 noneSelected =
false;
1409 TriMesh::HalfedgeHandle hh = mesh.halfedge_handle( *e_it, 0 );
1411 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
1412 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
1415 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1416 if ( mesh.status(*v_it).tagged() ){
1417 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1418 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1426 PolyMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1427 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1428 mesh.status(*v_it).set_tagged(
false);
1430 PolyMesh::EdgeIter e_it = mesh.edges_begin();
1431 PolyMesh::EdgeIter e_end = mesh.edges_end();
1432 for (; e_it!=e_end; ++e_it)
1433 if ( mesh.status(*e_it).selected() )
1435 noneSelected =
false;
1436 PolyMesh::HalfedgeHandle hh = mesh.halfedge_handle( *e_it, 0 );
1438 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
1439 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
1442 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1443 if ( mesh.status(*v_it).tagged() ){
1444 mesh.set_point (*v_it, _matrix.
transform_point ( mesh.point(*v_it) ) );
1445 mesh.set_normal(*v_it, normalMatrix.
transform_vector( mesh.normal(*v_it) ) );
1448 #ifdef ENABLE_TSPLINEMESH_SUPPORT 1449 else if ( object->
dataType( DATA_TSPLINE_MESH ) ) {
1451 TSplineMesh& mesh = (*PluginFunctions::tsplineMesh(
object));
1454 TSplineMesh::VertexIter v_it, v_end( mesh.vertices_end() );
1455 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1456 mesh.status(v_it).set_tagged(
false);
1458 TSplineMesh::EdgeIter e_it = mesh.edges_begin();
1459 TSplineMesh::EdgeIter e_end = mesh.edges_end();
1460 for (; e_it!=e_end; ++e_it)
1461 if ( mesh.status(e_it).selected() )
1463 noneSelected =
false;
1464 TSplineMesh::HalfedgeHandle hh = mesh.halfedge_handle( e_it, 0 );
1466 mesh.status( mesh.from_vertex_handle( hh ) ).set_tagged(
true);
1467 mesh.status( mesh.to_vertex_handle( hh ) ).set_tagged(
true);
1470 for (v_it=mesh.vertices_begin(); v_it!=v_end; ++v_it)
1471 if ( mesh.status(v_it).tagged() ){
1473 mesh.set_normal(v_it, normalMatrix.
transform_vector( mesh.normal(v_it) ) );
1477 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 1488 statusAttrib[*v_it].set_tagged(
false);
1492 for (; e_it!=e_end; ++e_it)
1493 if ( statusAttrib[*e_it].selected() )
1495 noneSelected =
false;
1497 statusAttrib[e.from_vertex()].set_tagged(
true);
1498 statusAttrib[e.to_vertex()].set_tagged(
true);
1502 if ( statusAttrib[*v_it].tagged() )
1505 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1510 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 1511 if ( object->
dataType( DATA_TETRAHEDRAL_MESH ) ) {
1513 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
1521 statusAttrib[*v_it].set_tagged(
false);
1525 for (; e_it!=e_end; ++e_it)
1526 if ( statusAttrib[*e_it].selected() )
1528 noneSelected =
false;
1530 statusAttrib[e.from_vertex()].set_tagged(
true);
1531 statusAttrib[e.to_vertex()].set_tagged(
true);
1535 if ( statusAttrib[*v_it].tagged() )
1537 mesh.set_vertex(*v_it, _matrix.
transform_point ( mesh.vertex(*v_it) ) );
1538 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1543 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 1554 statusAttrib[*v_it].set_tagged(
false);
1558 for (; e_it!=e_end; ++e_it)
1559 if ( statusAttrib[*e_it].selected() )
1561 noneSelected =
false;
1563 statusAttrib[e.from_vertex()].set_tagged(
true);
1564 statusAttrib[e.to_vertex()].set_tagged(
true);
1568 if ( statusAttrib[*v_it].tagged() )
1571 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1577 #ifdef ENABLE_POLYLINE_SUPPORT 1579 std::cerr <<
"Todo : transform PolyLine" << std::endl;
1582 #ifdef ENABLE_BSPLINE_CURVE_SUPPORT 1584 std::cerr <<
"Todo : transform BSplineCurve" << std::endl;
1594 for (
int i=0; i < 4; i++)
1595 for (
int j=0; j < 4; j++)
1596 matString +=
" , " + QString::number( _matrix(i,j) );
1598 matString = matString.right( matString.length()-3 );
1600 emit scriptInfo(
"transformEdgeSelection( ObjectId , Matrix4x4(" + matString +
" ) )" );
1617 emit log(
LOGERR,tr(
"transform : unable to get object") );
1625 bool noneSelected =
true;
1627 #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT 1638 statusAttrib[*v_it].set_tagged(
false);
1642 for (; c_it!=c_end; ++c_it)
1643 if ( statusAttrib[*c_it].selected() )
1645 noneSelected =
false;
1647 statusAttrib[*cv_it].set_tagged(
true);
1651 if ( statusAttrib[*v_it].tagged() )
1654 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1659 #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT 1660 if ( object->
dataType( DATA_TETRAHEDRAL_MESH ) ) {
1662 TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(
object));
1670 statusAttrib[*v_it].set_tagged(
false);
1674 for (; c_it!=c_end; ++c_it)
1675 if ( statusAttrib[*c_it].selected() )
1677 noneSelected =
false;
1679 statusAttrib[*cv_it].set_tagged(
true);
1683 if ( statusAttrib[*v_it].tagged() )
1685 mesh.set_vertex(*v_it, _matrix.
transform_point ( mesh.vertex(*v_it) ) );
1686 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1691 #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT 1702 statusAttrib[*v_it].set_tagged(
false);
1706 for (; c_it!=c_end; ++c_it)
1707 if ( statusAttrib[*c_it].selected() )
1709 noneSelected =
false;
1711 statusAttrib[*cv_it].set_tagged(
true);
1715 if ( statusAttrib[*v_it].tagged() )
1718 normalAttrib[*v_it] = normalMatrix.
transform_vector( normalAttrib[*v_it] );
1729 for (
int i=0; i < 4; i++)
1730 for (
int j=0; j < 4; j++)
1731 matString +=
" , " + QString::number( _matrix(i,j) );
1733 matString = matString.right( matString.length()-3 );
1735 emit scriptInfo(
"transformCellSelection( ObjectId , Matrix4x4(" + matString +
" ) )" );
1752 emit log(
LOGERR,tr(
"setManipulatorPosition : unable to get object") );
1760 object->manipPlaced(
true );
1762 object->manipulatorNode()->loadIdentity();
1763 object->manipulatorNode()->set_center(_position);
1764 object->manipulatorNode()->set_draw_cylinder(
true);
1766 object->manipulatorNode()->show();
1778 emit scriptInfo(
"setManipulatorPosition( ObjectId , Vector(" +
1779 QString::number( _position[0] ) +
" , " +
1780 QString::number( _position[1] ) +
" , " +
1781 QString::number( _position[2] ) +
" ) )" );
1796 emit log(
LOGERR,tr(
"manipulatorPosition : unable to get object" ));
1800 return (
Vector)
object->manipulatorNode()->center();
1816 emit log(
LOGERR,tr(
"setManipulatorDirection : unable to get object") );
1821 emit log(
LOGERR,tr(
"setManipulatorDirection : manipulator position has to be set first" ));
1825 object->manipulatorNode()->set_direction(_directionX, _directionY);
1827 emit scriptInfo(
"setManipulatorDirection( ObjectId , Vector(" +
1828 QString::number( _directionX[0] ) +
" , " +
1829 QString::number( _directionX[1] ) +
" , " +
1830 QString::number( _directionX[2] ) +
" ), Vector(" +
1831 QString::number( _directionY[0] ) +
" , " +
1832 QString::number( _directionY[1] ) +
" , " +
1833 QString::number( _directionY[2] ) +
" ) )" );
1848 emit log(
LOGERR,tr(
"manipulatorDirection : unable to get object" ));
1852 return (
Vector)
object->manipulatorNode()->directionX();
1867 emit log(
LOGERR,tr(
"manipulatorDirection : unable to get object" ));
1871 return (
Vector)
object->manipulatorNode()->directionY();
1886 emit log(
LOGERR,tr(
"manipulatorDirection : unable to get object" ));
1890 return (
Vector)
object->manipulatorNode()->directionZ();
1899 emit log(
LOGERR,tr(
"objectRenderingMatrixIdentity : unable to get object" ));
1903 object->manipulatorNode()->loadIdentity();
1914 emit log(
LOGERR,tr(
"objectRenderingMatrixScale : unable to get object" ));
1918 object->manipulatorNode()->scale(_s);
1929 emit log(
LOGERR,tr(
"objectRenderingMatrixTranslate : unable to get object" ));
1933 object->manipulatorNode()->translate(_translation);
1944 emit log(
LOGERR,tr(
"objectRenderingMatrixRotate : unable to get object" ));
1948 object->manipulatorNode()->rotate(_angle,_axis);
1959 emit log(
LOGERR,tr(
"getObjectRenderingMatrix : unable to get object" ));
1963 return object->manipulatorNode()->matrix();
void setDescriptions()
Set Descriptions for scriptable functions.
const VecT & vertex(const VertexHandle &_vh) const
Get point _vh's coordinates.
bool transformEdgeSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
void objectRenderingMatrixRotate(int _objectId, Vector _axis, double _angle)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
void transpose()
transpose matrix
Vector manipulatorPosition(int _objectId)
Get the position of the manipulator.
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
void transformHandleVertices(ACG::Matrix4x4d _matrix, MeshT &_mesh)
bool transformFaceSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
bool getObject(int _identifier, BSplineCurveObject *&_object)
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
bool dataType(DataType _type) const
bool transformVertexSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
void setManipulatorPosition(int _objectId, Vector _position)
Set the position of the manipulator.
#define DATA_POLYHEDRAL_MESH
void translateEdgeSelection(int _objectId, Vector _vector)
translate current edge selection of an Object by a given vector
ACG::Matrix4x4d Matrix4x4
Standard Type for a 4x4 Matrix used for scripting.
double sceneRadius()
Returns the current scene radius from the active examiner widget.
void set_vertex(const VertexHandle &_vh, const VecT &_p)
Set the coordinates of point _vh.
QtTranslationManipulatorNode * manipulatorNode()
void objectRenderingMatrixScale(int _objectId, double _s)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
void translate(int _objectId, Vector _vector)
translate an Object by a given vector
PolyLine * polyLine(BaseObjectData *_object)
Get a poly Line from an object.
bool transformCellSelection(int _objectId, Matrix4x4 _matrix)
transform current selection of an Object by a given matrix
#define DATA_HEXAHEDRAL_MESH
Vector manipulatorDirectionZ(int _objectId)
Get the z-direction of the manipulator.
void manipulatorMoved(QtTranslationManipulatorNode *_node, QMouseEvent *_event)
move the object when its manipulator moves
const UpdateType UPDATE_VISIBILITY(UpdateTypeSet(1)<< 1)
This is the update identifier for global Object visibility ( show/hide )
const UpdateType UPDATE_GEOMETRY(UpdateTypeSet(1)<< 2)
Geometry updated.
Point & point(unsigned int _i)
Get a point of the polyline.
void setManipulatorDirection(int _objectId, Vector _directionX, Vector _directionY)
Set the direction of the manipulator.
void translateVertexSelection(int _objectId, Vector _vector)
translate current vertex selection of an Object by a given vector
void objectRenderingMatrixTranslate(int _objectId, Vector _translation)
Adds a scaling factor to the Object rendering Matrix in the scenegraph.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Matrix4x4 getObjectRenderingMatrix(int _objectId)
Gets the Object Matrix in the scenegraph.
double manip_size_
Size for the manipulators.
void ManipulatorPositionChanged(QtTranslationManipulatorNode *_node)
update object when its manipulator changes position
Vector manipulatorDirectionX(int _objectId)
Get the x-direction of the manipulator.
double manip_size_modifier_
Modifier for the Size (changed by Mousewheel Events)
PolyhedralMesh * polyhedralMesh(BaseObjectData *_object)
Get an PolyhedralMesh from an object.
#define DATA_BSPLINE_CURVE
bool invert()
matrix inversion (returns true on success)
int lastActiveManipulator_
Stores the last manipulator which has been clicked ( used for the toolbox dialog) ...
Functions for modifying a Mesh.
bool manipPlaced()
Check if the manipulator has been placed.
void translateFaceSelection(int _objectId, Vector _vector)
translate current face selection of an Object by a given vector
void transform(int _objectId, Matrix4x4 _matrix)
transform an Object by a given matrix
size_t n_vertices() const
Get number of vertices.
void transformHandleRegion(int _objectId, Matrix4x4 _matrix)
Transform handle region using the given transformation matrix.
#define DATA_TRIANGLE_MESH
Vector manipulatorDirectionY(int _objectId)
Get the y-direction of the manipulator.
HexahedralMesh * hexahedralMesh(BaseObjectData *_object)
Get an HexahedralMesh from an object.
void objectRenderingMatrixIdentity(int _objectId)
Sets the Object Matrix in the scenegraph to identity.
VectorT< T, 3 > transform_vector(const VectorT< T, 3 > &_v) const
transform vector (x',y',z',0) = A * (x,y,z,0)
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.