Sp3dObj class
(en) Flutter implementation of Sp3dObj. The options for this object and internal elements can be freely extended for each application. When writing out, toDict is converted to json. If you want to read it, you can easily restore it by calling fromDict.
(ja) Sp3dObjのFlutter実装です。 このオブジェクト及び内部要素のoptionはアプリケーション毎に自由に拡張できます。 書きだす場合はtoDictしたものをjson化します。読み込む場合はfromDict呼び出しで簡単に復元できます。
Author Masahide Mori
First edition creation date 2021-06-30 22:54:22
Constructors
-
Sp3dObj(List<
Sp3dV3D> vertices, List<Sp3dFragment> fragments, List<Sp3dMaterial> materials, List<Uint8List> images, {String? id, String? name, String? author, Sp3dPhysics? physics, Map<String, dynamic> ? option, int layerNum = 0, EnumSp3dDrawMode drawMode = EnumSp3dDrawMode.normal}) - Constructor
Properties
-
getter/setter pair
- drawMode ↔ EnumSp3dDrawMode
-
getter/setter pair
-
fragments
↔ List<
Sp3dFragment> -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
getter/setter pair
-
images
↔ List<
Uint8List> -
getter/setter pair
- layerNum ↔ int
-
getter/setter pair
-
materials
↔ List<
Sp3dMaterial> -
getter/setter pair
- name ↔ String?
-
getter/setter pair
-
option
↔ Map<
String, dynamic> ? -
getter/setter pair
- physics ↔ Sp3dPhysics?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
vertices
↔ List<
Sp3dV3D> -
getter/setter pair
Methods
-
addImages(
List< Uint8List> images) → List<int> - (en) Appends image data to this object and returns the corresponding index. This method adds image data as is even if it already exists.
-
addMaterialIfNeeded(
Sp3dMaterial m) → int - (en) Add Sp3dMaterial to this object and returns the corresponding index. This method returns the index of the specified material if it already exists and does not add a new material. Adds the specified material if it does not already exist and returns its index. Please note that materials are compared on the basis of content equivalence.
-
addMaterials(
List< Sp3dMaterial> m) → List<int> - (en) Add Sp3dMaterials to this object and returns the corresponding index. This method will add the material as is even if it already exists.
-
addVertices(
List< Sp3dV3D> v) → List<int> - (en) Add vertices to this object and returns the corresponding index.
-
cleaning(
) → Sp3dObj - (en) Remove unused vertices, materials, and images and adjust internal indexes. Please note that this method is processing intensive. Also, please note that the vertices and material index in Sp3dFace, and the image index of Sp3dMaterial will be changed.
-
deepCopy(
) → Sp3dObj - Deep copy the object.
-
getCenter(
) → Sp3dV3D - (en)Gets the average coordinates of this object.
-
merge(
Sp3dObj other) → Sp3dObj - (en)Merge another object into this object. This operation is high cost. id, name, author, physics, option, layerNum and drawMode values do not change.
-
move(
Sp3dV3D v) → Sp3dObj - (en)Adds the specified vector to all vectors of this object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resize(
double mag) → Sp3dObj - (en) Resizes the object to the specified magnification based on the center of the object.
-
reverse(
) → void - (en)Flips the orientation of all faces.
-
reversed(
) → Sp3dObj - (en)Creates and returns a new object with all faces flipped.
-
rotate(
Sp3dV3D norAxis, double radian) → Sp3dObj - (en)Rotates all vectors of this object based on the specified axis.
-
rotateBy(
Sp3dV3D center, Sp3dV3D norAxis, double radian) → Sp3dObj - (en)Rotates all vectors of this object based on the specified axis. This method allows you to rotate this object around any point.
-
rotateInPlace(
Sp3dV3D norAxis, double radian) → Sp3dObj - (en)Rotates all vectors of this object based on the specified axis. Unlike rotate, rotateInPlace performs the rotation around the mean coordinates of this object.
-
setIsTouchableFlags(
bool isTouchable) → Sp3dObj - (en)Change the isTouchable flag of all fragments of this object.
-
toDict(
) → Map< String, dynamic> - Convert the object to a dictionary.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited