BLOC - Automatic UML class diagram creator

by

 

Used to create a UML class diagram from a MATLAB object oriented program.

Compos
classdef Compos < Arrow
    properties
        Shape
    end
    methods
        function obj = Compos(TipPos,TailPos)
            if nargin == 2 && isa(TipPos,'double') && length(TipPos) == 2 && length(TailPos) == 2
                if TipPos(1) > TailPos(1)       
                    obj.Shape{1} = [TipPos(1) TipPos(1)-0.15 TipPos(1)-0.15];
                    obj.Shape{2} = [TipPos(2) TipPos(2)-0.05 TipPos(2)+0.05];
                    obj.Shape{3} = [TailPos(1) TailPos(1)+0.075 TailPos(1)+0.18 TailPos(1)+0.075];
                    obj.Shape{4} = [TailPos(2) TailPos(2)-0.05 TailPos(2) TailPos(2)+0.05];
                else
                    obj.Shape{1} = [TipPos(1) TipPos(1)+0.15 TipPos(1)+0.15];
                    obj.Shape{2} = [TipPos(2) TipPos(2)-0.05 TipPos(2)+0.05];
                    obj.Shape{3} = [TailPos(1) TailPos(1)-0.075 TailPos(1)-0.18 TailPos(1)-0.075];
                    obj.Shape{4} = [TailPos(2) TailPos(2)-0.05 TailPos(2) TailPos(2)+0.05];
                end
                
            else
                error('TipPos and Tailpos must be [1x2] double arrays')
            end
        end
    end
end

Contact us