📄 pipe1.cxx
字号:
/*========================================================================= Program: Visualization Toolkit Module: $RCSfile: pipe1.cxx,v $ Language: C++ Date: $Date: 2002/09/30 20:37:43 $ Version: $Revision: 1.6 $ Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information.=========================================================================*/#include "vtkImageData.h"#include "vtkOutputPort.h"#include "vtkRTAnalyticSource.h"#include "PipelineParallelism.h"static float XFreq = 60;// Increments XFreq of the synthetic sourcevoid IncrementXFreq(void* sr){ vtkRTAnalyticSource* source1 = reinterpret_cast<vtkRTAnalyticSource*>(sr); XFreq = XFreq + 10; source1->SetXFreq(XFreq);}// Pipe 1 for PipelineParallelism.// See PipelineParallelism.cxx for more information.void pipe1(vtkMultiProcessController* vtkNotUsed(controller), void* vtkNotUsed(arg)){ double extent = 20; int iextent = static_cast<int>(extent); // Synthetic image source. vtkRTAnalyticSource* source1 = vtkRTAnalyticSource::New(); source1->SetWholeExtent (-1*iextent, iextent, -1*iextent, iextent, -1*iextent, iextent ); source1->SetCenter(0, 0, 0); source1->SetStandardDeviation( 0.5 ); source1->SetMaximum( 255.0 ); source1->SetXFreq( XFreq ); source1->SetXMag( 10 ); source1->SetYFreq( 30 ); source1->SetYMag( 18 ); source1->SetZFreq( 40 ); source1->SetZMag( 5 ); source1->GetOutput()->SetSpacing(2.0/extent,2.0/extent,2.0/extent); // Output port vtkOutputPort* op = vtkOutputPort::New(); op->SetInput(source1->GetOutput()); op->SetTag(11); // Turn this on for pipeline parallelism. op->PipelineFlagOn(); // Called every time data is requested from the output port op->SetParameterMethod(IncrementXFreq, source1); // Process requests op->WaitForUpdate(); // Cleanup op->Delete(); source1->Delete();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -