cz.cuni.jagrlib.iface
Interface Brep

All Superinterfaces:
Property
All Known Implementing Classes:
VEFDS

public interface Brep
extends Property

Boundary representation (B-rep) of 3D scene. Suitable for both compact and topological 3D databases. 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.09
See Also:
Brep.java

Field Summary
static int ATTR_BOOLEAN
          boolean attribute type.
static int ATTR_COORD_2D
          2D double coordinates [x,y].
static int ATTR_COORD_2F
          2D float coordinates [x,y].
static int ATTR_COORD_2I
          2D int coordinates [x,y].
static int ATTR_COORD_3D
          3D double coordinates [x,y,z].
static int ATTR_COORD_3F
          3D float coordinates [x,y,z].
static int ATTR_COORD_3I
          3D int coordinates [x,y,z].
static int ATTR_COORDH_3D
          2D double homogeneous coordinates [x,y,w].
static int ATTR_COORDH_3F
          2D float homogeneous coordinates [x,y,w].
static int ATTR_COORDH_4D
          3D double homogeneous coordinates [x,y,z,w].
static int ATTR_COORDH_4F
          3D float homogeneous coordinates [x,y,z,w].
static int ATTR_DOUBLE
          double attribute type.
static int ATTR_FLOAT
          float attribute type.
static int ATTR_INTEGER
          int attribute type.
static int ATTR_LAST
          Order number of the last attribute type.
static int ATTR_LONG
          long attribute type.
static int ATTR_OBJECT
          General attribute type (Object successor).
static int ATTR_RGB_3F
          RGB color attribute type (float[3]).
static int ATTR_RGBA_4F
          RGBA color attribute type (float[4]).
static java.lang.String COLOR
          Color (vertex, face, solid?).
static int CONTEXT
          Context data / attribute association.
static java.lang.String COORD
          String identifier of implicit coordinate attribute with double components.
static java.lang.String COORD_PROJ
          String identifier of implicit projected coordinate attribute.
static int CTX_DEFAULT
          Default context identifier.
static java.lang.String DATA
          String identifier of implicit data-attribute (edge, solid, etc.).
static int DIVISION
          Division data / attribute association.
static int EDGE
          Edge data / attribute association.
static int EDGE_SIZE
          Size of regular edge record (can be stored in one big array).
static int ERROR
          Error completion code.
static int FACE
          Face data / attribute association.
static java.lang.String MATERIAL_A
          Material id (face, solid?).
static java.lang.String NORMAL
          Normal vector (vertex, face).
static int NULL
          Empty (irelevant) object / parameter.
static java.lang.String PRIMARY_COORD_TYPE
           
static java.lang.String PROJECTED_COORD_TYPE
           
static int SCENE
          Global Brep data / attribute association.
static int SOLID
          Solid data / attribute association.
static java.lang.String SOLID_A
          Solid id (face).
static java.lang.String TEXTURE_0
          Texture coordinates (1D, 2D or 3D).
static java.lang.String TEXTURE_1
           
static java.lang.String TEXTURE_2
           
static java.lang.String TEXTURE_3
           
static int VERTEX
          Vertex data / attribute association.
static int WEDGE_FL
          Winged-edge-offset: the left face (FL).
static int WEDGE_FR
          Winged-edge-offset: the right face (FR).
static int WEDGE_LN
          Winged-edge-offset: successor in the left face (LN).
static int WEDGE_LP
          Winged-edge-offset: predecessor in the left face (LP).
static java.lang.String WEDGE_MODE
           
static int WEDGE_RN
          Winged-edge-offset: successor in the right face (RN).
static int WEDGE_RP
          Winged-edge-offset: predecessor in the right face (RP).
static int WEDGE_SIZE
          Size of winged-edge record (all items are integer numbers /handles/ and can be stored in one big array).
static int WEDGE_V1
          Winged-edge-offset: 1st vertex (V1).
