#include <vtkCollapseGraph.h>
vtkCollapseGraph "collapses" vertices onto their neighbors, while maintaining connectivity. Two inputs are required - a graph (directed or undirected), and a vertex selection that can be converted to indices.
Conceptually, each of the vertices specified in the input selection expands, "swallowing" adacent vertices. Edges to-or-from the "swallowed" vertices become edges to-or-from the expanding vertices, maintaining the overall graph connectivity.
In the case of directed graphs, expanding vertices only swallow vertices that are connected via out edges. This rule provides intuitive behavior when working with trees, so that "child" vertices collapse into their parents when the parents are part of the input selection.
Input port 0: graph Input port 1: selection
Definition at line 47 of file vtkCollapseGraph.h.
Public Types | |
typedef vtkGraphAlgorithm | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | SetGraphConnection (vtkAlgorithmOutput *) |
Convenience function provided for setting the graph input. | |
void | SetSelectionConnection (vtkAlgorithmOutput *) |
Convenience function provided for setting the selection input. | |
Static Public Member Functions | |
static vtkCollapseGraph * | New () |
static int | IsTypeOf (const char *type) |
static vtkCollapseGraph * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkCollapseGraph () | |
~vtkCollapseGraph () | |
int | FillInputPortInformation (int port, vtkInformation *info) |
int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
vtkCollapseGraph::vtkCollapseGraph | ( | ) | [protected] |
vtkCollapseGraph::~vtkCollapseGraph | ( | ) | [protected] |
static vtkCollapseGraph* vtkCollapseGraph::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkGraphAlgorithm.
virtual const char* vtkCollapseGraph::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkGraphAlgorithm.
static int vtkCollapseGraph::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type 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 vtkGraphAlgorithm.
virtual int vtkCollapseGraph::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 vtkGraphAlgorithm.
static vtkCollapseGraph* vtkCollapseGraph::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkGraphAlgorithm.
void vtkCollapseGraph::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 vtkGraphAlgorithm.
void vtkCollapseGraph::SetGraphConnection | ( | vtkAlgorithmOutput * | ) |
Convenience function provided for setting the graph input.
void vtkCollapseGraph::SetSelectionConnection | ( | vtkAlgorithmOutput * | ) |
Convenience function provided for setting the selection input.
int vtkCollapseGraph::FillInputPortInformation | ( | int | port, | |
vtkInformation * | info | |||
) | [protected, virtual] |
Fill the input port information objects for this algorithm. This is invoked by the first call to GetInputPortInformation for each port so subclasses can specify what they can handle.
Reimplemented from vtkGraphAlgorithm.
int vtkCollapseGraph::RequestData | ( | vtkInformation * | request, | |
vtkInformationVector ** | inputVector, | |||
vtkInformationVector * | outputVector | |||
) | [protected, virtual] |
This is called by the superclass. This is the method you should override.
Reimplemented from vtkGraphAlgorithm.