Example #1
0
 function GetLegendInterval(array &$spec, array &$cfg)
 {
     $spec['delta_size'] = $this->ComputeDeltaSize($cfg);
     $iv = new INTERVAL();
     $iv->SetupInterval($spec['xmin'], $spec['xmax']);
     $iv->SetupWindow(INTERVAL::WINDOW_NEIGHBOURHOOD, $spec['x'], dsMathPreciseSubstract($spec['xmax'], $spec['xmin']) * $spec['delta_size'] / $this->width);
     $iv->EnableFlexibility();
     return $iv;
 }
Example #2
0
 function GetNeighbors(MASK $mask = NULL, $x, $amount = false, $flags = 0)
 {
     if (!$mask) {
         $mask = $this->CreateMask();
     }
     if ($this->base_mask) {
         $mask = $this->base_mask->Superpose($mask);
     }
     $ivl = new INTERVAL();
     $ivl->SetupWindow(INTERVAL::WINDOW_LEFT, $x);
     $left = array();
     $d = new RAWPoint($this, $mask, $ivl, $amount === false ? 1 : $amount);
     foreach ($d as $tm => $val) {
         $left[$tm] = $val;
     }
     $ivl->SetupWindow(INTERVAL::WINDOW_RIGHT, $x);
     $right = array();
     $d = new RAWPoint($this, $mask, $ivl, $amount === false ? 1 : $amount);
     foreach ($d as $tm => $val) {
         $right[$tm] = $val;
     }
     return array('left' => &$left, 'right' => &$right);
 }