VTK三角面片

简介: /*#include "vtkRenderer.h"#include "vtkRenderWindow.h"#include "vtkRenderWindowInteractor.h"#include "vtkSphereSource.

/*
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkSphereSource.h"
#include "vtkShrinkFilter.h"
#include "vtkElevationFilter.h"
#include "vtkDataSetMapper.h"
#include "vtkActor.h"
#include "vtkCullerCollection.h"

 

void main( int argc, char *argv[] )
{
    vtkRenderer *renderer = vtkRenderer::New();
    renderer->GetCullers()->RemoveAllItems();
    vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer(renderer);
    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);
    vtkSphereSource *sphere = vtkSphereSource::New();
    sphere->SetThetaResolution(12); sphere->SetPhiResolution(12);
    vtkShrinkFilter *shrink = vtkShrinkFilter::New();
    shrink->SetInput((vtkDataSet *)sphere->GetOutput());
    shrink->SetShrinkFactor(0.9);

    vtkElevationFilter *colorIt = vtkElevationFilter::New();
    colorIt->SetInput((vtkDataSet *)shrink->GetOutput());
    colorIt->SetLowPoint(0,0,-0.5);
    colorIt->SetHighPoint(0,0,0.5);


    vtkDataSetMapper *mapper = vtkDataSetMapper::New();
    mapper->SetInput(colorIt->GetOutput());

    vtkActor *actor = vtkActor::New();
    actor->SetMapper(mapper);
    renderer->AddActor(actor);
    renderer->SetBackground(1,1,1);
    renWin->SetSize(400,400);

    renWin->Render(); // execute first time

 

    // interact with data
    iren->Start();

    // Clean up
    renderer->Delete();
    renWin->Delete();
    iren->Delete();
    sphere->Delete();
    shrink->Delete();
    colorIt->Delete();
    mapper->Delete();
    actor->Delete();
}
*/

目录
相关文章
Qt&Vtk-028-SGrid
Qt&Vtk-028-SGrid
159 0
Qt&Vtk-028-SGrid
Qt&Vtk-004-AmbientSpheres
Qt&Vtk-004-AmbientSpheres
216 0
Qt&Vtk-004-AmbientSpheres
Qt&Vtk-015-Cylinder
Qt&Vtk-015-Cylinder
140 0
Qt&Vtk-015-Cylinder
Qt&Vtk-009-Cone4
Qt&Vtk-009-Cone4
123 0
Qt&Vtk-009-Cone4
Qt&Vtk-016-DiffuseSpheres
Qt&Vtk-016-DiffuseSpheres
131 0
Qt&Vtk-016-DiffuseSpheres
Qt&Vtk-006-one
Qt&Vtk-006-one
124 0
Qt&Vtk-006-one
Qt&Vtk-024-PiecewiseItem
Qt&Vtk-024-PiecewiseItem
168 0
Qt&Vtk-024-PiecewiseItem
Qt&Vtk-010-Cone5
Qt&Vtk-010-Cone5
169 0
Qt&Vtk-010-Cone5
Qt&Vtk-027-RGrid
Qt&Vtk-027-RGrid
153 0
Qt&Vtk-027-RGrid
Qt&Vtk-025-QChartTable
Qt&Vtk-025-QChartTable
174 0
Qt&Vtk-025-QChartTable