cz.cuni.jagrlib.piece
Class VEFDS

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultProperty
      extended by cz.cuni.jagrlib.Piece
          extended by cz.cuni.jagrlib.piece.VEFDS
All Implemented Interfaces:
Breakable, Brep, Property, Template

public class VEFDS
extends Piece
implements Brep

Boundary representation (B-rep) of 3D scene - implemented by simple arrays. Restricted mode uses triangle faces only, general mode could contain arbitrary simple polygons as faces.

Vertices, edges, faces, divisions and solids (Vs, Es, Fs, Ds, Ss) are represented by their handles (integer indices). Arbitrary attributes can be associated with Vs, Es, Fs, Ds or Ss by the user. Implicit attribute: vertex coordinates. Attributes are accessed by string identifiers or integer shortcuts.

More than one context can be used (e.g. for different scene views, rendering modes). Handles (indices) are shared among all contexts, some attributes can be shared, too.

Since:
0.11
See Also:
VEFDS.java

Nested Class Summary
protected  class VEFDS.Attribute
          Internal attribute representation.
protected static class VEFDS.AttrKey
          Attribute key - [ entity, context, ident ] compound.
protected  class VEFDS.DivisionIterator
          Iterator for all divisions in the scene.
protected  class VEFDS.EdgeInFaceIterator
          Iterator for edges in the given face.
protected  class VEFDS.EdgeIterator
          Iterator for all edges in the scene.
protected  class VEFDS.FaceInSolidIterator
          Iterator for faces in the given solid.
protected  class VEFDS.FaceIterator
          Iterator for all faces in the scene.
protected static class VEFDS.MapAttr
          Support class - attribute map.
protected  class VEFDS.SolidIterator
          Iterator for all solids in the scene.
protected  class VEFDS.VertexInFaceIterator
          Iterator for vertices in the given face.
protected  class VEFDS.VertexIterator
          Iterator for all vertices in the scene.
 
Field Summary
protected  IntMap<VEFDS.Attribute> attributes
          Global attribute map: handle -> Attribute. attributes-allocated.
protected  VEFDS.MapAttr attrMap
          Attribute mappings (global, context, vertex, edge, face, division, solid -associated).
protected static java.lang.String CATEGORY
          Object category.
protected  boolean dirty
          Coordinate types or edge mode were changed since the last init().
protected  int edgeSize
          Edge-record size (Brep.WEDGE_SIZE in winged-edge mode).
protected static int MIN_ARRAY
          Minimum attribute-array length.
protected  int primaryProjType
          Type of projected coordinate attribute COORD_PROJ.
protected  int primaryType
          Type of primary coordinate attribute COORD.
static RegPiece reg
          Static registration instance for this class.
protected static java.lang.String TEMPLATE_NAME
          Object template identifier.
protected  int[] used
          Number of actually used vertex, edge, face, division and solid handles (granul-allocated).
protected  java.util.BitSet usedContexts
          Bit-mask of used context IDs.
 
Fields inherited from class cz.cuni.jagrlib.Piece
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak
 
Fields inherited from interface cz.cuni.jagrlib.iface.Brep
ATTR_BOOLEAN, ATTR_COORD_2D, ATTR_COORD_2F, ATTR_COORD_2I, ATTR_COORD_3D, ATTR_COORD_3F, ATTR_COORD_3I, ATTR_COORDH_3D, ATTR_COORDH_3F, ATTR_COORDH_4D, ATTR_COORDH_4F, ATTR_DOUBLE, ATTR_FLOAT, ATTR_INTEGER, ATTR_LAST, ATTR_LONG, ATTR_OBJECT, ATTR_RGB_3F, ATTR_RGBA_4F, COLOR, CONTEXT, COORD, COORD_PROJ, CTX_DEFAULT, DATA, DIVISION, EDGE, EDGE_SIZE, ERROR, FACE, MATERIAL_A, NORMAL, NULL, PRIMARY_COORD_TYPE, PROJECTED_COORD_TYPE, SCENE, SOLID, SOLID_A, TEXTURE_0, TEXTURE_1, TEXTURE_2, TEXTURE_3, VERTEX, WEDGE_FL, WEDGE_FR, WEDGE_LN, WEDGE_LP, WEDGE_MODE, WEDGE_RN, WEDGE_RP, WEDGE_SIZE, WEDGE_V1, WEDGE_V2
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Fields inherited from interface cz.cuni.jagrlib.Template
ALL_PLUGS, C_1D, C_2D, C_3D, C_ALPHA, C_BINARY, C_BREP, C_CAMERA, C_CIRCLE, C_CLIP, C_COMPRESSION, C_CURVE, C_DATA, C_DRAW, C_EDITOR, C_ELLIPSE, C_FILL, C_FILTER, C_FLOAT, C_FUNCTION, C_IMAGE, C_INTEGER, C_IO, C_LIGHT, C_LINE, C_METRIC, C_POLYGON, C_PROJECTION, C_RADIOSITY, C_RASTER, C_RENDER, C_SAMPLE, C_SCENE, C_SET, C_SOLID, C_TEXT, C_TRANSFORM, C_VECTOR, C_VIEWER, C_WORKER, CAT_EMPTY, EMPTY, IFACE, JAGRLIB, JAGRLIB2, MANIPULATOR_COMBO, MANIPULATOR_CUSTOM, MANIPULATOR_DEFAULT, MANIPULATOR_MULTILINE, PL_ALPHAMASK, PL_BITMASK, PL_CAUSTIC, PL_CODEC, PL_COLORMAP, PL_COMPARE, PL_DATA, PL_DIRECT, PL_EDITOR, PL_FILTER, PL_FUNCTION, PL_IMAGE, PL_IMPORT, PL_INPUT, PL_INTERSECTION, PL_LIGHTSOURCE, PL_ORDER, PL_OUTPUT, PL_PALETTE, PL_PHOTON, PL_PROPERTY, PL_QUANTIZER, PL_RASTER, PL_RENDER, PL_SHADOW, PL_STREAM, PL_TRANSFORM, PL_TRIGGER, PL_VOLUME, PL_WINDOW, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_STRING
 
