• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Viewer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Viewer的典型用法代码示例。如果您正苦于以下问题:C++ Viewer类的具体用法?C++ Viewer怎么用?C++ Viewer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Viewer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Viewer

Viewer *NotifyManager::onNotifyAdd(const QJsonObject &value) {
    m_clearButton->setVisible(true);

    Viewer* viewer = new Viewer(value, this);

    viewer->setFixedHeight(80);
    viewer->setContentsMargins(0, 0, 0, 0);

    viewer->adjustSize();

    m_viewerList.insert(viewer, value);
    connect(viewer, &Viewer::requestClose, this, &NotifyManager::onNotifyRemove);
    update();

    return viewer;
}
开发者ID:ghj1040110333,项目名称:dde-control-center,代码行数:16,代码来源:notifymanager.cpp


示例2: onNotifyRemove

void NotifyManager::onNotifyRemove(const QString &id)
{
    // main key is time;

    Viewer *viewer = qobject_cast<Viewer*>(sender());

    Q_ASSERT(viewer);

    m_connectLayout->removeWidget(viewer);
    m_viewerList.remove(viewer);
    m_dbus->RemoveRecord(id);

    viewer->deleteLater();

    update();
}
开发者ID:ghj1040110333,项目名称:dde-control-center,代码行数:16,代码来源:notifymanager.cpp


示例3: main

int main(int argc, char **argv) {
    if (argc < 2) {
        printf("Usage: \n\ttxtview <file.txt>\n");
        return 1;
    }

    Viewer viewer = Viewer();
    MyRenderer *xyzRenderer = new MyRenderer();
    viewer.set_renderer(xyzRenderer);
    viewer.init();
    char *xyz_file = argv[1];
    xyzRenderer->load(xyz_file);
    viewer.start();

    return 0;
}
开发者ID:CS184Team,项目名称:cs184-final,代码行数:16,代码来源:view.cpp


示例4: SelectClipboard

void OverlaysComp::SelectClipboard (Clipboard* cb, Editor* ed) {
    Selection* s = ed->GetSelection();
    s->Clear();
    Viewer* viewer;
    Iterator i;

    for (int j = 0; (viewer = ed->GetViewer(j)) != nil; ++j) {
        for (cb->First(i); !cb->Done(i); cb->Next(i)) {
            GraphicView* views = viewer->GetGraphicView();
            GraphicView* view = views->GetGraphicView(cb->GetComp(i));

            if (view != nil) s->Append(view);
        }
    }
    ((OverlaySelection*)s)->Reserve();
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:16,代码来源:ovcomps.c


示例5: main

int main(int argc, char** argv)
{
  QApplication application(argc, argv);

  Viewer viewer;

#if QT_VERSION < 0x040000
  application.setMainWidget(&viewer);
#else
  viewer.setWindowTitle("drawLight");
#endif

  viewer.show();

  return application.exec();
}
开发者ID:nanzhang790,项目名称:View3dn,代码行数:16,代码来源:main.cpp


示例6: main

int main(int argc, char** argv){
    // Read command lines arguments.
    QApplication application(argc,argv);
    // Instantiate the viewer.
    Viewer viewer;
#if QT_VERSION < 0x040000
    // Set the viewer as the application main widget.
    //application.setMainWidget(&viewer);
#else
    viewer.setWindowTitle("simpleViewer");
#endif
    // Make the viewer window visible on screen.
    viewer.show();
    // Run main loop.
    return application.exec();
}
开发者ID:maparrar,项目名称:tester-device,代码行数:16,代码来源:main.cpp


示例7: setMaxHeartbeatInterval

void
MainThread::work() 
{
    setMaxHeartbeatInterval( 1.0 );

    // get 1 image
    // and check it's description for the particular image configuration
    getImage();
    
    //set up the viewer according to the configuration
    Viewer viewer = Viewer( imageData_->description->width,
                            imageData_->description->height,
                            imageData_->description->format,
                            context_ );

    while ( !isStopping() )
    {
        try 
        {
            // this blocks until a new image arrives and then
            // copies into a member variable
            getImage();
            
            // pass the image to the viewer
            viewer.display( imageData_ );
            
            //pushing too fast will cause the gui to not respond, sleep to prevent that
            // TODO: dodgy hack... needs to be fixed
            // The GUI diplay should be independent of incoming data. If the GUI dies,
            // then this code should be in the Viewer.
            IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(5));
        }
        catch ( ... ) 
        {
            orcaice::catchMainLoopExceptions( health() );

            // Re-create the viewer, unless we are stopping
            if ( !isStopping() ) {
                // TODO: make opencv window handle exception safe so we can create
                // another viewer here. At the moment, if an exception is thrown, 
                // the viewer will not self destruct. 
                // createViewer();
            }
        }

    } // end of while
}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:47,代码来源:mainthread.cpp


示例8: emit

void mepp_component_Boolean_Operations_plugin::Union()
{
    QApplication::setOverrideCursor(Qt::WaitCursor);

    // active viewer
    if (mw->activeMdiChild() != 0)
    {
        Viewer* viewer = (Viewer *)mw->activeMdiChild();
        Viewer* viewerU = NULL;

        if (viewer->getScenePtr()->get_nb_polyhedrons() == 2)
        {
            ScenePtr S = viewer->getScenePtr();
            PolyhedronPtr polyhedron_ptr_in1 = viewer->getScenePtr()->get_polyhedron(0);
            PolyhedronPtr polyhedron_ptr_in2 = viewer->getScenePtr()->get_polyhedron(1);
            PolyhedronPtr polyhedron_ptr_out;

            emit(mw->get_actionNewEmpty()->trigger());

            for (int i=0; i<lwindow.size(); i++) // all viewers
            {
                viewerU = (Viewer *)qobject_cast<QWidget *>(lwindow[i]->widget());
                if (viewerU->getScenePtr()->get_polyhedron()->empty())
                {
                    polyhedron_ptr_out = viewerU->getScenePtr()->get_polyhedron();
                }
            }

            Boolean_Operations_ComponentPtr component_ptr = findOrCreateComponentForViewer<Boolean_Operations_ComponentPtr, Boolean_Operations_Component>(viewer, polyhedron_ptr_in1);
            component_ptr->Boolean_Union(polyhedron_ptr_in1, polyhedron_ptr_in2, polyhedron_ptr_out);
            component_ptr->cpt_U++;

            polyhedron_ptr_out->compute_bounding_box();
            polyhedron_ptr_out->compute_normals();
            polyhedron_ptr_out->compute_type();
            (void)polyhedron_ptr_out->calc_nb_components();
            (void)polyhedron_ptr_out->calc_nb_boundaries();

            viewerU->showAllScene();

            viewerU->getScenePtr()->setcurrentFile(tr("Union %1 from vid %2").arg(component_ptr->cpt_U).arg((qlonglong)viewer, 0, 16));
            viewerU->setDynTitle();
        }
    }

    QApplication::restoreOverrideCursor();
}
开发者ID:hmfkz7,项目名称:MEPP,代码行数:47,代码来源:mepp_component_Boolean_Operations_plugin.cpp


示例9: main

int main(int argc, char** argv)
{
  // Read command lines arguments.
  QApplication application(argc,argv);

  // Instantiate the viewer.
  Viewer viewer;
  //for Windows
  application.setAttribute(Qt::AA_UseDesktopOpenGL);
  viewer.setWindowTitle("Intersection points of randomly generated circles.");

  // Make the viewer window visible on screen.
  viewer.show();

  // Run main loop.
  return application.exec();
}
开发者ID:weaselp,项目名称:cgal,代码行数:17,代码来源:Circular_kernel_3.cpp


示例10: save

void Editor::save(const bool all)
{
    int index = all ? 0 : files->currentIndex();
    if (index < 0)
        return;
    do {
        Coder *coder = qobject_cast<Coder *>(tabs->widget(index));
        if (coder != nullptr)
            coder->save();
        else {
            Viewer *viewer = qobject_cast<Viewer *>(tabs->widget(index));
            if (viewer != nullptr)
                viewer->save();
        }
        index++;
    } while (all && (index < files->count()));
}
开发者ID:popboyking,项目名称:apkstudio,代码行数:17,代码来源:editor.cpp


示例11: LaplacianSmoothing

void mepp_component_Various_Processing_plugin::LaplacianSmoothing()
{
	// active viewer
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		Various_Processing_ComponentPtr component_ptr = findOrCreateComponentForViewer<Various_Processing_ComponentPtr, Various_Processing_Component>(viewer, polyhedron_ptr);

		SettingsDialog_Various_Processing_Smoothing dial;
		if (dial.exec() == QDialog::Accepted)
		{
			QApplication::setOverrideCursor(Qt::WaitCursor);

			/*char deformFactorChar[256];
			strcpy(deformFactorChar, dial.m_textCtrlDeformFactor->GetValue().ToAscii());*/
			double deformFactor = dial.DeformFactor->value();

			/*char IteraNumChar[256];
			strcpy(IteraNumChar, dial.m_textCtrlIteraNum->GetValue().ToAscii());*/
			int iteraNum = dial.IteraNum->value();

			bool preserveBoundaries = dial.PreserveBoundaries->isChecked();

			//wxBusyInfo busy(_T("Laplacian smoothing..."));
			//m_frame->set_status_message(_T("Laplacian smoothing..."));
			mw->statusBar()->showMessage(tr("Laplacian smoothing..."));
			//double start = clock();

			component_ptr->LaplacianSmoothing(polyhedron_ptr,deformFactor,iteraNum,preserveBoundaries);

			/*float duration = (float)((clock()-start)/CLOCKS_PER_SEC);
			m_frame->update_mesh_properties();
			m_frame->Refresh();
			wxString msg;
			msg.Printf(_T("Laplacian smoothing...done (%g s)"), duration);
			m_frame->set_status_message(msg);*/
			mw->statusBar()->showMessage(tr("Laplacian smoothing...done"));

			viewer->recreateListsAndUpdateGL();
		}
	}

	QApplication::restoreOverrideCursor();
}
开发者ID:FlorianClosse,项目名称:MEPP,代码行数:46,代码来源:mepp_component_Various_Processing_plugin.cpp


示例12:

void mepp_component_Partition_plugin::step5()
{
    if (mw->activeMdiChild() != 0)
    {
        Viewer* viewer = (Viewer *)mw->activeMdiChild();
        PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();
        Partition_ComponentPtr component_ptr = findOrCreateComponentForViewer<Partition_ComponentPtr, Partition_Component>(viewer, polyhedron_ptr);

        QApplication::setOverrideCursor(Qt::WaitCursor);

        component_ptr->faceLabelToColorMap();
        viewer->recreateListsAndUpdateGL();

        mw->statusBar()->showMessage(tr("face label to color map...done"));
        QApplication::restoreOverrideCursor();
    }
}
开发者ID:ftasse,项目名称:MEPP,代码行数:17,代码来源:mepp_component_Partition_plugin.cpp


示例13: main

int main( int argc, char** argv ) {

  // create viewer
  Viewer viewer = Viewer();

  // defined a user space renderer
  Renderer* renderer = new TextDrawer();

  // set user space renderer
  viewer.set_renderer(renderer);

  // start the viewer
  viewer.init();
  viewer.start();

  return 0;
}
开发者ID:462cmu,项目名称:asst2_meshedit,代码行数:17,代码来源:text.cpp


示例14: main

int main(int argc, char** argv)
{
  QApplication application(argc,argv);

  Viewer viewer;

#if QT_VERSION < 0x040000
  // Set the viewer as the application main widget.
  application.setMainWidget(&viewer);
#else
  viewer.setWindowTitle("select");
#endif

  viewer.show();

  return application.exec();
}
开发者ID:emmaai,项目名称:fractalM,代码行数:17,代码来源:main.cpp


示例15: pw

void mepp_component_CGAL_Example_plugin::step5()
{
	QApplication::setOverrideCursor(Qt::WaitCursor);

	// active viewer
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		CGAL_Example_ComponentPtr component_ptr = findOrCreateComponentForViewer<CGAL_Example_ComponentPtr, CGAL_Example_Component>(viewer, polyhedron_ptr);
		
		Vec pw(2, 0, 0); viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setPosition(pw); // position in world coordinate system
		//Vec pl(2, 0, 0); viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setTranslation(pl); // local frame translation

		Quaternion qw(0, 0, 0, 1); // identity quaternion (i.e., no rotation)
		viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setOrientation(qw); // rotation in world coordinate system
		/*Quaternion ql(0, 0, 0, 1); // identity quaternion (i.e., no rotation)
		viewer->frame(viewer->getScenePtr()->get_current_polyhedron())->setRotation(ql); // local frame rotation*/

		viewer->updateGL();
	}

	QApplication::restoreOverrideCursor();
}
开发者ID:VisualComputeLabinXDU,项目名称:MeshDisplay,代码行数:25,代码来源:mepp_component_CGAL_Example_plugin.cpp


示例16: main

int
main(int argc, char * argv[])
{
  if (argc < 2)
    return usage(argc, argv);

  std::string in_path = argv[1];

  long target_num_faces = -1;
  std::string out_path;
  if (argc >= 3)
  {
    target_num_faces = std::atoi(argv[2]);

    if (argc >= 4)
      out_path = argv[3];
  }

  Mesh mesh;
  if (!mesh.load(in_path))
    return -1;

  DGP_CONSOLE << "Read mesh '" << mesh.getName() << "' with " << mesh.numVertices() << " vertices, " << mesh.numEdges()
              << " edges and " << mesh.numFaces() << " faces from " << in_path;

  if (target_num_faces >= 0 && mesh.numFaces() > target_num_faces)
  {
    mesh.decimateQuadricEdgeCollapse(target_num_faces);
    mesh.updateBounds();
  }

  if (!out_path.empty())
  {
    if (!mesh.save(out_path))
      return -1;

    DGP_CONSOLE << "Saved mesh to " << out_path;
  }

  Viewer viewer;
  viewer.setObject(&mesh);
  viewer.launch(argc, argv);

  return 0;
}
开发者ID:praveenagrawal,项目名称:Digital-Geometry-Processing-Assignments,代码行数:45,代码来源:main.cpp


示例17: OnMouseWheel

void mepp_component_Compression_Valence_plugin::OnMouseWheel(QWheelEvent *event)
{
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		if (doesExistComponentForViewer<Compression_Valence_ComponentPtr, Compression_Valence_Component>(viewer, polyhedron_ptr)) // important !!!
		{
			int rot = event->delta();

			if (rot<0)
				OnMouseLeftUp(NULL);	// todo: NULL
			else
				OnMouseRightUp(NULL);	// todo: NULL
		}
	}
}
开发者ID:Salepate,项目名称:MEPP,代码行数:18,代码来源:mepp_component_Compression_Valence_plugin.cpp


示例18: main

int main(int argc, char** argv)
{
  QApplication application(argc,argv);

  // Set the default OpenGL format with stereo capabilities.
  // An alternative is to pass this parameter to the QGLWidget constructor.
  QGLFormat format;
  format.setStereo(true);
  QGLFormat::setDefaultFormat(format);

  Viewer viewer;

  viewer.setWindowTitle("stereoViewer");

  viewer.show();

  return application.exec();
}
开发者ID:151706061,项目名称:libQGLViewer,代码行数:18,代码来源:main.cpp


示例19:

void mepp_component_CGAL_Example_plugin::step4()
{
	QApplication::setOverrideCursor(Qt::WaitCursor);

	// active viewer
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		CGAL_Example_ComponentPtr component_ptr = findOrCreateComponentForViewer<CGAL_Example_ComponentPtr, CGAL_Example_Component>(viewer, polyhedron_ptr);
		
		component_ptr->set_init(3);
		viewer->updateGL();
	}

	QApplication::restoreOverrideCursor();
}
开发者ID:VisualComputeLabinXDU,项目名称:MeshDisplay,代码行数:18,代码来源:mepp_component_CGAL_Example_plugin.cpp


示例20: OnMouseWheel

void mepp_component_CGAL_Example_plugin::OnMouseWheel(QWheelEvent *event)
{
	if (mw->activeMdiChild() != 0)
	{
		Viewer* viewer = (Viewer *)mw->activeMdiChild();
		PolyhedronPtr polyhedron_ptr = viewer->getScenePtr()->get_polyhedron();

		if (doesExistComponentForViewer<CGAL_Example_ComponentPtr, CGAL_Example_Component>(viewer, polyhedron_ptr)) // important !!!
		{
			int rot = event->delta();

			if (rot<0)
				mw->statusBar()->showMessage(tr("mepp_component_CGAL_Example_plugin: OnMouseWheel Up"), 1000);
			else
				mw->statusBar()->showMessage(tr("mepp_component_CGAL_Example_plugin: OnMouseWheel Down"), 1000);
		}
	}
}
开发者ID:VisualComputeLabinXDU,项目名称:MeshDisplay,代码行数:18,代码来源:mepp_component_CGAL_Example_plugin.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Viewer3D类代码示例发布时间:2022-05-31
下一篇:
C++ ViewWidget类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap