Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-conn-end-pair.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_CONN_END_PAIR
3#define SEEN_SP_CONN_END_PAIR
4
5/*
6 * A class for handling connector endpoint movement and libavoid interaction.
7 *
8 * Authors:
9 * Peter Moulder <pmoulder@mail.csse.monash.edu.au>
10 *
11 * * Copyright (C) 2004 Monash University
12 *
13 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14 */
15
16#include <cstddef>
17#include <sigc++/sigc++.h>
18#include <2geom/pathvector.h>
19
21#include "attributes.h"
22
23class SPConnEnd;
24class SPPath;
25class SPItem;
26class SPObject;
27
28namespace Geom { class Point; }
29namespace Inkscape {
30namespace XML {
31class Node;
32}
33}
34
36public:
39 void release();
40 void setAttr(const SPAttr key, char const *const value);
41 void writeRepr(Inkscape::XML::Node *const repr) const;
42 void getAttachedItems(SPItem *[2]) const;
43 void getEndpoints(Geom::Point endPts[]) const;
44 double getCurvature() const;
46 bool isOrthogonal() const;
48 void tellLibavoidNewEndpoints(bool const processTransaction = false);
50 void makePathInvalid();
51 void update();
52 bool isAutoRoutingConn() const;
54
55private:
56 void _updateEndPoints();
57
59
61
62 // libavoid's internal representation of the item.
64
67
68 // A sigc connection for transformed signal.
69 sigc::connection _transformed_connection;
70};
71
72
74
75
76// _connType options:
77enum {
78 SP_CONNECTOR_NOAVOID, // Basic connector - a straight line.
79 SP_CONNECTOR_POLYLINE, // Object avoiding polyline.
80 SP_CONNECTOR_ORTHOGONAL // Object avoiding orthogonal polyline (only horizontal and vertical segments).
81};
82
83#endif /* !SEEN_SP_CONN_END_PAIR */
84
85/*
86 Local Variables:
87 mode:c++
88 c-file-style:"stroustrup"
89 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
90 indent-tabs-mode:nil
91 fill-column:99
92 End:
93*/
94// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
pair< double, double > Point
Definition parser.cpp:7
Lookup dictionary for attributes/properties.
SPAttr
Definition attributes.h:27
The ConnRef class represents a connector object.
Definition connector.h:132
Sequence of subpaths.
Definition pathvector.h:122
Two-dimensional point that doubles as a vector.
Definition point.h:66
Interface for refcounted XML nodes.
Definition node.h:80
Avoid::ConnRef * _connRef
void writeRepr(Inkscape::XML::Node *const repr) const
void setAttr(const SPAttr key, char const *const value)
void getEndpoints(Geom::Point endPts[]) const
sigc::connection _transformed_connection
SPConnEnd * _connEnd[2]
bool isOrthogonal() const
void tellLibavoidNewEndpoints(bool const processTransaction=false)
SPConnEnd ** getConnEnds()
static Geom::PathVector createCurve(Avoid::ConnRef *connRef, double curvature)
bool isAutoRoutingConn() const
double getCurvature() const
void getAttachedItems(SPItem *[2]) const
Base class for visual SVG elements.
Definition sp-item.h:109
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
SVG <path> implementation.
Definition sp-path.h:27
Contains the interface for the ConnRef class.
Various utility functions.
Definition affine.h:22
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
PathVector - a sequence of subpaths.
double curvature(Point const &a, Point const &b, Point const &c)
@ SP_CONNECTOR_POLYLINE
@ SP_CONNECTOR_NOAVOID
@ SP_CONNECTOR_ORTHOGONAL
void sp_conn_end_pair_build(SPObject *object)