Constructor Summary
VEFDS()
           
 
Method Summary
protected  void adjustAttributes(int where, int len)
          Adjusts attribute-array lengths for the given entity.
static int[] arrayAppend(int[] arr, int item)
          Appends the given integer to the 1-allocated array.
 int assertEdge(int v1, int v2, int face)
          Finds an edge from its vertices.
 void commit()
          Commits all previous changes to the internal object state.
 int copyAttribute(int attrFrom, int ctx)
          Copies the existing scene attribute to a new one (preserves attribute association /where/, type and identifier string /ident/).
 int copyAttribute(int attrFrom, int ctx, java.lang.String ident)
          Copies the existing scene attribute to a new one (preserves attribute association /where/ and type).
 void copyCoordinates(int attrFrom, int attrTo, java.util.BitSet set)
          Copies data from coordinate-attribute to another one.
 int copyCoordinates(int attrFrom, int ctxTo, java.lang.String identTo)
          Copies data from coordinate-attribute to another one.
 int createAttribute(int where, int ctx, java.lang.String ident, int type)
          Creates a new scene attribute.
 int createContext(int ctxFrom)
          Creates a new scene context (can be pre-initialized from one of existing contexts).
 int createDivision(int ctx)
          Creates a new division (in the given context).
 int createEdge()
          Creates a new edge.
 int createFace()
          Creates a new face.
 int createSolid(int ctx)
          Creates a new solid (in the given context).
 int createVertex()
          Creates a new vertex.
 BrepIterator divisionInSolidIterator(int ctx, int solid, BrepIterator pre)
          Initializes iterator for divisions within the given solid.
 BrepIterator divisionIterator(int ctx, BrepIterator pre)
          Initializes iterator for all divisions in the scene.
 BrepIterator edgeInFaceIterator(int face, BrepIterator pre)
          Initializes iterator for edges within the given face.
 BrepIterator edgeIterator(BrepIterator pre)
          Initializes iterator for all edges in the scene.
 BrepIterator faceInSolidIterator(int ctx, int solid, BrepIterator pre)
          Initializes iterator for faces within the given solid.
 BrepIterator faceIterator(int ctx, BrepIterator pre)
          Initializes iterator for all faces in the scene.
protected  double[] fetch(VEFDS.Attribute a, int id, double[] pre)
          Fetches double[] value from the given Attribute.
protected  float[] fetch(VEFDS.Attribute a, int id, float[] pre)
          Fetches float[] value from the given Attribute.
protected  int[] fetch(VEFDS.Attribute a, int id, int[] pre)
          Fetches int[] value from the given Attribute.
protected  java.lang.Object fetch(VEFDS.Attribute a, int id, java.lang.Object pre)
          Fetches one data item from the given Attribute.
 java.lang.Object get(java.lang.String key)
          Gets the given property.
 int getAllDivisions(int ctx, int[] div)
          Returns all division handles in the given context of the database.
 int getAllEdges(int ctx, int[] edge)
          Returns all edge handles in the given context of the database.
 int getAllEdgeVertices(int ctx, int[] vert)
          Returns vertex handles of all edges in the given context of the database.
 int getAllFaces(int ctx, int[] face)
          Returns all face handles in the given context of the database.
 int getAllSolids(int ctx, int[] solid)
          Returns all solid handles in the given context of the database.
 int getAllTriangleEdges(int ctx, int[] edge)
          Returns edge handles of all triangles in the given context of the database.
 int getAllTriangleVertices(int ctx, int[] vert)
          Returns vertex handles of all triangles in the given context of the database.
 int getAllVertexCoords(int attr, int dim, double[] coord)
          Returns all floating-point vertex-coordinates in the database (Cartesian or homogeneous).
 int getAllVertexCoords(int attr, int dim, float[] coord)
          Returns all floating-point vertex-coordinates in the database (Cartesian or homogeneous).
 int getAllVertexCoords(int attr, int dim, int[] coord)
          Returns all integer vertex-coordinates in the database (Cartesian - 2D or 3D).
 int getAllVertices(int[] vert)
          Returns all vertex handles in the database.
 double[] getAttribute(int attr, int id, double[] coord)
          Retrieves value of the given coordinate-attribute for the given entity (for double coordinate types).
 float[] getAttribute(int attr, int id, float[] coord)
          Retrieves value of the given coordinate-attribute for the given entity (for float [coordinate] types).
 int[] getAttribute(int attr, int id, int[] coord)
          Retrieves value of the given coordinate-attribute for the given entity (for int coordinate types).
 java.lang.Object getAttribute(int attr, int id, java.lang.Object pre)
          Retrieves value of the given attribute for the given entity (general form).
 java.lang.Object getAttribute(int where, int ctx, java.lang.String ident, int id, java.lang.Object pre)
          Retrieves value of the given attribute for the given entity (general form).
 int getAttributeContext(int attr)
          Return a context of the given attribute (for non-shared attributes only).
 int getAttributeId(int where, int ctx, java.lang.String ident)
          Finds a handle of the given scene attribute.
 java.lang.String getAttributeIdent(int attr)
          Returns a string identifier of the given attribute.
 int getAttributeType(int attr)
          Returns a type of the given attribute.
 int getAttributeWhere(int attr)
          Return a where parameter of the given attribute (entity which the attribute is associated with).
 boolean getBoolAttribute(int attr, int id)
          Retrieves value of the given flag-attribute for the given entity (for boolean attribute type).
 int getDivisionFaces(int ctx, int div, int[] up, int[] down)
          Returns face handles of the given division.
 double getDoubleAttribute(int attr, int id)
          Retrieves value of the given float-attribute for the given entity (for double attribute type).
 int[] getEdgeRecord(int edge, int[] index)
          Returns record of the given edge (useful particularly for winged-edges).
 int[] getEdgeVertices(int edge, int[] vert)
          Returns vertex handles of the given edge.
 int getFaceEdges(int face, int[] edge)
          Returns edge handles of the given face.
 int getFaceVertices(int face, int[] vert)
          Returns vertex handles of the given face.
 float getFloatAttribute(int attr, int id)
          Retrieves value of the given float-attribute for the given entity (for float attribute type).
