当前位置: 首页>>代码示例>>C++>>正文


C++ GmoBox::get_shape方法代码示例

本文整理汇总了C++中GmoBox::get_shape方法的典型用法代码示例。如果您正苦于以下问题:C++ GmoBox::get_shape方法的具体用法?C++ GmoBox::get_shape怎么用?C++ GmoBox::get_shape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GmoBox的用法示例。


在下文中一共展示了GmoBox::get_shape方法的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 );
    }
开发者ID:lenmus,项目名称:lomse,代码行数:35,代码来源:lomse_test_interactor.cpp

示例2: doc

 TEST_FIXTURE(DocLayouterTestFixture, DocLayouter_BoxSystemHasStaffShape)
 {
     Document doc(m_libraryScope);
     doc.from_string("(lenmusdoc (vers 0.0) "
         "(pageLayout (pageSize 24000 35700)(pageMargins 1000 1500 3000 2500 4000) landscape) "
         "(content (score (vers 1.6) "
         "(instrument (musicData (clef G)(key e)(n c4 q)(r q)(barline simple))))))" );
     DocLayouter dl( doc.get_im_model(), m_libraryScope);
     dl.layout_document();
     GraphicModel* pGModel = dl.get_graphic_model();
     GmoBoxDocPage* pPage = pGModel->get_page(0);
     GmoBox* pBDPC = pPage->get_child_box(0);    //DocPageContent
     GmoBox* pBSP = pBDPC->get_child_box(0);     //ScorePage
     GmoBox* pBSys = pBSP->get_child_box(0);     //System
     GmoShape* pShape = pBSys->get_shape(0);     //ShapeStaff
     CHECK( pShape != NULL );
     CHECK( pShape->is_shape_staff() == true );
     //CHECK( pShape->get_width() == 16000.0f );
     delete pGModel;
 }
开发者ID:gouchi,项目名称:lenmus,代码行数:20,代码来源:lomse_test_document_layouter.cpp

示例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 );
    }
开发者ID:lenmus,项目名称:lomse,代码行数:22,代码来源:lomse_test_interactor.cpp


注:本文中的GmoBox::get_shape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。