36 addProperty(
"length", 8.0);
39 addProperty(
"height", 12.0);
53 std::vector<ChildrenData>
children_data(std::vector<SessionItem*> children)
55 std::vector<ChildrenData> result;
56 for (
auto child : children)
57 result.push_back({child->modelType(), child->tagRow().tag});
72 auto children = strategy.
children(
nullptr);
73 EXPECT_EQ(children.size(), 0);
77 children = strategy.
children(&item1);
78 EXPECT_EQ(children.size(), 0);
82 children = strategy.
children(&item2);
83 EXPECT_EQ(children.size(), 3);
88 children = strategy.
children(&item3);
89 EXPECT_EQ(children.size(), 1);
93 children = strategy.
children(&item4);
94 EXPECT_EQ(children.size(), 3);
99 children = strategy.
children(&item5);
100 EXPECT_EQ(children.size(), 3);
110 auto children = strategy.
children(
nullptr);
111 EXPECT_EQ(children.size(), 0);
115 children = strategy.
children(&item1);
116 EXPECT_EQ(children.size(), 0);
120 children = strategy.
children(&item2);
121 EXPECT_EQ(children.size(), 0);
126 children = strategy.
children(&item3);
127 EXPECT_EQ(children.size(), 0);
131 children = strategy.
children(&item4);
132 EXPECT_EQ(children.size(), 1);
137 children = strategy.
children(&item5);
138 EXPECT_EQ(children.size(), 3);
149 auto children = strategy.
children(
nullptr);
150 EXPECT_EQ(children.size(), 0);
156 auto children = strategy.
children(&item);
157 EXPECT_EQ(children.size(), 0);
163 auto children = strategy.
children(&item);
164 EXPECT_EQ(children.size(), 3);
171 auto children = strategy.
children(&item);
172 EXPECT_EQ(children.size(), 1);
178 auto children = strategy.
children(&item);
179 EXPECT_EQ(children.size(), 2);
186 auto children = strategy.
children(&item);
187 EXPECT_EQ(children.size(), 2);
189 std::vector<ChildrenData> expected_children_data{
192 EXPECT_EQ(children_data(children), expected_children_data);
204 auto children = strategy.
children(
nullptr);
205 EXPECT_EQ(children.size(), 0);
211 auto children = strategy.
children(&item);
212 EXPECT_EQ(children.size(), 0);
218 auto children = strategy.
children(&item);
219 EXPECT_EQ(children.size(), 3);
226 auto children = strategy.
children(&item);
227 EXPECT_EQ(children.size(), 1);
233 auto children = strategy.
children(&item);
234 EXPECT_EQ(children.size(), 2);
241 auto children = strategy.
children(&item);
242 EXPECT_EQ(children.size(), 2);
244 std::vector<ChildrenData> expected_children_data{
247 EXPECT_EQ(children_data(children), expected_children_data);
253 auto children = strategy.
children(&item);
254 EXPECT_EQ(children.size(), 3);
256 std::vector<ChildrenData> expected_children_data{
261 EXPECT_EQ(children_data(children), expected_children_data);
Strategy to find children of given item: gives all actual children back.
std::vector< SessionItem * > children(const SessionItem *item) const override
Returns vector of children of given item.
Complex item holding mixed SessionItem types (single properties and other CompountItems).
T * addProperty(const std::string &name)
Adds property item of given type.
void setCurrentType(const std::string &model_type)
Sets item corresponding to given model type.
Strategy to find children of given item: flat alignment.
std::vector< SessionItem * > children(const SessionItem *item) const override
Returns vector of children of given item.
Strategy to find children of given item: only property item will be given, all top level items will b...
std::vector< SessionItem * > children(const SessionItem *item) const override
Returns vector of children of given item.
The main object representing an editable/displayable/serializable entity.
static TagInfo universalTag(std::string name, std::vector< std::string > modelTypes={})
Constructs universal tag intended for unlimited amount of various items.
static TagRow append(const std::string &tag_name={})
Returns TagRow corresponding to the append to tag_name.
Strategy to find children of given item: only top level items will be given, all property items will ...
std::vector< SessionItem * > children(const SessionItem *item) const override
Returns vector of children of given item.
Vector item with three x,y,z property items.
Helper class with two properties and one top level item on board.
std::vector< ChildrenData > children_data(std::vector< SessionItem * > children)
~StandardChildrenStrategiesTest()
static const std::string P_HEIGHT
static const std::string P_RADIUS
Represents a particle, with a position, and a selection of possible shapes.
static const std::string P_SHAPES
static const std::string P_POSITION
Represents a group item holding a collection of shapes.
static const std::string P_RADIUS
const model_type PropertyType
const model_type VectorItemType
materialitems.h Collection of materials to populate MaterialModel.
const ModelView::model_type CylinderItemType
const ModelView::model_type ShapeGroupItemType
TEST_F(StandardChildrenStrategiesTest, AllChildrenStrategy)
Testing AllChildrenStrategy.
bool operator==(const ChildrenData &other) const