2005-02-08 13:43:03 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* VCGLib o o *
|
|
|
|
* Visual and Computer Graphics Library o o *
|
|
|
|
* _ O _ *
|
|
|
|
* Copyright(C) 2004 \/)\/ *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
|
|
History
|
|
|
|
|
|
|
|
$Log: not supported by cvs2svn $
|
2005-02-22 11:38:17 +01:00
|
|
|
Revision 1.8 2005/02/21 17:55:36 ponchio
|
|
|
|
debug debug debug
|
|
|
|
|
2005-02-21 18:55:49 +01:00
|
|
|
Revision 1.7 2005/02/20 18:07:01 ponchio
|
|
|
|
cleaning.
|
|
|
|
|
2005-02-20 19:07:01 +01:00
|
|
|
Revision 1.6 2005/02/19 10:45:04 ponchio
|
|
|
|
Patch generalized and small fixes.
|
|
|
|
|
2005-02-19 11:45:05 +01:00
|
|
|
Revision 1.5 2005/02/18 13:04:13 ponchio
|
|
|
|
Added patch reordering.
|
|
|
|
|
2005-02-18 14:04:13 +01:00
|
|
|
Revision 1.4 2005/02/08 12:43:03 ponchio
|
|
|
|
Added copyright
|
|
|
|
|
2005-02-08 13:43:03 +01:00
|
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
2004-10-01 14:40:32 +02:00
|
|
|
#ifndef NXS_ALGO_H
|
|
|
|
#define NXS_ALGO_H
|
|
|
|
|
2005-02-22 11:38:17 +01:00
|
|
|
#include <set>
|
2004-10-01 14:40:32 +02:00
|
|
|
#include <vector>
|
2005-02-19 11:45:05 +01:00
|
|
|
#include "patch.h"
|
2005-02-20 19:07:01 +01:00
|
|
|
#include <vcg/space/sphere3.h>
|
2004-10-01 14:40:32 +02:00
|
|
|
|
|
|
|
namespace nxs {
|
|
|
|
|
|
|
|
class Nexus;
|
2004-10-19 03:23:02 +02:00
|
|
|
class Patch;
|
2004-10-01 14:40:32 +02:00
|
|
|
|
2005-02-20 19:07:01 +01:00
|
|
|
|
2005-02-18 14:04:13 +01:00
|
|
|
struct ZEntry {
|
|
|
|
unsigned int id;
|
|
|
|
unsigned int pos;
|
|
|
|
bool operator<(const ZEntry &e) const { return pos < e.pos; }
|
|
|
|
};
|
|
|
|
|
2005-02-22 11:38:17 +01:00
|
|
|
//for every patch return close by (sphere intersecting)
|
|
|
|
//threshold is added to the distance to make sure we do not miss anything
|
|
|
|
void Connect(Nexus &nexus, std::vector< std::set<unsigned int> > &close,
|
|
|
|
float threshold);
|
|
|
|
|
2004-10-01 14:40:32 +02:00
|
|
|
void ComputeNormals(Nexus &nexus);
|
2005-02-22 11:38:17 +01:00
|
|
|
|
2005-01-17 18:35:48 +01:00
|
|
|
void Unify(Nexus &nexus, float threshold);
|
2005-02-18 14:04:13 +01:00
|
|
|
void ZSort(Nexus &nexus, std::vector<unsigned int> &forward,
|
|
|
|
std::vector<unsigned int> &backward);
|
2005-02-21 18:55:49 +01:00
|
|
|
// void TightSphere(vcg::Sphere3f &sphere, std::vector<vcg::Point3f> &points);
|
2004-10-01 14:40:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|