Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::graph::Outline Class Reference

Define a single continuous stroke by control vertices. More...

#include <Outline.hpp>

Collaboration diagram for gamp::graph::Outline:

Public Types

typedef uint32_t size_type
 

Public Member Functions

constexpr Outline ()
 
constexpr Outline (size_type vertCapacity)
 
void addVertex (const Vertex &vertex)
 Appends a vertex to the outline loop/strip.
 
void addVertex (size_type position, const Vertex &vertex)
 Insert the Vertex element at the given position to the outline loop/strip.
 
const AABBox3fbounds () const noexcept
 
int compareTo (const Outline &other) const noexcept
 Compare two outline's Bounding Box size.
 
constexpr bool empty () const noexcept
 
Winding getWinding () const noexcept
 Returns the cached or computed winding of this Outlines polyline using VectorUtil#area(ArrayList).
 
constexpr bool isClosed () const noexcept
 
bool isComplex () const noexcept
 Returns cached or computed result if whether this Outlines polyline is a complex shape.
 
bool isEmpty () const noexcept
 
const VertexlastVertex () const noexcept
 
constexpr bool operator== (const Outline &o) const noexcept
 
void removeVertex (size_type position)
 Removes the Vertex element at the given position.
 
constexpr void reserve (size_type newVertCapacity)
 
bool setClosed (bool closeTail)
 Ensure this outline is closed.
 
void setWinding (Winding enforce)
 Sets Winding to this outline.
 
Outline transform (const AffineTransform &t) const
 Returns a transformed copy of this instance using the given AffineTransform.
 
constexpr const Vertexvertex (size_type i) const noexcept
 
constexpr Vertexvertex (size_type i) noexcept
 
constexpr size_type vertexCount () const noexcept
 
constexpr const VertexListvertices () const noexcept
 
constexpr VertexListvertices () noexcept
 

Static Public Attributes

static constexpr size_type max_elements = std::numeric_limits<uint32_t>::max() / sizeof(uint32_t)
 byte-size int32_t limit: 536'870'911 (FIXME: Adjust to actual type, i.e. Vertex = 2x Vec3f?)
 

Detailed Description

Define a single continuous stroke by control vertices.

The vertices define the shape of the region defined by this outline. The Outline can contain a list of off-curve and on-curve vertices which define curved regions.

Note: An outline should be closed to be rendered as a region.

See also
OutlineShape
Region

Definition at line 51 of file Outline.hpp.

Member Typedef Documentation

◆ size_type

Definition at line 71 of file Outline.hpp.

Constructor & Destructor Documentation

◆ Outline() [1/2]

gamp::graph::Outline::Outline ( )
inlineconstexpr

Definition at line 75 of file Outline.hpp.

Here is the caller graph for this function:

◆ Outline() [2/2]

gamp::graph::Outline::Outline ( size_type vertCapacity)
inlineconstexpr

Definition at line 77 of file Outline.hpp.

Member Function Documentation

◆ reserve()

void gamp::graph::Outline::reserve ( size_type newVertCapacity)
inlineconstexpr

Definition at line 85 of file Outline.hpp.

◆ empty()

bool gamp::graph::Outline::empty ( ) const
inlineconstexprnoexcept

Definition at line 87 of file Outline.hpp.

Here is the caller graph for this function:

◆ vertexCount()

size_type gamp::graph::Outline::vertexCount ( ) const
inlineconstexprnoexcept

Definition at line 89 of file Outline.hpp.

Here is the caller graph for this function:

◆ vertices() [1/2]

const VertexList & gamp::graph::Outline::vertices ( ) const
inlineconstexprnoexcept

Definition at line 91 of file Outline.hpp.

Here is the caller graph for this function:

◆ vertices() [2/2]

VertexList & gamp::graph::Outline::vertices ( )
inlineconstexprnoexcept

Definition at line 92 of file Outline.hpp.

◆ vertex() [1/2]

const Vertex & gamp::graph::Outline::vertex ( size_type i) const
inlineconstexprnoexcept

Definition at line 94 of file Outline.hpp.

Here is the caller graph for this function:

◆ vertex() [2/2]

Vertex & gamp::graph::Outline::vertex ( size_type i)
inlineconstexprnoexcept

Definition at line 95 of file Outline.hpp.

◆ removeVertex()

void gamp::graph::Outline::removeVertex ( size_type position)
inline

Removes the Vertex element at the given position.

Sets the bounding box dirty, hence a next call to bounds() will validate it.

Parameters
positionof the to be removed Vertex

Definition at line 104 of file Outline.hpp.

◆ isEmpty()

bool gamp::graph::Outline::isEmpty ( ) const
inlinenoexcept

Definition at line 111 of file Outline.hpp.

◆ lastVertex()

const Vertex & gamp::graph::Outline::lastVertex ( ) const
inlinenoexcept

Definition at line 115 of file Outline.hpp.

Here is the caller graph for this function:

◆ isClosed()

bool gamp::graph::Outline::isClosed ( ) const
inlineconstexprnoexcept

Definition at line 122 of file Outline.hpp.

◆ setClosed()

bool gamp::graph::Outline::setClosed ( bool closeTail)
inline

Ensure this outline is closed.

Checks whether the last vertex equals to the first. If not equal, it either appends a copy of the first vertex or prepends a copy of the last vertex, depending on closeTail.

Parameters
closeTailif true, a copy of the first vertex will be appended, otherwise a copy of the last vertex will be prepended.
Returns
true if closing performed, otherwise false for NOP

Definition at line 135 of file Outline.hpp.

◆ getWinding()

Winding gamp::graph::Outline::getWinding ( ) const
inlinenoexcept

Returns the cached or computed winding of this Outlines polyline using VectorUtil#area(ArrayList).

The result is cached.

Returns
Winding#CCW or Winding#CW

Definition at line 159 of file Outline.hpp.

Here is the caller graph for this function:

◆ setWinding()

void gamp::graph::Outline::setWinding ( Winding enforce)
inline

Sets Winding to this outline.

If the enforced Winding doesn't match this Outline, the vertices are reversed.

Parameters
enforceto be enforced Winding

Definition at line 180 of file Outline.hpp.

Here is the caller graph for this function:

◆ isComplex()

bool gamp::graph::Outline::isComplex ( ) const
inlinenoexcept

Returns cached or computed result if whether this Outlines polyline is a complex shape.

A polyline with less than 3 elements is marked a simple shape for simplicity.

The result is cached.

Definition at line 203 of file Outline.hpp.

Here is the caller graph for this function:

◆ bounds()

const AABBox3f & gamp::graph::Outline::bounds ( ) const
inlinenoexcept

Definition at line 223 of file Outline.hpp.

Here is the caller graph for this function:

◆ addVertex() [1/2]

void gamp::graph::Outline::addVertex ( const Vertex & vertex)
inline

Appends a vertex to the outline loop/strip.

Parameters
vertexVertex to be added
Exceptions
NullPointerExceptionif the Vertex element is null

Definition at line 235 of file Outline.hpp.

Here is the caller graph for this function:

◆ addVertex() [2/2]

void gamp::graph::Outline::addVertex ( size_type position,
const Vertex & vertex )
inline

Insert the Vertex element at the given position to the outline loop/strip.

Parameters
positionof the added Vertex
vertexVertex object to be added
Exceptions
NullPointerExceptionif the Vertex element is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position > getVertexNumber())

Definition at line 253 of file Outline.hpp.

◆ transform()

Outline gamp::graph::Outline::transform ( const AffineTransform & t) const
inline

Returns a transformed copy of this instance using the given AffineTransform.

Definition at line 265 of file Outline.hpp.

◆ compareTo()

int gamp::graph::Outline::compareTo ( const Outline & other) const
inlinenoexcept

Compare two outline's Bounding Box size.

Returns
<0, 0, >0 if this this object is less than, equal to, or greater than the other object.
See also
AABBox3f::size()

Definition at line 279 of file Outline.hpp.

◆ operator==()

bool gamp::graph::Outline::operator== ( const Outline & o) const
inlineconstexprnoexcept
Returns
true if o equals bounds and vertices in the same order

Definition at line 294 of file Outline.hpp.

Member Data Documentation

◆ max_elements

size_type gamp::graph::Outline::max_elements = std::numeric_limits<uint32_t>::max() / sizeof(uint32_t)
staticconstexpr

byte-size int32_t limit: 536'870'911 (FIXME: Adjust to actual type, i.e. Vertex = 2x Vec3f?)

Definition at line 73 of file Outline.hpp.


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