protected static int getGranulLength(int len)
          Returns granul-based array length.
 int getIntAttribute(int attr, int id)
          Retrieves value of the given integer-attribute for the given entity (for int attribute type).
 long getLongAttribute(int attr, int id)
          Retrieves value of the given integer-attribute for the given entity (for long attribute type).
 int getSolidFaces(int ctx, int solid, int[] face)
          Returns face handles of the given solid.
 double[] getVertexCoords(int ctx, int vert, double[] coord)
          Returns floating-point coordinates of the given vertex (implicit attribute COORD).
 float[] getVertexCoords(int ctx, int vert, float[] coord)
          Returns floating-point coordinates of the given vertex (implicit attribute COORD).
 int[] getVertexCoords(int ctx, int vert, int[] coord)
          Returns integer coordinates of the given vertex (implicit attribute COORD_PROJ) (Cartesian 2D or 3D).
 void init()
          Database (re-)initialization.
protected  int insertAttribute(VEFDS.Attribute a)
          Assigns an attribute-handle to the new attribute.
 void insertFaceIntoSolid(int ctx, int solid, int face)
          Inserts another face handle into the given solid.
 int nextItem(BrepIterator iter)
          Returns the next entity-handle.
 void removeAttribute(int attr)
          Removes the given scene attribute.
 void removeContext(int ctx)
          Removes an existing scene context.
 void resetSolid(int ctx, int solid)
          Resets the given solid.
 int roundCoordinates(int attrFrom, int ctxTo, java.lang.String identTo, TrMatrix tr)
          Transforms data from coordinate-attribute to another one.
 void roundCoordinates(int attrFrom, int attrTo, TrMatrix tr, java.util.BitSet set)
          Transforms data from coordinate-attribute to another one.
 void set(java.lang.String key, java.lang.Object value)
          Sets the given property.
 void setAttribute(int attr, int id, java.lang.Object val)
          Sets value of the given attribute of the given entity (general form).
 void setCoordTypes(int baseType, int baseProjType)
          Set default coordinate types.
 void setDivisionFaces(int ctx, int div, int[] up, int[] down)
          Sets face handles of the given division.
 void setEdgeMode(boolean wedge)
          Set winged-edge mode.
 void setEdgeVertices(int edge, int v1, int v2)
          Sets vertex handles of the given edge.
 void setFaceEdges(int face, int[] edge)
          Sets edge handles of the given face.
 void setFaceVertices(int face, int[] vert)
          Sets vertex handles of the given face.
 void setSolidFaces(int ctx, int solid, int[] face)
          Sets face handles of the given solid.
static int setTemplate(Template t, int ord)
          General-purpose registration routine.
 void setTriangleEdges(int face, int e1, int e2, int e3)
          Sets edge handles of the given triangle.
 void setTriangleVertices(int face, int v1, int v2, int v3)
          Sets vertex handles of the given triangle.
 void setVertexCoords(int ctx, int vert, double[] coord)
          Sets floating-point coordinates of the given vertex (implicit attribute COORD) (Cartesian or homogeneous).
 void setVertexCoords(int ctx, int vert, float[] coord)
          Sets floating-point coordinates of the given vertex (implicit attribute COORD) (Cartesian or homogeneous).
 void setVertexCoords(int ctx, int vert, int[] coord)
          Sets integer coordinates of the given vertex (implicit attribute COORD_PROJ) (Cartesian 2D or 3D).
 BrepIterator solidIterator(BrepIterator pre)
          Initializes iterator for all solids in the scene.
protected  void store(VEFDS.Attribute a, int id, java.lang.Object val)
          Stores one data item into the given Attribute.
 int transformCoordinates(int attrFrom, int ctxTo, java.lang.String identTo, TrMatrix tr)
          Transforms data from coordinate-attribute to another one.
 void transformCoordinates(int attrFrom, int attrTo, TrMatrix tr, java.util.BitSet set)
          Transforms data from coordinate-attribute to another one.
 BrepIterator vertexInFaceIterator(int face, BrepIterator pre)
          Initializes iterator for vertices within the given face.
 BrepIterator vertexIterator(BrepIterator pre)
          Initializes iterator for all vertices in the scene.
 
Methods inherited from class cz.cuni.jagrlib.Piece
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop
 
Methods inherited from class cz.cuni.jagrlib.DefaultProperty
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_ARRAY

protected static final int MIN_ARRAY
Minimum attribute-array length.

See Also:
Constant Field Values

attrMap

protected final VEFDS.MapAttr attrMap
Attribute mappings (global, context, vertex, edge, face, division, solid -associated).


used

protected final int[] used
Number of actually used vertex, edge, face, division and solid handles (granul-allocated). Contexts are 1-allocated.


attributes

protected final IntMap<VEFDS.Attribute> attributes
Global attribute map: handle -> Attribute. attributes-allocated.


usedContexts

protected final java.util.BitSet usedContexts
Bit-mask of used context IDs.


primaryType

protected int primaryType
Type of primary coordinate attribute COORD.


primaryProjType

protected int primaryProjType
Type of projected coordinate attribute COORD_PROJ.


edgeSize

protected int edgeSize
Edge-record size (Brep.WEDGE_SIZE in winged-edge mode).


dirty

protected boolean dirty
Coordinate types or edge mode were changed since the last init().


TEMPLATE_NAME

protected static final java.lang.String TEMPLATE_NAME
Object template identifier.

See Also:
Constant Field Values

CATEGORY

protected static final java.lang.String CATEGORY
Object category.

See Also:
Constant Field Values

reg

public static final RegPiece reg
Static registration instance for this class. Automatically initialized in class-loading time.

Constructor Detail

VEFDS

public VEFDS()
Method Detail

getGranulLength

