HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  OP_ItemType getItemType() const override
25  { return OP_ITEMTYPE_INDIRECT; }
26  fpreal getW() const override
27  { return 0.8; }
28  fpreal getH() const override
29  { return 0.3; }
30  const UT_String &getItemName() const override;
31  bool setItemName(const UT_String &name) override;
32 
33  OP_NetworkBoxItem *getInputItem() const override;
34  int getInputItemOutputIndex() const override;
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  int64 getItemUniqueId() const override
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  ~OP_SubnetIndirectInput() override;
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
int64 getItemUniqueId() const override
Functions to get hip-file-unique ids for any item type.
int64 getMemoryUsage(bool inclusive) const
fpreal getH() const override
virtual OP_NetworkBoxItem * getInputItem() const =0
OP_ItemType
Definition: OP_ItemId.h:28
long long int64
Definition: SYS_Types.h:116
int64 getMemoryUsage(bool inclusive) const
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual int getInputItemOutputIndex() const =0
virtual const UT_String & getItemName() const =0
OP_ItemType getItemType() const override
Our children should implement this and return what type of item they are.
virtual bool setItemName(const UT_String &name)=0
fpreal64 fpreal
Definition: SYS_Types.h:277
#define OP_API
Definition: OP_API.h:10
fpreal getW() const override
GLenum src
Definition: glcorearb.h:1793