Пример #1
0
 public function testMethods()
 {
     $this->object->set(ElevationMethod::NONE);
     $this->assertTrue($this->object->usesNone());
     $this->assertFalse($this->object->usesThreshold());
     $this->assertFalse($this->object->usesDouglasPeucker());
     $this->object->set(ElevationMethod::THRESHOLD);
     $this->assertFalse($this->object->usesNone());
     $this->assertTrue($this->object->usesThreshold());
     $this->assertFalse($this->object->usesDouglasPeucker());
     $this->object->set(ElevationMethod::DOUGLAS_PEUCKER);
     $this->assertFalse($this->object->usesNone());
     $this->assertFalse($this->object->usesThreshold());
     $this->assertTrue($this->object->usesDouglasPeucker());
 }
Пример #2
0
 /**
  * Choose strategy
  */
 protected function chooseStrategy()
 {
     if ($this->Method->usesThreshold()) {
         $this->Strategy = new Threshold($this->ElevationPoints, $this->Threshold);
     } elseif ($this->Method->usesDouglasPeucker()) {
         $this->Strategy = new DouglasPeucker($this->ElevationPoints, $this->Threshold);
     } elseif ($this->Method->usesReumannWitkam()) {
         $this->Strategy = new ReumannWitkam($this->ElevationPoints);
     } else {
         $this->Strategy = new NoSmoothing($this->ElevationPoints);
     }
 }