swh:1:snp:818279ffd0c3c25a68d33cc2b97d007e1bdc7ed6
Raw File
Tip revision: 8abaf41b7c113afafcca20c0b869826efb0c6e6b authored by ennetws on 15 January 2014, 06:15:06 UTC
Changes to filtering.
Tip revision: 8abaf41
CurveskelHelper.h
#pragma once
#include "CurveskelQForEach.h"

#include <string>
using namespace std;

namespace CurveskelTypes{

	/// @{ Default property names definition
	const string VPOINT = "v:point";
	const string ELENGTH = "e:length";
	/// @}

	typedef MyWingedMesh::Vertex_property<Point>  Vector3VertexProperty;
	typedef MyWingedMesh::Edge_property<Scalar>	ScalarEdgeProperty;


	class CurveskelHelper{
	protected:
		CurveskelModel* skel;
		Vector3VertexProperty points;
		ScalarEdgeProperty elenght;  /// NULL

	public:
		CurveskelHelper(CurveskelModel* skel) : skel(skel){
			points = skel->vertex_property<Point>("v:point");
			elenght = skel->get_edge_property<Scalar>(ELENGTH);
		}

		ScalarEdgeProperty computeEdgeLengths(string property=ELENGTH){
			elenght = skel->edge_property<Scalar>(property,0.0f);
			foreach(Edge eit,skel->edges())
				elenght[eit] = skel->edge_length(eit);
			return elenght;
		}
	};

}
back to top