本文整理汇总了C++中GmoBox::get_child_box方法的典型用法代码示例。如果您正苦于以下问题:C++ GmoBox::get_child_box方法的具体用法?C++ GmoBox::get_child_box怎么用?C++ GmoBox::get_child_box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmoBox
的用法示例。
在下文中一共展示了GmoBox::get_child_box方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: libraryScope
TEST_FIXTURE(InteractorTestFixture, Interactor_SelectObjectAtScreenPoint)
{
//as coordinates conversion is involved, the View must be rendered
MyDoorway platform;
LibraryScope libraryScope(cout, &platform);
libraryScope.set_default_fonts_path(TESTLIB_FONTS_PATH);
SpDocument spDoc( new Document(libraryScope) );
spDoc->from_string("(lenmusdoc (vers 0.0) (content (score (vers 1.6) "
"(instrument (musicData (clef G)(key e)(n c4 q)(r q)(barline simple))))))" );
VerticalBookView* pView = Injector::inject_VerticalBookView(libraryScope, spDoc.get());
SpInteractor pIntor(Injector::inject_Interactor(libraryScope, WpDocument(spDoc), pView, NULL));
pView->set_interactor(pIntor.get());
RenderingBuffer rbuf;
pView->set_rendering_buffer(&rbuf);
pView->redraw_bitmap();
GraphicModel* pModel = pIntor->get_graphic_model();
GmoBoxDocPage* pPage = pModel->get_page(0); //DocPage
GmoBox* pBDPC = pPage->get_child_box(0); //DocPageContent
GmoBox* pBSP = pBDPC->get_child_box(0); //ScorePage
GmoBox* pBSys = pBSP->get_child_box(0); //System
GmoBox* pBSlice = pBSys->get_child_box(0); //Slice
GmoBox* pBSliceInstr = pBSlice->get_child_box(0); //SliceInsr
GmoShape* pClef = pBSliceInstr->get_shape(0); //Clef
LUnits x = (pClef->get_left() + pClef->get_right()) / 2.0f;
LUnits y = (pClef->get_top() + pClef->get_bottom()) / 2.0f;
double vx = x;
double vy = y;
pIntor->model_point_to_screen(&vx, &vy, 0);
pIntor->task_action_select_object_and_show_contextual_menu(Pixels(vx), Pixels(vy), 0);
CHECK( pIntor->is_in_selection(pClef) == true );
}
示例2: doc
TEST_FIXTURE(DocLayouterTestFixture, DocLayouter_EmptyScore_TwoInstruments)
{
Document doc(m_libraryScope);
doc.from_string("(lenmusdoc (vers 0.0) (content (score (vers 1.6) "
"(instrument (musicData )) (instrument (musicData )) )))" );
DocLayouter dl( doc.get_im_model(), m_libraryScope);
dl.layout_document();
GraphicModel* pGModel = dl.get_graphic_model();
CHECK( pGModel->get_num_pages() == 1 );
GmoBoxDocPage* pPage = pGModel->get_page(0);
CHECK( pPage->get_num_boxes() == 1 );
GmoBox* pBDPC = pPage->get_child_box(0); //DocPageContent
CHECK( pBDPC->get_num_boxes() == 1 );
GmoBox* pBSP = pBDPC->get_child_box(0); //ScorePage
CHECK( pBSP->get_num_boxes() == 1 );
GmoBoxSystem* pBSys = dynamic_cast<GmoBoxSystem*>( pBSP->get_child_box(0) );
CHECK( pBSys->get_num_shapes() == 2 );
GmoShape* pShape = pBSys->get_staff_shape(0);
CHECK( pShape != NULL );
CHECK( pShape->is_shape_staff() == true );
GmoShapeStaff* pSS = dynamic_cast<GmoShapeStaff*>(pShape);
CHECK( pSS->get_num_staff() == 0 );
pShape = pBSys->get_staff_shape(1);
CHECK( pShape != NULL );
CHECK( pShape->is_shape_staff() == true );
pSS = dynamic_cast<GmoShapeStaff*>(pShape);
CHECK( pSS->get_num_staff() == 0 );
CHECK( pBSys->get_num_boxes() == 0 );
delete pGModel;
}
示例3: spDoc
TEST_FIXTURE(InteractorTestFixture, Interactor_SelectObject)
{
SpDocument spDoc( new Document(m_libraryScope) );
spDoc->from_string("(lenmusdoc (vers 0.0) (content (score (vers 1.6) "
"(instrument (musicData (clef G)(key e)(n c4 q)(r q)(barline simple))))))" );
View* pView = Injector::inject_View(m_libraryScope, ViewFactory::k_view_simple,
spDoc.get());
SpInteractor pIntor(Injector::inject_Interactor(m_libraryScope, WpDocument(spDoc), pView, NULL));
pView->set_interactor(pIntor.get());
GraphicModel* pModel = pIntor->get_graphic_model();
GmoBoxDocPage* pPage = pModel->get_page(0); //DocPage
GmoBox* pBDPC = pPage->get_child_box(0); //DocPageContent
GmoBox* pBSP = pBDPC->get_child_box(0); //ScorePage
GmoBox* pBSys = pBSP->get_child_box(0); //System
GmoBox* pBSlice = pBSys->get_child_box(0); //Slice
GmoBox* pBSliceInstr = pBSlice->get_child_box(0); //SliceInsr
GmoShape* pClef = pBSliceInstr->get_shape(0); //Clef
pIntor->select_object(pClef);
CHECK( pIntor->is_in_selection(pClef) == true );
}