Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
Plugin-Move
Commits
d8e8a677
Commit
d8e8a677
authored
Dec 28, 2016
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Splitted OpenVolumemesh into separate type dir
parent
16f80f35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
113 deletions
+88
-113
CMakeLists.txt
CMakeLists.txt
+3
-28
MovePlugin.cc
MovePlugin.cc
+38
-38
MovePlugin.hh
MovePlugin.hh
+17
-17
MovePluginScript.cc
MovePluginScript.cc
+30
-30
No files found.
CMakeLists.txt
View file @
d8e8a677
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
)
...
...
MovePlugin.cc
View file @
d8e8a677
...
...
@@ -72,15 +72,15 @@
#include <ObjectTypes/Skeleton/Helper/SkeletonTransform.hh>
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
HEXAHEDRAL_SUPPORT
#ifdef ENABLE_HEXAHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/HexahedralMesh/HexahedralMesh.hh>
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/TetrahedralMesh/TetrahedralMesh.hh>
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/PolyhedralMesh/PolyhedralMesh.hh>
#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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
)
)
object
->
manipulatorNode
()
->
set_center
(
cogVolumeMesh
(
*
PluginFunctions
::
hexahedralMesh
(
object
))
);
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
)
)
object
->
manipulatorNode
()
->
set_center
(
cogVolumeMesh
(
*
PluginFunctions
::
tetrahedralMesh
(
object
))
);
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
hexahedralMesh
(
object
)),
(
PluginFunctions
::
hexahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
tetrahedralMesh
(
object
)),
(
PluginFunctions
::
tetrahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
hexahedralMesh
(
object
)),
(
PluginFunctions
::
hexahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
tetrahedralMesh
(
object
)),
(
PluginFunctions
::
tetrahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
hexahedralMesh
(
object
)),
(
PluginFunctions
::
hexahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
tetrahedralMesh
(
object
)),
(
PluginFunctions
::
tetrahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
hexahedralMesh
(
object
)),
(
PluginFunctions
::
hexahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
))
transformVolumeMesh
(
m
,
(
*
PluginFunctions
::
tetrahedralMesh
(
object
)),
(
PluginFunctions
::
tetrahedralMeshObject
(
object
)
->
normals
()));
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_OPENVOLUME
MESH_SUPPORT
#if
def
ined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRAL
MESH_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_OPENVOLUME
MESH_SUPPORT
#if
def
ined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRAL
MESH_SUPPORT
)
bool
functionExistsVolumeMeshV
;
emit
functionExists
(
"volumemeshselection"
,
"vertexTypeActive()"
,
functionExistsVolumeMeshV
);
bool
functionExistsVolumeMeshE
;
...
...
MovePlugin.hh
View file @
d8e8a677
...
...
@@ -74,7 +74,7 @@
#include <ObjectTypes/Skeleton/Skeleton.hh>
#endif
#ifdef
ENABLE_OPENVOLUME
MESH_SUPPORT
#if
def
ined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRAL
MESH_SUPPORT
)
#include <OpenVolumeMesh/Attribs/NormalAttrib.hh>
#endif
...
...
@@ -356,26 +356,26 @@ public:
void
transformSkeleton
(
ACG
::
Matrix4x4d
_mat
,
Skeleton
&
_skeleton
);
#endif
#ifdef
ENABLE_OPENVOLUME
MESH_SUPPORT
/// Transform a volume mesh with the given transformation matrix
template
<
typename
VolumeMeshT
>
void
transformVolumeMesh
(
ACG
::
Matrix4x4d
_mat
,
VolumeMeshT
&
_mesh
,
OpenVolumeMesh
::
NormalAttrib
<
VolumeMeshT
>&
_normalAttrib
);
#if
def
ined(ENABLE_HEXAHEDRALMESH_SUPPORT) || defined(ENABLE_POLYHEDRALMESH_SUPPORT) || defined(ENABLE_TETRAHEDRAL
MESH_SUPPORT
)
/// Transform a volume mesh with the given transformation matrix
template
<
typename
VolumeMeshT
>
void
transformVolumeMesh
(
ACG
::
Matrix4x4d
_mat
,
VolumeMeshT
&
_mesh
,
OpenVolumeMesh
::
NormalAttrib
<
VolumeMeshT
>&
_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
<
VolumeMeshT
>&
_normalAttrib
,
Unificationtype
u
=
MovePlugin
::
DIAGONAL
);
/// scale volume mesh to have a boundingboxdiagonal of one
template
<
typename
VolumeMeshT
>
void
unifyBBVolumeMesh
(
VolumeMeshT
&
_mesh
,
OpenVolumeMesh
::
NormalAttrib
<
VolumeMeshT
>&
_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
<
VolumeMeshT
>&
_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
<
VolumeMeshT
>&
_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 )
...
...
MovePluginScript.cc
View file @
d8e8a677
...
...
@@ -57,13 +57,13 @@
#endif
#include <MeshTools/MeshFunctions.hh>
#ifdef ENABLE_
OPENVOLUMEMESH_
HEXAHEDRAL_SUPPORT
#ifdef ENABLE_HEXAHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/HexahedralMesh/HexahedralMesh.hh>
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/TetrahedralMesh/TetrahedralMesh.hh>
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_SUPPORT
#include <ObjectTypes/PolyhedralMesh/PolyhedralMesh.hh>
#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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_HEXAHEDRAL_MESH
)
)
{
HexahedralMesh
&
mesh
=
(
*
PluginFunctions
::
hexahedralMesh
(
object
));
OpenVolumeMesh
::
NormalAttrib
<
HexahedralMesh
>&
normalAttrib
=
((
HexahedralMeshObject
*
)
object
)
->
normals
();
...
...
@@ -1107,7 +1107,7 @@ bool MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){
}
}
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
TETRAHEDRAL_SUPPORT
#ifdef ENABLE_TETRAHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_TETRAHEDRAL_MESH
)
)
{
TetrahedralMesh
&
mesh
=
(
*
PluginFunctions
::
tetrahedralMesh
(
object
));
OpenVolumeMesh
::
NormalAttrib
<
TetrahedralMesh
>&
normalAttrib
=
((
TetrahedralMeshObject
*
)
object
)
->
normals
();
...
...
@@ -1123,7 +1123,7 @@ bool MovePlugin::transformVertexSelection( int _objectId , Matrix4x4 _matrix ){
}
}
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
POLYHEDRAL_SUPPORT
#ifdef ENABLE_POLYHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_POLYHEDRAL_MESH
)
)
{
PolyhedralMesh
&
mesh
=
(
*
PluginFunctions
::
polyhedralMesh
(
object
));
OpenVolumeMesh
::
NormalAttrib
<
PolyhedralMesh
>&
normalAttrib
=
((
PolyhedralMeshObject
*
)
object
)
->
normals
();
...
...
@@ -1256,7 +1256,7 @@ bool MovePlugin::transformFaceSelection( int _objectId , Matrix4x4 _matrix ){
}
}
#endif
#ifdef ENABLE_
OPENVOLUMEMESH_
HEXAHEDRAL_SUPPORT
#ifdef ENABLE_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_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_HEXAHEDRAL
MESH
_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_TETRAHEDRAL
MESH
_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_POLYHEDRAL
MESH
_SUPPORT
else
if
(
object
->
dataType
(
DATA_POLYHEDRAL_MESH
)
)
{
PolyhedralMesh
&
mesh
=
(
*
PluginFunctions
::
polyhedralMesh
(
object
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment