PlainModelDocument class final

A ModelDocument assembled by hand, from plain lists.

The one fake every writer's test needs, so there is one of it. A test of a writer wants a document that came from nowhere in particular — no decoder, no file — and before this each writer's test file declared its own private _Document doing exactly that, field for field the same as the next one's. Two copies of a class are two places a third field can be added to one and forgotten in the other.

nodes defaults to empty rather than to ModelDocument's own "one node per surface" fallback, so a document built here has exactly the fields it was given and nothing a later change to that fallback could move underneath a test that never asked for it. A test of the fallback itself constructs ModelDocument some other way.

A second, real use: rebuilding a document with one field changed. flutter3d_build's converter (ap-07) reads every field off a decoded document and rebuilds one with images alone re-encoded to a compressed format — every other decoder-specific override (a real node hierarchy, a skin) already resolved to a plain value by the time it is read, so copying the values rather than wrapping the original loses nothing and needs no decorator that forwards every current and future getter.

Inheritance

Constructors

PlainModelDocument({List<ModelSurface> surfaces = const <ModelSurface>[], List<SurfaceMaterial> materials = const <SurfaceMaterial>[], List<EncodedImage> images = const <EncodedImage>[], List<ModelNode> nodes = const <ModelNode>[], List<AnimationClip> animations = const <AnimationClip>[], List<ModelSkin> skins = const <ModelSkin>[], List<ModelLight> lights = const <ModelLight>[], List<ModelCamera> cameras = const <ModelCamera>[], List<String> warnings = const <String>[], DocumentAsset? asset})
const

Properties

animations → List<AnimationClip>
Clips that drive nodes. Empty for formats that carry no animation.
final
asset → DocumentAsset?
What the source file said about itself. Null for a format that carries no such block, or a document nobody has set one on.
final
cameras → List<ModelCamera>
Cameras a node in nodes may point at, by ModelNode.cameraIndex. Empty for formats that carry none — OBJ and .f3d among them.
final
hashCode → int
The hash code for this object.
no setterinherited
images → List<EncodedImage>
final
lights → List<ModelLight>
Punctual lights a node in nodes may point at, by ModelNode.lightIndex — fmt-28's own row. Empty for formats that carry no light, which is every one of them except glTF's own KHR_lights_punctual.
final
materials → List<SurfaceMaterial>
final
nodes → List<ModelNode>
The model's node hierarchy.
final
roots → List<int>
Indices into nodes with no parent.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skins → List<ModelSkin>
Skeletons. Empty for formats that carry no skinning.
final
surfaces → List<ModelSurface>
final
triangleCount → int
no setterinherited
vertexCount → int
no setterinherited
warnings → List<String>
Non-fatal findings from decoding: ignored extensions, skipped primitives, unresolved references. Surfaced rather than logged so callers can decide whether to care.
final

Methods

computeBounds() → Aabb3
Bounds in the model's own space.
inherited
maskUnder(String name) → AnimationMask
The joints at and under the node called name, as a mask a layer takes.
inherited
maskUnderIndex(int root) → AnimationMask
The same, from an index into nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited