Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.cpp

    r68f03d r8f215d  
    2121#include "Plane.hpp"
    2222#include "Exceptions/LinearDependenceException.hpp"
     23#include "Helpers/Assert.hpp"
    2324
    2425class molecule;
     
    682683}
    683684
     685/**
     686 * gets the Plane defined by the three triangle Basepoints
     687 */
     688Plane BoundaryTriangleSet::getPlane() const{
     689  ASSERT(endpoints[0] && endpoints[1] && endpoints[2], "Triangle not fully defined");
     690
     691  return Plane(*endpoints[0]->node->node,
     692               *endpoints[1]->node->node,
     693               *endpoints[2]->node->node);
     694}
     695
     696Vector BoundaryTriangleSet::getEndpoint(int i) const{
     697  ASSERT(i>=0 && i<3,"Index of Endpoint out of Range");
     698
     699  return *endpoints[i]->node->node;
     700}
     701
     702string BoundaryTriangleSet::getEndpointName(int i) const{
     703  ASSERT(i>=0 && i<3,"Index of Endpoint out of Range");
     704
     705  return endpoints[i]->node->getName();
     706}
     707
    684708/** output operator for BoundaryTriangleSet.
    685709 * \param &ost output stream
     
    688712ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a)
    689713{
    690   ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << "," << a.endpoints[1]->node->getName() << "," << a.endpoints[2]->node->getName() << "]";
     714  ost << "[" << a.Nr << "|" << a.getEndpointName(0) << "," << a.getEndpointName(1) << "," << a.getEndpointName(2) << "]";
    691715  //  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << ","
    692716  //      << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "," << a.endpoints[2]->node->Name << " at " << *a.endpoints[2]->node->node << "]";
     
    14551479        CenterVector.Zero();
    14561480        for (int i = 0; i < 3; i++)
    1457           CenterVector += (*BTS->endpoints[i]->node->node);
     1481          CenterVector += BTS->getEndpoint(i);
    14581482        CenterVector.Scale(1. / 3.);
    14591483        DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl);
     
    48024826  if (LastTriangle != NULL) {
    48034827    stringstream sstr;
    4804     sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->endpoints[0]->node->getName() << "_" << LastTriangle->endpoints[1]->node->getName() << "_" << LastTriangle->endpoints[2]->node->getName();
     4828    sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->getEndpointName(0) << "_" << LastTriangle->getEndpointName(1) << "_" << LastTriangle->getEndpointName(2);
    48054829    NumberName = sstr.str();
    48064830    if (DoTecplotOutput) {
Note: See TracChangeset for help on using the changeset viewer.