Ignore:
Timestamp:
Mar 1, 2010, 10:10:13 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
e49719
Parents:
075d08
git-author:
Frederik Heber <heber@…> (03/01/10 20:48:40)
git-committer:
Frederik Heber <heber@…> (03/01/10 22:10:13)
Message:

New class TriangleIntersection List and (hopefully) final fix of CorrelationToSurface().

  • Distances to surface were still calculated between the vector and the triangle plane not the triangle itself. Although functions such as BoundaryTriangleSet::GetClosestPointInsideTriangle had already been written.
  • As in class Tesselation there were many functions that all did the same: Calculate intersections between a point and all closeby triangles and then get the intersection or calculate this minimum distance and so ...
  • ... this was all put into a new class (in a new file): TriangleIntersectionList whose constructor scans all nearby triangles and put the calculates Intersections in the triangle into a list.
  • Functions as IsInside(), GetSmallestDistance(), GetClosestIntersection() and GetClosestTriangle() bring the desired functionality to the outside.
  • Respective functions in class Tesselation just make use of this new class and its member functions.
  • CorrelationToSurface() also directly instantiates this class to effectively use two of its functions.
  • Makefile.am has this new file in its SOURCES and HEADERS.
  • Tesselation:GetDistanceSquaredToSurface() -> Tesselation:GetDistanceToSurface(), FillBoxWithMolecule() has been adapted to this change.

AnalysisCorrelationToSurfaceUnitTest:

  • still has errors in it, as the distance were wrong before (because with respect to triangle plane, not triangle). Hence, the test was corrected.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    r075d08 rf7b476  
    904904              FillIt = false;
    905905            } else {
    906               const double distance = (TesselStruct[(*ListRunner)]->GetDistanceSquaredToSurface(Inserter, LCList[(*ListRunner)]));
    907               FillIt = FillIt && (distance > boundary*boundary) && ((MaxDistance < 0) || (MaxDistance*MaxDistance > distance));
     906              const double distance = (TesselStruct[(*ListRunner)]->GetDistanceToSurface(Inserter, LCList[(*ListRunner)]));
     907              FillIt = FillIt && (distance > boundary) && ((MaxDistance < 0) || (MaxDistance > distance));
    908908            }
    909909          }
Note: See TracChangeset for help on using the changeset viewer.