Struct GraphMask


Holds a bitmask of graphs.

This bitmask can hold up to 32 graphs.

The bitmask can be converted to and from integers implicitly.

GraphMask mask1 = GraphMask.FromGraphName("My Grid Graph");
GraphMask mask2 = GraphMask.FromGraphName("My Other Grid Graph");

NNConstraint nn = NNConstraint.Default;

nn.graphMask = mask1 | mask2;

// Find the node closest to somePoint which is either in 'My Grid Graph' OR in 'My Other Grid Graph'
var info =, nn);

Public Methods

Contains (graphIndex)

True if this mask contains the graph with the given graph index.

GraphMask (value)
ToString ()

Public Static Methods

FromGraph (graph)

A bitmask containing the given graph.

Public Static
FromGraphName (graphName)

A bitmask containing the first graph with the given name.

Public Static
operator GraphMask (mask)
Public Static
operator int (mask)
Public Static
operator& (lhs, rhs)

Combines two masks to form the intersection between them.

Public Static
operator| (lhs, rhs)

Combines two masks to form the union of them.

Public Static
operator~ (lhs)

Inverts the mask.

Public Static

Public Variables


Bitmask representing the mask.


Public Static Variables


A mask containing every graph.

Public Static