Edge/QuadCurveEdge.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 100% 31 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Edge/BezierEdge.pm ↑ Summary Edge/SplineEdge.pm »
1 package yEd::Edge::QuadCurveEdge;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use yEd::PropertyBasedObject;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use base qw(yEd::Edge);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 yEd::Edge::QuadCurveEdge - quadratic curve Edge
10  
11 =head1 DESCRIPTION
12  
13 Creates an Edge with quadratic curving.
14  
15 It can have multiple waypoints which may actually lie outside the Edge depending on C<straightness>.
16  
17 A C<straightness> set to 1 will look like a PolyLineEdge without smoohting.
18  
19 Make sure to have a look at L<yEd::Edge>, the properties and functions described there will not be repeated here.
20  
21 =head1 SUPPORTED FEATURES
22  
23 The type specific features are fully supported.
24  
25 For basic Edge type feature support and which Edge types are supported see L<yEd::Edge>.
26  
27 =head1 PROPERTIES
28  
29 =head2 all properties from base class
30  
31 L<yEd::Edge>
32  
33 =head2 straightness
34  
35 Type: ratio (ufloat [0-1])
36  
37 Default: 0.1
38  
39 The straightness.
40  
41 =head1 SUBROUTINES/METHODS
42  
43 =head2 all functions from base class
44  
45 L<yEd::Edge>
46  
47 =cut
48  
49  
50 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
51 1 my ($class, @args) = @_;
52 1 my $self = bless {}, $class;
53 1 return $self->_init(@args);
54 }
55  
56 1 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
57 1 my ($self, @args) = @_;
58 1 $self->straightness(0.1);
59 1 $self->SUPER::_init(@args);
60 1 return $self;
61 }
62  
63 2 ▶sub straightness {
Subroutine straightness: called CC=1 SCAR=0.0
Pod documented
64 2 return _PROPERTY($match{'ratio'}, @_);
65 }
66  
67 1 ▶sub _addTypeNode {
Subroutine _addTypeNode: called CC=1 SCAR=0.0
68 1 my ($self, $node) = @_;
69 1 my $type = $node->addNewChild('', 'y:QuadCurveEdge');
70 1 $type->setAttribute('straightness', $self->straightness());
71 1 return $type;
72 }
73  
74 =head1 SEE ALSO
75  
76 L<yEd::Document> for further informations about the whole package
77  
78 L<yEd::PropertyBasedObject> for further basic information about properties and their additional functions
79  
80 L<yEd::Edge> for information about the Edge base class and which other Edge types are currently supported
81  
82 =cut
83  
84 3 1;
« Edge/BezierEdge.pm ↑ Summary Edge/SplineEdge.pm »