level 1
vtkSmartPointer<vtkSTLReader> reader_l = vtkSmartPointer<vtkSTLReader>::New();
reader_l->SetFileName("D:\\TEST\\feiai\\xinzang.stl");
reader_l->Update();
smooth_l=vtkSmartPointer<vtkSmoothPolyDataFilter>::New();
smooth_l->SetInputConnection(reader_l->GetOutputPort());
smooth_l->SetNumberOfIterations(5);
smooth_l->SetRelaxationFactor(0.1);
smooth_l->FeatureEdgeSmoothingOn();
smooth_l->BoundarySmoothingOn();
smooth_l->Update();
normals = vtkSmartPointer<vtkPolyDataNormals>::New();
normals->SetInputConnection( smooth_l -> GetOutputPort());
normals->FlipNormalsOn();
normals->ComputeCellNormalsOn();
normals->ComputePointNormalsOn();
normals->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper_l = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper_l->SetInputConnection(normals->GetOutputPort());
mapper_l->SetNumberOfPieces(1);
mapper_l->SetScalarRange(0 , 1);
mapper_l->SetColorMode(1);
mapper_l->SetResolveCoincidentTopology(0);
mapper_l->SetScalarMode(1);
mapper_l->SetImmediateModeRendering(0);
mapper_l->SetScalarVisibility(1);
mapper_l->SetUseLookupTableScalarRange(0);
mapper_l->Update();
actor_l =vtkSmartPointer<vtkActor>::New();
actor_l->SetMapper(mapper_l);
actor_l->GetProperty()->SetAmbientColor(0 , 0 , 0);
actor_l->GetProperty()->SetColor(0 , 0 , 0);
actor_l->GetProperty()->SetDiffuseColor(0 , 1 , 1);
actor_l->GetProperty()->SetOpacity(0.8);
actor_l->GetProperty()->SetInterpolation(1);
actor_l->GetProperty()->SetRepresentation(2);
actor_l->GetProperty()->SetBackfaceCulling(0);
actor_l->GetProperty()->SetFrontfaceCulling(1);
actor_l->GetProperty()->SetEdgeVisibility(0);
actor_l->GetProperty()->SetDiffuse(1);
actor_l->SetScale(1 , 1 , 1);
actor_l->SetVisibility(1);
2017年08月01日 09点08分


