A 2D graphics item for rendering a graph.
More...
#include <vtkGraphItem.h>
Inherits vtkContextItem.
|
|
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.
- Examples:
- vtkGraphItem (Examples)
- Tests:
- vtkGraphItem (Tests)
Definition at line 49 of file vtkGraphItem.h.
vtkGraphItem::vtkGraphItem |
( |
| ) |
|
|
protected |
vtkGraphItem::~vtkGraphItem |
( |
| ) |
|
|
protected |
static int vtkGraphItem::IsTypeOf |
( |
const char * |
type | ) |
|
|
static |
virtual int vtkGraphItem::IsA |
( |
const char * |
type | ) |
|
|
virtual |
static vtkGraphItem* vtkGraphItem::SafeDownCast |
( |
vtkObjectBase * |
o | ) |
|
|
static |
virtual vtkObjectBase* vtkGraphItem::NewInstanceInternal |
( |
| ) |
const |
|
protectedvirtual |
virtual void vtkGraphItem::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
| |
|
virtual |
virtual void vtkGraphItem::SetGraph |
( |
vtkGraph * |
graph | ) |
|
|
virtual |
The graph that this item draws.
virtual vtkGraph* vtkGraphItem::GetGraph |
( |
| ) |
|
|
virtual |
The graph that this item draws.
Exposes the incremental graph layout for updating parameters.
virtual void vtkGraphItem::StartLayoutAnimation |
( |
vtkRenderWindowInteractor * |
interactor | ) |
|
|
virtual |
Begins or ends the layout animation.
virtual void vtkGraphItem::StopLayoutAnimation |
( |
| ) |
|
|
virtual |
Begins or ends the layout animation.
virtual void vtkGraphItem::UpdateLayout |
( |
| ) |
|
|
virtual |
Incrementally updates the graph layout.
virtual bool vtkGraphItem::Paint |
( |
vtkContext2D * |
painter | ) |
|
|
protectedvirtual |
virtual void vtkGraphItem::RebuildBuffers |
( |
| ) |
|
|
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).
virtual void vtkGraphItem::PaintBuffers |
( |
vtkContext2D * |
painter | ) |
|
|
protectedvirtual |
Efficiently draws the contents of the buffers built in RebuildBuffers. This occurs once per frame.
virtual bool vtkGraphItem::IsDirty |
( |
| ) |
|
|
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.
virtual vtkIdType vtkGraphItem::NumberOfVertices |
( |
| ) |
|
|
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.
virtual vtkIdType vtkGraphItem::NumberOfEdges |
( |
| ) |
|
|
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.
virtual vtkIdType vtkGraphItem::NumberOfEdgePoints |
( |
vtkIdType |
edge | ) |
|
|
protectedvirtual |
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.
virtual float vtkGraphItem::EdgeWidth |
( |
vtkIdType |
edge, |
|
|
vtkIdType |
point |
|
) |
| |
|
protectedvirtual |
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.
virtual vtkColor4ub vtkGraphItem::EdgeColor |
( |
vtkIdType |
edge, |
|
|
vtkIdType |
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.
virtual vtkVector2f vtkGraphItem::EdgePosition |
( |
vtkIdType |
edge, |
|
|
vtkIdType |
point |
|
) |
| |
|
protectedvirtual |
Returns the edge control point positions. You generally do not need to override this method, instead change the edge control points on the underlying vtkGraph with SetEdgePoint(), AddEdgePoint(), etc., then call Modified() on the vtkGraph and re-render the scene.
virtual float vtkGraphItem::VertexSize |
( |
vtkIdType |
vertex | ) |
|
|
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.
virtual vtkColor4ub vtkGraphItem::VertexColor |
( |
vtkIdType |
vertex | ) |
|
|
protectedvirtual |
Returns the color of each vertex. Override in a subclass to change the graph vertex colors.
virtual int vtkGraphItem::VertexMarker |
( |
vtkIdType |
vertex | ) |
|
|
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.
virtual vtkVector2f vtkGraphItem::VertexPosition |
( |
vtkIdType |
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.
virtual vtkStdString vtkGraphItem::VertexTooltip |
( |
vtkIdType |
vertex | ) |
|
|
protectedvirtual |
Returns the tooltip for each vertex. Override in a subclass to change the tooltip text.
static void vtkGraphItem::ProcessEvents |
( |
vtkObject * |
caller, |
|
|
unsigned long |
event, |
|
|
void * |
clientData, |
|
|
void * |
callerData |
|
) |
| |
|
staticprotected |
Process events and dispatch to the appropriate member functions.
virtual vtkIdType vtkGraphItem::HitVertex |
( |
const vtkVector2f & |
pos | ) |
|
|
protectedvirtual |
Return index of hit vertex, or -1 if no hit.
virtual bool vtkGraphItem::MouseMoveEvent |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
virtual bool vtkGraphItem::MouseLeaveEvent |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
virtual bool vtkGraphItem::MouseEnterEvent |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
virtual bool vtkGraphItem::MouseButtonPressEvent |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
virtual bool vtkGraphItem::MouseButtonReleaseEvent |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
virtual bool vtkGraphItem::MouseWheelEvent |
( |
const vtkContextMouseEvent & |
event, |
|
|
int |
delta |
|
) |
| |
|
protectedvirtual |
virtual bool vtkGraphItem::Hit |
( |
const vtkContextMouseEvent & |
event | ) |
|
|
protectedvirtual |
Whether this graph item is hit.
virtual void vtkGraphItem::PlaceTooltip |
( |
vtkIdType |
v | ) |
|
|
protectedvirtual |
Change the position of the tooltip based on the vertex hovered.
The documentation for this class was generated from the following file: