Schematic

ILxSchematicConnection

class ILxSchematicConnection

Public Functions

LxResult ItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)

A SchematicConnection server manages a particular connection point for inter-item relations. Normally this is a graph link but can be any type of relation that the client wants to implement. The name of the connection point (the text shown on the node) is the name of the server. This method is called for every item displayed in the schematic to determine if and how it supports this connection point. Failure or a zero falgs value means that the item does not have a connection.

LxResult AllowConnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)

Given a pair of items, this function returns LXe_TRUE if the connection is allowed. The ‘to’ item is the one with the connection point, and is assumed to have valid item flags, above.

LxResult AllowConnectType(LXtObjectID self, LXtObjectID to, unsigned int type)

This function returnes LXe_TRUE if the connection is allowed between an item and an item type.

LxResult GraphName(LXtObjectID self, const char **name)

This returns the name of a single graph. For connection points that can be described by one graph the graph name is sufficient for schematic to do all the legwork. Connecting adds a link from the source to the target in the graph, and drawing just enumerates the graph. This must be implemented (to traverse output links), but all connections will be handled fully by the server (as given by the methods below) as long as Count() is implemented and returns LXe_OK.

LxResult Count(LXtObjectID self, LXtObjectID item, unsigned *count)

For connections not given by a single graph, the server has to provide the list of connections coming into an item presenting a connection point. These are given by a count and items by index.

LxResult ByIndex(LXtObjectID self, LXtObjectID item, unsigned index, void **ppvObj)
LxResult Connect(LXtObjectID self, LXtObjectID from, LXtObjectID to, int toIndex)

Servers that enumerate the links themselves also need to manage creating and breaking links. The schematic view will call these methods from a context where undos are allowed.

LxResult Disconnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)
int BaseFlags(LXtObjectID self)

This method is called once to determine the minimum flags that will be used for any item. Certain flags can vary by item type, such as LXfSCON_SINGLE, LXfSCON_MULTIPLE and LXfSCON_ORDERED, but the flags LXfSCON_USESERVER and LXfSCON_REVERSE must be consistent for all item types. LXfSCON_PERITEM should be added as a base flag if the flags can change over time. If set, ItemFlagsValid() will be called before any schematic draw. Returning these flags allows us to initialize the server list once for all items. If this method is not implemented, LXfSCON_USESERVER and LXfSCON_REVERSE are assumed to be 0.

LxResult PerItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)

When a graph should only be present on some items of a particular type, this is called for each item. When rejecting the graph for the element, this should return 0, otherwise it should typically return the same flags as returned by ItemFlags.

int ItemFlagsValid(LXtObjectID self)

When per-item flags are used, there are circumstances under which the flags for an item may change (e.g. a Dynamics package may be added or removed from a mesh). When this happens, any cached per-item data would need to be refreshed. This method is called before any schematic redraw, and if implemented, should return 1 if all item flags are still valid, or 0 if not. This function will only be called once before validating, so once called, you can restore your internal valid flag.

LxResult ChannelAllowConnect(LXtObjectID self, LXtObjectID from, int fromIndex, LXtObjectID to, int toIndex)

The following “Channel” functions are used for Schematic Conections that work with connections between Items and Channels. Given a ‘from’ Item and Channel index and a ‘to’ Item and Channel index, this function returns LXe_TRUE if the connection is allowed.

LxResult ChannelIOType(LXtObjectID self, unsigned int *ioType)

Called to determine whether the connection should be an input or output. The type should be set to LXvSCON_INPUT or LXvSCON_OUTPUT.

LxResult ChannelCount(LXtObjectID self, LXtObjectID xItem, int fromIndex, unsigned *count)

These functions are used to iterate over the Channel connections into or out of an Item or Channel.

LxResult ChannelByIndex(LXtObjectID self, LXtObjectID xItem, int fromIndex, unsigned index, void **ppvObj, int *toIndex)
LxResult ChannelConnect(LXtObjectID self, LXtObjectID from, int fromIndex, LXtObjectID to, int toIndex)

Servers that enumerate the links themselves also need to manage creating and breaking links. The schematic view will call these methods from a context where undos are allowed.

LxResult ChannelDisconnect(LXtObjectID self, LXtObjectID from, int fromIndex, LXtObjectID to, int toIndex)

LXfSCON_SINGLE

If any flags are set they define the type of connection this item allows.

  • SINGLE it can have a single incoming connection from one other item.

  • MULTIPLE it can have multiple incoming connection from one or more item.

  • ORDERED for multiple connections, the order of the connections is important.

  • REVERSE This server uses normal graphs, but reverses the to/from relationships. It is up to the server to set this flag even if it is managing the connections itself, otherwise link tool tips or missing nodes may not be properly identified.

  • PERITEM Typically an item type will have the same set of relationships for all items of that type, e.g. all “Replicator” items will have “Particle Source” and “Protopyes” relationships. In some cases, however, it might be desirable to have a relationship like “Dynamics” only be present for certain mesh items, but not all. In this case LXfSCON_PERITEM would be used, and PerItemFlags would be called for each item.

  • NOLISTS Schematic Connections can be displayed in list views, such as the deformer list. This flag prevents the schematic connection from being displayed in list views, limiting it to the schematic viewport only.

  • CHANNEL This flag indicates that Schematic Connections can be made between Items and Channels.

  • USESERVER this type of connection supports multiple relationships, and fully implements the advanced methods such as Count() & ByIndex(). This flag is typically combined with the flags above.

  • LXfSCON_MULTIPLE

  • LXfSCON_ORDERED

  • LXfSCON_REVERSE

  • LXfSCON_PERITEM

  • LXfSCON_NOLISTS

  • LXfSCON_CHANNEL

  • LXfSCON_USESERVER

  • LXvSCON_INPUT

  • LXvSCON_OUTPUT

ILxSchematicConnection2

class ILxSchematicConnection2

// Old Schematic Connection Interface (< 14.2)

Public Functions

LxResult ItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)
LxResult AllowConnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)
LxResult AllowConnectType(LXtObjectID self, LXtObjectID to, unsigned int type)
LxResult GraphName(LXtObjectID self, const char **name)
LxResult Count(LXtObjectID self, LXtObjectID item, unsigned *count)
LxResult ByIndex(LXtObjectID self, LXtObjectID item, unsigned index, void **ppvObj)
LxResult Connect(LXtObjectID self, LXtObjectID from, LXtObjectID to, int toIndex)
LxResult Disconnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)
int BaseFlags(LXtObjectID self)
LxResult PerItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)
int ItemFlagsValid(LXtObjectID self)

ILxSchematicConnection1

class ILxSchematicConnection1

// Old Schematic Connection Interface (< MODOP)

Public Functions

LxResult ItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)
LxResult AllowConnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)
LxResult GraphName(LXtObjectID self, const char **name)
LxResult Count(LXtObjectID self, LXtObjectID item, unsigned *count)
LxResult ByIndex(LXtObjectID self, LXtObjectID item, unsigned index, void **ppvObj)
LxResult Connect(LXtObjectID self, LXtObjectID from, LXtObjectID to, int toIndex)
LxResult Disconnect(LXtObjectID self, LXtObjectID from, LXtObjectID to)
int BaseFlags(LXtObjectID self)
LxResult PerItemFlags(LXtObjectID self, LXtObjectID item, unsigned *flags)
int ItemFlagsValid(LXtObjectID self)

ILxSchemaDest

class ILxSchemaDest

The ILxSchemaDrop interface is used when dropping items into a schematic view. This interface can be used to identify the group (assembly, workspace) into which the source was dropped, as well as the item, node, channel or graph that it may have been dropped on top of. In addition, this also suports the ILxItem, ILxGroupDest & ILxChannelDest interfaces for alternate drop actions.

Public Functions

int ViewType(LXtObjectID self)

This method returns the type of scheamtic view

LxResult Position(LXtObjectID self, LXtVector pos)

This method is used to obtain the mouse position in the schematic

LxResult Group(LXtObjectID self, void **ppvObj)

This method is used to obtain the Group (assembly, workspace) at the drop location.

LxResult Item(LXtObjectID self, void **ppvObj)

This method is used to obtain the item being dropped onto, it any.

LxResult Node(LXtObjectID self, void **ppvObj)

This method is used to obtain the schematic node being dropped onto, it any.

LxResult Channel(LXtObjectID self, void **ppvObj)

This method is used to obtain the item channel being dropped onto, it any.

