HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OP_GroupList.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 library (C++)
7  *
8  * COMMENTS:
9  *
10  * BUGS:
11  *
12  */
13 
14 #ifndef __OP_GroupList_h__
15 #define __OP_GroupList_h__
16 
17 #include "OP_API.h"
18 #include "OP_Error.h"
19 #include <UT/UT_ValArray.h>
20 #include <SYS/SYS_Types.h>
21 #include <iosfwd>
22 
23 class OP_Node;
24 class OP_Network;
25 class OP_Group;
26 
27 class OP_API OP_GroupList : public UT_ValArray<OP_Group *>
28 {
29 public:
31 
32  OP_GroupList(OP_Network *owner);
33  // NOTE: We don't need a virtual destructor, because our superclass
34  // has a non-virtual destructor, and this is only destructed
35  // as type OP_GroupList.
36  ~OP_GroupList();
37 
38  void clearAndDestroy(); // Destroy all groups
39 
40  OP_Group *createGroup(const char *name, fpreal x = .0F, fpreal y = .0F);
41  OP_Group *findGroup(const char *name) const;
42  int deleteGroup(const char *name);
43  int deleteGroup(OP_Group *group);
44 //
45 // getMembers will provide an array of pointers to all groups in the list.
46 // If the internal flag is zero this will not include internal groups.
47 //
48  int getMembers(UT_ValArray<OP_Group *> &list, int internal=0) const;
49 //
50 // getMemberships will provide an array of pointers to the groups that
51 // the specified node is a member of. The return value is the number of
52 // groups returned. If the internal flag is set the list will include
53 // internal groups.
54 //
55  int getMemberships(const OP_Node *node,
57  int internal=0) const;
58 
59 //
60 // saveCount returns the number of groups that would be saved if you
61 // performed a save operation. This does not count internal groups.
62 //
63  int saveCount() const;
64  void saveToClipboard(std::ostream &os, int all=0, int list=0) const;
65  bool loadFromClipboard(UT_IStream &is, const char *path) const;
66  OP_ERROR save(std::ostream &os, int binary = 0);
67  bool load(UT_IStream &is, int merge = 0);
68 
69  void clearUndoFlags();
70 
71  /// Return the amount of memory owned by this OP_GroupList
72  int64 getMemoryUsage(bool inclusive) const;
73 
74 private:
75  OP_Network *myNetwork;
76 };
77 
78 #endif
UT_ValArray< OP_Group * > Base
Definition: OP_GroupList.h:30
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
int64 getMemoryUsage(bool inclusive=false) const
Definition: UT_Array.h:455
UT_ErrorSeverity
Definition: UT_Error.h:25
GLint y
Definition: glcorearb.h:102
long long int64
Definition: SYS_Types.h:100
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:263
#define OP_API
Definition: OP_API.h:10
GLint GLenum GLint x
Definition: glcorearb.h:408