protected static final int getGranulLength(int len)
Returns granul-based array length.

Parameters:
len - Required array length.
Returns:
Valid array length.

adjustAttributes

protected void adjustAttributes(int where,
                                int len)
Adjusts attribute-array lengths for the given entity.

Parameters:
where - The entity code.
len - New length of an entity-array.

insertAttribute

protected int insertAttribute(VEFDS.Attribute a)
Assigns an attribute-handle to the new attribute.


store

protected void store(VEFDS.Attribute a,
                     int id,
                     java.lang.Object val)
Stores one data item into the given Attribute.

Parameters:
a - The attribute which data will be stored to.
id - Entity handle (array index).
val - Attribute value.

fetch

protected java.lang.Object fetch(VEFDS.Attribute a,
                                 int id,
                                 java.lang.Object pre)
Fetches one data item from the given Attribute.

Parameters:
a - The attribute which data will be fetched from.
id - Entity handle (array index).
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

fetch

protected int[] fetch(VEFDS.Attribute a,
                      int id,
                      int[] pre)
Fetches int[] value from the given Attribute.

Parameters:
a - The attribute which data will be fetched from.
id - Entity handle (array index).
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

fetch

protected float[] fetch(VEFDS.Attribute a,
                        int id,
                        float[] pre)
Fetches float[] value from the given Attribute.

Parameters:
a - The attribute which data will be fetched from.
id - Entity handle (array index).
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

fetch

protected double[] fetch(VEFDS.Attribute a,
                         int id,
                         double[] pre)
Fetches double[] value from the given Attribute.

Parameters:
a - The attribute which data will be fetched from.
id - Entity handle (array index).
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

arrayAppend

public static final int[] arrayAppend(int[] arr,
                                      int item)
Appends the given integer to the 1-allocated array.


assertEdge

public int assertEdge(int v1,
                      int v2,
                      int face)
Finds an edge from its vertices. Creates a new one if not found.


setCoordTypes

public void setCoordTypes(int baseType,
                          int baseProjType)
Set default coordinate types.

Specified by:
setCoordTypes in interface Brep
Parameters:
baseType - Base type for the COORD attribute.
baseProjType - Base type for the COORD_PROJ (projected) attribute.

setEdgeMode

