From d8e8a67726daab2ff4bfd58eba093ceabf098397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 28 Dec 2016 12:26:51 +0100 Subject: [PATCH] Splitted OpenVolumemesh into separate type dir --- CMakeLists.txt | 31 ++---------------- MovePlugin.cc | 76 ++++++++++++++++++++++----------------------- MovePlugin.hh | 34 ++++++++++---------- MovePluginScript.cc | 60 +++++++++++++++++------------------ 4 files changed, 88 insertions(+), 113 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25c3e54..c546ed1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,37 +1,12 @@ include (plugin) -SET( CURRENT_PLUGIN_DEPS "") - if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TSplineMesh) add_definitions (-DENABLE_TSPLINEMESH_SUPPORT) endif () -if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/PolyhedralMesh) - add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT) - add_definitions (-DENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT) - - list( APPEND CURRENT_PLUGIN_DEPS OpenVolumeMesh ) -endif() - -if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/HexahedralMesh) - add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT) - add_definitions (-DENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT) - - list( APPEND CURRENT_PLUGIN_DEPS OpenVolumeMesh ) -endif() - -if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/TetrahedralMesh) - add_definitions (-DENABLE_OPENVOLUMEMESH_SUPPORT) - add_definitions (-DENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT) - - list( APPEND CURRENT_PLUGIN_DEPS OpenVolumeMesh ) -endif() - -list(REMOVE_DUPLICATES CURRENT_PLUGIN_DEPS ) - -openflipper_plugin ( DEPS ${CURRENT_PLUGIN_DEPS} - TYPES PLANE POLYMESH TRIANGLEMESH - OPT_TYPES POLYLINE SKELETON +openflipper_plugin ( TYPES PLANE POLYMESH TRIANGLEMESH + OPTDEPS OpenVolumeMesh + OPT_TYPES POLYLINE SKELETON HEXAHEDRALMESH POLYHEDRALMESH TETRAHEDRALMESH TRANSLATION_LANGUAGES de_DE INSTALLDATA Icons VsiMetadata ) diff --git a/MovePlugin.cc b/MovePlugin.cc index 6f7e3ed..4c41034 100644 --- a/MovePlugin.cc +++ b/MovePlugin.cc @@ -72,15 +72,15 @@ #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT #include #endif @@ -598,17 +598,17 @@ void MovePlugin::moveObject(ACG::Matrix4x4d mat, int _id) { } else if ( object->dataType() == DATA_SKELETON ) { transformSkeleton(mat , *PluginFunctions::skeleton(object) ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT } else if ( object->dataType() == DATA_HEXAHEDRAL_MESH ) { HexahedralMeshObject* obj = PluginFunctions::hexahedralMeshObject(object); transformVolumeMesh(mat , *obj->mesh() , obj->normals() ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT } else if ( object->dataType() == DATA_TETRAHEDRAL_MESH ) { TetrahedralMeshObject* obj = PluginFunctions::tetrahedralMeshObject(object); transformVolumeMesh(mat , *obj->mesh() , obj->normals() ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT } else if ( object->dataType() == DATA_POLYHEDRAL_MESH ) { PolyhedralMeshObject* obj = PluginFunctions::polyhedralMeshObject(object); transformVolumeMesh(mat , *obj->mesh() , obj->normals() ); @@ -1399,15 +1399,15 @@ void MovePlugin::slotMoveManipToCOG() { else if ( object->dataType( DATA_TSPLINE_MESH ) ) object->manipulatorNode()->set_center( MeshInfo::cog(PluginFunctions::tsplineMesh(object)) ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType( DATA_HEXAHEDRAL_MESH ) ) object->manipulatorNode()->set_center( cogVolumeMesh(*PluginFunctions::hexahedralMesh(object)) ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType( DATA_TETRAHEDRAL_MESH ) ) object->manipulatorNode()->set_center( cogVolumeMesh(*PluginFunctions::tetrahedralMesh(object)) ); #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType( DATA_POLYHEDRAL_MESH ) ) object->manipulatorNode()->set_center( cogVolumeMesh(*PluginFunctions::polyhedralMesh(object)) ); #endif @@ -1467,15 +1467,15 @@ void MovePlugin::slotRotate() { if (object->dataType(DATA_TSPLINE_MESH)) transformMesh(m, (*PluginFunctions::tsplineMesh(object))); #endif - #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT + #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if (object->dataType(DATA_HEXAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::hexahedralMesh(object)), (PluginFunctions::hexahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT + #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if (object->dataType(DATA_TETRAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::tetrahedralMesh(object)), (PluginFunctions::tetrahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT + #ifdef ENABLE_POLYHEDRALMESH_SUPPORT if (object->dataType(DATA_POLYHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::polyhedralMesh(object)), (PluginFunctions::polyhedralMeshObject(object)->normals())); #endif @@ -1523,15 +1523,15 @@ void MovePlugin::slotRotate() { if (o_it->dataType(DATA_TSPLINE_MESH)) transformMesh(m, (*PluginFunctions::tsplineMesh(o_it))); #endif - #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT + #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if (object->dataType(DATA_HEXAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::hexahedralMesh(object)), (PluginFunctions::hexahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT + #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if (object->dataType(DATA_TETRAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::tetrahedralMesh(object)), (PluginFunctions::tetrahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT + #ifdef ENABLE_POLYHEDRALMESH_SUPPORT if (object->dataType(DATA_POLYHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::polyhedralMesh(object)), (PluginFunctions::polyhedralMeshObject(object)->normals())); #endif @@ -1619,15 +1619,15 @@ void MovePlugin::slotScale() { if (object->dataType(DATA_TSPLINE_MESH)) transformMesh(m, (*PluginFunctions::tsplineMesh(object))); #endif - #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT + #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if (object->dataType(DATA_HEXAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::hexahedralMesh(object)), (PluginFunctions::hexahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT + #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if (object->dataType(DATA_TETRAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::tetrahedralMesh(object)), (PluginFunctions::tetrahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT + #ifdef ENABLE_POLYHEDRALMESH_SUPPORT if (object->dataType(DATA_POLYHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::polyhedralMesh(object)), (PluginFunctions::polyhedralMeshObject(object)->normals())); #endif @@ -1673,15 +1673,15 @@ void MovePlugin::slotScale() { if (o_it->dataType(DATA_TSPLINE_MESH)) transformMesh(m, (*PluginFunctions::tsplineMesh(o_it))); #endif - #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT + #ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if (object->dataType(DATA_HEXAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::hexahedralMesh(object)), (PluginFunctions::hexahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT + #ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if (object->dataType(DATA_TETRAHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::tetrahedralMesh(object)), (PluginFunctions::tetrahedralMeshObject(object)->normals())); #endif - #ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT + #ifdef ENABLE_POLYHEDRALMESH_SUPPORT if (object->dataType(DATA_POLYHEDRAL_MESH)) transformVolumeMesh(m, (*PluginFunctions::polyhedralMesh(object)), (PluginFunctions::polyhedralMeshObject(object)->normals())); #endif @@ -1772,7 +1772,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_HEXAHEDRAL_MESH )) { HexahedralMesh& mesh = *PluginFunctions::hexahedralMesh(*o_it); cog += cogVolumeMesh(mesh) * double(mesh.n_vertices()); @@ -1780,7 +1780,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_TETRAHEDRAL_MESH )) { TetrahedralMesh& mesh = *PluginFunctions::tetrahedralMesh(*o_it); cog += cogVolumeMesh(mesh) * double(mesh.n_vertices()); @@ -1788,7 +1788,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_POLYHEDRAL_MESH )) { PolyhedralMesh& mesh = *PluginFunctions::polyhedralMesh(*o_it); cog += cogVolumeMesh(mesh) * double(mesh.n_vertices()); @@ -1843,7 +1843,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_HEXAHEDRAL_MESH )) { HexahedralMesh& mesh = *PluginFunctions::hexahedralMesh(*o_it); @@ -1858,7 +1858,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_TETRAHEDRAL_MESH )) { TetrahedralMesh& mesh = *PluginFunctions::tetrahedralMesh(*o_it); @@ -1873,7 +1873,7 @@ void MovePlugin::slotMoveToOrigin() { } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_POLYHEDRAL_MESH )) { PolyhedralMesh& mesh = *PluginFunctions::polyhedralMesh(*o_it); @@ -1966,7 +1966,7 @@ void MovePlugin::unifyBoundingBox(Unificationtype u) } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_HEXAHEDRAL_MESH )) { HexahedralMesh& mesh = *PluginFunctions::hexahedralMesh(*o_it); getBBVolumeMesh(mesh,bb_min_tmp,bb_max_tmp); @@ -1975,7 +1975,7 @@ void MovePlugin::unifyBoundingBox(Unificationtype u) } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_TETRAHEDRAL_MESH )) { TetrahedralMesh& mesh = *PluginFunctions::tetrahedralMesh(*o_it); getBBVolumeMesh(mesh,bb_min_tmp,bb_max_tmp); @@ -1984,7 +1984,7 @@ void MovePlugin::unifyBoundingBox(Unificationtype u) } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT if ( o_it->dataType( DATA_POLYHEDRAL_MESH )) { PolyhedralMesh& mesh = *PluginFunctions::polyhedralMesh(*o_it); getBBVolumeMesh(mesh,bb_min_tmp,bb_max_tmp); @@ -2007,15 +2007,15 @@ void MovePlugin::unifyBoundingBox(Unificationtype u) else if ( o_it->dataType( DATA_TSPLINE_MESH ) ) unifyBB(*PluginFunctions::tsplineMesh(*o_it),bb_min,bb_max, u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_HEXAHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()),bb_min,bb_max, u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_TETRAHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::tetrahedralMesh(*o_it),(PluginFunctions::tetrahedralMeshObject(*o_it)->normals()),bb_min,bb_max, u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_POLYHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()),bb_min,bb_max, u); #endif @@ -2028,15 +2028,15 @@ void MovePlugin::unifyBoundingBox(Unificationtype u) else if ( o_it->dataType( DATA_TSPLINE_MESH ) ) unifyBB(*PluginFunctions::tsplineMesh(*o_it), u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_HEXAHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::hexahedralMesh(*o_it),(PluginFunctions::hexahedralMeshObject(*o_it)->normals()), u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_TETRAHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::tetrahedralMesh(*o_it),(PluginFunctions::tetrahedralMeshObject(*o_it)->normals()), u); #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( o_it->dataType( DATA_POLYHEDRAL_MESH ) ) unifyBBVolumeMesh(*PluginFunctions::polyhedralMesh(*o_it),(PluginFunctions::polyhedralMeshObject(*o_it)->normals()), u); #endif @@ -2292,7 +2292,7 @@ void MovePlugin::transformSkeleton( ACG::Matrix4x4d _mat , Skeleton& _skeleton #endif -#ifdef ENABLE_OPENVOLUMEMESH_SUPPORT +#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) /** \brief Transform a volume mesh with the given transformation matrix * * Note: The normals have to be transformed with the inverse @@ -2593,7 +2593,7 @@ void MovePlugin::updateSelectionType() { } -#ifdef ENABLE_OPENVOLUMEMESH_SUPPORT +#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) bool functionExistsVolumeMeshV; emit functionExists("volumemeshselection", "vertexTypeActive()", functionExistsVolumeMeshV); bool functionExistsVolumeMeshE; diff --git a/MovePlugin.hh b/MovePlugin.hh index 1954b4f..3577f27 100644 --- a/MovePlugin.hh +++ b/MovePlugin.hh @@ -74,7 +74,7 @@ #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_SUPPORT +#if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) #include #endif @@ -356,26 +356,26 @@ public: void transformSkeleton( ACG::Matrix4x4d _mat , Skeleton& _skeleton ); #endif - #ifdef ENABLE_OPENVOLUMEMESH_SUPPORT - /// Transform a volume mesh with the given transformation matrix - template< typename VolumeMeshT > - void transformVolumeMesh(ACG::Matrix4x4d _mat , VolumeMeshT& _mesh , OpenVolumeMesh::NormalAttrib& _normalAttrib ); + #if defined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRALMESH_SUPPORT) + /// Transform a volume mesh with the given transformation matrix + template< typename VolumeMeshT > + void transformVolumeMesh(ACG::Matrix4x4d _mat , VolumeMeshT& _mesh , OpenVolumeMesh::NormalAttrib& _normalAttrib ); - /// Calculate center of gravity of a volume mesh - template< typename VolumeMeshT > - ACG::Vec3d cogVolumeMesh( VolumeMeshT& _mesh ); + /// Calculate center of gravity of a volume mesh + template< typename VolumeMeshT > + ACG::Vec3d cogVolumeMesh( VolumeMeshT& _mesh ); - /// get bounding box diagonal of a volume mesh - template< typename VolumeMeshT > - void getBBVolumeMesh( VolumeMeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max ); + /// get bounding box diagonal of a volume mesh + template< typename VolumeMeshT > + void getBBVolumeMesh( VolumeMeshT& _mesh, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max ); - /// scale volume mesh to have a boundingboxdiagonal of one - template< typename VolumeMeshT > - void unifyBBVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib& _normalAttrib, Unificationtype u = MovePlugin::DIAGONAL); + /// scale volume mesh to have a boundingboxdiagonal of one + template< typename VolumeMeshT > + void unifyBBVolumeMesh(VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib& _normalAttrib, Unificationtype u = MovePlugin::DIAGONAL); - /// Scales volume mesh such that bounding box diagonal has unit length - template< typename VolumeMeshT > - void unifyBBVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max, Unificationtype u = MovePlugin::DIAGONAL ); + /// Scales volume mesh such that bounding box diagonal has unit length + template< typename VolumeMeshT > + void unifyBBVolumeMesh( VolumeMeshT& _mesh, OpenVolumeMesh::NormalAttrib& _normalAttrib, ACG::Vec3d& _bb_min, ACG::Vec3d& _bb_max, Unificationtype u = MovePlugin::DIAGONAL ); #endif /** Get the Matrix of the last active Manipulator ( Identity if not found or hidden Manipulator ) diff --git a/MovePluginScript.cc b/MovePluginScript.cc index c855dc8..79ca32d 100644 --- a/MovePluginScript.cc +++ b/MovePluginScript.cc @@ -57,13 +57,13 @@ #endif #include -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT #include #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT #include #endif @@ -208,7 +208,7 @@ void MovePlugin::translate( int _objectId , Vector _vector) { line.point(i) = line.point(i) + _vector; } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -218,7 +218,7 @@ void MovePlugin::translate( int _objectId , Vector _vector) { mesh.set_vertex(*v_it, mesh.vertex(*v_it) + _vector ); } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -228,7 +228,7 @@ void MovePlugin::translate( int _objectId , Vector _vector) { mesh.set_vertex(*v_it, mesh.vertex(*v_it) + _vector ); } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -309,7 +309,7 @@ void MovePlugin::translate( int _objectId , IdList _vHandles, Vector _vector ){ line.point( _vHandles[i] ) = line.point( _vHandles[i] ) + _vector; } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -319,7 +319,7 @@ void MovePlugin::translate( int _objectId , IdList _vHandles, Vector _vector ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -329,7 +329,7 @@ void MovePlugin::translate( int _objectId , IdList _vHandles, Vector _vector ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -419,7 +419,7 @@ void MovePlugin::translateVertexSelection( int _objectId , Vector _vector) { } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -433,7 +433,7 @@ void MovePlugin::translateVertexSelection( int _objectId , Vector _vector) { } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -447,7 +447,7 @@ void MovePlugin::translateVertexSelection( int _objectId , Vector _vector) { } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -833,7 +833,7 @@ void MovePlugin::transform( int _objectId , Matrix4x4 _matrix ){ line.point(i) = _matrix.transform_point( line.point(i) ); } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -846,7 +846,7 @@ void MovePlugin::transform( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -859,7 +859,7 @@ void MovePlugin::transform( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -956,7 +956,7 @@ void MovePlugin::transform( int _objectId , IdList _vHandles, Matrix4x4 _matrix } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -968,7 +968,7 @@ void MovePlugin::transform( int _objectId , IdList _vHandles, Matrix4x4 _matrix } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -980,7 +980,7 @@ void MovePlugin::transform( int _objectId , IdList _vHandles, Matrix4x4 _matrix } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -1091,7 +1091,7 @@ bool MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){ std::cerr << "Todo : transform BSplineCurve" << std::endl; } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_HEXAHEDRAL_MESH) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); OpenVolumeMesh::NormalAttrib& normalAttrib = ((HexahedralMeshObject*)object)->normals(); @@ -1107,7 +1107,7 @@ bool MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT else if ( object->dataType(DATA_TETRAHEDRAL_MESH) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); OpenVolumeMesh::NormalAttrib& normalAttrib = ((TetrahedralMeshObject*)object)->normals(); @@ -1123,7 +1123,7 @@ bool MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType(DATA_POLYHEDRAL_MESH) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); OpenVolumeMesh::NormalAttrib& normalAttrib = ((PolyhedralMeshObject*)object)->normals(); @@ -1256,7 +1256,7 @@ bool MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( object->dataType( DATA_HEXAHEDRAL_MESH ) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -1288,7 +1288,7 @@ bool MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( object->dataType( DATA_TETRAHEDRAL_MESH ) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -1320,7 +1320,7 @@ bool MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType( DATA_POLYHEDRAL_MESH ) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -1474,7 +1474,7 @@ bool MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){ } } #endif -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( object->dataType( DATA_HEXAHEDRAL_MESH ) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -1507,7 +1507,7 @@ bool MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( object->dataType( DATA_TETRAHEDRAL_MESH ) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -1540,7 +1540,7 @@ bool MovePlugin::transformEdgeSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT if ( object->dataType( DATA_POLYHEDRAL_MESH ) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); @@ -1624,7 +1624,7 @@ bool MovePlugin::transformCellSelection( int _objectId , Matrix4x4 _matrix ){ bool noneSelected = true; -#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT +#ifdef ENABLE_HEXAHEDRALMESH_SUPPORT if ( object->dataType( DATA_HEXAHEDRAL_MESH ) ) { HexahedralMesh& mesh = (*PluginFunctions::hexahedralMesh(object)); @@ -1656,7 +1656,7 @@ bool MovePlugin::transformCellSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_TETRAHEDRAL_SUPPORT +#ifdef ENABLE_TETRAHEDRALMESH_SUPPORT if ( object->dataType( DATA_TETRAHEDRAL_MESH ) ) { TetrahedralMesh& mesh = (*PluginFunctions::tetrahedralMesh(object)); @@ -1688,7 +1688,7 @@ bool MovePlugin::transformCellSelection( int _objectId , Matrix4x4 _matrix ){ } #endif -#ifdef ENABLE_OPENVOLUMEMESH_POLYHEDRAL_SUPPORT +#ifdef ENABLE_POLYHEDRALMESH_SUPPORT else if ( object->dataType( DATA_POLYHEDRAL_MESH ) ) { PolyhedralMesh& mesh = (*PluginFunctions::polyhedralMesh(object)); -- GitLab