[vtkusers] vtkstructuredpoints
Ahmet Alacadoğan
dfm at uyduarge.com
Thu Mar 14 09:59:49 EDT 2013
hi everyone,
I have tried to used vtkstructuredpoints and set dimension 4,4,4 but it
shows just one cube I cant see other cubes
how can I see other cubes of main cube
Thank you
#pragmacomment(linker,"/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#include <iostream>
#include <vtkRenderer.h>
#include <vtkStructuredPoints.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkFloatArray.h>
#include <vtkPointData.h>
#include <vtkDataSetMapper.h>
#include <vtkOutlineFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkElevationFilter.h>
using namespace std;
int main()
{
vtkRenderer *ren1=vtkRenderer::New();
vtkRenderWindow *renwin=vtkRenderWindow::New();
vtkRenderWindowInteractor *rwi=vtkRenderWindowInteractor::New();
vtkInteractorStyleTrackballCamera *style=vtkInteractorStyleTrackballCamera::New();
renwin->AddRenderer(ren1);
rwi->SetRenderWindow(renwin);
rwi->SetInteractorStyle(style);
vtkStructuredPoints *sp=vtkStructuredPoints::New();
sp->SetOrigin(0,0,0);
sp->SetDimensions(4,4,4);
sp->SetSpacing(1,1,1);
/*
vtkFloatArray *fa=vtkFloatArray::New();
for(int i=0;i<64;i++)
fa->InsertValue(i,i);
sp->GetPointData()->SetScalars(fa);
vtkOutlineFilter *of=vtkOutlineFilter::New();
of->SetInput(sp);
vtkElevationFilter *filter=vtkElevationFilter::New();
//filter->SetInputConnection(sp->GetProducerPort());
filter->SetInput(sp);
filter->SetLowPoint(0,0,-1);
filter->SetHighPoint(0,0,1);
*/
vtkDataSetMapper *map=vtkDataSetMapper::New();
// map->SetInputConnection(sp->GetProducerPort());
map->SetInput(sp);
vtkActor *actor=vtkActor::New();
actor->SetMapper(map);
ren1->AddActor(actor);
renwin->Render();
rwi->Start();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130314/26fef239/attachment.htm>
More information about the vtkusers
mailing list