7#ifndef PXR_EXEC_VDF_GRAPHER_OPTIONS_H
8#define PXR_EXEC_VDF_GRAPHER_OPTIONS_H
14#include "pxr/exec/vdf/api.h"
18#include "pxr/base/tf/hashmap.h"
25PXR_NAMESPACE_OPEN_SCOPE
57 bool (
const VdfNode &nodeToFilter)>;
83 typedef std::vector<NodeLimit> NodeLimitVector;
113 _printSingleOutputs = enable; }
118 return _printSingleOutputs; }
126 _pageHeight = height;
163 _drawColorizedConnectionsOnly = drawColorizedConnectionsOnly;
170 return _drawColorizedConnectionsOnly;
180 _nodesToGraph.push_back(
NodeLimit(&node, maxInDepth, maxOutDepth));
191 _objectColors[object] = color;
204 _objectAnnotations[object] = text;
224 _nodeFilterCallback = callback;
229 return _nodeFilterCallback;
236 _nodeStyleCallback = callback;
242 return _nodeStyleCallback;
253 const std::vector<std::string> &nameList,
254 bool includeIfInNameList,
260 _displayStyle = style;
273 bool _drawAffectsMasks;
286 NodeLimitVector _nodesToGraph;
298 bool _printSingleOutputs;
301 TfHashMap<VdfObjectPtr, TfToken, VdfObjectPtr::HashFunctor> _objectColors;
304 TfHashMap<VdfObjectPtr, std::string, VdfObjectPtr::HashFunctor> _objectAnnotations;
307 bool _omitUnconnectedSpecs;
310 bool _drawColorizedConnectionsOnly;
313PXR_NAMESPACE_CLOSE_SCOPE
Token for efficient comparison, assignment, and hashing of known strings.
bool IsEmpty() const
Returns true iff this token contains the empty string "".
This class can be used to configure aspects of VdfGrapher's output.
void SetDrawColorizedConnectionsOnly(bool drawColorizedConnectionsOnly)
When drawColorizedConnectionsOnly is set, only connections that have a color set via SetColor() will ...
void SetDrawMasks(bool drawMasks)
When drawMasks is true, the masks on the connections will be drawn.
void SetNodeStyleCallback(const NodeStyleCallback &callback)
Sets the callback used used to style nodes.
void AddNodeToGraph(const VdfNode &node, int maxInDepth, int maxOutDepth)
Adds node to the list of nodes to be graphed.
DisplayStyle
The display styles for nodes.
void SetOmitUnconnectedSpecs(bool omit)
When omit is set, unconnected specs will be omitted.
void SetNodeFilterCallback(const NodeFilterCallback &callback)
Sets the callback used used to filter nodes out of the graph.
const NodeLimitVector & GetNodesToGraph() const
Returns the list of nodes that should be graphed.
bool GetUniqueIds() const
Returns whether or not the graph should use unique ids.
std::function< bool(const VdfNode &nodeToFilter)> NodeFilterCallback
This typedef describes the function signature for callbacks used to filter nodes out of the graph.
TfToken GetColor(const VdfObjectPtr &object) const
Returns the color for object or the empty TfToken if none was set.
const NodeFilterCallback & GetNodeFilterCallback() const
Returns the callback used to filter nodes out of the graph.
void SetDisplayStyle(DisplayStyle style)
Sets the default display style for nodes.
DisplayStyle GetDisplayStyle() const
Returns the default display style for a node.
void SetPrintSingleOutputs(bool enable)
When enable is false, nodes containing only a single output, won't render their full connector to red...
const NodeStyleCallback & GetNodeStyleCallback() const
Returns the (optional) callback used to style nodes.
void SetUniqueIds(bool uniqueIds)
When uniqueIds is false, the graph will be printed without using unique ids for node names and ports.
void SetPageSize(double width, double height)
Sets the desired size of the page output.
void SetAnnotation(const VdfObjectPtr &object, const std::string &text)
Sets an annotation text for object which gets rendered for the object.
bool GetOmitUnconnectedSpecs() const
Returns whether or not the produced graph should include unconnected specs (ie.
std::string GetAnnotation(const VdfObjectPtr &object) const
Returns the annotation for object or the empty string if none was set.
bool GetPrintSingleOutputs() const
Returns true, if skipping single outputs is enabled.
double GetPageHeight() const
Returns the page height.
bool GetDrawColorizedConnectionsOnly() const
Returns whether connections that have not a color set via SetColor() should not be drawn.
std::function< DisplayStyle(const VdfNode &node, const VdfConnectionVector &drawnIn, const VdfConnectionVector &drawnOut)> NodeStyleCallback
This callback is used to determine what style a specific node should be rendered with regardless what...
bool GetDrawAffectsMasks() const
Returns whether or not masks will be draw on the connections.
double GetPageWidth() const
Returns the page width.
void SetDrawAffectsMasks(bool drawMasks)
When drawMasks is true, the affects masks on node outputs will be drawn.
void SetColor(const VdfObjectPtr &object, const TfToken &color)
Sets a color for object which can be a connection or node.
bool GetDrawMasks() const
Returns whether or not masks will be draw on the connections.
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.
This is the base class for all nodes in a VdfNetwork.
An universal class to represent pointers to various Vdf types.
const Result TfMapLookupByValue(Container const &map, Key const &key, const Result &defaultValue)
Checks if an item exists in a map or a TfHashMap.
This struct is used to allow the grapher to graph a subset of the nodes.