public void setEdgeMode(boolean wedge)
Set winged-edge mode. Default value: false (don't use winged edge).

Specified by:
setEdgeMode in interface Brep
Parameters:
wedge - Winged-edges will be used?
See Also:
getEdgeRecord(int, int[]), Brep.WEDGE_SIZE

init

public void init()
Database (re-)initialization. Removes all scene contexts and implicit / explicit attributes.

Specified by:
init in interface Brep

createContext

public int createContext(int ctxFrom)
Creates a new scene context (can be pre-initialized from one of existing contexts). No attributes (even implicit) are created for the new context (exception: pre-initialized contexts).

Specified by:
createContext in interface Brep
Parameters:
ctxFrom - Context handle for initialization (non-mandatory parameter - can be NULL).
Returns:
Handle to a new context.
See Also:
copyAttribute(int,int,String), copyAttribute(int,int), removeContext(int)

removeContext

public void removeContext(int ctx)
Removes an existing scene context. Brep.CTX_DEFAULT cannot be removed.

Specified by:
removeContext in interface Brep
Parameters:
ctx - Handle to a context to be destroyed.
See Also:
createContext(int)

createAttribute

public int createAttribute(int where,
                           int ctx,
                           java.lang.String ident,
                           int type)
Creates a new scene attribute.

Specified by:
createAttribute in interface Brep
Parameters:
where - Entity which a new attribute will be associated with (VERTEX, EDGE, ..).
ctx - Handle to a context (can be NULL for shared attributes).
ident - String identifier of the attribute.
type - Attribute type (ATTR_* constant).
Returns:
Handle to a new attribute.
See Also:
copyAttribute(int,int,String), copyAttribute(int,int), removeAttribute(int), copyCoordinates(int,int,String), roundCoordinates(int,int,String,TrMatrix), transformCoordinates(int,int,String,TrMatrix)

copyAttribute

public int copyAttribute(int attrFrom,
                         int ctx,
                         java.lang.String ident)
Copies the existing scene attribute to a new one (preserves attribute association /where/ and type).

Specified by:
copyAttribute in interface Brep
Parameters:
attrFrom - Handle to a source attribute.
ctx - Handle to a context (cannot be NULL).
ident - String identifier of the attribute.
Returns:
Handle to a new attribute.
See Also:
createAttribute(int, int, java.lang.String, int), copyAttribute(int,int), removeAttribute(int), copyCoordinates(int,int,String), roundCoordinates(int,int,String,TrMatrix), transformCoordinates(int,int,String,TrMatrix)

copyAttribute

public final int copyAttribute(int attrFrom,
                               int ctx)
Copies the existing scene attribute to a new one (preserves attribute association /where/, type and identifier string /ident/).

Specified by:
copyAttribute in interface Brep
Parameters:
attrFrom - Handle to a source attribute.
ctx - Handle to a context (cannot be NULL).
Returns:
Handle to a new attribute.
See Also:
createAttribute(int, int, java.lang.String, int), copyAttribute(int,int,String), removeAttribute(int), copyCoordinates(int,int,String), roundCoordinates(int,int,String,TrMatrix), transformCoordinates(int,int,String,TrMatrix)

removeAttribute

public void removeAttribute(int attr)
Removes the given scene attribute.

Specified by:
removeAttribute in interface Brep
Parameters:
attr - Handle to an attribute.
See Also:
copyAttribute(int,int,String), copyAttribute(int,int), createAttribute(int, int, java.lang.String, int)

getAttributeId

public final int getAttributeId(int where,
                                int ctx,
                                java.lang.String ident)
Finds a handle of the given scene attribute.

Specified by:
getAttributeId in interface Brep
Parameters:
where - Entity which the attribute is associated with (VERTEX, EDGE, ..).
ctx - Handle to a context (can be NULL for shared attributes).
ident - String identifier of the attribute.
Returns:
Handle to the given attribute.

getAttributeWhere

public final int getAttributeWhere(int attr)
Return a where parameter of the given attribute (entity which the attribute is associated with).

Specified by:
getAttributeWhere in interface Brep
Parameters:
attr - Handle to the attribute.
Returns:
The where parameter.

getAttributeContext

public final int getAttributeContext(int attr)
Return a context of the given attribute (for non-shared attributes only).

Specified by:
getAttributeContext in interface Brep
Parameters:
attr - Handle to the attribute.
Returns:
Exclusive context of the attribute (or NULL).

getAttributeIdent

public final java.lang.String getAttributeIdent(int attr)
Returns a string identifier of the given attribute.

Specified by:
getAttributeIdent in interface Brep
Parameters:
attr - Handle to the attribute.
Returns:
String identifier of the attribute (null if failed).

getAttributeType

public final int getAttributeType(int attr)
Returns a type of the given attribute.

Specified by:
getAttributeType in interface Brep
Parameters:
attr - Handle to the attribute.
Returns:
The type parameter.

getAttribute

public final java.lang.Object getAttribute(int where,
                                           int ctx,
                                           java.lang.String ident,
                                           int id,
                                           java.lang.Object pre)
Retrieves value of the given attribute for the given entity (general form).

Specified by:
getAttribute in interface Brep
Parameters:
where - Entity which the attribute is associated with (VERTEX, EDGE, ..).
ctx - Handle to a context (can be NULL for shared attributes).
ident - String identifier of the attribute.
id - Handle to the entity.
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

getAttribute

public final java.lang.Object getAttribute(int attr,
                                           int id,
                                           java.lang.Object pre)
Retrieves value of the given attribute for the given entity (general form).

Specified by:
getAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
pre - Pre-allocated result object (can be null).
Returns:
The value of the attribute for the given entity.

setAttribute

public final void setAttribute(int attr,
                               int id,
                               java.lang.Object val)
Sets value of the given attribute of the given entity (general form).

Specified by:
setAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
val - New attribute value (can be null).

getAttribute

public final float[] getAttribute(int attr,
                                  int id,
                                  float[] coord)
Retrieves value of the given coordinate-attribute for the given entity (for float [coordinate] types).

Specified by:
getAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getAttribute

public final double[] getAttribute(int attr,
                                   int id,
                                   double[] coord)
Retrieves value of the given coordinate-attribute for the given entity (for double coordinate types).

Specified by:
getAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getAttribute

public int[] getAttribute(int attr,
                          int id,
                          int[] coord)
Retrieves value of the given coordinate-attribute for the given entity (for int coordinate types).

Specified by:
getAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getBoolAttribute

public boolean getBoolAttribute(int attr,
                                int id)
Retrieves value of the given flag-attribute for the given entity (for boolean attribute type).

Specified by:
getBoolAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Boolean attribute value.

getIntAttribute

public int getIntAttribute(int attr,
                           int id)
Retrieves value of the given integer-attribute for the given entity (for int attribute type).

Specified by:
getIntAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Integer attribute value.

getLongAttribute

public long getLongAttribute(int attr,
                             int id)
Retrieves value of the given integer-attribute for the given entity (for long attribute type).

Specified by:
getLongAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Long-integer attribute value.

getDoubleAttribute

public double getDoubleAttribute(int attr,
                                 int id)
Retrieves value of the given float-attribute for the given entity (for double attribute type).

Specified by:
getDoubleAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Double attribute value.

getFloatAttribute

public float getFloatAttribute(int attr,
                               int id)
Retrieves value of the given float-attribute for the given entity (for float attribute type).

Specified by:
getFloatAttribute in interface Brep
Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Double attribute value.

copyCoordinates

public int copyCoordinates(int attrFrom,
                           int ctxTo,
                           java.lang.String identTo)
Copies data from coordinate-attribute to another one. Destination attribute is implicitly created.

Specified by:
copyCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
ctxTo - Handle to a context (can be NULL for shared attributes).
identTo - String identifier of the attribute.
Returns:
Handle to a new coordinate-attribute.
See Also:
createAttribute(int, int, java.lang.String, int), roundCoordinates(int,int,String,TrMatrix), transformCoordinates(int,int,String,TrMatrix)

copyCoordinates

public void copyCoordinates(int attrFrom,
                            int attrTo,
                            java.util.BitSet set)
Copies data from coordinate-attribute to another one. Destination attribute must exist before, copying can be restricted to the given handle-set.

Specified by:
copyCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
attrTo - Handle to a destination coordinate attribute.
set - Entity handle-set (for null everything will be copied).
See Also:
createAttribute(int, int, java.lang.String, int), roundCoordinates(int,int,TrMatrix,BitSet), transformCoordinates(int,int,TrMatrix,BitSet)

roundCoordinates

public int roundCoordinates(int attrFrom,
                            int ctxTo,
                            java.lang.String identTo,
                            TrMatrix tr)
Transforms data from coordinate-attribute to another one. Projection-plane transformation (and roundup) is done implicitly, destination attribute is created implicitly, too.

Specified by:
roundCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
ctxTo - Handle to a context (can be NULL for shared attributes).
identTo - String identifier of the attribute.
tr - Linear (projection-plane) transformation.
Returns:
Handle to a new coordinate-attribute.
See Also:
createAttribute(int, int, java.lang.String, int), copyCoordinates(int,int,String), transformCoordinates(int,int,String,TrMatrix)

roundCoordinates

public void roundCoordinates(int attrFrom,
                             int attrTo,
                             TrMatrix tr,
                             java.util.BitSet set)
Transforms data from coordinate-attribute to another one. Projection-plane transformation (and roundup) is done implicitly, destination attribute must exist before. Transformation can be restricted to the given handle-set.

Specified by:
roundCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
attrTo - Handle to a destination coordinate attribute.
tr - Linear (projection-plane) transformation.
set - Entity handle-set (for null everything will be transformed).
See Also:
createAttribute(int, int, java.lang.String, int), copyCoordinates(int,int,BitSet), transformCoordinates(int,int,TrMatrix,BitSet)

transformCoordinates

public int transformCoordinates(int attrFrom,
                                int ctxTo,
                                java.lang.String identTo,
                                TrMatrix tr)
Transforms data from coordinate-attribute to another one. Linear transformation is done implicitly, destination attribute is created implicitly, too.

Specified by:
transformCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
ctxTo - Handle to a context (can be NULL for shared attributes).
identTo - String identifier of the attribute.
tr - Linear matrix transformation.
Returns:
Handle to a new coordinate-attribute.
See Also:
createAttribute(int, int, java.lang.String, int), copyCoordinates(int,int,String), roundCoordinates(int,int,String,TrMatrix)

transformCoordinates

public void transformCoordinates(int attrFrom,
                                 int attrTo,
                                 TrMatrix tr,
                                 java.util.BitSet set)
Transforms data from coordinate-attribute to another one. Linear transformation is done implicitly, destination attribute must exist before. Transformation can be restricted to the given handle-set.

Specified by:
transformCoordinates in interface Brep
Parameters:
attrFrom - Handle to a source coordinate attribute.
attrTo - Handle to a destination coordinate attribute.
tr - Linear matrix transformation.
set - Entity handle-set (for null everything will be transformed).
See Also:
createAttribute(int, int, java.lang.String, int), copyCoordinates(int,int,BitSet), roundCoordinates(int,int,TrMatrix,BitSet)

vertexIterator

public BrepIterator vertexIterator(BrepIterator pre)
Initializes iterator for all vertices in the scene.

Specified by:
vertexIterator in interface Brep
Parameters:
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
vertexInFaceIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

vertexInFaceIterator

public BrepIterator vertexInFaceIterator(int face,
                                         BrepIterator pre)
Initializes iterator for vertices within the given face.

Specified by:
vertexInFaceIterator in interface Brep
Parameters:
face - Handle to the face.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
vertexIterator(cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

edgeIterator

public BrepIterator edgeIterator(BrepIterator pre)
Initializes iterator for all edges in the scene.

Specified by:
edgeIterator in interface Brep
Parameters:
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
edgeInFaceIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

edgeInFaceIterator

public BrepIterator edgeInFaceIterator(int face,
                                       BrepIterator pre)
Initializes iterator for edges within the given face.

Specified by:
edgeInFaceIterator in interface Brep
Parameters:
face - Handle to the face.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
edgeIterator(cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

faceIterator

public BrepIterator faceIterator(int ctx,
                                 BrepIterator pre)
Initializes iterator for all faces in the scene.

Specified by:
faceIterator in interface Brep
Parameters:
ctx - Handle to a context.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
faceInSolidIterator(int, int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

faceInSolidIterator

public BrepIterator faceInSolidIterator(int ctx,
                                        int solid,
                                        BrepIterator pre)
Initializes iterator for faces within the given solid.

Specified by:
faceInSolidIterator in interface Brep
Parameters:
ctx - Handle to a context.
solid - Handle to the face.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
faceIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

divisionIterator

public BrepIterator divisionIterator(int ctx,
                                     BrepIterator pre)
Initializes iterator for all divisions in the scene.

Specified by:
divisionIterator in interface Brep
Parameters:
ctx - Handle to a context.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
divisionInSolidIterator(int, int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

divisionInSolidIterator

public BrepIterator divisionInSolidIterator(int ctx,
                                            int solid,
                                            BrepIterator pre)
Initializes iterator for divisions within the given solid.

Specified by:
divisionInSolidIterator in interface Brep
Parameters:
ctx - Handle to a context.
solid - Handle to the face.
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
divisionIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

solidIterator

public BrepIterator solidIterator(BrepIterator pre)
Initializes iterator for all solids in the scene.

Specified by:
solidIterator in interface Brep
Parameters:
pre - Pre-allocated BrepIterator object (can be null).
Returns:
The initialized iterator data.
See Also:
nextItem(cz.cuni.jagrlib.iface.BrepIterator)

nextItem

public int nextItem(BrepIterator iter)
Returns the next entity-handle.

Specified by:
nextItem in interface Brep
Parameters:
iter - Associated iterator data.
Returns:
Handle to the next entity or NULL at the end of an iteration.

getVertexCoords

public int[] getVertexCoords(int ctx,
                             int vert,
                             int[] coord)
Returns integer coordinates of the given vertex (implicit attribute COORD_PROJ) (Cartesian 2D or 3D).

Specified by:
getVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Pre-allocated coordinate vector.
Returns:
Result array (coord if possible).
See Also:
getVertexCoords(int,int,double[]), getVertexCoords(int,int,float[])

getVertexCoords

public double[] getVertexCoords(int ctx,
                                int vert,
                                double[] coord)
Returns floating-point coordinates of the given vertex (implicit attribute COORD).

Specified by:
getVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Optional pre-allocated coordinate vector (Cartesian or homogeneous).
Returns:
Result array (coord if possible).
See Also:
getVertexCoords(int,int,int[]), getVertexCoords(int,int,float[])

getVertexCoords

public float[] getVertexCoords(int ctx,
                               int vert,
                               float[] coord)
Returns floating-point coordinates of the given vertex (implicit attribute COORD).

Specified by:
getVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Optional pre-allocated coordinate vector (Cartesian or homogeneous).
Returns:
Result array (coord if possible).
See Also:
getVertexCoords(int,int,int[]), getVertexCoords(int,int,double[])

getEdgeVertices

public int[] getEdgeVertices(int edge,
                             int[] vert)
Returns vertex handles of the given edge.

Specified by:
getEdgeVertices in interface Brep
Parameters:
edge - Handle of the edge.
vert - Optional pre-allocated array to hold two vertex handles.
Returns:
Result array (vert if possible).

getEdgeRecord

public int[] getEdgeRecord(int edge,
                           int[] index)
Returns record of the given edge (useful particularly for winged-edges). All edge records can be stored in one huge int[] array, user of this method receives such array and origin of the particular edge record.

Specified by:
getEdgeRecord in interface Brep
Parameters:
edge - Handle of the edge.
index - Pre-allocated int[] array to receive starting index of the edge-record. If this array is longer than int[1], actual record-size will be returned after the starting index. If {code index} is null, R/O edge record is returned.
Returns:
Shared (read/write) array possibly holding all edge records.

getFaceEdges

public int getFaceEdges(int face,
                        int[] edge)
Returns edge handles of the given face.

Specified by:
getFaceEdges in interface Brep
Parameters:
face - Handle of the face.
edge - Pre-allocated array to hold edge handles (or null to get the face size).
Returns:
Number of face edges.
See Also:
getFaceVertices(int, int[])

getFaceVertices

public int getFaceVertices(int face,
                           int[] vert)
Returns vertex handles of the given face.

Specified by:
getFaceVertices in interface Brep
Parameters:
face - Handle of the face.
vert - Pre-allocated array to hold vertex handles (or null to get the face size).
Returns:
Number of face vertices.
See Also:
getFaceEdges(int, int[])

getDivisionFaces

public int getDivisionFaces(int ctx,
                            int div,
                            int[] up,
                            int[] down)
Returns face handles of the given division.

Specified by:
getDivisionFaces in interface Brep
Parameters:
ctx - Handle of the context.
div - Handle of the division.
up - Pre-allocated array to hold predecessor-face handles (will be terminated by NULL). null to get number of predecessors.
down - Pre-allocated array to hold successor-face handles (will be terminated by NULL). null to get number of successors.
Returns:
Number of successor faces (or number of predecessor faces for up == null).

getSolidFaces

public int getSolidFaces(int ctx,
                         int solid,
                         int[] face)
Returns face handles of the given solid.

Specified by:
getSolidFaces in interface Brep
Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
face - Pre-allocated array to hold face handles (or null to get the solid size).
Returns:
Number of faces.

getAllVertices

public int getAllVertices(int[] vert)
Returns all vertex handles in the database.

Specified by:
getAllVertices in interface Brep
Parameters:
vert - Pre-allocated array to hold vertex handles (or null to get the array size).
Returns:
Array size.
See Also:
getAllVertexCoords(int,int,int[]), getAllVertexCoords(int,int,double[])

getAllVertexCoords

public int getAllVertexCoords(int attr,
                              int dim,
                              int[] coord)
Returns all integer vertex-coordinates in the database (Cartesian - 2D or 3D).

Specified by:
getAllVertexCoords in interface Brep
Parameters:
attr - Handle to the attribute (e.g. COORD_PROJ).
dim - Size of coordinate vector (2 or 3).
coord - Pre-allocated array to hold vertex coordinates (or null to get the array size).
Returns:
Array size (number of vertices).
See Also:
getAllVertices(int[]), getAllVertexCoords(int,int,double[])

getAllVertexCoords

public int getAllVertexCoords(int attr,
                              int dim,
                              double[] coord)
Returns all floating-point vertex-coordinates in the database (Cartesian or homogeneous).

Specified by:
getAllVertexCoords in interface Brep
Parameters:
attr - Handle to the attribute (e.g. COORD).
dim - Size of coordinate vector (2 to 4).
coord - Pre-allocated array to hold vertex coordinates (or null to get the array size).
Returns:
Array size (number of vertices).
See Also:
getAllVertices(int[]), getAllVertexCoords(int,int,int[])

getAllVertexCoords

public int getAllVertexCoords(int attr,
                              int dim,
                              float[] coord)
Returns all floating-point vertex-coordinates in the database (Cartesian or homogeneous).

Specified by:
getAllVertexCoords in interface Brep
Parameters:
attr - Handle to the attribute (e.g. COORD).
dim - Size of coordinate vector (2 to 4).
coord - Pre-allocated array to hold vertex coordinates (or null to get the array size).
Returns:
Array size (number of vertices).
See Also:
getAllVertices(int[]), getAllVertexCoords(int,int,int[])

getAllEdges

public int getAllEdges(int ctx,
                       int[] edge)
Returns all edge handles in the given context of the database.

Specified by:
getAllEdges in interface Brep
Parameters:
ctx - Handle of the context.
edge - Pre-allocated array to hold edge handles (or null to get the array size).
Returns:
Array size.
See Also:
getAllEdgeVertices(int, int[])

getAllEdgeVertices

public int getAllEdgeVertices(int ctx,
                              int[] vert)
Returns vertex handles of all edges in the given context of the database.

Specified by:
getAllEdgeVertices in interface Brep
Parameters:
ctx - Handle of the context.
vert - Pre-allocated array to hold vertex handles (or null to get the array size).
Returns:
Array size (number of edges).
See Also:
getAllEdges(int, int[])

getAllFaces

public int getAllFaces(int ctx,
                       int[] face)
Returns all face handles in the given context of the database.

Specified by:
getAllFaces in interface Brep
Parameters:
ctx - Handle of the context.
face - Pre-allocated array to hold face handles (or null to get the array size).
Returns:
Array size.

getAllTriangleEdges

public int getAllTriangleEdges(int ctx,
                               int[] edge)
Returns edge handles of all triangles in the given context of the database.

Specified by:
getAllTriangleEdges in interface Brep
Parameters:
ctx - Handle of the context.
edge - Pre-allocated array to hold edge handles (or null to get the array size). It will hold data only for triangle faces.
Returns:
Array size (number of faces).
See Also:
getAllTriangleVertices(int, int[])

getAllTriangleVertices

public int getAllTriangleVertices(int ctx,
                                  int[] vert)
Returns vertex handles of all triangles in the given context of the database.

Specified by:
getAllTriangleVertices in interface Brep
Parameters:
ctx - Handle of the context.
vert - Pre-allocated array to hold vertex handles (or null to get the array size). It will hold data only for triangle faces.
Returns:
Array size (number of faces).
See Also:
getAllTriangleEdges(int, int[])

getAllDivisions

public int getAllDivisions(int ctx,
                           int[] div)
Returns all division handles in the given context of the database.

Specified by:
getAllDivisions in interface Brep
Parameters:
ctx - Handle of the context.
div - Pre-allocated array to hold division handles (or null to get the array size).
Returns:
Array size.

getAllSolids

public int getAllSolids(int ctx,
                        int[] solid)
Returns all solid handles in the given context of the database.

Specified by:
getAllSolids in interface Brep
Parameters:
ctx - Handle of the context.
solid - Pre-allocated array to hold solid handles (or null to get the array size).
Returns:
Array size.

createVertex

public int createVertex()
Creates a new vertex.

Specified by:
createVertex in interface Brep
Returns:
Handle of the new vertex.

setVertexCoords

public void setVertexCoords(int ctx,
                            int vert,
                            int[] coord)
Sets integer coordinates of the given vertex (implicit attribute COORD_PROJ) (Cartesian 2D or 3D).

Specified by:
setVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D or 3D).
See Also:
createVertex()

setVertexCoords

public void setVertexCoords(int ctx,
                            int vert,
                            double[] coord)
Sets floating-point coordinates of the given vertex (implicit attribute COORD) (Cartesian or homogeneous).

Specified by:
setVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D to 4D).
See Also:
createVertex()

setVertexCoords

public void setVertexCoords(int ctx,
                            int vert,
                            float[] coord)
Sets floating-point coordinates of the given vertex (implicit attribute COORD) (Cartesian or homogeneous).

Specified by:
setVertexCoords in interface Brep
Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D to 4D).
See Also:
createVertex()

createEdge

public int createEdge()
Creates a new edge.

Specified by:
createEdge in interface Brep
Returns:
Handle of the new edge.

setEdgeVertices

public void setEdgeVertices(int edge,
                            int v1,
                            int v2)
Sets vertex handles of the given edge.

Specified by:
setEdgeVertices in interface Brep
Parameters:
edge - Handle of the edge.
v1 - Handle of the 1st vertex.
v2 - Handle of the 2nd vertex.
See Also:
createEdge()

createFace

public int createFace()
Creates a new face.

Specified by:
createFace in interface Brep
Returns:
Handle of the new face.

setTriangleEdges

public void setTriangleEdges(int face,
                             int e1,
                             int e2,
                             int e3)
Sets edge handles of the given triangle.

Specified by:
setTriangleEdges in interface Brep
Parameters:
face - Handle of the face.
e1 - Handle of the 1st edge.
e2 - Handle of the 2nd edge.
e3 - Handle of the 3rd edge.
See Also:
createFace()

setTriangleVertices

public void setTriangleVertices(int face,
                                int v1,
                                int v2,
                                int v3)
Sets vertex handles of the given triangle.

Specified by:
setTriangleVertices in interface Brep
Parameters:
face - Handle of the face.
v1 - Handle of the 1st vertex.
v2 - Handle of the 2nd vertex.
v3 - Handle of the 3rd vertex.
See Also:
createFace()

setFaceVertices

public void setFaceVertices(int face,
                            int[] vert)
Sets vertex handles of the given face.

Specified by:
setFaceVertices in interface Brep
Parameters:
face - Handle of the face.
vert - Handles of the vertices (Brep.NULL breaks the sequence}).
See Also:
createFace()

setFaceEdges

public void setFaceEdges(int face,
                         int[] edge)
Sets edge handles of the given face.

Specified by:
setFaceEdges in interface Brep
Parameters:
face - Handle of the face.
edge - Array of edge handles (can be prematurely terminated by NULL).
See Also:
createFace()

setSolidFaces

public void setSolidFaces(int ctx,
                          int solid,
                          int[] face)
Sets face handles of the given solid.

Specified by:
setSolidFaces in interface Brep
Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
face - Array of face handles (can be prematurely terminated by NULL).
See Also:
createSolid(int)

createDivision

public int createDivision(int ctx)
Creates a new division (in the given context).

Specified by:
createDivision in interface Brep
Parameters:
ctx - Handle of the context.
Returns:
Handle of the new division.

setDivisionFaces

public void setDivisionFaces(int ctx,
                             int div,
                             int[] up,
                             int[] down)
Sets face handles of the given division.

Specified by:
setDivisionFaces in interface Brep
Parameters:
ctx - Handle of the context.
div - Handle of the division.
up - Array of predecessor-face handles (can be prematurely terminated by NULL).
down - Array of successor-face handles (can be prematurely terminated by NULL).
See Also:
createDivision(int)

createSolid

public int createSolid(int ctx)
Creates a new solid (in the given context).

Specified by:
createSolid in interface Brep
Parameters:
ctx - Handle of the context.
Returns:
Handle of the new solid.

resetSolid

public void resetSolid(int ctx,
                       int solid)
Resets the given solid.

Specified by:
resetSolid in interface Brep
Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
See Also:
createSolid(int), insertFaceIntoSolid(int, int, int)

insertFaceIntoSolid

public void insertFaceIntoSolid(int ctx,
                                int solid,
                                int face)
Inserts another face handle into the given solid.

Specified by:
insertFaceIntoSolid in interface Brep
Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
face - Handle of the new face.
See Also:
resetSolid(int, int)

set

public void set(java.lang.String key,
                java.lang.Object value)
Sets the given property.

Specified by:
set in interface Property
Overrides:
set in class DefaultProperty
Parameters:
key - Key string.
value - The new value.
See Also:
Property.commit()

get

public java.lang.Object get(java.lang.String key)
Gets the given property.

Specified by:
get in interface Property
Overrides:
get in class DefaultProperty
Parameters:
key - Key string.
Returns:
The actual value or null.

commit

public void commit()
Commits all previous changes to the internal object state. Non-mandatory.

Specified by:
commit in interface Property
Overrides:
commit in class DefaultProperty

setTemplate

public static int setTemplate(Template t,
                              int ord)
General-purpose registration routine. Sets all plugs, strings, etc. to the given Template.