VTK  9.3.20240328
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 Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class. More...
 
vtkEdgeTableNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
void Initialize ()
 Free memory and return to the initially instantiated state. More...
 
int InitEdgeInsertion (vtkIdType numPoints, int storeAttributes=0)
 Initialize the edge insertion process. More...
 
vtkIdType InsertEdge (vtkIdType p1, vtkIdType p2)
 Insert the edge (p1,p2) into the table. More...
 
void 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). More...
 
void 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). More...
 
vtkIdType 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. More...
 
void IsEdge (vtkIdType p1, vtkIdType p2, void *&ptr)
 Similar to above, but returns a void* pointer is InitEdgeInsertion() has been called with storeAttributes==2. More...
 
int InitPointInsertion (vtkPoints *newPts, vtkIdType estSize)
 Initialize the point insertion process. More...
 
int InsertUniquePoint (vtkIdType p1, vtkIdType p2, double x[3], vtkIdType &ptId)
 Insert a unique point on the specified edge. More...
 
void InitTraversal ()
 Initialize traversal of edges in table. More...
 
vtkIdType GetNextEdge (vtkIdType &p1, vtkIdType &p2)
 Traverse list of edges in table. More...
 
int GetNextEdge (vtkIdType &p1, vtkIdType &p2, void *&ptr)
 Similar to above, but fills a void* pointer if InitEdgeInsertion() has been called with storeAttributes==2. More...
 
void Reset ()
 Reset the object and prepare for reinsertion of edges. More...
 
virtual vtkIdType GetNumberOfEdges ()
 Return the number of edges that have been inserted thus far. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method. More...
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not. More...
 

Static Public Member Functions

static vtkEdgeTableNew ()
 Instantiate object assuming that 1000 edges are to be inserted. More...
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkEdgeTableSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class. More...
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkEdgeTable ()
 
 ~vtkEdgeTable () override
 
vtkIdList ** Resize (vtkIdType size)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
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
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

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 29 of file vtkEdgeTable.h.

Member Typedef Documentation

◆ Superclass

Definition at line 37 of file vtkEdgeTable.h.

Constructor & Destructor Documentation

◆ vtkEdgeTable()

vtkEdgeTable::vtkEdgeTable ( )
protected

◆ ~vtkEdgeTable()

vtkEdgeTable::~vtkEdgeTable ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkEdgeTable* vtkEdgeTable::New ( )
static

Instantiate object assuming that 1000 edges are to be inserted.

◆ IsTypeOf()

static vtkTypeBool vtkEdgeTable::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool 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 vtkObjectBase.

◆ SafeDownCast()

static vtkEdgeTable* vtkEdgeTable::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkEdgeTable::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkEdgeTable* vtkEdgeTable::NewInstance ( ) const

◆ PrintSelf()

void vtkEdgeTable::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

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.

◆ Initialize()

void vtkEdgeTable::Initialize ( )

Free memory and return to the initially instantiated state.

◆ InitEdgeInsertion()

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

◆ InsertEdge() [1/3]

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.

◆ InsertEdge() [2/3]

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.

◆ InsertEdge() [3/3]

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.

◆ IsEdge() [1/2]

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.

◆ IsEdge() [2/2]

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 nullptr pointer value is returned if the edge does not exist.

◆ InitPointInsertion()

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.

◆ InsertUniquePoint()

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.

◆ GetNumberOfEdges()

virtual vtkIdType vtkEdgeTable::GetNumberOfEdges ( )
virtual

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

◆ InitTraversal()

void vtkEdgeTable::InitTraversal ( )

Initialize traversal of edges in table.

◆ GetNextEdge() [1/2]

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.

◆ GetNextEdge() [2/2]

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 nullptr pointer value is filled otherwise. Returns 0 if list is exhausted.

◆ Reset()

void vtkEdgeTable::Reset ( )

Reset the object and prepare for reinsertion of edges.

Does not delete memory like the Initialize() method.

◆ Resize()

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

Member Data Documentation

◆ Table

vtkIdList** vtkEdgeTable::Table
protected

Definition at line 159 of file vtkEdgeTable.h.

◆ TableMaxId

vtkIdType vtkEdgeTable::TableMaxId
protected

Definition at line 160 of file vtkEdgeTable.h.

◆ TableSize

vtkIdType vtkEdgeTable::TableSize
protected

Definition at line 161 of file vtkEdgeTable.h.

◆ Position

int vtkEdgeTable::Position[2]
protected

Definition at line 162 of file vtkEdgeTable.h.

◆ Extend

int vtkEdgeTable::Extend
protected

Definition at line 163 of file vtkEdgeTable.h.

◆ NumberOfEdges

vtkIdType vtkEdgeTable::NumberOfEdges
protected

Definition at line 164 of file vtkEdgeTable.h.

◆ Points

vtkPoints* vtkEdgeTable::Points
protected

Definition at line 165 of file vtkEdgeTable.h.

◆ StoreAttributes

int vtkEdgeTable::StoreAttributes
protected

Definition at line 167 of file vtkEdgeTable.h.

◆ Attributes

vtkIdList** vtkEdgeTable::Attributes
protected

Definition at line 168 of file vtkEdgeTable.h.

◆ PointerAttributes

vtkVoidArray** vtkEdgeTable::PointerAttributes
protected

Definition at line 169 of file vtkEdgeTable.h.


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