HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Bundle Class Reference

#include <OP_Bundle.h>

Public Member Functions

 OP_Bundle (const char *name, int internal=0)
 
 ~OP_Bundle ()
 
const char * getName () const
 Obtains the unique name of the bungle. More...
 
int isInternal () const
 
void rename (const char *name)
 Rename the bundle to a new name. More...
 
bool nodeAdded (OP_Node *node)
 
void nodeDeleted (OP_Node *node)
 
void bulkNodesAdded (const OP_NodeList &list)
 
void nodeAddedDeleted ()
 
void otherBundleChanged (const char *bundle_name)
 
void expandPattern (const OP_Network *creator, const OP_Node *relativeto, const char *pattern)
 
void clear ()
 Removes all the member nodes (or cached nodes and dirties the bundle). More...
 
void setFilter (const OP_BundleFilter *filter)
 
const OP_BundleFiltergetFilter ()
 Returns the current node filter. More...
 
void setStringPattern (const char *pattern)
 
const char * getStringPattern () const
 Returns the pattern originally set on the bundle. More...
 
const OP_BundlePatterngetBundlePattern () const
 
void setBundlePatternDirty ()
 Mark the bundle pattern as dirty. More...
 
bool isSmart () const
 
void setSubnetInclusionFlag (bool onoff)
 
int getSubnetInclusionFlag () const
 Obtains the subnet inclusion flag. More...
 
int addOp (OP_Node *op)
 
int addOp (int unique_id)
 
int addOpList (const OP_NodeList &list)
 
int removeOp (OP_Node *op)
 Removes the node from the bundle and sends out a notification event. More...
 
int removeOp (int unique_id)
 
void refilterOp (OP_Node &node)
 
int getTouchTime () const
 
int isLocked () const
 
void setLocked (bool onoff)
 
int entries ()
 Returns the number of member nodes. More...
 
OP_NodegetNode (int idx)
 
const OP_NodegetPatternNode () const
 
const OP_NodegetRelativeNode () const
 Returns the node used to resolve relative paths in the pattern. More...
 
void sortByPath ()
 Sorts the member nodes alphanumerically by node path. More...
 
void sortByPointer ()
 Sorts the member nodes by numerical value of the node pointer. More...
 
void bumpRefCount (int dir)
 
int getRefCount () const
 Returns the current reference count. More...
 
int contains (const OP_Node *op, bool check_representative)
 
int contains (int unique_id, bool check_representative)
 
void buildString (UT_WorkBuffer &buffer, OP_Node *cwd=0, char delim= ' ')
 Builds a string that specifies all the members of the bundle. More...
 
void getMembers (UT_Array< int > &list)
 Obtains all the bundle member ids. More...
 
void getMembers (UT_Array< OP_Node * > &list)
 Obtains all the bundle members as a node list. More...
 
void undoSetMembers (UT_Array< int > &nodes)
 
void addInterest (int add_id)
 
void removeInterest (int remove_id)
 
void addParmInterest (int node_id, int parm_id)
 
void removeParmInterest (int node_id, int parm_id)
 
int setPicked (int on_off)
 Sets the picked (selected) flag to on/off. More...
 
int getPicked () const
 Returns the current pick (selected) flag. More...
 
UT_NotifierImpl
< OP_BundleEvent & > & 
getEventNotifier ()
 
void convertToSmartBundle (UT_String *finalpattern)
 
void setOpsFlag (char flagchar, int onoff, bool propagate_to_ancestors=false)
 Sets the flag on on all the members of this bundle. More...
 
void setOpsVisibility (bool onoff)
 
void syncOpOTLs (bool sync_flag, bool propagate_to_ancestors=false)
 

Static Public Member Functions

static void getAllMembers (const UT_Array< OP_Bundle * > &bundles, UT_Array< OP_Node * > &nodes)
 
static void notifyOpsOfGroupChange (OP_Group *group)
 

Detailed Description

Definition at line 86 of file OP_Bundle.h.

Constructor & Destructor Documentation

OP_Bundle::OP_Bundle ( const char *  name,
int  internal = 0 
)
OP_Bundle::~OP_Bundle ( )

Member Function Documentation

void OP_Bundle::addInterest ( int  add_id)

Adds a node interest to the bundle. If the bundle changes, it will alert all the nodes that expressed interest in it by calling bundleChanged() on it. This is a separate notification mechanism from passing the OP_BundleEvent via myEventNotifier.

Parameters
add_idThe node id of the interested node.
int OP_Bundle::addOp ( OP_Node op)

Adds the node to the bundle and sends out a notification that a node has been added.

int OP_Bundle::addOp ( int  unique_id)
int OP_Bundle::addOpList ( const OP_NodeList list)

Adds the nodes in the list to the bundle and sends out a notification that nodes have been added. If filter or a pattern is set, only the nodes that match them will be added.

Returns
Returns the number of added nodes .
void OP_Bundle::addParmInterest ( int  node_id,
int  parm_id 
)

Adds a parameter interest to the bundle. If the bundle changes, it will alert all the parameter channels by calling parmChanged() on the node with parm id. This is a separate notification mechanism from passing the OP_BundleEvent via myEventNotifier.

Parameters
add_idThe node id of the interested node.
parm_idThe id (index) of the referencing parameter
void OP_Bundle::buildString ( UT_WorkBuffer buffer,
OP_Node cwd = 0,
char  delim = ' ' 
)

Builds a string that specifies all the members of the bundle.

void OP_Bundle::bulkNodesAdded ( const OP_NodeList list)

Processes a list of nodes that have just been added to some network. Any nodes that match the pattern (if set) will be added to the bundle.

void OP_Bundle::bumpRefCount ( int  dir)
inline

Changes (ie, increases or decreases) the reference count by the given amount. When the count decreases to zero, the bundle list (ie, the owner of all the bundles) will delete the bundle.

Definition at line 250 of file OP_Bundle.h.

void OP_Bundle::clear ( )

Removes all the member nodes (or cached nodes and dirties the bundle).

int OP_Bundle::contains ( const OP_Node op,
bool  check_representative 
)

Determines whether or not a node is contained in the bundle. If the check_representative flag is true, then the node's parents will be checked for containment inside the bundle.

int OP_Bundle::contains ( int  unique_id,
bool  check_representative 
)
void OP_Bundle::convertToSmartBundle ( UT_String finalpattern)

Converts the normal bundle to a smart bundle by using the members of the bundle to constuct a pattern that will match all of the current members and only the current members.

int OP_Bundle::entries ( )

Returns the number of member nodes.

void OP_Bundle::expandPattern ( const OP_Network creator,
const OP_Node relativeto,
const char *  pattern 
)

Calculates and caches the member nodes that match the specified pattern, and other member values (such as myPatternSubnetInclusion)

Parameters
creatorThe creator network whose descendant nodes (children and grand children, etc) are considered for the bundle membership.
relativetoThe node with respect to which the pattern is specified (so that it is possible to resolve relative path patterns such as "../sibbling*"
patternThe pattern which the member member nodes must match.
static void OP_Bundle::getAllMembers ( const UT_Array< OP_Bundle * > &  bundles,
UT_Array< OP_Node * > &  nodes 
)
static

Obtains the union of the member nodes from all the given bundles. The nodes in the result list are unique.

const OP_BundlePattern* OP_Bundle::getBundlePattern ( ) const
inline

Returns the current pattern for nodes. The nodes that match the pattern are the members of the bundle.

Definition at line 168 of file OP_Bundle.h.

UT_NotifierImpl<OP_BundleEvent&>& OP_Bundle::getEventNotifier ( )
inline

Returns an object that emmits events originating from the bundle when something about the bundle changes.

Definition at line 323 of file OP_Bundle.h.

const OP_BundleFilter* OP_Bundle::getFilter ( )
inline

Returns the current node filter.

Definition at line 149 of file OP_Bundle.h.

void OP_Bundle::getMembers ( UT_Array< int > &  list)

Obtains all the bundle member ids.

void OP_Bundle::getMembers ( UT_Array< OP_Node * > &  list)

Obtains all the bundle members as a node list.

const char* OP_Bundle::getName ( ) const
inline

Obtains the unique name of the bungle.

Definition at line 92 of file OP_Bundle.h.

OP_Node* OP_Bundle::getNode ( int  idx)

Returns the i-th member of the bundle. The order is arbitrary, but the index should not exceed the number of total entries.

const OP_Node* OP_Bundle::getPatternNode ( ) const

Returns the root node at which the search begins when matching the pattern. Only the ancestors (children, grandchildren - that is nodes contained in some way by the root) are considered when matching the pattern.

int OP_Bundle::getPicked ( ) const
inline

Returns the current pick (selected) flag.

Definition at line 318 of file OP_Bundle.h.

int OP_Bundle::getRefCount ( ) const
inline

Returns the current reference count.

Definition at line 253 of file OP_Bundle.h.

const OP_Node* OP_Bundle::getRelativeNode ( ) const

Returns the node used to resolve relative paths in the pattern.

const char* OP_Bundle::getStringPattern ( ) const
inline

Returns the pattern originally set on the bundle.

Definition at line 160 of file OP_Bundle.h.

int OP_Bundle::getSubnetInclusionFlag ( ) const
inline

Obtains the subnet inclusion flag.

Definition at line 194 of file OP_Bundle.h.

int OP_Bundle::getTouchTime ( ) const
inline

Returns the touch time, which is an integer that gets incremented each time the bundle contents changes.

Definition at line 218 of file OP_Bundle.h.

int OP_Bundle::isInternal ( ) const
inline

Determines whether the budnle has been internally created. An internal bundle is created in C++ code, based on some pattern string obtained from a node's parameter. The non-internal bundles are explicitly created by the user and are all listed in the bundle pane.

Definition at line 98 of file OP_Bundle.h.

int OP_Bundle::isLocked ( ) const
inline

Returns a flag that indicates if the bundle tries to automatically add newly created nodes to itself.

Definition at line 222 of file OP_Bundle.h.

bool OP_Bundle::isSmart ( ) const
inline

Returns true if the bundle is "smart". That is if it is a non-internal bundle whose contents is determined by a pattern.

Definition at line 182 of file OP_Bundle.h.

bool OP_Bundle::nodeAdded ( OP_Node node)

Processes a new node that has been added to some network. The bundle may decide to add that node to itself, if it is a pattern bundle.

void OP_Bundle::nodeAddedDeleted ( )

Informs the bundle that some unspecified nodes have been added or deleted. The bundle will mark itself as dirty, if necessary.

void OP_Bundle::nodeDeleted ( OP_Node node)

Processes a node that is about to be deleted from some network. If that node belongs to the bundle, it will be reomved as a member.

static void OP_Bundle::notifyOpsOfGroupChange ( OP_Group group)
static

Processes the given group after it has changed. If any bundles reference this group, the will be marked as dirty.

void OP_Bundle::otherBundleChanged ( const char *  bundle_name)

Informs the bundle that some other bundle contents has changed. This bundle will mark iself as dirty, if necessary.

Parameters
bundle_nameThe name of the other bundle that has changed (including the @ signg )
void OP_Bundle::refilterOp ( OP_Node node)

Processes a node when its type (or representative type) has changed. The bundle gets marked as dirty if necessary.

void OP_Bundle::removeInterest ( int  remove_id)

Removes the node interest from the bundle.

Parameters
remove_idThe node id that is no longer interested in bundle.
int OP_Bundle::removeOp ( OP_Node op)

Removes the node from the bundle and sends out a notification event.

int OP_Bundle::removeOp ( int  unique_id)
void OP_Bundle::removeParmInterest ( int  node_id,
int  parm_id 
)

Removes the parameter interest from the bundle.

Parameters
add_idThe node id of the interested node.
parm_idThe id (index) of the referencing parameter
void OP_Bundle::rename ( const char *  name)

Rename the bundle to a new name.

void OP_Bundle::setBundlePatternDirty ( )
inline

Mark the bundle pattern as dirty.

Definition at line 174 of file OP_Bundle.h.

void OP_Bundle::setFilter ( const OP_BundleFilter filter)

Sets a new node filter for the bundle, dirties the bundle, and sends out an event.

Parameters
filterThe new filter that influences the membership. It accepts some nodes and rejects other.
void OP_Bundle::setLocked ( bool  onoff)
void OP_Bundle::setOpsFlag ( char  flagchar,
int  onoff,
bool  propagate_to_ancestors = false 
)

Sets the flag on on all the members of this bundle.

void OP_Bundle::setOpsVisibility ( bool  onoff)

sets op visibility. This is smarter than just truning the display flag. It also adds to the visible children parameter of the ancestors so that the bundle nodes become visibile.

int OP_Bundle::setPicked ( int  on_off)

Sets the picked (selected) flag to on/off.

void OP_Bundle::setStringPattern ( const char *  pattern)

Sets the pattern and turn the bundle into a smart bundle, if it is not already smart. If the pattern is NULL, the bundle will no longer be smart (it will be converted into a normal bundle).

void OP_Bundle::setSubnetInclusionFlag ( bool  onoff)

The subnet inclusion flag determines whether a pattern includes subnet contents. This means that if a node does not explicitly a member of the bundle (ie, does not match the pattern), but its ancestor does, then that node is also a member.

void OP_Bundle::sortByPath ( )

Sorts the member nodes alphanumerically by node path.

void OP_Bundle::sortByPointer ( )

Sorts the member nodes by numerical value of the node pointer.

void OP_Bundle::syncOpOTLs ( bool  sync_flag,
bool  propagate_to_ancestors = false 
)

Syncs (if sync_flag == true) and unsyncs (if sync_flag == false ) the HDA definitions of the nodes contained in this bundle.

void OP_Bundle::undoSetMembers ( UT_Array< int > &  nodes)

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