%
%  Abgel. Klasse für Kreis-Objekte
%    >> s = ShCircle( 2 )
%    >> s = ShCircle( 1, 2, 1 );
%
classdef ShCircle < ShLines
  properties (Access = private)
    rad = 0;
    curvature = [1,1];
  end
    
  methods
    function obj = ShCircle( rad, varargin )
      posX = 0;
      posY = 0;
      if( nargin == 3 )  % optional posX, posY 
        posX = varargin{1};
        posY = varargin{2};
      end
      obj@ShLines(posX,posY); 
      obj.rad = rad;
      obj.hnd = [];
    end
    
    function disp( obj )
      disp@Shape(obj);
      fprintf( 'Radius = %g \n', obj.rad );
    end
  
    function draw( obj )      
      clear( obj );    % Methode von Shape
      % rechte untere Ecke  
      x = obj.x - obj.rad;
      y = obj.y - obj.rad;
      d = 2*obj.rad;
      % Plotten und MATLAB Handle merken 
      obj.hnd = rectangle( 'Position', [x, y, d,d], ...
                           'Curvature', obj.curvature ); 
    end
     
  end
end