Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
TestEventHandler Struct Reference
Inheritance diagram for TestEventHandler:
bentleyottmann::SweepLineInterface

Public Member Functions

 TestEventHandler (skiatest::Reporter *r, Point eventPoint, SkSpan< const Segment > deletions, SkSpan< const Segment > insertions, SkSpan< const Crossing > crossings, HasDeletions hasDeletions=kHasDeletions)
 
void handleDeletions (Point eventPoint, const DeletionSegmentSet &removing) override
 
void handleInsertionsAndCheckForNewCrossings (Point eventPoint, const InsertionSegmentSet &inserting, EventQueueInterface *queue) override
 
- Public Member Functions inherited from bentleyottmann::SweepLineInterface
virtual ~SweepLineInterface ()=default
 
virtual void handleDeletions (Point eventPoint, const DeletionSegmentSet &removing)=0
 
virtual void handleInsertionsAndCheckForNewCrossings (Point eventPoint, const InsertionSegmentSet &inserting, EventQueueInterface *queue)=0
 

Public Attributes

skiatest::Reporter *const fR
 
const Point fCandidateEventPoint
 
std::vector< SegmentfDeletions
 
std::vector< SegmentfInsertions
 
std::vector< CrossingfCrossings
 
const HasDeletions fHasDeletions
 

Detailed Description

Definition at line 135 of file EventQueueTest.cpp.

Constructor & Destructor Documentation

◆ TestEventHandler()

TestEventHandler::TestEventHandler ( skiatest::Reporter r,
Point  eventPoint,
SkSpan< const Segment deletions,
SkSpan< const Segment insertions,
SkSpan< const Crossing crossings,
HasDeletions  hasDeletions = kHasDeletions 
)
inline

Definition at line 136 of file EventQueueTest.cpp.

142 : fR(r)
143 , fCandidateEventPoint{eventPoint}
144 , fDeletions{deletions.begin(), deletions.end()}
145 , fInsertions{insertions.begin(), insertions.end()}
146 , fCrossings{crossings.begin(), crossings.end()}
147 , fHasDeletions{hasDeletions} {}
constexpr T * begin() const
Definition: SkSpan_impl.h:90
constexpr T * end() const
Definition: SkSpan_impl.h:91
std::vector< Crossing > fCrossings
std::vector< Segment > fInsertions
const Point fCandidateEventPoint
std::vector< Segment > fDeletions
skiatest::Reporter *const fR
const HasDeletions fHasDeletions

Member Function Documentation

◆ handleDeletions()

void TestEventHandler::handleDeletions ( Point  eventPoint,
const DeletionSegmentSet removing 
)
inlineoverridevirtual

Implements bentleyottmann::SweepLineInterface.

Definition at line 149 of file EventQueueTest.cpp.

150 {
152 REPORTER_ASSERT(fR, false, "There should be no deletions.");
153 return;
154 }
155
157
158 REPORTER_ASSERT(fR, removing.size() == fDeletions.size());
159
160 for (const Segment& s : fDeletions) {
161 REPORTER_ASSERT(fR, removing.find(s) != removing.end());
162 }
163 }
@ kHasNoDeletions
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
struct MyStruct s

◆ handleInsertionsAndCheckForNewCrossings()

void TestEventHandler::handleInsertionsAndCheckForNewCrossings ( Point  eventPoint,
const InsertionSegmentSet inserting,
EventQueueInterface queue 
)
inlineoverridevirtual

Implements bentleyottmann::SweepLineInterface.

Definition at line 166 of file EventQueueTest.cpp.

168 {
170
171 REPORTER_ASSERT(fR, inserting.size() == fInsertions.size());
172
173 for (const Segment& s : fInsertions) {
174 REPORTER_ASSERT(fR, inserting.find(s) != inserting.end());
175 }
176
177 for (const Crossing& crossing : fCrossings) {
178 auto [s0, s1, pt] = crossing;
179 queue->addCrossing(pt, s0, s1);
180 }
181 }
VkQueue queue
Definition: main.cc:55

Member Data Documentation

◆ fCandidateEventPoint

const Point TestEventHandler::fCandidateEventPoint

Definition at line 184 of file EventQueueTest.cpp.

◆ fCrossings

std::vector<Crossing> TestEventHandler::fCrossings

Definition at line 187 of file EventQueueTest.cpp.

◆ fDeletions

std::vector<Segment> TestEventHandler::fDeletions

Definition at line 185 of file EventQueueTest.cpp.

◆ fHasDeletions

const HasDeletions TestEventHandler::fHasDeletions

Definition at line 188 of file EventQueueTest.cpp.

◆ fInsertions

std::vector<Segment> TestEventHandler::fInsertions

Definition at line 186 of file EventQueueTest.cpp.

◆ fR

skiatest::Reporter* const TestEventHandler::fR

Definition at line 183 of file EventQueueTest.cpp.


The documentation for this struct was generated from the following file: