Commit 266465e8 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 e6e49ea8
include (plugin)
if (EXISTS ${CMAKE_SOURCE_DIR}/ObjectTypes/BSplineCurve)
add_definitions (-DENABLE_SKELETON_SUPPORT)
endif()
openflipper_plugin (INSTALLDATA Icons)
......@@ -52,7 +52,6 @@
#include <OpenMesh/Core/Utils/Property.hh>
#include <ACG/Math/VectorT.hh>
#include <ObjectTypes/Skeleton/BaseSkin.hh>
#include <map>
#include <vector>
......@@ -69,8 +68,12 @@ const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_Vec
PropertyNameListModel::TypeInfoWrapper(typeid(OpenMesh::PropertyT<ACG::Vec3d>), "Vec3d");
const PropertyNameListModel::TypeInfoWrapper PropertyNameListModel::proptype_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");
#endif
/*
* 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[]
proptype_double,
proptype_Vec3d,
proptype_Vec3f,
#ifdef ENABLE_SKELETON_SUPPORT
proptype_SkinWeights,
#endif
};
const PropertyNameListModel::TYPE_INFO_SET PropertyNameListModel::sane_prop_types(prop_types, prop_types + 7);
......
......@@ -219,8 +219,10 @@ void PropertyVisPlugin::propertySelectionChanged() {
visibleMask |= T_UINT;
} else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool) {
visibleMask |= T_BOOL;
#ifdef ENABLE_SKELETON_SUPPORT
} else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights) {
visibleMask |= T_SKIN_WEIGHTS;
#endif
}
}
......@@ -236,7 +238,9 @@ void PropertyVisPlugin::propertySelectionChanged() {
tool_->paramUint->setVisible(visibleMask & T_UINT);
tool_->paramInt->setVisible(visibleMask & T_INT);
tool_->paramBool->setVisible(visibleMask & T_BOOL);
#ifdef ENABLE_SKELETON_SUPPORT
tool_->paramSkinWeights->setVisible(visibleMask & T_SKIN_WEIGHTS);
#endif
tool_->vectors_edges_rb->setVisible(visibleMask & T_VECTOR_EDGES);
if (tool_->vectors_edges_rb->isChecked() && (visibleMask & T_VECTOR_EDGES) == 0)
tool_->vectors_strokes_rb->setChecked(true);
......@@ -292,9 +296,11 @@ void PropertyVisPlugin::visualizeProperty(MeshT *mesh, const PropertyNameListMod
//BOOL
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
visualizeBool(mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
//SKIN WEIGHTS
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
visualizeSkinWeights(mesh, tool_->boneId->value(), currentProp);
#endif
}
......@@ -2006,8 +2012,10 @@ void PropertyVisPlugin::duplicateProperty(MeshT *mesh, const PropertyNameListMod
duplicateProperty_stage1<MeshT, int>(*mesh, currentProp);
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
duplicateProperty_stage1<MeshT, bool>(*mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
duplicateProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp);
#endif
}
template<typename MeshT>
......@@ -2023,8 +2031,10 @@ void PropertyVisPlugin::removeProperty(MeshT *mesh, const PropertyNameListModel:
removeProperty_stage1<MeshT, int>(*mesh, currentProp);
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_bool)
removeProperty_stage1<MeshT, bool>(*mesh, currentProp);
#ifdef ENABLE_SKELETON_SUPPORT
else if (currentProp.typeinfo() == PropertyNameListModel::proptype_SkinWeights)
removeProperty_stage1<MeshT, BaseSkin::SkinWeights>(*mesh, currentProp);
#endif
}
Q_EXPORT_PLUGIN2( propertyvisplugin , PropertyVisPlugin );
......
......@@ -74,7 +74,10 @@
#include <ObjectTypes/TriangleMesh/TriangleMesh.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 "PropertyNameListModel.hh"
......
......@@ -811,6 +811,7 @@ void PropertyVisPlugin::visualizeInteger( MeshT* _mesh, const PropertyNameList
//------------------------------------------------------------------------------
#ifdef ENABLE_SKELETON_SUPPORT
template< class MeshT >
void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const PropertyNameListModel::PROP_INFO &currentProp) {
......@@ -847,6 +848,7 @@ void PropertyVisPlugin::visualizeSkinWeights( MeshT* _mesh, int _boneId, const
PluginFunctions::setDrawMode(ACG::SceneGraph::DrawModes::SOLID_POINTS_COLORED);
}
#endif
//------------------------------------------------------------------------------
......@@ -1747,7 +1749,8 @@ void PropertyVisPlugin::getPropertyValue( MeshT* _mesh , int _id, unsigned int _
}
}
#ifdef ENABLE_SKELETON_SUPPORT
//==================================================================
//Skin Weights
//==================================================================
......@@ -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