com.jme3.scene.plugins.blender.file
Class FileBlockHeader

java.lang.Object
  extended by com.jme3.scene.plugins.blender.file.FileBlockHeader

public class FileBlockHeader
extends java.lang.Object

A class that holds the header data of a file block. The file block itself is not implemented. This class holds its start position in the stream and using this the structure can fill itself with the proper data.


Field Summary
static int BLOCK_AC00
           
static int BLOCK_CA00
           
static int BLOCK_DATA
           
static int BLOCK_DNA1
           
static int BLOCK_ENDB
           
static int BLOCK_GLOB
           
static int BLOCK_IP00
           
static int BLOCK_LA00
           
static int BLOCK_MA00
           
static int BLOCK_ME00
           
static int BLOCK_OB00
           
static int BLOCK_REND
           
static int BLOCK_SC00
           
static int BLOCK_SR00
           
static int BLOCK_TE00
           
static int BLOCK_TX00
           
static int BLOCK_WO00
           
 
Constructor Summary
FileBlockHeader(BlenderInputStream inputStream, BlenderContext blenderContext)
          Constructor.
 
Method Summary
protected  java.lang.String codeToString(int code)
          This method transforms the coded bloch id into a string value.
 int getBlockPosition()
          This method returns the start position of the data block in the blend file stream.
 int getCode()
          This method returns the code of this data block.
 int getCount()
          This data returns the number of structure stored in the data block after this header.
 long getOldMemoryAddress()
          This method returns the memory address.
 int getSdnaIndex()
          This method returns the sdna index.
 int getSize()
          This method returns the size of the data stored in this block.
 Structure getStructure(BlenderContext blenderContext)
          This method returns the structure described by the header filled with appropriate data.
 boolean isDnaBlock()
          This method indicates if the block is the SDNA block.
 boolean isLastBlock()
          This method indicates if the block is the last block in the file.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BLOCK_TE00

public static final int BLOCK_TE00
See Also:
Constant Field Values

BLOCK_ME00

public static final int BLOCK_ME00
See Also:
Constant Field Values

BLOCK_SR00

public static final int BLOCK_SR00
See Also:
Constant Field Values

BLOCK_CA00

public static final int BLOCK_CA00
See Also:
Constant Field Values

BLOCK_LA00

public static final int BLOCK_LA00
See Also:
Constant Field Values

BLOCK_OB00

public static final int BLOCK_OB00
See Also:
Constant Field Values

BLOCK_MA00

public static final int BLOCK_MA00
See Also:
Constant Field Values

BLOCK_SC00

public static final int BLOCK_SC00
See Also:
Constant Field Values

BLOCK_WO00

public static final int BLOCK_WO00
See Also:
Constant Field Values

BLOCK_TX00

public static final int BLOCK_TX00
See Also:
Constant Field Values

BLOCK_IP00

public static final int BLOCK_IP00
See Also:
Constant Field Values

BLOCK_AC00

public static final int BLOCK_AC00
See Also:
Constant Field Values

BLOCK_GLOB

public static final int BLOCK_GLOB
See Also:
Constant Field Values

BLOCK_REND

public static final int BLOCK_REND
See Also:
Constant Field Values

BLOCK_DATA

public static final int BLOCK_DATA
See Also:
Constant Field Values

BLOCK_DNA1

public static final int BLOCK_DNA1
See Also:
Constant Field Values

BLOCK_ENDB

public static final int BLOCK_ENDB
See Also:
Constant Field Values
Constructor Detail

FileBlockHeader

public FileBlockHeader(BlenderInputStream inputStream,
                       BlenderContext blenderContext)
                throws BlenderFileException
Constructor. Loads the block header from the given stream during instance creation.

Parameters:
inputStream - the stream we read the block header from
blenderContext - the blender context
Throws:
BlenderFileException - this exception is thrown when the pointer size is neither 4 nor 8
Method Detail

getStructure

public Structure getStructure(BlenderContext blenderContext)
                       throws BlenderFileException
This method returns the structure described by the header filled with appropriate data.

Parameters:
blenderContext - the blender context
Returns:
structure filled with data
Throws:
BlenderFileException

getCode

public int getCode()
This method returns the code of this data block.

Returns:
the code of this data block

getSize

public int getSize()
This method returns the size of the data stored in this block.

Returns:
the size of the data stored in this block

getOldMemoryAddress

public long getOldMemoryAddress()
This method returns the memory address.

Returns:
the memory address

getSdnaIndex

public int getSdnaIndex()
This method returns the sdna index.

Returns:
the sdna index

getCount

public int getCount()
This data returns the number of structure stored in the data block after this header.

Returns:
the number of structure stored in the data block after this header

getBlockPosition

public int getBlockPosition()
This method returns the start position of the data block in the blend file stream.

Returns:
the start position of the data block

isLastBlock

public boolean isLastBlock()
This method indicates if the block is the last block in the file.

Returns:
true if this block is the last one in the file nad false otherwise

isDnaBlock

public boolean isDnaBlock()
This method indicates if the block is the SDNA block.

Returns:
true if this block is the SDNA block and false otherwise

toString

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

codeToString

protected java.lang.String codeToString(int code)
This method transforms the coded bloch id into a string value.

Parameters:
code - the id of the block
Returns:
the string value of the block id