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

A Generic shape objects which is defined by a list of Outlines. More...

#include <OutlineShape.hpp>

Collaboration diagram for gamp::graph::OutlineShape:

Public Types

enum class  DirtyBits : uint16_t {
  none = 0 , bounds = 1 << 0 , vertices = 1 << 1 , triangles = 1 << 2 ,
  convex = 1 << 3 , convexOverride = 1 << 4
}
 
typedef uint32_t size_type
 
enum class  VertexState : uint16_t { undefined = 0 , quadratic_nurbs = 1 }
 

Public Member Functions

 OutlineShape ()
 
 OutlineShape (size_type capacity, size_type outlineVertCapacity)
 
constexpr size_type addedVertexCount () const noexcept
 Return the number of newly added vertices during getTriangles(VerticesState) while transforming the outlines to VerticesState::QUADRATIC_NURBS and triangulation.
 
void addEmptyOutline ()
 Add a new empty Outline to the end of this shape's outline list.
 
void addOutline (const Outline &outline)
 Appends the Outline element to the end, ensuring a clean tail.
 
void addOutline (size_type position, const Outline &outline)
 Insert the Outline element at the given position.
 
void addOutlineShape (const OutlineShape &outlineShape)
 Insert the OutlineShape elements of type Outline, .
 
void addVertex (const Vec2f &v, bool onCurve)
 Add a 2D Vertex to the last open outline to the shape's tail.
 
void addVertex (const Vec3f &v, bool onCurve)
 Add a 3D Vertex to the last open outline to the shape's tail.
 
void addVertex (const Vertex &v)
 Adds a vertex to the last open outline to the shape's tail.
 
void addVertex (float x, float y, bool onCurve)
 Add a 2D Vertex to the last open outline to the shape's tail.
 
void addVertex (float x, float y, float z, bool onCurve)
 Add a 3D Vertex to the last open outline to the shape's tail.
 
void addVertex (size_type position, const Vertex &v)
 Adds a vertex to the last open outline to the shape at position @endiliteral.

 
void addVertex (size_type position, float x, float y, float z, bool onCurve)
 Add a 3D Vertex to the last open outline to the shape at position.
 
const AABBox3fbounds () const noexcept
 
void clear ()
 Clears all data and reset all states as if this instance was newly created.
 
void clearCache () noexcept
 Clears cached triangulated data, i.e.
 
void clearOverrideConvex () noexcept
 Clears the isComplex() override done by setOverrideConvex(boolean).
 
void closeLastOutline (bool closeTail)
 Closes the last outline in the shape.
 
void closePath ()
 Closes the current sub-path segment by drawing a straight line back to the coordinates of the last moveTo.
 
int compareTo (const OutlineShape &other) const noexcept
 Compare two outline shape's Bounding Box size.
 
void cubicTo (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3)
 Add a cubic Bézier curve segment, intersecting the last point and the second given point x3/y3 (P3).
 
constexpr DirtyBits dirtyBits () const noexcept
 
bool empty () const noexcept
 
OutlineShape flipFace (float zoffset=0) const
 Returns a copy of this instance with normal() and all outlines() vertices()'s z-axis sign-flipped, used to generate a back-face from a front-face shape.
 
const TriangleRefListgetTriangles (VertexState destinationType=VertexState::quadratic_nurbs)
 Triangulate the OutlineShape generating a list of triangles, while transformOutlines(VerticesState) beforehand.
 
const VertexListgetVertices ()
 Return list of concatenated vertices associated with all Outlines of this object.
 
bool isComplex () const noexcept
 Returns cached or computed result if at least one polyline outline(size_type) is a complex shape, see Outline::isComplex().
 
 JAU_MAKE_BITFIELD_ENUM_STRING_MEMBER (DirtyBits, bounds, vertices, triangles, convex, convexOverride)
 
 JAU_MAKE_ENUM_STRING_MEMBER (VertexState, quadratic_nurbs)
 
const OutlinelastOutline () const noexcept
 Get the last added outline to the list of outlines that define the shape.
 
OutlinelastOutline () noexcept
 Get the last added outline to the list of outlines that define the shape.
 
void lineTo (float x, float y, float z)
 Add a line segment, intersecting the last point and the given point x/y (P1).
 
void markClean (DirtyBits flags) noexcept
 
void moveTo (float x, float y, float z)
 Start a new position for the next line segment at given point x/y (P1).
 
constexpr const Vec3fnormal () const noexcept
 Normal vector, optionally used by tesselator to add (interleaved) normals.
 
constexpr Vec3fnormal () noexcept
 Writing the normal vector, optionally used by tesselator to add (interleaved) normals.
 
constexpr bool operator== (const OutlineShape &o) const noexcept
 
const Outlineoutline (size_type i) const noexcept
 
Outlineoutline (size_type i) noexcept
 
size_type outlineCount () const noexcept
 Returns the number of Outlines.
 
const OutlineListoutlines () const noexcept
 
OutlineListoutlines () noexcept
 
VertexState outlineState () const noexcept
 
void quadTo (float x1, float y1, float z1, float x2, float y2, float z2)
 Add a quadratic curve segment, intersecting the last point and the second given point x2/y2 (P2).
 
void removeOutline (size_type position)
 Removes the Outline element at the given position.
 
constexpr void reserve (size_type newCapacity)
 
void setIsQuadraticNurbs () noexcept
 Claim this outline's vertices are all VertexState::quadratic_nurbs, hence no cubic transformations will be performed.
 
void setOutline (size_type position, const Outline &outline)
 Replaces the Outline element at the given position.
 
void setOverrideConvex (bool convex) noexcept
 Overrides isComplex() using the given value instead of computing via Outline#isComplex().
 
void setSharpness (float s) noexcept
 Sets sharpness, defaults to DEFAULT_SHARPNESS.
 
void setWindingOfLastOutline (Winding enforced)
 Sets the enforced Winding of the getLastOutline().
 
constexpr float sharpness () const noexcept
 Sharpness value, defaults to DEFAULT_SHARPNESS.
 
std::string toString () const noexcept
 
OutlineShape transform (const AffineTransform &t) const
 Return a transformed instance with all Outlines are copied and transformed.
 
constexpr bool trianglesDirty () const noexcept
 
size_type vertexCount () const noexcept
 Returns the total vertex number of all Outlines.
 
constexpr bool verticesDirty () const noexcept
 
Winding windingOfLastOutline () const noexcept
 Compute the Winding of the getLastOutline() using the VectorUtil#area(ArrayList) function over all of its vertices.
 

Static Public Attributes

static constexpr float DEFAULT_SHARPNESS = 0.5f
 Initial sharpness() value, which can be modified via setSharpness(float).
 
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

A Generic shape objects which is defined by a list of Outlines.

This Shape can be transformed to triangulations. The list of triangles generated are render-able by a Region object. The triangulation produced by this Shape will define the closed region defined by the outlines.

One or more OutlineShape Object can be associated to a region this is left as a high-level representation of the Objects. For optimizations, flexibility requirements for future features.

Outline shape general Winding rules

Example to creating an Outline Shape:

   addVertex(...)
   addVertex(...)
   addVertex(...)
   addEmptyOutline()
   addVertex(...)
   addVertex(...)
   addVertex(...)

The above will create two outlines each with three vertices. By adding these two outlines to the OutlineShape, we are stating that the combination of the two outlines represent the shape.

To specify that the shape is curved at a region, the on-curve flag should be set to false for the vertex that is in the middle of the curved region (if the curved region is defined by 3 vertices (quadratic curve).

In case the curved region is defined by 4 or more vertices the middle vertices should both have the on-curve flag set to false.

Example:

   addVertex(0,0, true);
   addVertex(0,1, false);
   addVertex(1,1, false);
   addVertex(1,0, true);

The above snippet defines a cubic nurbs curve where (0,1 and 1,1) do not belong to the final rendered shape.

Implementation Notes:

  • The first vertex of any outline belonging to the shape should be on-curve
  • Intersections between off-curved parts of the outline is not handled
See also
Outline
Region
Examples
Primitives02.cpp.

Definition at line 100 of file OutlineShape.hpp.

Member Typedef Documentation

◆ size_type

Definition at line 102 of file OutlineShape.hpp.

Member Enumeration Documentation

◆ DirtyBits

enum class gamp::graph::OutlineShape::DirtyBits : uint16_t
strong
Enumerator
none 
bounds 
vertices 
triangles 

<Modified shape, requires to update the vertices and triangles, here: vertices

convex 

<Modified shape, requires to update the vertices and triangles, here: triangulation.

convexOverride 

<Modified shape, requires to update the convex determination

Definition at line 110 of file OutlineShape.hpp.

◆ VertexState

enum class gamp::graph::OutlineShape::VertexState : uint16_t
strong
Enumerator
undefined 
quadratic_nurbs 

Definition at line 120 of file OutlineShape.hpp.

Constructor & Destructor Documentation

◆ OutlineShape() [1/2]

gamp::graph::OutlineShape::OutlineShape ( )
inline

Definition at line 138 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ OutlineShape() [2/2]

gamp::graph::OutlineShape::OutlineShape ( size_type capacity,
size_type outlineVertCapacity )
inline

Definition at line 139 of file OutlineShape.hpp.

Member Function Documentation

◆ JAU_MAKE_BITFIELD_ENUM_STRING_MEMBER()

gamp::graph::OutlineShape::JAU_MAKE_BITFIELD_ENUM_STRING_MEMBER ( DirtyBits ,
bounds ,
vertices ,
triangles ,
convex ,
convexOverride  )

◆ JAU_MAKE_ENUM_STRING_MEMBER()

gamp::graph::OutlineShape::JAU_MAKE_ENUM_STRING_MEMBER ( VertexState ,
quadratic_nurbs  )

◆ normal() [1/2]

const Vec3f & gamp::graph::OutlineShape::normal ( ) const
inlineconstexprnoexcept

Normal vector, optionally used by tesselator to add (interleaved) normals.

Examples
GraphShapes01.cpp.

Definition at line 155 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ normal() [2/2]

Vec3f & gamp::graph::OutlineShape::normal ( )
inlineconstexprnoexcept

Writing the normal vector, optionally used by tesselator to add (interleaved) normals.

Definition at line 157 of file OutlineShape.hpp.

◆ addedVertexCount()

size_type gamp::graph::OutlineShape::addedVertexCount ( ) const
inlineconstexprnoexcept

Return the number of newly added vertices during getTriangles(VerticesState) while transforming the outlines to VerticesState::QUADRATIC_NURBS and triangulation.

See also
setIsQuadraticNurbs()
Examples
GraphShapes01.cpp.

Definition at line 164 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ sharpness()

float gamp::graph::OutlineShape::sharpness ( ) const
inlineconstexprnoexcept

Sharpness value, defaults to DEFAULT_SHARPNESS.

Definition at line 167 of file OutlineShape.hpp.

◆ setSharpness()

void gamp::graph::OutlineShape::setSharpness ( float s)
inlinenoexcept

Sets sharpness, defaults to DEFAULT_SHARPNESS.

Definition at line 170 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ clear()

void gamp::graph::OutlineShape::clear ( )
inline

Clears all data and reset all states as if this instance was newly created.

Definition at line 178 of file OutlineShape.hpp.

◆ clearCache()

void gamp::graph::OutlineShape::clearCache ( )
inlinenoexcept

Clears cached triangulated data, i.e.

getTriangles(VerticesState) and getVertices().

Examples
GraphShapes01.cpp.

Definition at line 191 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ reserve()

void gamp::graph::OutlineShape::reserve ( size_type newCapacity)
inlineconstexpr

Definition at line 197 of file OutlineShape.hpp.

◆ dirtyBits()

DirtyBits gamp::graph::OutlineShape::dirtyBits ( ) const
inlineconstexprnoexcept

Definition at line 199 of file OutlineShape.hpp.

◆ verticesDirty()

bool gamp::graph::OutlineShape::verticesDirty ( ) const
inlineconstexprnoexcept

Definition at line 200 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ trianglesDirty()

bool gamp::graph::OutlineShape::trianglesDirty ( ) const
inlineconstexprnoexcept

Definition at line 201 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ markClean()

void gamp::graph::OutlineShape::markClean ( DirtyBits flags)
inlinenoexcept

Definition at line 202 of file OutlineShape.hpp.

◆ bounds()

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

Definition at line 214 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ empty()

bool gamp::graph::OutlineShape::empty ( ) const
inlinenoexcept

Definition at line 221 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ outlineCount()

size_type gamp::graph::OutlineShape::outlineCount ( ) const
inlinenoexcept

Returns the number of Outlines.

Definition at line 224 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ vertexCount()

size_type gamp::graph::OutlineShape::vertexCount ( ) const
inlinenoexcept

Returns the total vertex number of all Outlines.

Definition at line 229 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ outlines() [1/2]

const OutlineList & gamp::graph::OutlineShape::outlines ( ) const
inlinenoexcept

Definition at line 237 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ outlines() [2/2]

OutlineList & gamp::graph::OutlineShape::outlines ( )
inlinenoexcept

Definition at line 238 of file OutlineShape.hpp.

◆ outline() [1/2]

const Outline & gamp::graph::OutlineShape::outline ( size_type i) const
inlinenoexcept

Definition at line 240 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ outline() [2/2]

Outline & gamp::graph::OutlineShape::outline ( size_type i)
inlinenoexcept

Definition at line 241 of file OutlineShape.hpp.

◆ lastOutline() [1/2]

const Outline & gamp::graph::OutlineShape::lastOutline ( ) const
inlinenoexcept

Get the last added outline to the list of outlines that define the shape.

Returns
the last outline

Definition at line 248 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ lastOutline() [2/2]

Outline & gamp::graph::OutlineShape::lastOutline ( )
inlinenoexcept

Get the last added outline to the list of outlines that define the shape.

Returns
the last outline

Definition at line 256 of file OutlineShape.hpp.

◆ windingOfLastOutline()

Winding gamp::graph::OutlineShape::windingOfLastOutline ( ) const
inlinenoexcept

Compute the Winding of the getLastOutline() using the VectorUtil#area(ArrayList) function over all of its vertices.

Returns
Winding#CCW or Winding#CW

Definition at line 264 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ setWindingOfLastOutline()

void gamp::graph::OutlineShape::setWindingOfLastOutline ( Winding enforced)
inline

Sets the enforced Winding of the getLastOutline().

Definition at line 271 of file OutlineShape.hpp.

◆ isComplex()

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

Returns cached or computed result if at least one polyline outline(size_type) is a complex shape, see Outline::isComplex().

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

The result is cached.

See also
#setOverrideConvex(boolean)
clearOverrideConvex()

Definition at line 286 of file OutlineShape.hpp.

◆ setOverrideConvex()

void gamp::graph::OutlineShape::setOverrideConvex ( bool convex)
inlinenoexcept

Overrides isComplex() using the given value instead of computing via Outline#isComplex().

See also
clearOverrideConvex()
isComplex()

Definition at line 304 of file OutlineShape.hpp.

◆ clearOverrideConvex()

void gamp::graph::OutlineShape::clearOverrideConvex ( )
inlinenoexcept

Clears the isComplex() override done by setOverrideConvex(boolean).

See also
#setOverrideConvex(boolean)
isComplex()

Definition at line 314 of file OutlineShape.hpp.

◆ addEmptyOutline()

void gamp::graph::OutlineShape::addEmptyOutline ( )
inline

Add a new empty Outline to the end of this shape's outline list.

If the getLastOutline() is empty already, no new one will be added.

After a call to this function all new vertices added will belong to the new outline

Definition at line 327 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ addOutline() [1/2]

void gamp::graph::OutlineShape::addOutline ( const Outline & outline)
inline

Appends the Outline element to the end, ensuring a clean tail.

A clean tail is ensured, no double empty Outlines are produced and a pre-existing empty outline will be replaced with the given one.

Parameters
outlineOutline object to be added
Exceptions
NullPointerExceptionif the Outline element is null

Definition at line 343 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ addOutline() [2/2]

void gamp::graph::OutlineShape::addOutline ( size_type position,
const Outline & outline )
inline

Insert the Outline element at the given position.

If the position indicates the end of this list, a clean tail is ensured, no double empty Outlines are produced and a pre-existing empty outline will be replaced with the given one.

Parameters
positionof the added Outline
outlineOutline object to be added
Exceptions
NullPointerExceptionif the Outline element is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position > getOutlineNumber())

Definition at line 359 of file OutlineShape.hpp.

◆ addOutlineShape()

void gamp::graph::OutlineShape::addOutlineShape ( const OutlineShape & outlineShape)
inline

Insert the OutlineShape elements of type Outline, .

. at the end of this shape, using addOutline(Outline) for each element.

Closes the current last outline via closeLastOutline(boolean) before adding the new ones.

Parameters
outlineShapeOutlineShape elements to be added.
Exceptions
NullPointerExceptionif the OutlineShape is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position > getOutlineNumber())

Definition at line 390 of file OutlineShape.hpp.

◆ setOutline()

void gamp::graph::OutlineShape::setOutline ( size_type position,
const Outline & outline )
inline

Replaces the Outline element at the given position.

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

Parameters
positionof the replaced Outline
outlinereplacement Outline object
Exceptions
NullPointerExceptionif the Outline element is null
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position >= getOutlineNumber())

Definition at line 406 of file OutlineShape.hpp.

◆ removeOutline()

void gamp::graph::OutlineShape::removeOutline ( size_type position)
inline

Removes the Outline element at the given position.

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

Parameters
positionof the to be removed Outline
Exceptions
IndexOutOfBoundsExceptionif position is out of range (position < 0 || position >= getOutlineNumber())

Definition at line 418 of file OutlineShape.hpp.

◆ addVertex() [1/7]

void gamp::graph::OutlineShape::addVertex ( const Vertex & v)
inline

Adds a vertex to the last open outline to the shape's tail.

Parameters
vthe vertex to be added to the OutlineShape
See also
see winding rules

Definition at line 432 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ addVertex() [2/7]

void gamp::graph::OutlineShape::addVertex ( size_type position,
const Vertex & v )
inline

Adds a vertex to the last open outline to the shape at position @endiliteral.

Parameters
positionindex within the last open outline, at which the vertex will be added
vthe vertex to be added to the OutlineShape
See also
see winding rules

Definition at line 449 of file OutlineShape.hpp.

◆ addVertex() [3/7]

void gamp::graph::OutlineShape::addVertex ( float x,
float y,
float z,
bool onCurve )
inline

Add a 3D Vertex to the last open outline to the shape's tail.

Parameters
xthe x coordinate
ythe y coordinate
zthe z coordinate
onCurveflag if this vertex is on the curve or defines a curved region of the shape around this vertex.
See also
see winding rules

Definition at line 468 of file OutlineShape.hpp.

◆ addVertex() [4/7]

void gamp::graph::OutlineShape::addVertex ( const Vec3f & v,
bool onCurve )
inline

Add a 3D Vertex to the last open outline to the shape's tail.

Parameters
vthe Vec3f coordinates
onCurveflag if this vertex is on the curve or defines a curved region of the shape around this vertex.
See also
see winding rules

Definition at line 479 of file OutlineShape.hpp.

◆ addVertex() [5/7]

void gamp::graph::OutlineShape::addVertex ( float x,
float y,
bool onCurve )
inline

Add a 2D Vertex to the last open outline to the shape's tail.

Parameters
xthe x coordinate
ythe y coordinate
onCurveflag if this vertex is on the curve or defines a curved region of the shape around this vertex.
See also
see winding rules

Definition at line 491 of file OutlineShape.hpp.

◆ addVertex() [6/7]

void gamp::graph::OutlineShape::addVertex ( const Vec2f & v,
bool onCurve )
inline

Add a 2D Vertex to the last open outline to the shape's tail.

Parameters
vthe Vec2f coordinates
onCurveflag if this vertex is on the curve or defines a curved region of the shape around this vertex.
See also
see winding rules

Definition at line 502 of file OutlineShape.hpp.

◆ addVertex() [7/7]

void gamp::graph::OutlineShape::addVertex ( size_type position,
float x,
float y,
float z,
bool onCurve )
inline

Add a 3D Vertex to the last open outline to the shape at position.

Parameters
positionindex within the last open outline, at which the vertex will be added
xthe x coordinate
ythe y coordniate
zthe z coordinate
onCurveflag if this vertex is on the curve or defines a curved region of the shape around this vertex.
See also
see winding rules

Definition at line 516 of file OutlineShape.hpp.

◆ moveTo()

void gamp::graph::OutlineShape::moveTo ( float x,
float y,
float z )
inline

Start a new position for the next line segment at given point x/y (P1).

Parameters
xpoint (P1)
ypoint (P1)
zpoint (P1)
See also
Path2F#moveTo(float, float)
#addPath(com.jogamp.math.geom.plane.Path2F.Iterator, boolean)
see winding rules
Examples
GraphShapes01.cpp, and Primitives02.cpp.

Definition at line 530 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ lineTo()

void gamp::graph::OutlineShape::lineTo ( float x,
float y,
float z )
inline

Add a line segment, intersecting the last point and the given point x/y (P1).

Parameters
xfinal point (P1)
yfinal point (P1)
zfinal point (P1)
See also
Path2F#lineTo(float, float)
#addPath(com.jogamp.math.geom.plane.Path2F.Iterator, boolean)
see winding rules
Examples
GraphShapes01.cpp, and Primitives02.cpp.

Definition at line 550 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ quadTo()

void gamp::graph::OutlineShape::quadTo ( float x1,
float y1,
float z1,
float x2,
float y2,
float z2 )
inline

Add a quadratic curve segment, intersecting the last point and the second given point x2/y2 (P2).

Parameters
x1quadratic parametric control point (P1)
y1quadratic parametric control point (P1)
z1quadratic parametric control point (P1)
x2final interpolated control point (P2)
y2final interpolated control point (P2)
z2quadratic parametric control point (P2)
See also
Path2F#quadTo(float, float, float, float)
#addPath(com.jogamp.math.geom.plane.Path2F.Iterator, boolean)
see winding rules
Examples
GraphShapes01.cpp.

Definition at line 567 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ cubicTo()

void gamp::graph::OutlineShape::cubicTo ( float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3 )
inline

Add a cubic Bézier curve segment, intersecting the last point and the second given point x3/y3 (P3).

Parameters
x1Bézier control point (P1)
y1Bézier control point (P1)
z1Bézier control point (P1)
x2Bézier control point (P2)
y2Bézier control point (P2)
z2Bézier control point (P2)
x3final interpolated control point (P3)
y3final interpolated control point (P3)
z3final interpolated control point (P3)
See also
Path2F#cubicTo(float, float, float, float, float, float)
#addPath(com.jogamp.math.geom.plane.Path2F.Iterator, boolean)
see winding rules
Examples
GraphShapes01.cpp.

Definition at line 588 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ closeLastOutline()

void gamp::graph::OutlineShape::closeLastOutline ( bool closeTail)
inline

Closes the last outline in the shape.

Checks whether the last vertex equals to the first of the last outline. 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.

Definition at line 604 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ closePath()

void gamp::graph::OutlineShape::closePath ( )
inline

Closes the current sub-path segment by drawing a straight line back to the coordinates of the last moveTo.

If the path is already closed then this method has no effect.

See also
Path2F#closePath()
#addPath(com.jogamp.math.geom.plane.Path2F.Iterator, boolean)
Examples
GraphShapes01.cpp, and Primitives02.cpp.

Definition at line 615 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ outlineState()

VertexState gamp::graph::OutlineShape::outlineState ( ) const
inlinenoexcept

Definition at line 622 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ setIsQuadraticNurbs()

void gamp::graph::OutlineShape::setIsQuadraticNurbs ( )
inlinenoexcept

Claim this outline's vertices are all VertexState::quadratic_nurbs, hence no cubic transformations will be performed.

Definition at line 628 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ transform()

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

Return a transformed instance with all Outlines are copied and transformed.

Note: Triangulated data is lost in returned instance!

Definition at line 639 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ flipFace()

OutlineShape gamp::graph::OutlineShape::flipFace ( float zoffset = 0) const
inline

Returns a copy of this instance with normal() and all outlines() vertices()'s z-axis sign-flipped, used to generate a back-face from a front-face shape.

Examples
GraphShapes01.cpp, and Primitives02.cpp.

Definition at line 650 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ compareTo()

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

Compare two outline shape'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 666 of file OutlineShape.hpp.

◆ operator==()

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

Definition at line 681 of file OutlineShape.hpp.

◆ getVertices()

const VertexList & gamp::graph::OutlineShape::getVertices ( )
inline

Return list of concatenated vertices associated with all Outlines of this object.

Vertices are cached until marked dirty.

Should always be called after getTriangles(VerticesState), since the latter will mark all cached vertices dirty!

Examples
GraphShapes01.cpp.

Definition at line 871 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ getTriangles()

const TriangleRefList & gamp::graph::OutlineShape::getTriangles ( VertexState destinationType = VertexState::quadratic_nurbs)
inline

Triangulate the OutlineShape generating a list of triangles, while transformOutlines(VerticesState) beforehand.

Triangles are cached until marked dirty.

Returns
an arraylist of triangles representing the filled region which is produced by the combination of the outlines
Examples
GraphShapes01.cpp.

Definition at line 936 of file OutlineShape.hpp.

Here is the caller graph for this function:

◆ toString()

std::string gamp::graph::OutlineShape::toString ( ) const
inlinenoexcept

Definition at line 964 of file OutlineShape.hpp.

Member Data Documentation

◆ max_elements

size_type gamp::graph::OutlineShape::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 105 of file OutlineShape.hpp.

◆ DEFAULT_SHARPNESS

float gamp::graph::OutlineShape::DEFAULT_SHARPNESS = 0.5f
staticconstexpr

Initial sharpness() value, which can be modified via setSharpness(float).

Definition at line 108 of file OutlineShape.hpp.


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