org.jzy3d.io.obj
Class OBJFile

java.lang.Object
  extended by org.jzy3d.io.obj.OBJFile

public class OBJFile
extends Object

Translated from C++ Version: nvModel.h - Model support class The nvModel class implements an interface for a multipurpose model object. This class is useful for loading and formatting meshes for use by OpenGL. It can compute face normals, tangents, and adjacency information. The class supports the obj file format. Author: Evan Hart Email: sdkfeedback@nvidia.com Copyright (c) NVIDIA Corporation. All rights reserved.


Nested Class Summary
 class OBJFile.IdxSet
           
static class OBJFile.PrimType
          Enumeration of primitive types
 
Field Summary
protected  IntBuffer indices_
           
protected  List<Integer> nIndex_
           
protected  int nOffset_
           
protected  List<Float> normals_
           
static int NumPrimTypes
           
protected  int openEdges_
           
protected  List<Integer> pIndex_
           
protected  int pOffset_
           
protected  List<Float> positions_
           
protected  int posSize_
           
protected  FloatBuffer vertices_
           
protected  int vtxSize_
           
 
Constructor Summary
OBJFile()
           
 
Method Summary
 void clearNormals()
           
 void compileModel()
          This function takes the raw model data in the internal structures, and attempts to bring it to a format directly accepted for vertex array style rendering.
 BoundingBox3d computeBoundingBox()
          Returns the points defining the axis-aligned bounding box containing the model.
 IntBuffer getCompiledIndices()
           
 int getCompiledNormalOffset()
           
 int getCompiledPositionOffset()
           
 int getCompiledVertexCount()
           
 int getCompiledVertexSize()
           
 FloatBuffer getCompiledVertices()
           
 int getIndexCount()
           
 int getNormalCount()
           
 List<Integer> getNormalIndices()
           
 List<Float> getNormals()
           
 int getNormalSize()
           
 int getOpenEdgeCount()
           
 int getPositionCount()
           
 List<Integer> getPositionIndices()
           
 List<Float> getPositions()
           
 int getPositionSize()
           
 boolean hasNormals()
           
 boolean loadModelFromFile(String file)
          This function attempts to determine the type of the filename passed as a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NumPrimTypes

public static final int NumPrimTypes
See Also:
Constant Field Values

positions_

protected List<Float> positions_

normals_

protected List<Float> normals_

posSize_

protected int posSize_

pIndex_

protected List<Integer> pIndex_

nIndex_

protected List<Integer> nIndex_

indices_

protected IntBuffer indices_

vertices_

protected FloatBuffer vertices_

pOffset_

protected int pOffset_

nOffset_

protected int nOffset_

vtxSize_

protected int vtxSize_

openEdges_

protected int openEdges_
Constructor Detail

OBJFile

public OBJFile()
Method Detail

loadModelFromFile

public boolean loadModelFromFile(String file)
This function attempts to determine the type of the filename passed as a parameter. If it understands that file type, it attempts to parse and load the file into its raw data structures. If the file type is recognized and successfully parsed, the function returns true, otherwise it returns false.


compileModel

public void compileModel()
This function takes the raw model data in the internal structures, and attempts to bring it to a format directly accepted for vertex array style rendering. This means that a unique compiled vertex will exist for each unique combination of position, normal, tex coords, etc that are used in the model. The prim parameter, tells the model what type of index list to compile. By default it compiles a simple triangle mesh with no connectivity.


computeBoundingBox

public BoundingBox3d computeBoundingBox()
Returns the points defining the axis-aligned bounding box containing the model.


clearNormals

public void clearNormals()

hasNormals

public boolean hasNormals()

getPositionSize

public int getPositionSize()

getNormalSize

public int getNormalSize()

getPositions

public List<Float> getPositions()

getNormals

public List<Float> getNormals()

getPositionIndices

public List<Integer> getPositionIndices()

getNormalIndices

public List<Integer> getNormalIndices()

getPositionCount

public int getPositionCount()

getNormalCount

public int getNormalCount()

getIndexCount

public int getIndexCount()

getCompiledVertices

public FloatBuffer getCompiledVertices()

getCompiledIndices

public IntBuffer getCompiledIndices()

getCompiledPositionOffset

public int getCompiledPositionOffset()

getCompiledNormalOffset

public int getCompiledNormalOffset()

getCompiledVertexSize

public int getCompiledVertexSize()

getCompiledVertexCount

public int getCompiledVertexCount()

getOpenEdgeCount

public int getOpenEdgeCount()


Copyright © 2013. All rights reserved.