AsImpL 1.0
Asynchronous Importer and run-time Loader for Unity
AsImpL.DataSet Class Reference

Data set for storing data in a neutral format for a generic model More...

Classes

class  FaceGroupData
 Container class for faces group data. More...
 
struct  FaceIndices
 Indices for each vertex More...
 
class  ObjectData
 Container class for object data. More...
 

Public Member Functions

 DataSet ()
 Constructor: create data lists and initialzize the default object. More...
 
void AddObject (string objectName)
 Add and initialize a new object. More...
 
void AddGroup (string groupName)
 Add and initialize a new group and add it to the current object. More...
 
void AddMaterialName (string matName)
 Set a new material name to the current group (add a group if not yet added). More...
 
void AddVertex (Vector3 vertex)
 Add a vertex to the global vertex list More...
 
void AddUV (Vector2 uv)
 Add a texture coordinate (U,V) to the global list More...
 
void AddNormal (Vector3 normal)
 Add a new normal to the global list More...
 
void AddColor (Color color)
 Add a new color to the global list More...
 
void AddFaceIndices (FaceIndices faceIdx)
 Add a new face indices entry to the current faces group More...
 
void PrintSummary ()
 Print a summary of the stored data More...
 

Static Public Member Functions

static string GetFaceIndicesKey (FaceIndices fi)
 Get a string key based on the given face indices More...
 
static string FixMaterialName (string mtlName)
 Change the material name to be compliant with Unity material asset naming. More...
 

Public Attributes

List< ObjectDataobjectList = new List<ObjectData>()
 List of objects More...
 
List< Vector3 > vertList = new List<Vector3>()
 List of vertices More...
 
List< Vector2 > uvList = new List<Vector2>()
 List of texture coordinates (UV) More...
 
List< Vector3 > normalList = new List<Vector3>()
 List of normals More...
 
List< Color > colorList = new List<Color>()
 List of colors More...
 

Properties

string? CurrGroupName [get]
 Name of the current group. More...
 
bool IsEmpty [get]
 Check if there is no vertex defined. More...
 

Detailed Description

Data set for storing data in a neutral format for a generic model

This should be completed and extended to support more formats.

TODO: Classes to hold data for internal hierarchy should be defined.

Constructor & Destructor Documentation

◆ DataSet()

AsImpL.DataSet.DataSet ( )

Constructor: create data lists and initialzize the default object.

Member Function Documentation

◆ AddColor()

void AsImpL.DataSet.AddColor ( Color  color)

Add a new color to the global list

Parameters
colorcolor

◆ AddFaceIndices()

void AsImpL.DataSet.AddFaceIndices ( FaceIndices  faceIdx)

Add a new face indices entry to the current faces group

Parameters
faceIdxnew vertex indices

◆ AddGroup()

void AsImpL.DataSet.AddGroup ( string  groupName)

Add and initialize a new group and add it to the current object.

Parameters
groupNamename of the new group

◆ AddMaterialName()

void AsImpL.DataSet.AddMaterialName ( string  matName)

Set a new material name to the current group (add a group if not yet added).

Parameters
matNamename of the new material

TODO: do not split by materials if there is only one meterial

◆ AddNormal()

void AsImpL.DataSet.AddNormal ( Vector3  normal)

Add a new normal to the global list

Parameters
normalnormal

◆ AddObject()

void AsImpL.DataSet.AddObject ( string  objectName)

Add and initialize a new object.

Parameters
objectNamename of the new object

◆ AddUV()

void AsImpL.DataSet.AddUV ( Vector2  uv)

Add a texture coordinate (U,V) to the global list

Parameters
uvtexture coordinate (U,V)

◆ AddVertex()

void AsImpL.DataSet.AddVertex ( Vector3  vertex)

Add a vertex to the global vertex list

Parameters
vertexnew vertex

◆ FixMaterialName()

static string AsImpL.DataSet.FixMaterialName ( string  mtlName)
static

Change the material name to be compliant with Unity material asset naming.

Parameters
mtlNameoriginal material name
Returns
Returns the name modified to be compliant with Unity material asset naming.

◆ GetFaceIndicesKey()

static string AsImpL.DataSet.GetFaceIndicesKey ( FaceIndices  fi)
static

Get a string key based on the given face indices

Parameters
fiface indices structure
Returns

◆ PrintSummary()

void AsImpL.DataSet.PrintSummary ( )

Print a summary of the stored data

Member Data Documentation

◆ colorList

List<Color> AsImpL.DataSet.colorList = new List<Color>()

List of colors

◆ normalList

List<Vector3> AsImpL.DataSet.normalList = new List<Vector3>()

List of normals

◆ objectList

List<ObjectData> AsImpL.DataSet.objectList = new List<ObjectData>()

List of objects

◆ uvList

List<Vector2> AsImpL.DataSet.uvList = new List<Vector2>()

List of texture coordinates (UV)

◆ vertList

List<Vector3> AsImpL.DataSet.vertList = new List<Vector3>()

List of vertices

Property Documentation

◆ CurrGroupName

string? AsImpL.DataSet.CurrGroupName
get

Name of the current group.

◆ IsEmpty

bool AsImpL.DataSet.IsEmpty
get

Check if there is no vertex defined.


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