HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_NetworkBoxItem Class Referenceabstract

#include <OP_NetworkBoxItem.h>

+ Inheritance diagram for OP_NetworkBoxItem:

Public Member Functions

 OP_NetworkBoxItem ()
 
virtual ~OP_NetworkBoxItem ()
 
virtual void setXY (fpreal x, fpreal y)=0
 
virtual fpreal getX () const =0
 
virtual fpreal getY () const =0
 
virtual fpreal getW () const =0
 
virtual fpreal getH () const =0
 
bool setXYWithBoundsChecks (fpreal x, fpreal y)
 
void validateSafeBounds (fpreal &x, fpreal &y)
 
void validateSafeBounds (fpreal &x, fpreal &y, fpreal &w, fpreal &h)
 
void moveToGoodPosition (bool relativetoinputs=true, bool moveinputs=true, bool moveoutputs=true, bool moveunconnected=true)
 
void setOwnerBox (OP_NetworkBox *box)
 
OP_NetworkBoxgetOwnerBox () const
 
bool hasOwnerBox (const OP_NetworkBoxItem *item) const
 
OP_NetworkBoxgetMinimizedOwnerBox () const
 
virtual bool setPicked (bool on_off, bool propagate_parent_event=true)=0
 
virtual bool getPicked () const =0
 
virtual OP_NetworkgetParentNetwork () const =0
 Returns the network that is our parent. More...
 
void getPathFromParent (UT_String &str, const OP_Node *parent) const
 
void getPathFromParent (UT_WorkBuffer &str, const OP_Node *parent) const
 
void getRelativePathTo (const OP_NetworkBoxItem *base_item, UT_String &result) const
 Returns the path of this item relative to 'base_item'. More...
 
virtual UT_Color getColor () const
 Accessors for color used in the network view. More...
 
virtual bool setColor (const UT_Color &color)
 
virtual OP_ItemType getItemType () const =0
 Our children should implement this and return what type of item they are. More...
 
virtual const UT_StringgetItemName () const =0
 
virtual bool setItemName (const UT_String &name)=0
 
virtual int64 getItemUniqueId () const =0
 Functions to get hip-file-unique ids for any item type. More...
 
virtual bool getItemExpose () const
 
virtual void setItemExpose (bool expose)
 
OP_NetworkgetCreator () const
 
OP_NetworkgetCodeCreator () const
 
void getConnectedItems (OP_NetworkBoxItemList &connected, bool inputs, bool recursive, bool include_this_item) const
 Fills an array with all network box items connected to this item. More...
 
int64 getMemoryUsage (bool inclusive) const
 

Static Public Member Functions

static fpreal getMaxSafeX ()
 The following methods return the safe extents of the position of items. More...
 
static fpreal getMinSafeX ()
 
static fpreal getMaxSafeY ()
 
static fpreal getMinSafeY ()
 
static OP_NetworkBoxItemlookupItem (const OP_ItemType &type, int64 id)
 
static OP_NetworkBoxItemlookupItem (const OP_ItemId &id)
 

Protected Attributes

UT_Color myColor
 

Additional Inherited Members

- Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable
 UT_NonCopyable ()=default
 
 ~UT_NonCopyable ()=default
 
 UT_NonCopyable (const UT_NonCopyable &)=delete
 
UT_NonCopyableoperator= (const UT_NonCopyable &)=delete
 

Detailed Description

Definition at line 40 of file OP_NetworkBoxItem.h.

Constructor & Destructor Documentation

OP_NetworkBoxItem::OP_NetworkBoxItem ( )
virtual OP_NetworkBoxItem::~OP_NetworkBoxItem ( )
virtual

Member Function Documentation

OP_Network* OP_NetworkBoxItem::getCodeCreator ( ) const

