#include <xsi_schematicnode.h>
The SchematicNode class represents a UI node as displayed in a Schematic view.
using namespace XSI;
void LogNode( SchematicNode& in_node );
Application app;
// Get a schematic view
Layout layout = app.GetDesktop().GetActiveLayout();
XSI::Schematic schematic = layout.FindView( "MySchematic" );
if ( !schematic.IsValid() )
{
app.GetDesktop().GetActiveLayout().CreateView( "Schematic", "MySchematic", schematic );
}
// Log the top level nodes
CRefArray nodes = schematic.GetNodes();
for (ULONG i=0; i<nodes.GetCount(); i++)
{
SchematicNode node = nodes[0];
LogNode( node );
}
void LogNode( SchematicNode& node )
{
LONG x,y,w,h;
node.GetUIInfo( x,y,w,h );
Application app;
app.LogMessage( "*******************************************************************" );
app.LogMessage( "Name: " + node.GetName() );
app.LogMessage( "X=" + CString(x) );
app.LogMessage( "Y=" + CString(y) );
app.LogMessage( "W=" + CString(w) );
app.LogMessage( "H=" + CString(h) );
app.LogMessage( "Expanded=" + CString(node.IsExpanded()) );
app.LogMessage( "Selected=" + CString(node.IsSelected()) );
app.LogMessage( "Node count=" + CString(node.GetNodes().GetCount()) );
app.LogMessage( "Parent object=" + SIObject(node.GetParent()).GetFullName() );
app.LogMessage( "Underlying object=" + CString( SIObject(node.GetObject()).GetFullName()) );
CRefArray nodes = node.GetNodes();
for ( LONG i=0; i<nodes.GetCount(); i++ )
{
SchematicNode node = nodes[i];
LogNode( node );
}
}
Public Member Functions |
|
| SchematicNode () | |
| ~SchematicNode () | |
| SchematicNode (const CRef &in_ref) | |
| SchematicNode (const SchematicNode &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| SchematicNode & | operator= (const SchematicNode &in_obj) |
| SchematicNode & | operator= (const CRef &in_ref) |
| bool | IsExpanded () const |
| CStatus | PutExpanded (bool in_bState) |
| siBranchFlag | IsSelected () const |
| CStatus | Move (LONG in_x, LONG in_y) |
| CRefArray | GetNodes () const |
| CRef | GetObject () const |
| CStatus | GetUIInfo (LONG &out_x, LONG &out_y, LONG &out_w, LONG &out_h) const |
| SchematicNode | ( | ) |
Default constructor.
| ~SchematicNode | ( | ) |
Default destructor.
| SchematicNode | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| SchematicNode | ( | const SchematicNode & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from UIObject.
| siClassID GetClassID | ( | ) | const [virtual] |
| SchematicNode& operator= | ( | const SchematicNode & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| SchematicNode& operator= | ( | const CRef & | in_ref | ) |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from UIObject.
| bool IsExpanded | ( | ) | const |
Determine if the node is expanded or not. Children nodes are set as expanded if their parent are also expanded.
| CStatus PutExpanded | ( | bool | in_bState | ) |
Set the node as expanded or collapsed.
| in_bState | true to expand or false to collapse the node. |
| siBranchFlag IsSelected | ( | ) | const |
Determine if the node is selected (node or branch).
| CStatus Move | ( | LONG | in_x, |
| LONG | in_y | ||
| ) |
Set the x and y position of the node. The position is in screen coordinates and is relative to the node's schematic view.
| in_x | Position in x. |
| in_y | Position in y. |
| CRefArray GetNodes | ( | ) | const |
Returns the children nodes of this Schematic node as an array of SchematicNode objects. Only visible nodes are returned.
| CRef GetObject | ( | ) | const |
Returns the node's underlying Softimage object.
| CStatus GetUIInfo | ( | LONG & | out_x, |
| LONG & | out_y, | ||
| LONG & | out_w, | ||
| LONG & | out_h | ||
| ) | const |
Returns the 2D coordinates and size of the node. Cooordinate units are in screen coordinates and relative to the node's schematic view.
| out_x | Position in x. |
| out_y | Position in y. |
| out_w | Width. |
| out_h | Height. |