Cleaned up harmonic.h (added standard header, needed meshassert)

This commit is contained in:
Paolo Cignoni 2014-11-03 15:00:06 +00:00
parent e1a327e556
commit db53a1ff06
1 changed files with 219 additions and 199 deletions

View File

@ -1,11 +1,29 @@
/****************************************************************************
* VCGLib o o *
* Visual and Computer Graphics Library o o *
* _ O _ *
* Copyright(C) 2014 \/)\/ *
* Visual Computing Lab /\/| *
* ISTI - Italian National Research Council | *
* \ *
* All rights reserved. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
#ifndef __VCGLIB_HARMONIC_FIELD #ifndef __VCGLIB_HARMONIC_FIELD
#define __VCGLIB_HARMONIC_FIELD #define __VCGLIB_HARMONIC_FIELD
#include <vcg/complex/complex.h> #include <vcg/complex/complex.h>
#include <utility>
#include <vector>
#include <map>
#include <eigenlib/Eigen/Sparse> #include <eigenlib/Eigen/Sparse>
namespace vcg { namespace vcg {
@ -45,6 +63,8 @@ public:
RequirePerVertexFlags(m); RequirePerVertexFlags(m);
RequireCompactness(m); RequireCompactness(m);
RequireFFAdjacency(m); RequireFFAdjacency(m);
MeshAssert<MeshType>::FFAdjacencyIsInitialized(m);
MeshAssert<MeshType>::NoUnreferencedVertex(m);
if (constraints.empty()) if (constraints.empty())
return false; return false;
@ -59,8 +79,6 @@ public:
for (size_t i = 0; i < m.face.size(); ++i) for (size_t i = 0; i < m.face.size(); ++i)
{ {
FaceType & f = m.face[i]; FaceType & f = m.face[i];
assert(!f.IsD());
assert(!f.IsV()); assert(!f.IsV());
f.SetV(); f.SetV();
@ -99,7 +117,9 @@ public:
// Setting the constraints // Setting the constraints
const CoeffScalar alpha = pow(10, 8); // penalty factor alpha const CoeffScalar alpha = pow(10.0, 8.0); // penalty factor alpha
// const CoeffScalar alpha = CoeffScalar(1e5); // penalty factor alpha
Eigen::Matrix<CoeffScalar, Eigen::Dynamic, 1> b, x; // Unknown and known terms vectors Eigen::Matrix<CoeffScalar, Eigen::Dynamic, 1> b, x; // Unknown and known terms vectors
b.setZero(n); b.setZero(n);