Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Plane.cpp

    r112b09 r82cf79  
    1515#include "verbose.hpp"
    1616#include "Helpers/Assert.hpp"
     17#include "helpers.hpp"
    1718#include <cmath>
    1819#include "Line.hpp"
     
    106107Plane::~Plane()
    107108{}
     109
     110Plane &Plane::operator=(const Plane &rhs){
     111  if(&rhs!=this){
     112    normalVector.reset(new Vector(*rhs.normalVector));
     113    offset = rhs.offset;
     114  }
     115  return *this;
     116}
    108117
    109118
     
    188197}
    189198
     199bool Plane::onSameSide(const Vector &point1,const Vector &point2) const{
     200  return sign(point1.ScalarProduct(*normalVector)-offset) ==
     201         sign(point2.ScalarProduct(*normalVector)-offset);
     202}
     203
    190204/************ Methods inherited from Space ****************/
    191205
     
    207221// Operators
    208222
     223bool operator==(const Plane &x,const Plane &y){
     224  return *x.normalVector == *y.normalVector && x.offset == y.offset;
     225}
     226
    209227ostream &operator << (ostream &ost,const Plane &p){
    210228  ost << "<" << p.getNormal() << ";x> - " << p.getOffset() << "=0";
Note: See TracChangeset for help on using the changeset viewer.