Commit ca61f05c authored by Jan Möbius's avatar Jan Möbius

Support building without Skeleton support


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15312 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cc708608
include (plugin) include (plugin)
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/BSplineCurve)
add_definitions (-DENABLE_SKELETON_SUPPORT)
endif()
openflipper_plugin (INSTALLDATA Icons) openflipper_plugin (INSTALLDATA Icons)
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include <OpenMesh/Core/Utils/Property.hh> #include <OpenMesh/Core/Utils/Property.hh>
#include <ACG/Math/VectorT.hh> #include <ACG/Math/VectorT.hh>
#include <ObjectTypes/Skeleton/BaseSkin.hh>
#include <map> #include <map>
#include <vector> #include <vector>
...@@ -69,8 +68,12 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec ...@@ -69,8 +68,12 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec
PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3d>), "Vec3d"); PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3d>), "Vec3d");
const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec3f = const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec3f =
PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3f>), "Vec3f"); PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3f>), "Vec3f");
const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_SkinWeights =
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/BaseSkin.hh>
const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_SkinWeights =
PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<BaseSkin::SkinWeights>), "SkinWeights"); PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<BaseSkin::SkinWeights>), "SkinWeights");
#endif
/* /*
* I'd love to do this with boost::assign but I'm not allowed to. :-( * I'd love to do this with boost::assign but I'm not allowed to. :-(
...@@ -83,7 +86,9 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::prop_types[] ...@@ -83,7 +86,9 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::prop_types[]
proptype_double, proptype_double,
proptype_Vec3d, proptype_Vec3d,
proptype_Vec3f, proptype_Vec3f,
#ifdef ENABLE_SKELETON_SUPPORT
proptype_SkinWeights, proptype_SkinWeights,
#endif
}; };
const PropertyNameListModel::TYPE_INFO_SET PropertyNameListModel::sane_prop_types(prop_types, prop_types + 7); const PropertyNameListModel::TYPE_INFO_SET PropertyNameListModel::sane_prop_types(prop_types, prop_types + 7);
......
...@@ -219,8 +219,10 @@ void PropertyVisPlugin::propertySelectionChanged() { ...@@ -219,8 +219,10 @@ void PropertyVisPlugin::propertySelectionChanged() {
visibleMask |= T_UINT; visibleMask |= T_UINT;
} else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) { } else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) {
visibleMask |= T_BOOL; visibleMask |= T_BOOL;
#ifdef ENABLE_SKELETON_SUPPORT
} else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) { } else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) {
visibleMask |= T_SKIN_WEIGHTS; visibleMask |= T_SKIN_WEIGHTS;
#endif
} }
} }
...@@ -236,7 +238,9 @@ void PropertyVisPlugin::propertySelectionChanged() { ...@@ -236,7 +238,9 @@ void PropertyVisPlugin::propertySelectionChanged() {
tool_->paramUint->setVisible(visibleMask & T_UINT); tool_->paramUint->setVisible(visibleMask & T_UINT);
tool_->paramInt->setVisible(visibleMask & T_INT); tool_->paramInt->setVisible(visibleMask & T_INT);
tool_->paramBool->setVisible(visibleMask & T_BOOL); tool_->paramBool->setVisible(visibleMask & T_BOOL);
#ifdef ENABLE_SKELETON_SUPPORT
tool_->paramSkinWeights->setVisible(visibleMask & T_SKIN_WEIGHTS); tool_->paramSkinWeights->setVisible(visibleMask & T_SKIN_WEIGHTS);
#endif
tool_->vectors_edges_rb->setVisible(visibleMask & T_VECTOR_EDGES); tool_->vectors_edges_rb->setVisible(visibleMask & T_VECTOR_EDGES);
if (tool_->vectors_edges_rb->isChecked() && (visibleMask & T_VECTOR_EDGES) == 0) if (tool_->vectors_edges_rb->isChecked() && (visibleMask & T_VECTOR_EDGES) == 0)
tool_->vectors_strokes_rb->setChecked(true); tool_->vectors_strokes_rb->setChecked(true);
...@@ -292,9 +296,11 @@ void PropertyVisPlugin::visualizeProperty(MeshT *mesh, const PropertyNameListMod ...@@ -292,9 +296,11 @@ void PropertyVisPlugin::visualizeProperty(MeshT *mesh, const PropertyNameListMod
//BOOL //BOOL
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
visualizeBool(mesh, currentProp); visualizeBool(mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
//SKIN WEIGHTS //SKIN WEIGHTS
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
visualizeSkinWeights(mesh, tool_->boneId->value(), currentProp); visualizeSkinWeights(mesh, tool_->boneId->value(), currentProp);
#endif
} }
...@@ -2006,8 +2012,10 @@ void PropertyVisPlugin::duplicateProperty(MeshT *mesh, const PropertyNameListMod ...@@ -2006,8 +2012,10 @@ void PropertyVisPlugin::duplicateProperty(MeshT *mesh, const PropertyNameListMod
duplicateProperty_stage1<MeshT, int>(*mesh, currentProp); duplicateProperty_stage1<MeshT, int>(*mesh, currentProp);
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
duplicateProperty_stage1<MeshT, bool>(*mesh, currentProp); duplicateProperty_stage1<MeshT, bool>(*mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
duplicateProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp); duplicateProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp);
#endif
} }
template<typename MeshT> template<typename MeshT>
...@@ -2023,8 +2031,10 @@ void PropertyVisPlugin::removeProperty(MeshT *mesh, const PropertyNameListModel: ...@@ -2023,8 +2031,10 @@ void PropertyVisPlugin::removeProperty(MeshT *mesh, const PropertyNameListModel:
removeProperty_stage1<MeshT, int>(*mesh, currentProp); removeProperty_stage1<MeshT, int>(*mesh, currentProp);
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
removeProperty_stage1<MeshT, bool>(*mesh, currentProp); removeProperty_stage1<MeshT, bool>(*mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
removeProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp); removeProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp);
#endif
} }
Q_EXPORT_PLUGIN2( propertyvisplugin , PropertyVisPlugin ); Q_EXPORT_PLUGIN2( propertyvisplugin , PropertyVisPlugin );
......
...@@ -74,7 +74,10 @@ ...@@ -74,7 +74,10 @@
#include <ObjectTypes/TriangleMesh/TriangleMesh.hh> #include <ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include <ObjectTypes/PolyMesh/PolyMesh.hh> #include <ObjectTypes/PolyMesh/PolyMesh.hh>
#include <ObjectTypes/Skeleton/BaseSkin.hh>
#ifdef ENABLE_SKELETON_SUPPORT
#include <ObjectTypes/Skeleton/BaseSkin.hh>
#endif
#include "PropertyVisToolbar.hh" #include "PropertyVisToolbar.hh"
#include "PropertyNameListModel.hh" #include "PropertyNameListModel.hh"
......
...@@ -811,6 +811,7 @@ void PropertyVisPlugin::visualizeInteger( MeshT* _mesh, const PropertyNameList ...@@ -811,6 +811,7 @@ void PropertyVisPlugin::visualizeInteger( MeshT* _mesh, const PropertyNameList
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
template< class MeshT > template< class MeshT >
void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const PropertyNameListModel::PROP_INFO &currentProp) { void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const PropertyNameListModel::PROP_INFO &currentProp) {
...@@ -847,6 +848,7 @@ void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const ...@@ -847,6 +848,7 @@ void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED); PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
} }
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -1747,7 +1749,8 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _ ...@@ -1747,7 +1749,8 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _
} }
} }
#ifdef ENABLE_SKELETON_SUPPORT
//================================================================== //==================================================================
//Skin Weights //Skin Weights
//================================================================== //==================================================================
...@@ -1781,6 +1784,7 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _ ...@@ -1781,6 +1784,7 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _
} }
} }
#endif
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment