PrimitiveType class final
How vertices are assembled into primitives.
Lists need nothing; strips and points are capabilities, since
1.0.0-rc.1: triangleStrip and lineStrip are
DeviceFeature.primitiveStrips, with primitive restart always on, and
point is DeviceFeature.pointPrimitives. PassEncoder.setPrimitiveType
has the rules; what a backend may never do is assemble one of these as
another.
A class with constants rather than an enum, so a value added in a minor
release does not break a switch written against it: name is what a
file or a snapshot writes, and byName reads it back.
- Available extensions
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStrip → bool
-
Available on PrimitiveType, provided by the PrimitiveTypeFeatures extension
Whether this is a strip, where an all-ones index restarts.no setter - name → String
-
The stable name, and the wire name: what a file, a report or a snapshot
writes for this value. Never renamed within a major.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkFeatures(
DeviceFeatures features, {required String backend}) → void -
Available on PrimitiveType, provided by the PrimitiveTypeFeatures extension
ThrowsUnsupportedCapabilityExceptionwhenfeatureslacks what this topology needs: a strip (primitiveStrips) or points (pointPrimitives). Triangle and line lists need nothing. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
byName(
String name) → PrimitiveType? -
The value called
name, or null for a name this version does not know, which is what a file written by a later version can carry.
Constants
- line → const PrimitiveType
- Every two vertices make an independent line segment.
- lineStrip → const PrimitiveType
-
Each vertex after the first makes a segment with the one before it. Needs
DeviceFeature.primitiveStrips; primitive restart is always on. - point → const PrimitiveType
-
Every vertex is one point. Needs
DeviceFeature.pointPrimitives. - triangle → const PrimitiveType
- Every three vertices make an independent triangle.
- triangleStrip → const PrimitiveType
-
Each vertex after the second makes a triangle with the two before it.
Needs
DeviceFeature.primitiveStrips; primitive restart is always on. -
values
→ const List<
PrimitiveType> - Every value this version names, in declaration order. A later version appends; nothing is removed or renamed within a major.