TriEdgeFlip::ComputPriority now use vcg::CircumCenter(triangle) to compute circumcenter coordinates

This commit is contained in:
Paolo Cignoni 2008-03-02 11:00:10 +00:00
parent 9841c8db32
commit 2aac6ba625
1 changed files with 13 additions and 7 deletions

View File

@ -23,7 +23,8 @@
#include <vcg/complex/local_optimization.h> #include <vcg/complex/local_optimization.h>
#include <vcg/simplex/face/topology.h> #include <vcg/simplex/face/topology.h>
#include <vcg/space/point3.h> //#include <vcg/space/point3.h>
#include <vcg/space/triangle3.h>
namespace vcg namespace vcg
{ {
@ -316,6 +317,8 @@ namespace vcg
typedef typename LocalOptimization<TRIMESH_TYPE>::HeapElem HeapElem; typedef typename LocalOptimization<TRIMESH_TYPE>::HeapElem HeapElem;
typedef typename LocalOptimization<TRIMESH_TYPE>::HeapType HeapType; typedef typename LocalOptimization<TRIMESH_TYPE>::HeapType HeapType;
typedef typename vcg::Triangle3<ScalarType> TriangleType;
public: public:
/*! /*!
* Default constructor * Default constructor
@ -373,7 +376,7 @@ namespace vcg
v3 = app.v->P(); v3 = app.v->P();
CoordType e01 = v0-v1; /*CoordType e01 = v0-v1;
CoordType e12 = v1-v2; CoordType e12 = v1-v2;
CoordType e20 = v2-v0; CoordType e20 = v2-v0;
CoordType e01Norm = e01; e01Norm.Normalize(); CoordType e01Norm = e01; e01Norm.Normalize();
@ -395,7 +398,10 @@ namespace vcg
if(SumC==0) return 20; if(SumC==0) return 20;
CoordType CircumCenter= v0*C0/SumC + v1*C1/SumC + v2*C2/SumC; CoordType CircumCenter= v0*C0/SumC + v1*C1/SumC + v2*C2/SumC;*/
TriangleType triangle(v0, v1, v2);
CoordType CircumCenter = vcg::Circumcenter(triangle);
ScalarType Radius= Distance(v0,CircumCenter); ScalarType Radius= Distance(v0,CircumCenter);
ScalarType Radius1= Distance(v1,CircumCenter); ScalarType Radius1= Distance(v1,CircumCenter);