proj home

Files   Classes   Functions   Hierarchy  

d4mingreedy2 Class Reference

#include <d4minboundary.h>

Inheritance diagram for d4mingreedy2:
Collaboration diagram for d4mingreedy2:

List of all members.

Public Member Functions

 d4mingreedy2 (d4tess &_tess)
bool const eval (uintc a, uintc b)


Detailed Description

Definition at line 31 of file d4minboundary.h.


Constructor & Destructor Documentation

d4mingreedy2::d4mingreedy2 ( d4tess _tess  )  [inline]

Definition at line 35 of file d4minboundary.h.

00036     : d4minoperator(_tess) {} 


Member Function Documentation

bool const d4mingreedy2::eval ( uintc  a,
uintc  b 
) [virtual]

Reimplemented from d4minoperator.

Definition at line 158 of file d4minboundary.cpp.

References d4minoperator::approximatelyequal(), d4tri::getanticlockwiseface(), d4tess::isconvex(), d4tri::niInverse(), d4tri::pi, r, SHOW, d4minoperator::tess, d4tess::tet2to3(), d4minoperator::twotetrahedronMInvert(), and d4tess::vi.

00159 {
00160   if (tess.isconvex(a,b)==false)
00161     return false;
00162 
00163   d4tri A(tess.vi[a]);
00164   d4tri B(tess.vi[b]);
00165 
00166   uint ai = A.niInverse(b);
00167   uint bi = B.niInverse(a);
00168 
00169   double const z = dist(A.pi[ai], B.pi[bi]);
00170 
00171   double l[3];
00172   uint u[3];
00173   A.getanticlockwiseface(u[0],u[1],u[2],ai);
00174   l[0] = dist(u[0],u[1]);
00175   l[1] = dist(u[1],u[2]);
00176   l[2] = dist(u[2],u[0]);
00177 
00178 
00179 
00180   // Order l[0],l[1],l[2] from smallest to largest.
00181 
00182   sort(l,l+3);
00183 
00184 cout << SHOW(l[0]) << " ";
00185 cout << SHOW(l[1]) << " ";
00186 cout << SHOW(l[2]) << " ";
00187 cout << SHOW(z) << endl;
00188 
00189   assert(l[2]!=0.0);
00190   
00191   // This is the ideal length of z when the tetrahedrons
00192   // have equal lengths and side lengths of 1.
00193   //double const e = 1.32287;
00194 
00195   // Ratio of l[2] to z;
00196   double const r = 1.5;
00197 
00198   if (z>l[2]*r)
00199   {
00200     cout << "large z" << endl;
00201     return twotetrahedronMInvert(a,ai,b,bi);
00202   }
00203 
00204   // Test for thin triangle boundary.
00205   if (approximatelyequal(l[2],l[1]))
00206   {
00207     cout << "thin triangle" << endl; 
00208     return twotetrahedronMInvert(a,ai,b,bi);
00209   }
00210 
00211   cout << "tet2to3" << endl;
00212 
00213   return tess.tet2to3(a,b);
00214 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:49:54 2011 for Chelton Evans Source by  doxygen 1.5.8