colladaLoader.xmlMapping
Class Triangles

java.lang.Object
  extended by colladaLoader.xmlMapping.SubTag
      extended by colladaLoader.xmlMapping.Triangles

 class Triangles
extends SubTag

Lucerne University of Applied Sciences and Arts http://www.hslu.ch

This source is free; you can redistribute it and/or modify it under the terms of the GNU General Public License and by nameing of the originally author

this class is a Helperclass for triangles-tag inside Geometry-tag (contains one or more triangles). It maps all points and their orders

Version:
1.0
Author:
Markus Zimmermann http://www.die-seite.ch

Field Summary
private  Material material
           
private  java.lang.String materialSymbol
           
private  int offsetTextures
           
private  int offsetVertex
           
private  int[][] pointIndexMatrix
           
private  Source textureSource
           
private  processing.xml.XMLElement triangles
           
private  Source vertexSource
           
 
Constructor Summary
Triangles(processing.xml.XMLElement triangles, java.util.HashMap<java.lang.String,SubTag> sources)
           
 
Method Summary
(package private)  java.lang.String getID()
          returns the ID of this xml-tag
(package private)  Material getMaterial()
           
(package private)  java.lang.String getNextSource()
          links to the next sub-tag (if exists)to get more informations.
(package private)  int getOffsetTextures()
           
(package private)  int getOffsetVertex()
           
(package private)  int[][] getPointIndexMatrix()
           
(package private)  Source getTextureSource()
           
(package private)  Source getVertexSource()
           
(package private)  boolean hasTexture()
          gives the answer if the triangles contains a color or an image
(package private)  void setMaterial(Material m)
          invoke that methode after the Object is initiated.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

materialSymbol

private java.lang.String materialSymbol

vertexSource

private Source vertexSource

textureSource

private Source textureSource

offsetVertex

private int offsetVertex

offsetTextures

private int offsetTextures

pointIndexMatrix

private int[][] pointIndexMatrix

material

private Material material

triangles

private processing.xml.XMLElement triangles
Constructor Detail

Triangles

Triangles(processing.xml.XMLElement triangles,
          java.util.HashMap<java.lang.String,SubTag> sources)
Method Detail

setMaterial

void setMaterial(Material m)
invoke that methode after the Object is initiated. Because of cyclic depencies at runtime its not possible to set Material at initiating-time

Parameters:
instance - of Material

hasTexture

boolean hasTexture()
gives the answer if the triangles contains a color or an image

Returns:
false on color, true on image

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getVertexSource

Source getVertexSource()
Returns:
the source of the vertices Position-Points (in 3D)

getTextureSource

Source getTextureSource()
Returns:
the source of the Texture Position-Points (in 2D)

getOffsetVertex

int getOffsetVertex()
Returns:
the offset for vertice in the indexmatrix

getOffsetTextures

int getOffsetTextures()
Returns:
the offset for Textures in the indexmatrix

getPointIndexMatrix

int[][] getPointIndexMatrix()
Returns:
the pointIndexMatrix in the format: [index][offset]

getMaterial

Material getMaterial()
Returns:
the material. It depends of the Runtime if it is null or not

getNextSource

java.lang.String getNextSource()
Description copied from class: SubTag
links to the next sub-tag (if exists)to get more informations. Otherwise it returns the ID

Specified by:
getNextSource in class SubTag
Returns:
the Alias-Name of Material-ID (the Material-symbol)

getID

java.lang.String getID()
Description copied from class: SubTag
returns the ID of this xml-tag

Specified by:
getID in class SubTag
Returns:
generates a Random-ID because the xml-Tag does'nt contain a defined ID