cz.cuni.jagrlib.piece
Class VEFDS.Attribute

java.lang.Object
  extended by cz.cuni.jagrlib.piece.VEFDS.Attribute
Enclosing class:
VEFDS

protected class VEFDS.Attribute
extends java.lang.Object

Internal attribute representation.

Since:
0.11

Field Summary
 int context
          Handle of the context (NULL for shared attributes).
 java.lang.Object data
          The data[-array] itself.
 int handle
          Attribute's handle (inverse mapping for VEFDS.attributes).
 java.lang.String ident
          Identifier (w/o the context-suffix).
 int itemSize
          Size of one data-array item.
 int size
          Actual size of the data[-array] in items (-1 for scalar attributes).
 int type
          Attribute type (ATTR_*).
 int where
          Entity which the attribute is associated with.
 
Constructor Summary
VEFDS.Attribute(int _where, int _context, java.lang.String _ident, int _type, int _size)
          Initializing constructor - allocates data object.
VEFDS.Attribute(VEFDS.Attribute _from, int _context, java.lang.String _ident)
          Initializing constructor - copies data from the given Attribute instance.
 
Method Summary
protected  void assertDataSize(int _size)
          Allocates data[-array] of the given size.
 void copyCoordinates(VEFDS.Attribute from, java.util.BitSet set)
          Copies coordinate data from the Attribute object to another one.
 void deepCopy(VEFDS.Attribute from)
          Deep-copy of attribute data from another Attribute instance.
 int hashCode()
          Returns a hash code value for the object.
 void roundCoordinates(VEFDS.Attribute from, TrMatrix tr, java.util.BitSet set)
          Rounds coordinate data from the Attribute object to another one.
 void transformCoordinates(VEFDS.Attribute from, TrMatrix tr, java.util.BitSet set)
          Transforms coordinate data from the Attribute object to another one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handle

public int handle
Attribute's handle (inverse mapping for VEFDS.attributes).


where

public int where
Entity which the attribute is associated with.


context

public int context
Handle of the context (NULL for shared attributes).


ident

public java.lang.String ident
Identifier (w/o the context-suffix).


type

public int type
Attribute type (ATTR_*).

See Also:
Brep.ATTR_OBJECT

itemSize

public int itemSize
Size of one data-array item. Allocation: size * itemSize.

See Also:
size, data, assertDataSize(int)

size

public int size
Actual size of the data[-array] in items (-1 for scalar attributes). Allocation: size * itemSize.

See Also:
itemSize, data, assertDataSize(int)

data

public java.lang.Object data
The data[-array] itself. Allocation: size * itemSize.

See Also:
itemSize, size, assertDataSize(int)
Constructor Detail

VEFDS.Attribute

public VEFDS.Attribute(int _where,
                       int _context,
                       java.lang.String _ident,
                       int _type,
                       int _size)
Initializing constructor - allocates data object.

Parameters:
_where - Entity which the attribute is associated with.
_context - Handle of the context (NULL for shared attributes).
_ident - Identifier (w/o the context-suffix).
_type - Attribute type.
_size - Array length (0 for no allocation, -1 for scalar value).
See Also:
VEFDS.Attribute(VEFDS.Attribute,int,String), assertDataSize(int)

VEFDS.Attribute

public VEFDS.Attribute(VEFDS.Attribute _from,
                       int _context,
                       java.lang.String _ident)
Initializing constructor - copies data from the given Attribute instance.

Parameters:
_from - Instance data shall be copied from.
_context - Handle of the context (NULL for shared attributes).
_ident - Identifier (w/o the context-suffix).
See Also:
VEFDS.Attribute(int,int,String,int,int), assertDataSize(int)
Method Detail

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.

assertDataSize

protected void assertDataSize(int _size)
Allocates data[-array] of the given size. Grows the array if needed, _size = 0 will de-allocate the data[-array].

Parameters:
_size - Required data size (0 will cause array de-allocation).
See Also:
size, itemSize, data

deepCopy

public void deepCopy(VEFDS.Attribute from)
Deep-copy of attribute data from another Attribute instance.

Parameters:
from - The Attribute which data will be copied from.

copyCoordinates

public void copyCoordinates(VEFDS.Attribute from,
                            java.util.BitSet set)
Copies coordinate data from the Attribute object to another one. Performs rounding and/or homo => Euclid conversions.

Parameters:
from - Source Attribute object.
set - Bit-set of handles to be copied (null for "copy all").
See Also:
roundCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, cz.cuni.jagrlib.TrMatrix, java.util.BitSet), transformCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, cz.cuni.jagrlib.TrMatrix, java.util.BitSet)

roundCoordinates

public void roundCoordinates(VEFDS.Attribute from,
                             TrMatrix tr,
                             java.util.BitSet set)
Rounds coordinate data from the Attribute object to another one. Performs linear planar transformation, rounding and homo => Euclid conversions.

Parameters:
from - Source Attribute object (can be this).
tr - Transformation matrix (only the planar part is used).
set - Bit-set of handles to be rounded (null for "round all").
See Also:
copyCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, java.util.BitSet), transformCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, cz.cuni.jagrlib.TrMatrix, java.util.BitSet)

transformCoordinates

public void transformCoordinates(VEFDS.Attribute from,
                                 TrMatrix tr,
                                 java.util.BitSet set)
Transforms coordinate data from the Attribute object to another one. Performs linear transformation, rounding and/or homo => Euclid conversions.

Parameters:
from - Source Attribute object (can be this).
tr - Transformation matrix.
set - Bit-set of handles to be transformed (null for "transform all").
See Also:
copyCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, java.util.BitSet), roundCoordinates(cz.cuni.jagrlib.piece.VEFDS.Attribute, cz.cuni.jagrlib.TrMatrix, java.util.BitSet)