static int WEDGE_V2
          Winged-edge-offset: 2nd vertex (V2).
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 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.
 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)
          Returns 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)
          Returns 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).
 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.
 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 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.
 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.
 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 interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

ERROR

static final int ERROR
Error completion code.

See Also:
Constant Field Values

NULL

static final int NULL
Empty (irelevant) object / parameter.

See Also:
Constant Field Values

SCENE

static final int SCENE
Global Brep data / attribute association.

See Also:
Constant Field Values

CONTEXT

static final int CONTEXT
Context data / attribute association.

See Also:
Constant Field Values

VERTEX

static final int VERTEX
Vertex data / attribute association.

See Also:
Constant Field Values

EDGE

static final int EDGE
Edge data / attribute association.

See Also:
Constant Field Values

FACE

static final int FACE
Face data / attribute association.

See Also:
Constant Field Values

DIVISION

static final int DIVISION
Division data / attribute association.

See Also:
Constant Field Values

SOLID

static final int SOLID
Solid data / attribute association.

See Also:
Constant Field Values

CTX_DEFAULT

static final int CTX_DEFAULT
Default context identifier.

See Also:
Constant Field Values

ATTR_OBJECT

static final int ATTR_OBJECT
General attribute type (Object successor).

See Also:
Constant Field Values

ATTR_BOOLEAN

static final int ATTR_BOOLEAN
boolean attribute type.

See Also:
Constant Field Values

ATTR_INTEGER

static final int ATTR_INTEGER
int attribute type.

See Also:
Constant Field Values

ATTR_LONG

static final int ATTR_LONG
long attribute type.

See Also:
Constant Field Values

ATTR_FLOAT

static final int ATTR_FLOAT
float attribute type.

See Also:
Constant Field Values

ATTR_DOUBLE

static final int ATTR_DOUBLE
double attribute type.

See Also:
Constant Field Values

ATTR_COORD_2F

static final int ATTR_COORD_2F
2D float coordinates [x,y].

See Also:
Constant Field Values

ATTR_COORD_2D

static final int ATTR_COORD_2D
2D double coordinates [x,y].

See Also:
Constant Field Values

ATTR_COORD_2I

static final int ATTR_COORD_2I
2D int coordinates [x,y].

See Also:
Constant Field Values

ATTR_COORDH_3F

static final int ATTR_COORDH_3F
2D float homogeneous coordinates [x,y,w].

See Also:
Constant Field Values

ATTR_COORDH_3D

static final int ATTR_COORDH_3D
2D double homogeneous coordinates [x,y,w].

See Also:
Constant Field Values

ATTR_COORD_3F

static final int ATTR_COORD_3F
3D float coordinates [x,y,z].

See Also:
Constant Field Values

ATTR_COORD_3D

static final int ATTR_COORD_3D
3D double coordinates [x,y,z].

See Also:
Constant Field Values

ATTR_COORD_3I

static final int ATTR_COORD_3I
3D int coordinates [x,y,z].

See Also:
Constant Field Values

ATTR_COORDH_4F

static final int ATTR_COORDH_4F
3D float homogeneous coordinates [x,y,z,w].

See Also:
Constant Field Values

ATTR_COORDH_4D

static final int ATTR_COORDH_4D
3D double homogeneous coordinates [x,y,z,w].

See Also:
Constant Field Values

ATTR_RGB_3F

static final int ATTR_RGB_3F
RGB color attribute type (float[3]).

See Also:
Constant Field Values

ATTR_RGBA_4F

static final int ATTR_RGBA_4F
RGBA color attribute type (float[4]).

See Also:
Constant Field Values

ATTR_LAST

static final int ATTR_LAST
Order number of the last attribute type.

See Also:
Constant Field Values

PRIMARY_COORD_TYPE

static final java.lang.String PRIMARY_COORD_TYPE
See Also:
Constant Field Values

PROJECTED_COORD_TYPE

