Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
modules
bentleyottmann
src
BentleyOttmann1.cpp
Go to the documentation of this file.
1
// Copyright 2023 Google LLC
2
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
4
#include "
modules/bentleyottmann/include/BentleyOttmann1.h
"
5
6
#include "
modules/bentleyottmann/include/EventQueue.h
"
7
#include "
modules/bentleyottmann/include/Segment.h
"
8
#include "
modules/bentleyottmann/include/SweepLine.h
"
9
10
#include <optional>
11
#include <utility>
12
#include <vector>
13
14
namespace
bentleyottmann
{
15
16
std::optional<std::vector<Crossing>>
bentley_ottmann_1
(
SkSpan<const Segment>
segments) {
17
if
(
auto
possibleEQ =
EventQueue::Make
(segments)) {
18
EventQueue
eventQueue = std::move(possibleEQ.value());
19
SweepLine
sweepLine;
20
while
(eventQueue.
hasMoreEvents
()) {
21
eventQueue.
handleNextEventPoint
(&sweepLine);
22
}
23
return
eventQueue.
crossings
();
24
}
25
return
std::nullopt;
26
}
27
}
// namespace bentleyottmann
BentleyOttmann1.h
EventQueue.h
Segment.h
SweepLine.h
SkSpan
Definition
SkSpan_impl.h:65
bentleyottmann::EventQueue
Definition
EventQueue.h:58
bentleyottmann::EventQueue::crossings
std::vector< Crossing > crossings()
Definition
EventQueue.cpp:125
bentleyottmann::EventQueue::hasMoreEvents
bool hasMoreEvents() const
Definition
EventQueue.cpp:54
bentleyottmann::EventQueue::handleNextEventPoint
void handleNextEventPoint(SweepLineInterface *handler)
Definition
EventQueue.cpp:63
bentleyottmann::EventQueue::Make
static std::optional< EventQueue > Make(SkSpan< const Segment > segments)
Definition
EventQueue.cpp:14
bentleyottmann::SweepLine
Definition
SweepLine.h:16
bentleyottmann
Definition
BentleyOttmann1.h:12
bentleyottmann::bentley_ottmann_1
std::optional< std::vector< Crossing > > bentley_ottmann_1(SkSpan< const Segment > segments)
Definition
BentleyOttmann1.cpp:16
Generated on Fri Apr 26 2024 06:16:16 for Flutter Engine by
1.9.8