~centralelyon2010/inkscape/imagelinks2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "connection-points.h"


bool ConnectionPoint::operator!=(ConnectionPoint& cp)
{
    return (id!=cp.id || type!=cp.type || dir!=cp.dir || pos!=cp.pos);
}

bool ConnectionPoint::operator==(ConnectionPoint& cp)
{
    return (id==cp.id && type==cp.type && dir==cp.dir && pos==cp.pos);
}


namespace Inkscape{

SVGIStringStream&
operator>>(SVGIStringStream& istr, ConnectionPoint& cp)
{
    istr>>cp.id>>cp.dir>>cp.pos[Geom::X]>>cp.pos[Geom::Y];

    return istr;
}

SVGOStringStream&
operator<<(SVGOStringStream& ostr, const ConnectionPoint& cp)
{
    ostr<<cp.id<<' '<<cp.dir<<' ';
    ::operator<<( ostr, cp.pos[Geom::X] );
    ostr<<' ';
    ::operator<<( ostr, cp.pos[Geom::Y] );

    return ostr;
}


}