本文整理汇总了C++中Layer::AddReference方法的典型用法代码示例。如果您正苦于以下问题:C++ Layer::AddReference方法的具体用法?C++ Layer::AddReference怎么用?C++ Layer::AddReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layer
的用法示例。
在下文中一共展示了Layer::AddReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitPages
void LibraryPanel::InitPages(StagePanel* stage, ee::PropertySettingPanel* property)
{
auto paste_op = std::make_shared<ee::PasteSymbolOP>(stage, stage->GetStageImpl(), this);
ee::OneFloatValue* capture_val = new ee::OneFloatValueStatic(10);
auto draw_line_op = std::make_shared<eshape::EditPolylineOP<eshape::DrawPenLineOP, ee::SelectShapesOP>>(
stage, stage->GetStageImpl(), stage, property, capture_val, NULL);
auto draw_poly_op = std::make_shared<eshape::EditPolylineOP<eshape::DrawPolygonOP, ee::SelectShapesOP>>(
stage, stage->GetStageImpl(), stage, property, capture_val, NULL);
int id = 0;
{
LibraryPage* page = new LibraryPage(this, "地形", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
m_terrain_page = page;
}
{
LibraryPage* page = new LibraryPage(this, "装饰", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_AUTO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
}
{
LibraryPage* page = new LibraryPage(this, "单位", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_AUTO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
m_unit_page = page;
}
{
LibraryPage* page = new LibraryPage(this, "点", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
}
{
LibraryPage* page = new LibraryPage(this, "路径", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(draw_line_op);
AddPage(page);
m_path_page = page;
}
{
LibraryPage* page = new LibraryPage(this, "区域", LT_SHAPE, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(draw_poly_op);
AddPage(page);
}
{
LibraryPage* page = new LibraryPage(this, "碰撞区域", LT_SHAPE, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(draw_poly_op);
page->AddEditOP(draw_line_op);
AddPage(page);
m_collision_page = page;
}
{
LibraryPage* page = new LibraryPage(this, "摄像机", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
}
{
LibraryPage* page = new LibraryPage(this, "关卡", LT_DEFAULT, id++, pt2::CM_PERSPECTIVE_NO_HEIGHT);
Layer* layer = page->GetLayer();
page->AddEditOP(m_stage->GetBaseOP());
page->AddEditOP(paste_op);
AddPage(page);
m_level_page = page;
}
std::vector<Layer*> layers;
for (int i = 0, n = m_pages.size(); i < n; ++i) {
Layer* layer = static_cast<LibraryPage*>(m_pages[i])->GetLayer();
layer->AddReference();
layers.push_back(layer);
}
stage->SetLayers(layers);
}