diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-05 22:40:31 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-05 22:40:31 +0000 |
| commit | 900577c7e71534ec32dcb4e0677a509a6e517b12 (patch) | |
| tree | 8d5b4c6201b0728bff338e89106d1a8c5a0b7fef /src/line-geometry.cpp | |
| parent | codedread's patch for bug 254850 (fixes handling of description field in Obje... (diff) | |
| download | inkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.tar.gz inkscape-900577c7e71534ec32dcb4e0677a509a6e517b12.zip | |
NR::Maybe => boost::optional
(bzr r6569)
Diffstat (limited to 'src/line-geometry.cpp')
| -rw-r--r-- | src/line-geometry.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/line-geometry.cpp b/src/line-geometry.cpp index d050ec458..056bfb71a 100644 --- a/src/line-geometry.cpp +++ b/src/line-geometry.cpp @@ -52,9 +52,9 @@ Line &Line::operator=(Line const &line) { return *this; } -NR::Maybe<NR::Point> Line::intersect(Line const &line) { +boost::optional<NR::Point> Line::intersect(Line const &line) { NR::Coord denom = NR::dot(v_dir, line.normal); - NR::Maybe<NR::Point> no_point = NR::Nothing(); + boost::optional<NR::Point> no_point; if (fabs(denom) < 1e-6) return no_point; @@ -72,7 +72,7 @@ void Line::set_direction(NR::Point const &dir) NR::Point Line::closest_to(NR::Point const &pt) { /* return the intersection of this line with a perpendicular line passing through pt */ - NR::Maybe<NR::Point> result = this->intersect(Line(pt, (this->v_dir).ccw(), false)); + boost::optional<NR::Point> result = this->intersect(Line(pt, (this->v_dir).ccw(), false)); g_return_val_if_fail (result, NR::Point (0.0, 0.0)); return *result; } @@ -178,7 +178,7 @@ side_of_intersection (NR::Point const &A, NR::Point const &B, NR::Point const &C } } -NR::Maybe<NR::Point> Line::intersection_with_viewbox (SPDesktop *desktop) +boost::optional<NR::Point> Line::intersection_with_viewbox (SPDesktop *desktop) { NR::Rect vb = desktop->get_display_area(); /* remaining viewbox corners */ @@ -188,7 +188,7 @@ NR::Maybe<NR::Point> Line::intersection_with_viewbox (SPDesktop *desktop) std::pair <NR::Point, NR::Point> e = side_of_intersection (vb.min(), lr, vb.max(), ul, this->pt, this->v_dir); if (e.first == e.second) { // perspective line lies outside the canvas - return NR::Nothing(); + return boost::optional<NR::Point>(); } Line line (e.first, e.second); |
