node.h revision 16a8c7d5e433b176636a4a1260c42ea43932110b
/** @file
* Editable node and associated data structures.
*/
/* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2009 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_UI_TOOL_NODE_H
#define SEEN_UI_TOOL_NODE_H
#include <iterator>
#include <iosfwd>
#include <stdexcept>
#include <tr1/functional>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#include <boost/operators.hpp>
#include "ui/tool/selectable-control-point.h"
#include "ui/tool/node-types.h"
}
}
}
}
/*
template <typename T>
struct ListMember {
T *next;
T *prev;
};
struct SubpathMember : public ListMember<NodeListMember> {
Subpath *list;
};
struct SubpathListMember : public ListMember<SubpathListMember> {
SubpathList *list;
};
*/
struct ListNode {
};
struct NodeSharedData {
};
inline double length();
bool isDegenerate() { return _degenerate; }
virtual void setVisible(bool);
void retract();
virtual bool _hasDragTips() { return true; }
void _grabbedHandler();
void _ungrabbedHandler();
// so a naked pointer is OK and allows setting it during Node's construction
bool _degenerate; // this is used often internally so it makes sense to cache this
static double _saved_length;
static bool _drag_out;
};
void showHandles(bool v);
void pickBestType(); // automatically determine the type from handle positions
bool isEndNode();
static NodeType parse_nodetype(char x);
void sink();
virtual bool _hasDragTips() { return true; }
bool _grabbedHandler(GdkEventMotion *);
void _updateAutoHandles();
// Handles are always present, but are not visible if they coincide with the node
// (are degenerate). A segment that has both handles degenerate is always treated
// as a line segment
bool _handles_shown;
};
N *, N &>
{
typedef NodeIterator self;
: _node(0)
{}
// default copy, default assign
return *this;
}
return *this;
}
inline operator bool() const; // define after NodeList
NodeIterator(ListNode const *n)
{}
};
typedef Node const &const_reference;
typedef Node const *const_pointer;
typedef Node value_type;
// TODO Lame. Make this private and make SubpathList a factory
~NodeList();
// iterators
// size
bool empty();
// extra node-specific methods
bool closed();
bool degenerate();
}
// list operations
}
void reverse();
void shift(int n);
void clear();
return ret;
}
// member access - undefined results when the list is empty
// HACK remove this subpath from its path. This will be removed later.
void kill();
// no copy or assign
bool _closed;
};
/** List of node lists. Represents an editable path. */
SubpathList() {}
};
// define inline Handle funcs after definition of Node
}
}
return relativePos().length();
}
// definitions for node iterator
NodeIterator<N>::operator bool() const {
}
++ret;
return ret;
}
--ret;
return ret;
}
} // namespace UI
} // namespace Inkscape
struct hash< Inkscape::UI::NodeIterator<N> > : public unary_function<Inkscape::UI::NodeIterator<N>, size_t> {
}
};
}
}
#endif
/*
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:encoding=utf-8:textwidth=99 :