VTK
|
A 2D graphics item for rendering a graph. More...
#include <vtkGraphItem.h>
Inherits vtkContextItem.
Public Types | |
typedef vtkContextItem | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkGraphItem * | NewInstance () const |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual vtkIncrementalForceLayout * | GetLayout () |
virtual void | UpdateLayout () |
virtual void | SetGraph (vtkGraph *graph) |
virtual vtkGraph * | GetGraph () |
virtual void | StartLayoutAnimation (vtkRenderWindowInteractor *interactor) |
virtual void | StopLayoutAnimation () |
Static Public Member Functions | |
static vtkGraphItem * | New () |
static int | IsTypeOf (const char *type) |
static vtkGraphItem * | SafeDownCast (vtkObjectBase *o) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkGraphItem () | |
~vtkGraphItem () | |
virtual bool | Paint (vtkContext2D *painter) |
virtual void | RebuildBuffers () |
virtual void | PaintBuffers (vtkContext2D *painter) |
virtual bool | IsDirty () |
virtual vtkIdType | NumberOfVertices () |
virtual vtkIdType | NumberOfEdges () |
virtual vtkIdType | NumberOfEdgePoints (vtkIdType edge) |
virtual float | EdgeWidth (vtkIdType edge, vtkIdType point) |
virtual vtkColor4ub | EdgeColor (vtkIdType edge, vtkIdType point) |
virtual vtkVector2f | EdgePosition (vtkIdType edge, vtkIdType point) |
virtual float | VertexSize (vtkIdType vertex) |
virtual vtkColor4ub | VertexColor (vtkIdType vertex) |
virtual int | VertexMarker (vtkIdType vertex) |
virtual vtkVector2f | VertexPosition (vtkIdType vertex) |
virtual vtkStdString | VertexTooltip (vtkIdType vertex) |
virtual vtkIdType | HitVertex (const vtkVector2f &pos) |
virtual bool | Hit (const vtkContextMouseEvent &event) |
virtual void | PlaceTooltip (vtkIdType v) |
virtual bool | MouseMoveEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseLeaveEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseEnterEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseButtonPressEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseButtonReleaseEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseWheelEvent (const vtkContextMouseEvent &event, int delta) |
Static Protected Member Functions | |
static void | ProcessEvents (vtkObject *caller, unsigned long event, void *clientData, void *callerData) |
A 2D graphics item for rendering a graph.
This item draws a graph as a part of a vtkContextScene. This simple class has minimal state and delegates the determination of visual vertex and edge properties like color, size, width, etc. to a set of virtual functions. To influence the rendering of the graph, subclass this item and override the property functions you wish to customize.
Definition at line 49 of file vtkGraphItem.h.
typedef vtkContextItem vtkGraphItem::Superclass |
Definition at line 53 of file vtkGraphItem.h.
|
protected |
|
protected |
|
static |
|
static |
|
virtual |
|
static |
|
protectedvirtual |
vtkGraphItem* vtkGraphItem::NewInstance | ( | ) | const |
|
virtual |
|
virtual |
The graph that this item draws.
|
virtual |
The graph that this item draws.
|
virtual |
Exposes the incremental graph layout for updating parameters.
|
virtual |
Begins or ends the layout animation.
|
virtual |
Begins or ends the layout animation.
|
virtual |
Incrementally updates the graph layout.
|
protectedvirtual |
Paints the graph. This method will call RebuildBuffers() if the graph is dirty, then call PaintBuffers().
|
protectedvirtual |
Builds a cache of data from the graph by calling the virtual functions such as VertexColor(), EdgeColor(), etc. This will only get called when the item is dirty (i.e. IsDirty() returns true).
|
protectedvirtual |
Efficiently draws the contents of the buffers built in RebuildBuffers. This occurs once per frame.
|
protectedvirtual |
Returns true if the underlying vtkGraph has been modified since the last RebuildBuffers, signalling a new RebuildBuffers is needed. When the graph was modified, it assumes the buffers will be rebuilt, so it updates the modified time of the last build. Override this function if you have a subclass that uses any information in addition to the vtkGraph to determine visual propeties that may be dynamic.
|
protectedvirtual |
Returns the number of vertices in the graph. Generally you do not need to override this method as it simply queries the underlying vtkGraph.
|
protectedvirtual |
Returns the number of edges in the graph. Generally you do not need to override this method as it simply queries the underlying vtkGraph.
Returns the number of edge control points for a particular edge. The implementation returns GetNumberOfEdgePoints(edge) + 2 for the specified edge to incorporate the source and target vertex positions as intial and final edge points.
Returns the edge width. Override in a subclass to change the edge width. Note: The item currently supports one width per edge, queried on the first point.
|
protectedvirtual |
Returns the edge color. Override in a subclass to change the edge color. Each edge control point may be rendered with a separate color with interpolation on line segments between points.
|
protectedvirtual |
|
protectedvirtual |
Returns the vertex size in pixels, which is remains the same at any zoom level. Override in a subclass to change the graph vertex size. Note: The item currently supports one size per graph, queried on the first vertex.
|
protectedvirtual |
Returns the color of each vertex. Override in a subclass to change the graph vertex colors.
|
protectedvirtual |
Returns the marker type for each vertex, as defined in vtkMarkerUtilities. Override in a subclass to change the graph marker type. Note: The item currently supports one marker type for all vertices, queried on the first vertex.
|
protectedvirtual |
Returns the position of each vertex. You generally do not need to override this method. Instead, change the vertex positions with vtkGraph's SetPoint(), then call Modified() on the graph and re-render the scene.
|
protectedvirtual |
Returns the tooltip for each vertex. Override in a subclass to change the tooltip text.
|
staticprotected |
Process events and dispatch to the appropriate member functions.
|
protectedvirtual |
Return index of hit vertex, or -1 if no hit.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Handle mouse events.
|
protectedvirtual |
Whether this graph item is hit.
|
protectedvirtual |
Change the position of the tooltip based on the vertex hovered.