pathvector.h revision 684a5fa4464dc8650d34718e955869846b34bb3f
/** @file
* @brief PathVector - a sequence of subpaths
*//*
* Authors:
* Johan Engelen <j.b.c.engelen@alumnus.utwente.nl>
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright 2008-2014 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 LIB2GEOM_SEEN_PATHVECTOR_H
#define LIB2GEOM_SEEN_PATHVECTOR_H
#include <boost/shared_ptr.hpp>
/** @brief Generalized time value in the path vector.
*
* This class exists because mapping the range of multiple curves onto the same interval
* as the curve index, we lose some precision. For instance, a path with 16 curves will
* have 4 bits less precision than a path with 1 curve. If you need high precision results
* in long paths, use this class and related methods instead of the standard methods
* pointAt(), nearestTime() and so on.
*
* @ingroup Paths */
struct PathVectorTime
{
}
return false;
}
}
PathTime const &asPathTime() const {
}
};
template <>
struct ShapeTraits<PathVector> {
typedef PathVectorTime TimeType;
//typedef PathVectorInterval IntervalType;
typedef PathVector AffineClosureType;
typedef PathVectorIntersection IntersectionType;
};
/** @brief Sequence of subpaths.
*
* This class corresponds to the SVG notion of a path:
* a sequence of any number of open or closed contiguous subpaths.
* Unlike Path, this class is closed under boolean operations.
*
* If you want to represent an arbitrary shape, this is the best class to use.
* Shapes with a boundary that is composed of only a single contiguous
* component can be represented with Path instead.
*
* @ingroup Paths
*/
> > > > > > > >
{
typedef PathVectorTime Position;
typedef Path value_type;
typedef Path const &const_reference;
PathVector() {}
PathVector(Path const &p)
: _data(1, p)
{}
{}
/// Check whether the vector contains any paths.
/// Get the number of paths in the vector.
/// Get the total number of curves in the vector.
size_type curveCount() const;
}
}
}
}
/// Append a path at the end.
}
/// Remove the last path.
void pop_back() {
}
}
}
/// Remove a path from the vector.
}
/// Remove a range of paths from the vector.
}
/// Remove all paths from the vector.
/** @brief Change the number of paths.
* If the vector size increases, it is passed with paths that contain only
* a degenerate closing segment at (0,0). */
/** @brief Reverse the direction of paths in the vector.
* @param reverse_paths If this is true, the order of paths is reversed as well;
* otherwise each path is reversed, but their order in the
* PathVector stays the same */
void reverse(bool reverse_paths = true);
/** @brief Get a new vector with reversed direction of paths.
* @param reverse_paths If this is true, the order of paths is reversed as well;
* otherwise each path is reversed, but their order in the
* PathVector stays the same */
/// Get the range of allowed time values.
}
/** @brief Get the first point in the first path of the vector.
* This method will throw an exception if the vector doesn't contain any paths. */
Point initialPoint() const {
}
/** @brief Get the last point in the last path of the vector.
* This method will throw an exception if the vector doesn't contain any paths. */
Point finalPoint() const {
}
}
}
}
}
}
OptRect boundsFast() const;
OptRect boundsExact() const;
operator*=(T const &t) {
*i *= t;
}
return *this;
}
}
/** @brief Determine the winding number at the specified point.
* This is simply the sum of winding numbers for constituent paths. */
};
} // end namespace Geom
#endif // LIB2GEOM_SEEN_PATHVECTOR_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:fileencoding=utf-8:textwidth=99 :