sp-conn-end-pair.cpp revision 6d8430ca47c35cff45dee59e1f9c025567d0af49
/*
* A class for handling connector endpoint movement and libavoid interaction.
*
* Authors:
* Peter Moulder <pmoulder@mail.csse.monash.edu.au>
* Michael Wybrow <mjwybrow@users.sourceforge.net>
* Abhishek Sharma
*
* * Copyright (C) 2004-2005 Monash University
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <cstring>
#include <string>
#include <iostream>
#include <glibmm/stringutils.h>
#include "attributes.h"
#include "sp-conn-end.h"
#include "uri.h"
#include "sp-path.h"
#include "libavoid/vertices.h"
#include "document.h"
#include "sp-item-group.h"
, _connCurvature(0.0)
{
}
}
{
}
}
void
{
}
// If the document is being destroyed then the router instance
// and the ConnRefs will have been destroyed with it.
if (_connRef && routerInstanceExists) {
delete _connRef;
}
}
void
{
}
static void
{
}
}
void
{
switch (key)
{
case SP_ATTR_CONNECTOR_TYPE:
if (!_connRef)
{
switch (newconnType)
{
case SP_CONNECTOR_POLYLINE:
break;
case SP_CONNECTOR_ORTHOGONAL:
}
}
else
if (newconnType != _connType)
{
switch (newconnType)
{
case SP_CONNECTOR_POLYLINE:
break;
case SP_CONNECTOR_ORTHOGONAL:
}
}
}
else {
if (_connRef) {
delete _connRef;
}
}
break;
if (value) {
// Redraw the connector, but only if it has been initialised.
}
}
break;
case SP_ATTR_CONNECTION_START:
case SP_ATTR_CONNECTION_END:
break;
}
}
void
{
}
}
repr->setAttribute("inkscape:connector-type", _connType == SP_CONNECTOR_POLYLINE ? "polyline" : "orthogonal" );
}
void
for (unsigned h = 0; h < 2; ++h) {
// Deal with the case of the attached object being an empty group.
// A group containing no items does not have a valid bbox, so
// causes problems for the auto-routing code. Also, since such a
// group no longer has an onscreen representation and can only be
// selected through the XML editor, it makes sense just to detach
// connectors from them.
if (SP_IS_GROUP(h2attItem[h])) {
// This group is empty, so detach.
sp_conn_end_detach(_path, h);
}
}
}
}
{
for (unsigned h = 0; h < 2; ++h) {
if ( h2attItem[h] ) {
}
{
if (h == 0) {
}
else {
}
}
}
}
SPConnEndPair::getCurvature(void) const {
return _connCurvature;
}
SPConnEndPair::getConnEnds(void)
{
return _connEnd;
}
bool
SPConnEndPair::isOrthogonal(void) const {
return _connType == SP_CONNECTOR_ORTHOGONAL;
}
static void redrawConnectorCallback(void *ptr)
{
// This can happen when the document is being destroyed.
return;
}
}
void
{
}
// Called from sp_path_update to initialise the endpoints.
void
SPConnEndPair::update(void)
{
if (_connType != SP_CONNECTOR_NOAVOID) {
if (!(_connRef->isInitialised())) {
}
// Store the ID of the objects attached to the connector.
storeIds();
}
}
void SPConnEndPair::storeIds(void)
{
// href begins with a '#' which we don't want.
}
else {
}
// href begins with a '#' which we don't want.
}
else {
}
}
bool
SPConnEndPair::isAutoRoutingConn(void)
{
if (_connType != SP_CONNECTOR_NOAVOID) {
return true;
}
return false;
}
void
SPConnEndPair::makePathInvalid(void)
{
}
// Redraws the curve along the recalculated route
// Straight or curved
{
if (!straight)
connRef->calcRouteDist();
for (int i = 1; i < pn; ++i) {
if (straight) {
}
else {
case 'M':
break;
case 'L':
break;
case 'C':
i+=2;
break;
}
}
}
}
void
{
if (!isAutoRoutingConn()) {
// Do nothing
return;
}
if (processTransaction)
{
}
return;
}
bool
{
if (!isAutoRoutingConn()) {
// Do nothing
return false;
}
return true;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :