path.h revision 01d27eab5fca2dcb8e883011f8be77ae6b78a11c
/**
* \file
* \brief Path - Series of continuous curves
*
* Authors:
* MenTaLguY <mental@rydia.net>
* Marco Cecchetti <mrcekets at gmail.com>
*
* Copyright 2007-2008 authors
*
* modify it either under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* (the "LGPL") or, at your option, under the terms of the Mozilla
* Public License Version 1.1 (the "MPL"). If you do not alter this
* notice, a recipient may use your version of this file under either
* the MPL or the LGPL.
*
* You should have received a copy of the LGPL along with this library
* in the file COPYING-LGPL-2.1; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the MPL along with this library
* in the file COPYING-MPL-1.1
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
* OF ANY KIND, either express or implied. See the LGPL or the MPL for
* the specific language governing rights and limitations.
*/
#ifndef SEEN_GEOM_PATH_H
#define SEEN_GEOM_PATH_H
#include <boost/shared_ptr.hpp>
#include <iterator>
#include <algorithm>
{
// default copy, default assign
}
}
}
C &operator++() {
++index;
return static_cast<C &>(*this);
}
C operator++(int) {
++(*this);
return old;
}
C &operator--() {
--index;
return static_cast<C &>(*this);
}
C operator--(int) {
--(*this);
return old;
}
P *path;
unsigned index;
};
ConstIterator() : Base() {}
// default copy, default assign
};
// default copy, default assign
operator ConstIterator const &() const {
}
};
}
/*
* Open and closed paths: all paths, whether open or closed, store a final
* segment which connects the initial and final endpoints of the "real"
* path data. While similar to the "z" in an SVG path, it exists for
* both open and closed paths, and is not considered part of the "normal"
* path data, which is always covered by the range [begin(), end_open()).
* Conversely, the range [begin(), end_closed()) always contains the "extra"
* closing segment.
*
* The only difference between a closed and an open path is whether
* end_default() returns end_closed() or end_open(). The idea behind this
* is to let any path be stroked using [begin(), end_default()), and filled
* using [begin(), end_closed()), without requiring a separate "filled" version
* of the path to use for filling.
*
* \invariant : curves_ always contains at least one segment. The last segment
* is always of type ClosingSegment. All constructors take care of this.
(curves_.size() > 0) && dynamic_cast<ClosingSegment>(curves_.back())
*/
ClosingSegment() : LineSegment() {}
};
enum Stitching {
NO_STITCHING=0,
};
StitchSegment() : LineSegment() {}
};
// Path(Path const &other) - use default copy constructor
closed_(false)
{
}
const_iterator const &last,
bool closed=false)
{
if (!get_curves().empty()) {
} else {
}
}
// Path &operator=(Path const &other) - use default assignment operator
}
return get_curves()[i];
}
}
Curve const &back_default() const {
}
const_iterator end_default() const {
}
size_type size_default() const {
}
Rect boundsFast() const;
Rect boundsExact() const;
unsigned i = 1;
bool degenerate = true;
// pw<d2<>> is always open. so if path is closed, add closing segment as well to pwd2.
if (!it->isDegenerate()) {
degenerate = false;
}
}
if (degenerate) {
// if path only contains degenerate curves, no second cut is added
// so we need to create at least one segment manually
}
return ret;
}
}
}
ret *= m;
return ret;
}
{
if ( t < 0 || t > sz )
{
THROW_RANGEERROR("parameter t out of bounds");
}
unsigned int i = static_cast<unsigned int>(k);
if ( i == sz )
{
--i;
lt = 1;
}
}
{
if ( t < 0 || t > sz )
{
THROW_RANGEERROR("parameter t out of bounds");
}
unsigned int i = static_cast<unsigned int>(k);
if ( i == sz )
{
--i;
lt = 1;
}
}
{
return pointAt(t);
}
for(unsigned i = 0; i <= size(); i++) {
}
return res;
}
{
}
double nearestPoint(Point const& _point, double from, double to, double *distance_squared = NULL) const;
{
}
void appendPortionTo(Path &p, double f, double t) const;
appendPortionTo(ret, f, t);
return ret;
}
{
}
return ret;
}
{
unshare();
}
const_iterator const &first,
const_iterator const &last,
{
unshare();
}
void clear() {
unshare();
}
unshare();
if (stitching) {
} else {
}
}
{
unshare();
if (stitching) {
} else {
}
}
// erase last segment of path
void erase_last() {
}
{
unshare();
}
iterator const &last_replaced,
{
unshare();
}
const_iterator const &first,
const_iterator const &last,
{
unshare();
}
iterator const &last_replaced,
const_iterator const &first,
const_iterator const &last,
{
unshare();
}
clear();
}
void setInitial(Point const& p)
{
if ( empty() ) return;
unshare();
head->setInitial(p);
}
{
if ( empty() ) return;
unshare();
}
unshare();
}
unshare();
}
}
if (!empty() && finalPoint() != p) {
unshare();
}
}
/*
* It is important to note that the coordinates passed to appendNew should be finite!
*/
void appendNew(A a) {
unshare();
}
void appendNew(A a, B b) {
unshare();
}
void appendNew(A a, B b, C c) {
unshare();
}
typename D>
void appendNew(A a, B b, C c, D d) {
unshare();
}
void appendNew(A a, B b, C c, D d, E e) {
unshare();
}
void appendNew(A a, B b, C c, D d, E e, F f) {
unshare();
}
typename G>
void appendNew(A a, B b, C c, D d, E e, F f, G g) {
unshare();
}
void appendNew(A a, B b, C c, D d, E e, F f, G g, H h) {
unshare();
}
void appendNew(A a, B b, C c, D d, E e, F f, G g, H h, I i) {
unshare();
}
}
}
void unshare() {
}
}
}
// n.b. takes ownership of curve object
bool closed_;
}; // end class Path
}
return ret;
}
inline
{
return c.nearestPoint(p);
}
} // end namespace Geom
template <>
{
a.swap(b);
}
} // end namespace std
#endif // SEEN_GEOM_PATH_H
/*
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 :