colladaLoader
Class LoadingHelper

java.lang.Object
  extended by colladaLoader.LoadingHelper

 class LoadingHelper
extends java.lang.Object

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 starts the kmz-unzipping, the xml-Loading and loads the texture-images. It will be used only once...

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

Field Summary
private  java.lang.String fileName
           
private  Line[] lines
           
private  java.lang.String pathName
           
private  Triangle[] triangles
           
 
Constructor Summary
LoadingHelper(java.lang.String file)
          use this constructor if you're shure that your export does'nt contain any textures and you have no intension to use the draw-methode
LoadingHelper(java.lang.String file, processing.core.PApplet applet)
          use this constructor if you think the export might contain any textures
 
Method Summary
private  java.lang.String checkIfPathDefined(java.lang.String filename)
          Checks if a Path as prefix is defined, if yes the filname will be unchanged otherwise it gets the prefix .
(package private)  Line[] getLines()
          returns the prepared Lines from the file to use whatever you want
(package private)  Triangle[] getTriangles()
          returns the prepared Triangeles from the file to use whatever you want
private  void recalculateSketchupAxisToProcessingAxis()
           
private  void recalculateSketchupTexturesToProcessing(processing.core.PApplet applet)
          per definition is: textureProcessing x = textureSketchup x * picture.width textureProcessing y = picture.height - textureSketchup y * picture.height it also creates an PImage to each Triangle (if it contains any Texture)
private  void unzip()
          unzips to the same path as the zipfile is
private  void useDOCkml()
          reconfigures pathname and filename using doc.kml inside the kmz-File it adds a subpath to pathname and renames the filename from kmz to dae
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

triangles

private Triangle[] triangles

lines

private Line[] lines

pathName

private java.lang.String pathName

fileName

private java.lang.String fileName
Constructor Detail

LoadingHelper

LoadingHelper(java.lang.String file)
use this constructor if you're shure that your export does'nt contain any textures and you have no intension to use the draw-methode

Parameters:
filename - of a .dae or .kmz -endian

LoadingHelper

LoadingHelper(java.lang.String file,
              processing.core.PApplet applet)
use this constructor if you think the export might contain any textures

Parameters:
filename - of a .dae or .kmz
Method Detail

useDOCkml

private void useDOCkml()
reconfigures pathname and filename using doc.kml inside the kmz-File it adds a subpath to pathname and renames the filename from kmz to dae


checkIfPathDefined

private java.lang.String checkIfPathDefined(java.lang.String filename)
Checks if a Path as prefix is defined, if yes the filname will be unchanged otherwise it gets the prefix ./data/

Parameters:
filename -
Returns:
the checked Filename

recalculateSketchupAxisToProcessingAxis

private void recalculateSketchupAxisToProcessingAxis()

recalculateSketchupTexturesToProcessing

private void recalculateSketchupTexturesToProcessing(processing.core.PApplet applet)
per definition is: textureProcessing x = textureSketchup x * picture.width textureProcessing y = picture.height - textureSketchup y * picture.height it also creates an PImage to each Triangle (if it contains any Texture)


unzip

private void unzip()
unzips to the same path as the zipfile is


getTriangles

Triangle[] getTriangles()
returns the prepared Triangeles from the file to use whatever you want

Returns:
Triangles

getLines

Line[] getLines()
returns the prepared Lines from the file to use whatever you want

Returns:
the Lines