SetBlock.h
1 //##################################################################################################
2 //
3 // Ceetron Export
4 // Component: VTFx
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2015, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeCore/Base.h"
16 #include "CeeCore/Str.h"
17 #include "CeeVTFx/Base.h"
18 #include "CeeVTFx/Block.h"
19 
20 
21 class VTFxSetBlock;
22 struct VTFxSetBlockItems;
23 
24 namespace cee {
25 namespace vtfx {
26 
27 //=================================================================================================================================
28 //
29 //
30 //
31 //=================================================================================================================================
32 class CEE_VTFX_EXPORT SetItemGroup : public RefCountedObject
33 {
34 public:
35  SetItemGroup();
36  virtual ~SetItemGroup();
37 
38  int blockId() const;
39  void setBlockId(int blockId);
40 
41  Block::BlockType blockType() const;
42  void setBlockType(Block::BlockType blockType);
43 
44  size_t itemCount() const;
45  int itemIdOrIndex(size_t index) const;
46 
47  void setItems(const std::vector<int>& itemIdOrIndices);
48 
49  void addItems(const std::vector<int>& itemIdOrIndices);
50  void addItem(int itemIdOrIndex);
51 
52  VTFxSetBlockItems* internal_vtfxSetBlockItems();
53 
54 private:
55  CEE_PRIVATE_IMPL(SetItemGroup);
56  CEE_DISALLOW_COPY_AND_ASSIGN(SetItemGroup);
57 };
58 
59 
60 //=================================================================================================================================
61 //
62 //
63 //
64 //=================================================================================================================================
65 class CEE_VTFX_EXPORT SetBlock : public Block
66 {
67 public:
69  enum ItemType {
71  UNKNOWN_ITEM_TYPE
72  };
73 
74 public:
75  SetBlock(int blockId, bool itemsByIds);
76  virtual ~SetBlock();
77 
78  int setId() const;
79  void setSetId(int setId);
80 
81  Str setName() const;
82  void setSetName(const Str& name);
83 
84  ItemType itemType() const;
85  void setItemType(ItemType itemType);
86 
87  size_t totalItemCount() const;
88 
89  int itemGroupCount() const;
90  SetItemGroup* itemGroup(size_t index);
91  const SetItemGroup* itemGroup(size_t index) const;
92 
93  void addItemGroup(SetItemGroup* itemGroup);
94  void addItem(int itemIdOrIndex, int itemGroupId);
95  void addItems(const int* itemIndicesOrIds, size_t itemCount, int itemGroupId);
96 
97 private:
98  SetBlock(VTFxSetBlock* block, int blockId);
99 
100  VTFxBlock* internal_vtfxBlock() const;
101 
102 private:
103  friend class DatabasePrivate;
104 
105  CEE_PRIVATE_IMPL(SetBlock);
106  CEE_DISALLOW_COPY_AND_ASSIGN(SetBlock);
107 };
108 
109 }
110 }
ItemType
Item types for SetBlock.
Definition: SetBlock.h:69
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppAssert.cpp:18
A general unicode based string class.
Definition: Str.h:28
A block for storing sets of elements or nodes.
Definition: SetBlock.h:65
BlockType
Global block type constants used by Ceetron Export. Normally users do not need these, except for some methods of TransformationResultValuesBlock.
Definition: Block.h:35
A class to store a group of items that map to a given block (only supported block type is currently e...
Definition: SetBlock.h:32
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Element item type.
Definition: SetBlock.h:70
Abstract base class for all VTFx blocks.
Definition: Block.h:29