[vtkusers] vtkstructuredpoints

David E DeMarle dave.demarle at kitware.com
Thu Mar 14 11:00:14 EDT 2013


Change from surface to wireframe rendering mode, or apply a filter such as
vtkExtractEdges and display the output of that.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, Mar 14, 2013 at 9:59 AM, Ahmet Alacadoğan <dfm at uyduarge.com> wrote:

>  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
> #pragma comment(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();
>
>  }
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130314/23820498/attachment.htm>


More information about the vtkusers mailing list