edu.mines.jtk.mesh
Interface TetMesh.TetListener

All Superinterfaces:
java.util.EventListener
Enclosing class:
TetMesh

public static interface TetMesh.TetListener
extends java.util.EventListener

Implemented to monitor the addition and removal of tets in the mesh. When tet listeners are called, the mesh may be in an invalid state. Specifically, the tet nabors of a tet added or removed may be invalid. However, all other state of that tet is valid.

Classes that maintain references to tets in a tet mesh should implement this interface. Those references are almost certainly invalid (and may prevent garbage collection) after tets are removed from the mesh. This is especially important because tets removed may be reused, and given entirely different state, as tets are added to the mesh.

Tet listeners may be costly. Typically, for each node added to a tet mesh, roughly 18 tets are removed and 24 tets are added. Therefore, tet listeners should be added just prior to making a small number of incremental changes to the mesh, and removed after such changes are completed.


Method Summary
 void tetAdded(TetMesh mesh, TetMesh.Tet tet)
          Called after the specified tet has been added to the mesh.
 void tetRemoved(TetMesh mesh, TetMesh.Tet tet)
          Called after the specified tet has been removed from the mesh.
 

Method Detail

tetAdded

void tetAdded(TetMesh mesh,
              TetMesh.Tet tet)
Called after the specified tet has been added to the mesh. When this method is called, the tet nabors of the specified tet are not valid. All other state of the specified tet, such as its nodes, is valid during this method call.

Parameters:
mesh - this mesh.
tet - the tet added.

tetRemoved

void tetRemoved(TetMesh mesh,
                TetMesh.Tet tet)
Called after the specified tet has been removed from the mesh. When this method is called, the tet nabors of the specified tet are not valid. All other state of the specified tet, such as its nodes, is valid during this method call.

Parameters:
mesh - this mesh.
tet - the tet removed.