57 auto [xmin, xmax] = viewport_item->xAxis()->range();
58 EXPECT_DOUBLE_EQ(xmin, 0.0);
59 EXPECT_DOUBLE_EQ(xmax, 1.0);
62 auto [ymin, ymax] = viewport_item->yAxis()->range();
63 EXPECT_DOUBLE_EQ(ymin, 0.0);
64 EXPECT_DOUBLE_EQ(ymax, 1.0);
67 auto [zmin, zmax] = viewport_item->zAxis()->range();
68 EXPECT_DOUBLE_EQ(zmin, 0.0);
69 EXPECT_DOUBLE_EQ(zmax, 1.0);
84 const std::vector<double> expected_content = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
85 data_item->setContent(expected_content);
87 colormap_item->setDataItem(data_item);
91 viewport_item->setViewportToContent();
94 auto [xmin, xmax] = viewport_item->xAxis()->range();
95 EXPECT_DOUBLE_EQ(xmin, 0.0);
96 EXPECT_DOUBLE_EQ(xmax, 2.0);
99 auto [ymin, ymax] = viewport_item->yAxis()->range();
100 EXPECT_DOUBLE_EQ(ymin, 0.0);
101 EXPECT_DOUBLE_EQ(ymax, 3.0);
104 auto [zmin, zmax] = viewport_item->zAxis()->range();
105 EXPECT_DOUBLE_EQ(zmin, 1.0);
106 EXPECT_DOUBLE_EQ(zmax, 6.0);
119 EXPECT_CALL(widget, onDataChange(_, _)).Times(0);
120 EXPECT_CALL(widget, onPropertyChange(_, _)).Times(0);
121 EXPECT_CALL(widget, onChildPropertyChange(_, _)).Times(0);
122 EXPECT_CALL(widget, onItemInserted(viewport_item, expected_tagrow)).Times(1);
123 EXPECT_CALL(widget, onAboutToRemoveItem(_, _)).Times(0);
141 const std::vector<double> expected_content = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
142 data_item->setContent(expected_content);
149 EXPECT_CALL(widget, onDataChange(_, _)).Times(0);
150 EXPECT_CALL(widget, onPropertyChange(_, _)).Times(0);
152 EXPECT_CALL(widget, onItemInserted(_, _)).Times(0);
153 EXPECT_CALL(widget, onAboutToRemoveItem(_, _)).Times(0);
156 colormap_item->setDataItem(data_item);
Testing ColorMapViewportItem.
~ColorMapViewportItemTest()
Two-dimensional color map representation of Data2DItem.
static const std::string P_LINK
Container with viewport and collection of ColorMapItem's to plot.
ViewportAxisItem * zAxis() const
void setViewportToContent() override
Sets range of x,y window to show all data.
Represents two-dimensional data (axes definition and 2d array of values).
static std::unique_ptr< FixedBinAxisItem > create(int nbins, double xmin, double xmax)
std::vector< T * > items(const std::string &tag) const
Returns all items under given tag casted to specific type.
model_type modelType() const
Returns item's model type.
Main class to hold hierarchy of SessionItem objects.
T * insertItem(SessionItem *parent=nullptr, const TagRow &tagrow={})
Inserts item into given parent under given tagrow.
Aggregate to hold (tag, row) information for SessionModel.
ViewportAxisItem * xAxis() const
static const std::string T_ITEMS
ViewportAxisItem * yAxis() const
TEST_F(ColorMapViewportItemTest, initialState)
Initial state.
const model_type ViewportAxisItemType
materialitems.h Collection of materials to populate MaterialModel.