LxResult Graph(LXtObjectID self, void **ppvObj)

This method is used to obtain the item graph being dropped onto, it any.

LxResult Link(LXtObjectID self, void **ppvObj)

This method is used to obtain the schematic link being dropped onto, it any.

bool GetGroup(CLxLoc_Item &item)

User Class Only:

bool GetItem(CLxLoc_Item &item)

ILxSchematicGroup

class ILxSchematicGroup

Group items can be queried for a schematic group interface. This interface provides information about the nodes it contains, and allows the properties of the schematic to be queried and manipulated.

Public Functions

LxResult Group(LXtObjectID self, void **ppvObj)

This returns the group item associated with a schematic group interface.

LxResult IsWorkspace(LXtObjectID self)

This returns LXe_TRUE or LXe_FALSE if the group is a workspace.

LxResult AddItem(LXtObjectID self, LXtObjectID item, void **ppvObj)

This function adds an item to the schematic group. If successful, the node is returned indirectly as an ILxSchematicNode.

void RemoveItem(LXtObjectID self, LXtObjectID item)

This function removes an item from the schematic group.

LxResult NodeCount(LXtObjectID self, unsigned int *count)

This function returns the number of schematic nodes in the workspace.

LxResult NodeByIndex(LXtObjectID self, unsigned int index, void **ppvObj)

This function returns a schematic node by index. The returned object is of the type ILxSchematicNode.

LxResult InputNode(LXtObjectID self, void **ppvObj)

This function returns an assembly input node. The returned object is of the type ILxSchematicNode.

LxResult OutputNode(LXtObjectID self, void **ppvObj)

This function returns an assembly output node. The returned object is of the type ILxSchematicNode.

unsigned int NNodes()

User Class Only:

ILxSchematicNode

class ILxSchematicNode

Schematic Groups contain nodes, these nodes represent items, and may have properties such as exposed channels, exposed graphs, input connections, output connections, as well as visual properties such as a size, position and thumbnail. This interface allows the properties of the node to be queried and manipulated.

Public Functions

LxResult Group(LXtObjectID self, void **ppvObj)

This returns the group item that the node belongs to.

LxResult Item(LXtObjectID self, void **ppvObj)

This returns the item that the node represents.

LxResult AddChannel(LXtObjectID self, unsigned int index)

This function adds a channel to a schematic node. The index provided should be the index of the channel on the item this node represents. If the channel already exists on another node, it will be moved.

LxResult RemoveChannel(LXtObjectID self, unsigned int index)

Removes a channel from a schematic node. The index provided should be the index of the channel on the item this node represents.

LxResult ChannelCount(LXtObjectID self, unsigned int *count)

This function returns the number of channels on a schematic node item.

LxResult ChannelByIndex(LXtObjectID self, unsigned int index, unsigned int type, void **ppvObj)

This function returns a SchematicNodeChannel object representing a specific channel by index. The type argument should be one of the LXi_SCHMNODE values, and specifies whether the input connection or the output connection is requested. The function will return NOTAVAILABLE if no input or output connection is available for the requested channel.

LxResult ConnectionCount(LXtObjectID self, unsigned int *count)

This function returns the number of item connections that are exposed on a schematic node.

LxResult ConnectionByIndex(LXtObjectID self, unsigned int index, unsigned int type, void **ppvObj)

This function returns a SchematicNodeConnection object representing a specific item connection by index. The type argument should be one of the LXi_SCHMNODE values, and specifies whether the input connection or the output connection is requested. The function will return NOTAVAILABLE if no input or output connection is available.

LxResult IsRoot(LXtObjectID self)

A single “root” node that is presented to the user may be constructed from multiple sub-nodes, each representing different item types. For example, a locator item can have any number of associated transform items, but these may be presented to the user as a single node. This function returns LXe_TRUE if the node is a root node, otherwise it returns LXe_FALSE.

LxResult RootNode(LXtObjectID self, void **ppvObj)

Given any sub-node, this function returns the root node.

LxResult SubNodeCount(LXtObjectID self, unsigned int *count)

Given any node, this function returns the number of associated sub-nodes.

LxResult SubNodeByIndex(LXtObjectID self, unsigned int index, void **ppvObj)

Given any node, this function allows the sub-nodes to be accessed by index. The returned object is of the type ILxSchematicNode.

LxResult Position(LXtObjectID self, double *x, double *y)

This function returns the position of the schematic node. If this schematic node is a sub-node, the function will fail.

LxResult SetPosition(LXtObjectID self, double x, double y)

This function allows the position of the schematic node to be set. If this schematic node is a sub-node, the function will fail.

LxResult Size(LXtObjectID self, double *width, double *height)

This function returns the size of the schematic node. This function will return the size of this specific node only, not including any sub-nodes.

LxResult AbsoluteSize(LXtObjectID self, double *width, double *height)

This function returns the size of a root schematic node. If this schematic node is a sub-node, the function will fail.

LxResult Expanded(LXtObjectID self)

This function returns LXe_TRUE or LXe_FALSE if the node is expanded to show connections.

unsigned int NSubNodes()

User Class Only:

  • LXi_SCHMNODE_INPUT

  • LXi_SCHMNODE_OUTPUT


LXf_SCHMNODECONN_INPUT

The flags method returns flags that represent the state of the schematic connection. It will be a bit mask containing some of the following.

  • INPUT The connection is an input connection and allows incoming connections from items.

  • OUTPUT The connection is an output connection and allows outgoing connections to items.

  • MULTIPLE The connection allows multiple items to be connected.

  • ORDERED The connection allows multiple items to be connected in a specific order. The MULTIPLE flag will always be set is ORDERED is set.

  • EXPANDED If the connection supports multiple ordered connections, the connection is expanded to display the multiple connections and allow them to be reordered.

  • LXf_SCHMNODECONN_OUTPUT

  • LXf_SCHMNODECONN_MULTIPLE

  • LXf_SCHMNODECONN_ORDERED

  • LXf_SCHMNODECONN_EXPANDED

ILxSchematicNodeConnection

class ILxSchematicNodeConnection

Schematic Nodes connect to each other using links. These links can either represent item to item connections or channel to channel connections. The SchematicNodeConnection interface allows item connections to be walked from one node to another.

Public Functions

LxResult Flags(LXtObjectID self, unsigned int *flags)
LxResult Node(LXtObjectID self, void **ppvObj)

This function returns the schematic node that this schematic node connection belongs to.

LxResult Count(LXtObjectID self, unsigned int *count)

The Count function will return the number of items connected to the schematic connection. Currently, only input connections can be enumerated. Attempts to enumerate over output connections will return NOTAVAILABLE.

LxResult ByIndex(LXtObjectID self, unsigned int index, void **ppvObj)

The ByIndex function will return the SchematicNodeConnection on another item, that this schematic node connection is connected to.

LxResult Position(LXtObjectID self, unsigned int index, double *x, double *y)

The position function will return the absolute position of the schematic connection in the workspace. If the graph supports multiple connections, the position of a specific connection by index can be requested.


LXf_SCHMNODECHAN_INPUT

The flags method returns flags that represent the state of the schematic channel connection. It will be a bit mask containing some of the following.

  • INPUT The connection is an input connection and allows incoming connections from channels.

  • OUTPUT The connection is an output connection and allows outgoing connections to channels.

  • MULTIPLE The connection allows multiple channels to be connected.

  • LXf_SCHMNODECHAN_OUTPUT

  • LXf_SCHMNODECHAN_MULTIPLE

ILxSchematicNodeChannel

class ILxSchematicNodeChannel

Schematic Nodes connect to each other using links. These links can either represent item to item connections or channel to channel connections. The SchematicNodeChannel interface allows channel connections to be walked from one node to another.

Public Functions

LxResult Flags(LXtObjectID self, unsigned int *flags)
LxResult Node(LXtObjectID self, void **ppvObj)

This function returns the schematic node that this schematic node channel belongs to.

LxResult Index(LXtObjectID self, unsigned int *index)

This function returns the channel index for this schematic node channel.

LxResult Count(LXtObjectID self, unsigned int *count)

The Count function will return the number of channels connected to the schematic connection.

LxResult ByIndex(LXtObjectID self, unsigned int index, void **ppvObj)

The ByIndex function will return the SchematicNodeChannel on another item, that this schematic node channel is connected to.

LxResult Position(LXtObjectID self, double *x, double *y)

The position function will return the absolute position of the schematic connection in the workspace.