Get the first parent node which has a VOP_CodeGenerator (i.e. has getVopCodeGenerator() defined.

virtual UT_Color OP_NetworkBoxItem::getColor ( ) const
inlinevirtual

Accessors for color used in the network view.

Reimplemented in OP_Node.

Definition at line 114 of file OP_NetworkBoxItem.h.

void OP_NetworkBoxItem::getConnectedItems ( OP_NetworkBoxItemList connected,
bool  inputs,
bool  recursive,
bool  include_this_item 
) const

Fills an array with all network box items connected to this item.

OP_Network* OP_NetworkBoxItem::getCreator ( ) const

getCreator is similar to getParentNetwork but it climbs the tree to find the network that originally created this network type. This means that if you're down in a sub-network you climb right up to the parent of all the sub-nets. For SOPs this will return the object, for COPs the icenet, for TOPs the Shader, for CHOPs the chopnet, for POPs the popnet. If the parent tree is truncated for some reason, we return whatever node is at the top.

Examples:
SOP/SOP_Cop2Raster.C, and SOP/SOP_HDKObject.C.
virtual fpreal OP_NetworkBoxItem::getH ( ) const
pure virtual
virtual bool OP_NetworkBoxItem::getItemExpose ( ) const
inlinevirtual

Basically the same as OP_Node::getExpose(), but abstracted to a higher level so we can call it on all items.

Reimplemented in OP_Node.

Definition at line 133 of file OP_NetworkBoxItem.h.

virtual const UT_String& OP_NetworkBoxItem::getItemName ( ) const
pure virtual

Basically the same as OP_Node::getName(), but abstracted to a higher level so we can call it on all items.

Implemented in OP_Node, OP_NetworkBox, OP_PostIt, OP_Dot, and OP_SubnetIndirectInput.

virtual OP_ItemType OP_NetworkBoxItem::getItemType ( ) const
pure virtual

Our children should implement this and return what type of item they are.

Implemented in OP_Node, OP_NetworkBox, OP_PostIt, OP_Dot, and OP_SubnetIndirectInput.

virtual int64 OP_NetworkBoxItem::getItemUniqueId ( ) const
pure virtual

Functions to get hip-file-unique ids for any item type.

Implemented in OP_Node, OP_NetworkBox, OP_PostIt, OP_Dot, and OP_SubnetIndirectInput.

static fpreal OP_NetworkBoxItem::getMaxSafeX ( )
inlinestatic

The following methods return the safe extents of the position of items.

Definition at line 63 of file OP_NetworkBoxItem.h.

static fpreal OP_NetworkBoxItem::getMaxSafeY ( )
inlinestatic

Definition at line 65 of file OP_NetworkBoxItem.h.

int64 OP_NetworkBoxItem::getMemoryUsage ( bool  inclusive) const
inline

Returns the amount of memory owned by this OP_NetworkBoxItem (JUST this class; not subclasses)

Definition at line 159 of file OP_NetworkBoxItem.h.

OP_NetworkBox* OP_NetworkBoxItem::getMinimizedOwnerBox ( ) const

Returns the highest level owner box that is minimized. In other words, the netbox that contains this item that is visible in a network editor.

static fpreal OP_NetworkBoxItem::getMinSafeX ( )
inlinestatic

Definition at line 64 of file OP_NetworkBoxItem.h.

static fpreal OP_NetworkBoxItem::getMinSafeY ( )
inlinestatic

Definition at line 66 of file OP_NetworkBoxItem.h.

OP_NetworkBox* OP_NetworkBoxItem::getOwnerBox ( ) const
virtual OP_Network* OP_NetworkBoxItem::getParentNetwork ( ) const
pure virtual

Returns the network that is our parent.

Implemented in OP_Node, OP_NetworkBox, OP_PostIt, OP_IndirectInput, and VOP_AutoConvert.

void OP_NetworkBoxItem::getPathFromParent ( UT_String str,
const OP_Node parent 
) const
inline

Sets 'str' to be the path from 'parent' to this item. Pass in NULL for 'parent' if you'd like the full path returned.

Definition at line 100 of file OP_NetworkBoxItem.h.

void OP_NetworkBoxItem::getPathFromParent ( UT_WorkBuffer str,
const OP_Node parent 
) const
virtual bool OP_NetworkBoxItem::getPicked ( ) const
pure virtual
void OP_NetworkBoxItem::getRelativePathTo ( const OP_NetworkBoxItem base_item,
UT_String result 
) const

Returns the path of this item relative to 'base_item'.

virtual fpreal OP_NetworkBoxItem::getW ( ) const
pure virtual
virtual fpreal OP_NetworkBoxItem::getX ( ) const
pure virtual
virtual fpreal OP_NetworkBoxItem::getY ( ) const
pure virtual
bool OP_NetworkBoxItem::hasOwnerBox ( const OP_NetworkBoxItem item) const
static OP_NetworkBoxItem* OP_NetworkBoxItem::lookupItem ( const OP_ItemType type,
int64  id 
)
static
static OP_NetworkBoxItem* OP_NetworkBoxItem::lookupItem ( const OP_ItemId id)
static
void OP_NetworkBoxItem::moveToGoodPosition ( bool  relativetoinputs = true,
bool  moveinputs = true,
bool  moveoutputs = true,
bool  moveunconnected = true 
)

Set the node's location to a "good" position, using either the input or output nodes as the basis for the decision of what "good" means. The keepcentered flag tells us to move every item in our parent network except us. The moveconnected flag causes this function to move items connected to the other side of this item to avoid overlaps when we move this item.

virtual bool OP_NetworkBoxItem::setColor ( const UT_Color color)
virtual
virtual void OP_NetworkBoxItem::setItemExpose ( bool  expose)
inlinevirtual

Reimplemented in OP_Node.

Definition at line 135 of file OP_NetworkBoxItem.h.

virtual bool OP_NetworkBoxItem::setItemName ( const UT_String name)
pure virtual
void OP_NetworkBoxItem::setOwnerBox ( OP_NetworkBox box)

The owner box of an OP_NetworkBoxItem is the OP_NetworkBox which it's held in. If a box has no owner, its owner box will be returned as NULL. Owner box is NULL by default on construction.

virtual bool OP_NetworkBoxItem::setPicked ( bool  on_off,
bool  propagate_parent_event = true 
)
pure virtual
virtual void OP_NetworkBoxItem::setXY ( fpreal  x,
fpreal  y 
)
pure virtual

Get and set the position of this item. Units are absolute, as opposed to relative units found in OPUI.

Implemented in OP_Node, OP_IndirectInput, OP_NetworkBox, and OP_PostIt.

bool OP_NetworkBoxItem::setXYWithBoundsChecks ( fpreal  x,
fpreal  y 
)

Set the node's location with setXY(), but first check if the new position is valid. Also update any netboxes containing this node and send an OP_UI_MOVED event.

void OP_NetworkBoxItem::validateSafeBounds ( fpreal x,
fpreal y 
)
void OP_NetworkBoxItem::validateSafeBounds ( fpreal x,
fpreal y,
fpreal w,
fpreal h 
)

Member Data Documentation

UT_Color OP_NetworkBoxItem::myColor
protected

Allow subclasses direct access to myColor to allow them to edit this color without risk of generating undo blocks or change events.

Definition at line 168 of file OP_NetworkBoxItem.h.


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