Flutter Impeller
impeller::Arc::Iteration Struct Reference

#include <arc.h>

Classes

struct  Quadrant
 

Public Member Functions

size_t GetPointCount () const
 

Public Attributes

impeller::Vector2 start
 
impeller::Vector2 end
 
size_t quadrant_count = 0u
 
Quadrant quadrants [9]
 

Detailed Description

A structure to describe the iteration through a set of angle vectors in a |Trigs| structure to render the points along an arc. The start and end vectors and each iteration's axis vector are all unit vectors that point in the direction of the point on the circle to be emitted.

Each vector should be rendered by multiplying it by the radius of the circle, or in the case of a stroked arc, by the inner and outer radii of the sides of the stroke.

  • The start vector will always be rendered first.
  • Then each quadrant will be iterated by composing the trigs vectors with the given axis vector, iterating from the start index (inclusive) to the end index (exclusive) of the vector of |Trig| values.
  • Finally the end vector will be rendered. For example: Insert(arc_iteration.start * radius); for (size_t i = 0u; i < arc_iteration.quadrant_count; i++) { Quadrant quadrant = arc_iteration.quadrants[i]; for (j = quadrant.start_index; j < quadrant.end_index; j++) { Insert(trigs[j] * quadrant.axis * radius); } } Insert(arc_iteration.end * radius);

The rendering routine may adjust the manner/order in which those vertices are inserted into the vertex buffer to optimally match the vertex triangle mode it plans to use, but the description above represents the basic technique to compute the points along the actual curve.

Definition at line 42 of file arc.h.

Member Function Documentation

◆ GetPointCount()

size_t impeller::Arc::Iteration::GetPointCount ( ) const

Definition at line 36 of file arc.cc.

36  {
37  size_t count = 2;
38  for (size_t i = 0; i < quadrant_count; i++) {
39  count += quadrants[i].GetPointCount();
40  }
41  return count;
42 }
size_t GetPointCount() const
Definition: arc.h:50
Quadrant quadrants[9]
Definition: arc.h:86
size_t quadrant_count
Definition: arc.h:63

References impeller::Arc::Iteration::Quadrant::GetPointCount(), quadrant_count, and quadrants.

Referenced by impeller::Tessellator::ArcVertexGenerator::GetVertexCount().

Member Data Documentation

◆ end

◆ quadrant_count

size_t impeller::Arc::Iteration::quadrant_count = 0u

◆ quadrants

Quadrant impeller::Arc::Iteration::quadrants[9]

◆ start


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