VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkEdgeTable Class Reference

keep track of edges (edge is pair of integer id's) More...

#include <vtkEdgeTable.h>

Inheritance diagram for vtkEdgeTable:
[legend]
Collaboration diagram for vtkEdgeTable:
[legend]

Public Types

typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkEdgeTableNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
void Initialize ()
 
int InitEdgeInsertion (vtkIdType numPoints, int storeAttributes=0)
 
vtkIdType InsertEdge (vtkIdType p1, vtkIdType p2)
 
void InsertEdge (vtkIdType p1, vtkIdType p2, vtkIdType attributeId)
 
void InsertEdge (vtkIdType p1, vtkIdType p2, void *ptr)
 
vtkIdType IsEdge (vtkIdType p1, vtkIdType p2)
 
void IsEdge (vtkIdType p1, vtkIdType p2, void *&ptr)
 
int InitPointInsertion (vtkPoints *newPts, vtkIdType estSize)
 
void InitTraversal ()
 
vtkIdType GetNextEdge (vtkIdType &p1, vtkIdType &p2)
 
int GetNextEdge (vtkIdType &p1, vtkIdType &p2, void *&ptr)
 
void Reset ()
 
int InsertUniquePoint (vtkIdType p1, vtkIdType p2, double x[3], vtkIdType &ptId)
 
virtual vtkIdType GetNumberOfEdges ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkEdgeTableNew ()
 
static int IsTypeOf (const char *type)
 
static vtkEdgeTableSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkEdgeTable ()
 
 ~vtkEdgeTable ()
 
vtkIdList ** Resize (vtkIdType size)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkIdList ** Table
 
vtkIdType TableMaxId
 
vtkIdType TableSize
 
int Position [2]
 
int Extend
 
vtkIdType NumberOfEdges
 
vtkPointsPoints
 
int StoreAttributes
 
vtkIdList ** Attributes
 
vtkVoidArray ** PointerAttributes
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

keep track of edges (edge is pair of integer id's)

vtkEdgeTable is a general object for keeping track of lists of edges. An edge is defined by the pair of point id's (p1,p2). Methods are available to insert edges, check if edges exist, and traverse the list of edges. Also, it's possible to associate attribute information with each edge. The attribute information may take the form of vtkIdType id's, void* pointers, or points. To store attributes, make sure that InitEdgeInsertion() is invoked with the storeAttributes flag set properly. If points are inserted, use the methods InitPointInsertion() and InsertUniquePoint().

Definition at line 39 of file vtkEdgeTable.h.

Member Typedef Documentation

Definition at line 45 of file vtkEdgeTable.h.

Constructor & Destructor Documentation

vtkEdgeTable::vtkEdgeTable ( )
protected
vtkEdgeTable::~vtkEdgeTable ( )
protected

Member Function Documentation

static vtkEdgeTable* vtkEdgeTable::New ( )
static

Instantiate object assuming that 1000 edges are to be inserted.

static int vtkEdgeTable::IsTypeOf ( const char *  type)
static
virtual int vtkEdgeTable::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

static vtkEdgeTable* vtkEdgeTable::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkEdgeTable::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkObject.

vtkEdgeTable* vtkEdgeTable::NewInstance ( ) const
void vtkEdgeTable::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

void vtkEdgeTable::Initialize ( )

Free memory and return to the initially instantiated state.

int vtkEdgeTable::InitEdgeInsertion ( vtkIdType  numPoints,
int  storeAttributes = 0 
)

Initialize the edge insertion process. Provide an estimate of the number of points in a dataset (the maximum range value of p1 or p2). The storeAttributes variable controls whether attributes are to be stored with the edge, and what type of attributes. If storeAttributes==1, then attributes of vtkIdType can be stored. If storeAttributes==2, then attributes of type void* can be stored. In either case, additional memory will be required by the data structure to store attribute data per each edge. This method is used in conjunction with one of the three InsertEdge() methods described below (don't mix the InsertEdge() methods—make sure that the one used is consistent with the storeAttributes flag set in InitEdgeInsertion()).

vtkIdType vtkEdgeTable::InsertEdge ( vtkIdType  p1,
vtkIdType  p2 
)

Insert the edge (p1,p2) into the table. It is the user's responsibility to check if the edge has already been inserted (use IsEdge()). If the storeAttributes flag in InitEdgeInsertion() has been set, then the method returns a unique integer id (i.e., the edge id) that can be used to set and get edge attributes. Otherwise, the method will return 1. Do not mix this method with the InsertEdge() method that follows.

void vtkEdgeTable::InsertEdge ( vtkIdType  p1,
vtkIdType  p2,
vtkIdType  attributeId 
)

Insert the edge (p1,p2) into the table with the attribute id specified (make sure the attributeId >= 0). Note that the attributeId is ignored if the storeAttributes variable was set to 0 in the InitEdgeInsertion() method. It is the user's responsibility to check if the edge has already been inserted (use IsEdge()). Do not mix this method with the other two InsertEdge() methods.

void vtkEdgeTable::InsertEdge ( vtkIdType  p1,
vtkIdType  p2,
void *  ptr 
)

Insert the edge (p1,p2) into the table with the attribute id specified (make sure the attributeId >= 0). Note that the attributeId is ignored if the storeAttributes variable was set to 0 in the InitEdgeInsertion() method. It is the user's responsibility to check if the edge has already been inserted (use IsEdge()). Do not mix this method with the other two InsertEdge() methods.

vtkIdType vtkEdgeTable::IsEdge ( vtkIdType  p1,
vtkIdType  p2 
)

Return an integer id for the edge, or an attribute id of the edge (p1,p2) if the edge has been previously defined (it depends upon which version of InsertEdge() is being used); otherwise -1. The unique integer id can be used to set and retrieve attributes to the edge.

void vtkEdgeTable::IsEdge ( vtkIdType  p1,
vtkIdType  p2,
void *&  ptr 
)

Similar to above, but returns a void* pointer is InitEdgeInsertion() has been called with storeAttributes==2. A NULL pointer value is returned if the edge does not exist.

int vtkEdgeTable::InitPointInsertion ( vtkPoints newPts,
vtkIdType  estSize 
)

Initialize the point insertion process. The newPts is an object representing point coordinates into which incremental insertion methods place their data. The points are associated with the edge.

int vtkEdgeTable::InsertUniquePoint ( vtkIdType  p1,
vtkIdType  p2,
double  x[3],
vtkIdType ptId 
)

Insert a unique point on the specified edge. Invoke this method only after InitPointInsertion() has been called. Return 0 if point was already in the list, otherwise return 1.

virtual vtkIdType vtkEdgeTable::GetNumberOfEdges ( )
virtual

Return the number of edges that have been inserted thus far.

void vtkEdgeTable::InitTraversal ( )

Intialize traversal of edges in table.

vtkIdType vtkEdgeTable::GetNextEdge ( vtkIdType p1,
vtkIdType p2 
)

Traverse list of edges in table. Return the edge as (p1,p2), where p1 and p2 are point id's. Method return value is <0 if list is exhausted; non-zero otherwise. The value of p1 is guaranteed to be <= p2.

int vtkEdgeTable::GetNextEdge ( vtkIdType p1,
vtkIdType p2,
void *&  ptr 
)

Similar to above, but fills a void* pointer if InitEdgeInsertion() has been called with storeAttributes==2. A NULL pointer value is filled otherwise. Returns 0 if list is exhausted.

void vtkEdgeTable::Reset ( )

Reset the object and prepare for reinsertion of edges. Does not delete memory like the Initialize() method.

vtkIdList** vtkEdgeTable::Resize ( vtkIdType  size)
protected

Member Data Documentation

vtkIdList** vtkEdgeTable::Table
protected

Definition at line 142 of file vtkEdgeTable.h.

vtkIdType vtkEdgeTable::TableMaxId
protected

Definition at line 143 of file vtkEdgeTable.h.

vtkIdType vtkEdgeTable::TableSize
protected

Definition at line 144 of file vtkEdgeTable.h.

int vtkEdgeTable::Position[2]
protected

Definition at line 145 of file vtkEdgeTable.h.

int vtkEdgeTable::Extend
protected

Definition at line 146 of file vtkEdgeTable.h.

vtkIdType vtkEdgeTable::NumberOfEdges
protected

Definition at line 147 of file vtkEdgeTable.h.

vtkPoints* vtkEdgeTable::Points
protected

Definition at line 148 of file vtkEdgeTable.h.

int vtkEdgeTable::StoreAttributes
protected

Definition at line 150 of file vtkEdgeTable.h.

vtkIdList** vtkEdgeTable::Attributes
protected

Definition at line 151 of file vtkEdgeTable.h.

vtkVoidArray** vtkEdgeTable::PointerAttributes
protected

Definition at line 152 of file vtkEdgeTable.h.


The documentation for this class was generated from the following file: