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


C++ Pointer::Delete方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
    {
        std::cerr << "ExceptionObject caught !" << std::endl;
        std::cerr << err << std::endl;
        return EXIT_FAILURE;
    }

    m_pImageData = pReader->GetOutput();
//    m_pImageData->DisconnectPipeline();

    // execute pipeline
    m_pInvertIntensityFilter->SetInput(m_pImageData);
    m_pConnector->SetInput(m_pInvertIntensityFilter->GetOutput()); //m_pReader->GetOutput());
#if VTK_MAJOR_VERSION <= 5
    m_pTissueExtractor->SetInput(m_pConnector->GetOutput());
#else
    m_pConnector->Update();
    m_pTissueExtractor->SetInputData(m_pConnector->GetOutput());
#endif
    //int nIsoSurface = ui.lineEditValue->text().toInt();
    //if(nIsoSurface == 0)
    int nIsoSurface = 155;
    m_pTissueExtractor->SetValue(0, nIsoSurface);

#if VTK_MAJOR_VERSION <= 5
    m_pTissueNormals->SetInput(m_pTissueExtractor->GetOutput());
#else
    m_pTissueNormals->SetInputConnection(m_pTissueExtractor->GetOutputPort());
#endif
    //m_pTissueNormals->SetFeatureAngle(60.0);
#if VTK_MAJOR_VERSION <= 5
    m_pTissueMapper->SetInput(m_pTissueNormals->GetOutput());
#else
    m_pTissueMapper->SetInputConnection(m_pTissueNormals->GetOutputPort());
#endif
    m_pTissueMapper->ScalarVisibilityOff();
    m_pTissue->SetMapper(m_pTissueMapper);

        //if(!m_pVolumeMapper)
        //{
        //	m_pVolumeMapper = vtkFixedPointVolumeRayCastMapper::New();
        //	m_pVolumeMapper->SetInput(m_pConnector->GetOutput());

        //	m_pVolume = vtkVolume::New();
        //	m_pVolume->SetMapper(m_pVolumeMapper);
        //	m_pVolume->Update();

        //	//m_pRenderer->AddActor(m_pVolume);

    m_pRenderer->AddActor(m_pTissue);

    m_pRenderer->SetBackground(0.0,0.0,0.4);
    m_pRenderer->ResetCamera();
    m_pRenderer->GetRenderWindow()->Render();

    m_pRenderWindowInteractor->Start();

    // save to vtk
    vtkPolyDataWriter* pWriter = vtkPolyDataWriter::New();
#if VTK_MAJOR_VERSION <= 5
    pWriter->SetInput(m_pTissueNormals->GetOutput());
#else
    pWriter->SetInputConnection(m_pTissueNormals->GetOutputPort());
#endif
    QString strVTKFileName;
    strVTKFileName.sprintf("test2.vtk");
    pWriter->SetFileName(strVTKFileName.toStdString().c_str());
    pWriter->SetFileTypeToBinary();
    pWriter->Write();

    // save to stl
    vtkSTLWriter* pSTLWriter = vtkSTLWriter::New();
#if VTK_MAJOR_VERSION <= 5
    pSTLWriter->SetInput(m_pTissueNormals->GetOutput());
#else
    pSTLWriter->SetInputConnection(m_pTissueNormals->GetOutputPort());
#endif
    QString strSTLFileName;
    strSTLFileName.sprintf("test2.stl");
    pSTLWriter->SetFileName(strSTLFileName.toStdString().c_str());
    pSTLWriter->SetFileTypeToBinary();
    pSTLWriter->Write();

    // finalize
    m_pRenderer->Delete();

    m_pTissueExtractor->Delete();
    m_pTissueNormals->Delete();
    m_pTissueMapper->Delete();
    m_pTissue->Delete();
    m_pTextActor->Delete();;
    m_pTextMapper->Delete();

    pReader->Delete();
    pWriter->Delete();
    pSTLWriter->Delete();

    // TODO: there are missing pointers to be deleted. Add them.

    return a.exec();
}
开发者ID:jrkwon,项目名称:VolumeViewer,代码行数:101,代码来源:main.cpp


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