Loading...
Searching...
No Matches
VdfGrapherOptions Class Reference

This class can be used to configure aspects of VdfGrapher's output. More...

#include <grapherOptions.h>

Classes

struct  NodeLimit
 This struct is used to allow the grapher to graph a subset of the nodes. More...
 

Public Types

enum  DisplayStyle { DisplayStyleFull = 0 , DisplayStyleNoLabels , DisplayStyleSummary }
 The display styles for nodes. More...
 
using NodeFilterCallback = std::function< bool(const VdfNode &nodeToFilter)>
 This typedef describes the function signature for callbacks used to filter nodes out of the graph.
 
using NodeStyleCallback = std::function< DisplayStyle(const VdfNode &node, const VdfConnectionVector &drawnIn, const VdfConnectionVector &drawnOut)>
 This callback is used to determine what style a specific node should be rendered with regardless what was set via SetDisplayStyle().
 
typedef std::vector< NodeLimitNodeLimitVector
 

Public Member Functions

void SetDrawMasks (bool drawMasks)
 When drawMasks is true, the masks on the connections will be drawn.
 
void SetDrawAffectsMasks (bool drawMasks)
 When drawMasks is true, the affects masks on node outputs will be drawn.
 
bool GetDrawMasks () const
 Returns whether or not masks will be draw on the connections.
 
bool GetDrawAffectsMasks () const
 Returns whether or not masks will be draw on the connections.
 
void SetPrintSingleOutputs (bool enable)
 When enable is false, nodes containing only a single output, won't render their full connector to reduce clutter.
 
bool GetPrintSingleOutputs () const
 Returns true, if skipping single outputs is enabled.
 
void SetPageSize (double width, double height)
 Sets the desired size of the page output.
 
double GetPageHeight () const
 Returns the page height.
 
double GetPageWidth () const
 Returns the page width.
 
void SetUniqueIds (bool uniqueIds)
 When uniqueIds is false, the graph will be printed without using unique ids for node names and ports.
 
bool GetUniqueIds () const
 Returns whether or not the graph should use unique ids.
 
void SetOmitUnconnectedSpecs (bool omit)
 When omit is set, unconnected specs will be omitted.
 
bool GetOmitUnconnectedSpecs () const
 Returns whether or not the produced graph should include unconnected specs (ie.
 
void SetDrawColorizedConnectionsOnly (bool drawColorizedConnectionsOnly)
 When drawColorizedConnectionsOnly is set, only connections that have a color set via SetColor() will be drawn.
 
bool GetDrawColorizedConnectionsOnly () const
 Returns whether connections that have not a color set via SetColor() should not be drawn.
 
void AddNodeToGraph (const VdfNode &node, int maxInDepth, int maxOutDepth)
 Adds node to the list of nodes to be graphed.
 
void SetColor (const VdfObjectPtr &object, const TfToken &color)
 Sets a color for object which can be a connection or node.
 
TfToken GetColor (const VdfObjectPtr &object) const
 Returns the color for object or the empty TfToken if none was set.
 
void SetAnnotation (const VdfObjectPtr &object, const std::string &text)
 Sets an annotation text for object which gets rendered for the object.
 
std::string GetAnnotation (const VdfObjectPtr &object) const
 Returns the annotation for object or the empty string if none was set.
 
const NodeLimitVector & GetNodesToGraph () const
 Returns the list of nodes that should be graphed.
 
void SetNodeFilterCallback (const NodeFilterCallback &callback)
 Sets the callback used used to filter nodes out of the graph.
 
const NodeFilterCallbackGetNodeFilterCallback () const
 Returns the callback used to filter nodes out of the graph.
 
void SetNodeStyleCallback (const NodeStyleCallback &callback)
 Sets the callback used used to style nodes.
 
const NodeStyleCallbackGetNodeStyleCallback () const
 Returns the (optional) callback used to style nodes.
 
void SetDisplayStyle (DisplayStyle style)
 Sets the default display style for nodes.
 
DisplayStyle GetDisplayStyle () const
 Returns the default display style for a node.
 

Static Public Member Functions

static VDF_API bool DebugNameFilter (const std::vector< std::string > &nameList, bool includeIfInNameList, const VdfNode &node)
 Filters nodes based on debug names, when used as a NodeFilterCallback.
 

Detailed Description

This class can be used to configure aspects of VdfGrapher's output.

Definition at line 35 of file grapherOptions.h.

Member Typedef Documentation

◆ NodeFilterCallback

using NodeFilterCallback = std::function< bool (const VdfNode &nodeToFilter)>

This typedef describes the function signature for callbacks used to filter nodes out of the graph.

Returns true if node should be in the graph, false if it should be left out.

Definition at line 56 of file grapherOptions.h.

◆ NodeLimitVector

typedef std::vector<NodeLimit> NodeLimitVector

Definition at line 83 of file grapherOptions.h.

◆ NodeStyleCallback

using NodeStyleCallback = std::function< DisplayStyle ( const VdfNode &node, const VdfConnectionVector &drawnIn, const VdfConnectionVector &drawnOut)>

This callback is used to determine what style a specific node should be rendered with regardless what was set via SetDisplayStyle().

Definition at line 62 of file grapherOptions.h.

Member Enumeration Documentation

◆ DisplayStyle

The display styles for nodes.

DisplayStyleFull: this is the default style and draws the full node. DisplayStyleNoLabels: this draws the node as a box with a name in it. DisplayStyleSummary: this draws the node as a small filled circle.

Definition at line 46 of file grapherOptions.h.

Member Function Documentation

◆ AddNodeToGraph()

void AddNodeToGraph ( const VdfNode node,
int  maxInDepth,
int  maxOutDepth 
)
inline

Adds node to the list of nodes to be graphed.

If this list is empty, the entire graph will be printed. The parameters maxInDepth and maxOutDepth determine the the depths of the traversal in both directions.

Definition at line 179 of file grapherOptions.h.

◆ DebugNameFilter()

static VDF_API bool DebugNameFilter ( const std::vector< std::string > &  nameList,
bool  includeIfInNameList,
const VdfNode node 
)
static

Filters nodes based on debug names, when used as a NodeFilterCallback.

If any of the strings in nameList are a substring of the debug name of node, returns includeIfInNameList, including/excluding node from the graph.

◆ GetAnnotation()

std::string GetAnnotation ( const VdfObjectPtr object) const
inline

Returns the annotation for object or the empty string if none was set.

Definition at line 210 of file grapherOptions.h.

◆ GetColor()

TfToken GetColor ( const VdfObjectPtr object) const
inline

Returns the color for object or the empty TfToken if none was set.

Definition at line 196 of file grapherOptions.h.

◆ GetDisplayStyle()

DisplayStyle GetDisplayStyle ( ) const
inline

Returns the default display style for a node.

Definition at line 265 of file grapherOptions.h.

◆ GetDrawAffectsMasks()

bool GetDrawAffectsMasks ( ) const
inline

Returns whether or not masks will be draw on the connections.

Definition at line 107 of file grapherOptions.h.

◆ GetDrawColorizedConnectionsOnly()

bool GetDrawColorizedConnectionsOnly ( ) const
inline

Returns whether connections that have not a color set via SetColor() should not be drawn.

Definition at line 169 of file grapherOptions.h.

◆ GetDrawMasks()

bool GetDrawMasks ( ) const
inline

Returns whether or not masks will be draw on the connections.

Definition at line 103 of file grapherOptions.h.

◆ GetNodeFilterCallback()

const NodeFilterCallback & GetNodeFilterCallback ( ) const
inline

Returns the callback used to filter nodes out of the graph.

Definition at line 228 of file grapherOptions.h.

◆ GetNodesToGraph()

const NodeLimitVector & GetNodesToGraph ( ) const
inline

Returns the list of nodes that should be graphed.

Definition at line 216 of file grapherOptions.h.

◆ GetNodeStyleCallback()

const NodeStyleCallback & GetNodeStyleCallback ( ) const
inline

Returns the (optional) callback used to style nodes.

Definition at line 241 of file grapherOptions.h.

◆ GetOmitUnconnectedSpecs()

bool GetOmitUnconnectedSpecs ( ) const
inline

Returns whether or not the produced graph should include unconnected specs (ie.

input and output ports).

Definition at line 157 of file grapherOptions.h.

◆ GetPageHeight()

double GetPageHeight ( ) const
inline

Returns the page height.

Definition at line 131 of file grapherOptions.h.

◆ GetPageWidth()

double GetPageWidth ( ) const
inline

Returns the page width.

Definition at line 135 of file grapherOptions.h.

◆ GetPrintSingleOutputs()

bool GetPrintSingleOutputs ( ) const
inline

Returns true, if skipping single outputs is enabled.

Definition at line 117 of file grapherOptions.h.

◆ GetUniqueIds()

bool GetUniqueIds ( ) const
inline

Returns whether or not the graph should use unique ids.

Definition at line 148 of file grapherOptions.h.

◆ SetAnnotation()

void SetAnnotation ( const VdfObjectPtr object,
const std::string &  text 
)
inline

Sets an annotation text for object which gets rendered for the object.

Definition at line 203 of file grapherOptions.h.

◆ SetColor()

void SetColor ( const VdfObjectPtr object,
const TfToken color 
)
inline

Sets a color for object which can be a connection or node.

Color must be in a format that is understood by dot. Lowercase English color names usually work, (e.g. "red", "green", "blue").

Definition at line 188 of file grapherOptions.h.

◆ SetDisplayStyle()

void SetDisplayStyle ( DisplayStyle  style)
inline

Sets the default display style for nodes.

Definition at line 259 of file grapherOptions.h.

◆ SetDrawAffectsMasks()

void SetDrawAffectsMasks ( bool  drawMasks)
inline

When drawMasks is true, the affects masks on node outputs will be drawn.

Setting this to true implies SetPrintSingleOutputs() true as well.

Definition at line 99 of file grapherOptions.h.

◆ SetDrawColorizedConnectionsOnly()

void SetDrawColorizedConnectionsOnly ( bool  drawColorizedConnectionsOnly)
inline

When drawColorizedConnectionsOnly is set, only connections that have a color set via SetColor() will be drawn.

Definition at line 162 of file grapherOptions.h.

◆ SetDrawMasks()

void SetDrawMasks ( bool  drawMasks)
inline

When drawMasks is true, the masks on the connections will be drawn.

Definition at line 93 of file grapherOptions.h.

◆ SetNodeFilterCallback()

void SetNodeFilterCallback ( const NodeFilterCallback callback)
inline

Sets the callback used used to filter nodes out of the graph.

If callback returns true the node should be in the graph, if false if it should be left out.

Definition at line 223 of file grapherOptions.h.

◆ SetNodeStyleCallback()

void SetNodeStyleCallback ( const NodeStyleCallback callback)
inline

Sets the callback used used to style nodes.

This style will override the default style set via SetDisplayStyle().

Definition at line 235 of file grapherOptions.h.

◆ SetOmitUnconnectedSpecs()

void SetOmitUnconnectedSpecs ( bool  omit)
inline

When omit is set, unconnected specs will be omitted.

Definition at line 152 of file grapherOptions.h.

◆ SetPageSize()

void SetPageSize ( double  width,
double  height 
)
inline

Sets the desired size of the page output.

Setting the width and height to -1 will disable the page statement in the dot file altogther (which is useful when outputting as .tif file).

Definition at line 124 of file grapherOptions.h.

◆ SetPrintSingleOutputs()

void SetPrintSingleOutputs ( bool  enable)
inline

When enable is false, nodes containing only a single output, won't render their full connector to reduce clutter.

Definition at line 112 of file grapherOptions.h.

◆ SetUniqueIds()

void SetUniqueIds ( bool  uniqueIds)
inline

When uniqueIds is false, the graph will be printed without using unique ids for node names and ports.

This will likely produce a graph that is not valid for graphing, but can be very useful for comparing output in a test, where we need ids to be exactly the same after each run.

Definition at line 144 of file grapherOptions.h.


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