static final java.lang.String PROJECTED_COORD_TYPE
See Also:
Constant Field Values

WEDGE_MODE

static final java.lang.String WEDGE_MODE
See Also:
Constant Field Values

COORD

static final java.lang.String COORD
String identifier of implicit coordinate attribute with double components.

See Also:
Constant Field Values

COORD_PROJ

static final java.lang.String COORD_PROJ
String identifier of implicit projected coordinate attribute.

See Also:
Constant Field Values

DATA

static final java.lang.String DATA
String identifier of implicit data-attribute (edge, solid, etc.).

See Also:
Constant Field Values

COLOR

static final java.lang.String COLOR
Color (vertex, face, solid?).

See Also:
Constant Field Values

NORMAL

static final java.lang.String NORMAL
Normal vector (vertex, face).

See Also:
Constant Field Values

TEXTURE_0

static final java.lang.String TEXTURE_0
Texture coordinates (1D, 2D or 3D).

See Also:
Constant Field Values

TEXTURE_1

static final java.lang.String TEXTURE_1
See Also:
Constant Field Values

TEXTURE_2

static final java.lang.String TEXTURE_2
See Also:
Constant Field Values

TEXTURE_3

static final java.lang.String TEXTURE_3
See Also:
Constant Field Values

SOLID_A

static final java.lang.String SOLID_A
Solid id (face).

See Also:
Constant Field Values

MATERIAL_A

static final java.lang.String MATERIAL_A
Material id (face, solid?).

See Also:
Constant Field Values

EDGE_SIZE

static final int EDGE_SIZE
Size of regular edge record (can be stored in one big array).

See Also:
Constant Field Values

WEDGE_SIZE

static final int WEDGE_SIZE
Size of winged-edge record (all items are integer numbers /handles/ and can be stored in one big array).

See Also:
Constant Field Values

WEDGE_V1

static final int WEDGE_V1
Winged-edge-offset: 1st vertex (V1).

See Also:
Constant Field Values

WEDGE_V2

static final int WEDGE_V2
Winged-edge-offset: 2nd vertex (V2).

See Also:
Constant Field Values

WEDGE_FL

static final int WEDGE_FL
Winged-edge-offset: the left face (FL).

See Also:
Constant Field Values

WEDGE_FR

static final int WEDGE_FR
Winged-edge-offset: the right face (FR).

See Also:
Constant Field Values

WEDGE_LP

static final int WEDGE_LP
Winged-edge-offset: predecessor in the left face (LP).

See Also:
Constant Field Values

WEDGE_LN

static final int WEDGE_LN
Winged-edge-offset: successor in the left face (LN).

See Also:
Constant Field Values

WEDGE_RP

static final int WEDGE_RP
Winged-edge-offset: predecessor in the right face (RP).

See Also:
Constant Field Values

WEDGE_RN

static final int WEDGE_RN
Winged-edge-offset: successor in the right face (RN).

See Also:
Constant Field Values
Method Detail

setCoordTypes

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

Parameters:
baseType - Base type for the COORD attribute.
baseProjType - Base type for the COORD_PROJ (projected) attribute.

setEdgeMode

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

Parameters:
wedge - Winged-edges will be used?
See Also:
getEdgeRecord(int, int[]), WEDGE_SIZE

init

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


createContext

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).

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

removeContext

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

Parameters:
ctx - Handle to a context to be destroyed.
See Also:
createContext(int)

createAttribute

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

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

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).

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

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

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

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

Parameters:
attr - Handle to an attribute.
See Also:
copyAttribute(int,int,String), copyAttribute(int,int), createAttribute(int, int, java.lang.String, int)

getAttributeId

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

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

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

Parameters:
attr - Handle to the attribute.
Returns:
The where parameter.

getAttributeContext

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

Parameters:
attr - Handle to the attribute.
Returns:
Exclusive context of the attribute (or NULL).

getAttributeIdent

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

Parameters:
attr - Handle to the attribute.
Returns:
String identifier of the attribute.

getAttributeType

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

Parameters:
attr - Handle to the attribute.
Returns:
The type parameter.

getAttribute

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).

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

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

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.

getAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
coord - Optional pre-allocated result array.
Returns:
Result array (coord if possible).

getBoolAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Boolean attribute value.

getIntAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Integer attribute value.

getLongAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Long-integer attribute value.

getFloatAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Double attribute value.

getDoubleAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
Returns:
Double attribute value.

setAttribute

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

Parameters:
attr - Handle to the attribute.
id - Handle to the entity.
val - New attribute value (can be null).

copyCoordinates

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

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

Parameters:
pre - Pre-allocated BrepIterator object (ca be null).
Returns:
The initialized iterator data.
See Also:
vertexInFaceIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

vertexInFaceIterator

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

Parameters:
face - Handle to the face.
pre - Pre-allocated BrepIterator object (ca be null).
Returns:
The initialized iterator data.
See Also:
vertexIterator(cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

edgeIterator

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

Parameters:
pre - Pre-allocated BrepIterator object (ca be null).
Returns:
The initialized iterator data.
See Also:
edgeInFaceIterator(int, cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

edgeInFaceIterator

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

Parameters:
face - Handle to the face.
pre - Pre-allocated BrepIterator object (ca be null).
Returns:
The initialized iterator data.
See Also:
edgeIterator(cz.cuni.jagrlib.iface.BrepIterator), nextItem(cz.cuni.jagrlib.iface.BrepIterator)

faceIterator

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

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

faceInSolidIterator

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

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

divisionIterator

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

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

divisionInSolidIterator

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

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

solidIterator

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

Parameters:
pre - Pre-allocated BrepIterator object (ca be null).
Returns:
The initialized iterator data.
See Also:
nextItem(cz.cuni.jagrlib.iface.BrepIterator)

nextItem

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

Parameters:
iter - Associated iterator data.
Returns:
Handle to the next entity or NULL at the end of an iteration.

getVertexCoords

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

Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Optional pre-allocated coordinate vector.
Returns:
Result array (coord if possible).
See Also:
getVertexCoords(int,int,double[]), getVertexCoords(int,int,float[])

getVertexCoords

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

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[])

getVertexCoords

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

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[])

getEdgeVertices

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

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

getEdgeRecord

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

int createVertex()
Creates a new vertex.

Returns:
Handle of the new vertex.

setVertexCoords

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

Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D or 3D).
See Also:
createVertex()

setVertexCoords

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

Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D to 4D).
See Also:
createVertex()

setVertexCoords

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

Parameters:
ctx - Handle of the context.
vert - Handle of the vertex.
coord - Coordinate vector (2D to 4D).
See Also:
createVertex()

createEdge

int createEdge()
Creates a new edge.

Returns:
Handle of the new edge.

setEdgeVertices

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

Parameters:
edge - Handle of the edge.
v1 - Handle of the 1st vertex.
v2 - Handle of the 2nd vertex.
See Also:
createEdge()

createFace

int createFace()
Creates a new face.

Returns:
Handle of the new face.

setTriangleEdges

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

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

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

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

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

Parameters:
face - Handle of the face.
vert - Handles of the vertices (NULL breaks the sequence}).
See Also:
createFace()

setFaceEdges

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

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

setSolidFaces

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

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

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

Parameters:
ctx - Handle of the context.
Returns:
Handle of the new division.

setDivisionFaces

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

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

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

Parameters:
ctx - Handle of the context.
Returns:
Handle of the new solid.

resetSolid

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

Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
See Also:
createSolid(int), insertFaceIntoSolid(int, int, int)

insertFaceIntoSolid

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

Parameters:
ctx - Handle of the context.
solid - Handle of the solid.
face - Handle of the new face.
See Also:
resetSolid(int, int)