45#ifdef ENABLE_SKELETON_SUPPORT
47#define OM_PROPERTY_VISUALIZER_SKIN_WEIGHTS_CC
49#include "OMPropertyVisualizerSkinWeights.hh"
51template <
typename MeshT>
52OMPropertyVisualizerSkinWeights<MeshT>::OMPropertyVisualizerSkinWeights(
MeshT* _mesh,
int _objectID,
const PropertyInfo& _propertyInfo)
55 if (PropertyVisualizer::widget)
delete PropertyVisualizer::widget;
57 w->paramSkinWeights->setTitle(QString(
"SkinWeights Parameters of ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
58 PropertyVisualizer::widget = w;
61template <
typename MeshT>
62QString OMPropertyVisualizerSkinWeights<MeshT>::getPropertyText(
unsigned int index)
67template <
typename MeshT>
68void OMPropertyVisualizerSkinWeights<MeshT>::visualizeFaceProp(
bool )
73template <
typename MeshT>
74void OMPropertyVisualizerSkinWeights<MeshT>::visualizeEdgeProp(
bool )
79template <
typename MeshT>
80void OMPropertyVisualizerSkinWeights<MeshT>::visualizeHalfedgeProp(
bool )
85template <
typename MeshT>
86void OMPropertyVisualizerSkinWeights<MeshT>::visualizeVertexProp(
bool _setDrawMode)
104 if ( weight.find( skinWeightsWidget->boneId->value() ) != weight.end() ) {
105 value = weight[skinWeightsWidget->boneId->value()];
109 typename MeshT::Color color(value,1.0-value,0.0,1.0);
119template<
typename MeshT>
120void OMPropertyVisualizerSkinWeights<MeshT>::removeProperty()
126template<
typename MeshT>
127void OMPropertyVisualizerSkinWeights<MeshT>::duplicateProperty()
132template<
typename MeshT>
133void OMPropertyVisualizerSkinWeights<MeshT>::setFacePropertyFromText(
unsigned int index, QString text)
138template<
typename MeshT>
139void OMPropertyVisualizerSkinWeights<MeshT>::setEdgePropertyFromText(
unsigned int index, QString text)
144template<
typename MeshT>
145void OMPropertyVisualizerSkinWeights<MeshT>::setHalfedgePropertyFromText(
unsigned int index, QString text)
150template<
typename MeshT>
151void OMPropertyVisualizerSkinWeights<MeshT>::setVertexPropertyFromText(
unsigned int index, QString text)
156 if ( !mesh->get_property_handle(prop, PropertyVisualizer::propertyInfo.propName() ) )
157 emit this->log(
LOGERR, QObject::tr(
"Error: No property with name ").append(PropertyVisualizer::propertyInfo.propName().c_str()));
159 typename MeshT::VertexHandle vh = mesh->vertex_handle(index);
164 text.remove(text.length()-1, 1);
166 QStringList slAll = text.
split(
")(");
168 for (QStringList::iterator it = slAll.begin(); it != slAll.end(); ++it)
170 QStringList slCurrent = it->split(
",");
171 sw.insert(std::pair<int, double>(slCurrent.at(0).toInt(), slCurrent.at(1).toDouble()));
174 mesh->property(prop, vh) = sw;
std::map< unsigned int, double > SkinWeights
Stores the joint weights per vertex.
SmartVertexHandle split(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)
Cellection of information about a property.
DrawMode SOLID_POINTS_COLORED
draw colored, but not lighted faces using interpolated vertex colors
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .