HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_SubnetIndirectInput.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OP_SubnetIndirectInput.h (C++)
7  *
8  * COMMENTS: OP_SubnetIndirectInput is used to maintain an indirect input
9  * for a sub-network. The input is a reference to one
10  * of the inputs to the owner of this node. The owner will be
11  * the sub-net.
12  */
13 
14 #ifndef _OP_SubnetIndirectInput_h_
15 #define _OP_SubnetIndirectInput_h_
16 
17 #include "OP_API.h"
18 #include "OP_IndirectInput.h"
19 #include <iosfwd>
20 
22 {
23 public:
24  virtual OP_ItemType getItemType() const
25  { return OP_ITEMTYPE_INDIRECT; }
26  virtual fpreal getW() const
27  { return 0.8; }
28  virtual fpreal getH() const
29  { return 0.3; }
30  virtual const UT_String &getItemName() const;
31  virtual bool setItemName(const UT_String &name);
32 
33  virtual OP_NetworkBoxItem *getInputItem() const;
34  virtual int getInputItemOutputIndex() const;
35 
36  int getInputIndex() const
37  { return myInputIndex; }
38 
39  // Functions to get hip-file-unique ids for any item type.
40  static OP_SubnetIndirectInput *lookupSubnetIndirectInput(int64 unique_id);
41  int64 getUniqueId() const;
42  virtual int64 getItemUniqueId() const
43  { return getUniqueId(); }
44 
45  // Return the amount of memory owned by this OP_SubnetIndirectInput
46  int64 getMemoryUsage(bool inclusive) const
47  {
48  int64 mem = inclusive ? sizeof(*this) : 0;
50  return mem;
51  }
52 
53 private:
55  int input_index);
56  virtual ~OP_SubnetIndirectInput();
57 
58  void initFromSubnetIndirect(
60  int save(std::ostream &os) const;
61  bool load(UT_IStream &is);
62 
63  short myInputIndex;
64  UT_String myName;
65 
66  friend class OP_Network;
67 };
68 
69 #endif
virtual fpreal getW() const
int64 getMemoryUsage(bool inclusive) const
virtual OP_NetworkBoxItem * getInputItem() const =0
OP_ItemType
Definition: OP_ItemId.h:23
long long int64
Definition: SYS_Types.h:106
virtual OP_ItemType getItemType() const
Our children should implement this and return what type of item they are.
virtual fpreal getH() const
int64 getMemoryUsage(bool inclusive) const
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual int getInputItemOutputIndex() const =0
double fpreal
Definition: SYS_Types.h:269
virtual const UT_String & getItemName() const =0
virtual bool setItemName(const UT_String &name)=0
virtual int64 getItemUniqueId() const
Functions to get hip-file-unique ids for any item type.
#define OP_API
Definition: OP_API.h:10
GLenum src
Definition: glcorearb.h:1792