[vtkusers] vtkstreamtracer on a surface
Bill Lorensen
bill.lorensen at gmail.com
Tue Mar 6 17:12:22 EST 2018
I need fully compilable program.
On Mar 6, 2018 1:50 PM, "ZACK" <chihebz at hotmail.com> wrote:
> Hi Bill,
>
> Here's the code that is working in previous 5.0 vtk version
>
> vtkSmartPointer<vtkGeometryFilter> extract =
> vtkSmartPointer<vtkGeometryFilter>::New();
> extract->SetInputConnection(m_pUnstructuredGridModel->
> GetOutputPort());
> extract->Modified();
> InitializePolyDataMapper(m_pModelPolyDataMapper);
>
> m_pModelPolyDataMapper->SetInputConnection(extract->GetOutputPort());
> PreparePolyDataMapper(m_pModelPolyDataMapper, pColours,
> m_CurrentMinValue,
>
> m_CurrentMaxValue);
> m_pCurrentFringeActor->SetMapper(m_pModelPolyDataMapper);
> m_pCurrentFringeActor->SetDragable(true);
> m_pCurrentFringeActor->VisibilityOn();
> m_prenderer->AddViewProp(m_pCurrentFringeActor);// m_prenderer is
> vtkopenglrenderer
>
> The piece of code above does render fine, but when I try to add the code
> below for wireframe the render windows becomes empty
>
> vtkSmartPointer<vtkFeatureEdges> edges_extractor =
> vtkSmartPointer<vtkFeatureEdges>::New();
> edges_extractor->SetInputConnection(extract->GetOutputPort());
> edges_extractor->ColoringOff();
> edges_extractor->BoundaryEdgesOn();
> edges_extractor->ManifoldEdgesOn();
> edges_extractor->NonManifoldEdgesOn();
> edges_extractor->FeatureEdgesOn();
> edges_extractor->Modified();
>
> vtkSmartPointer<vtkPolyDataMapper> edges_mapper =
> vtkSmartPointer<vtkPolyDataMapper>::New();
>
> edges_mapper->SetInputConnection(edges_
> extractor->GetOutputPort());
> edges_mapper->SetResolveCoincidentTopologyPolygonOffsetParameters(1,
> 1);
> edges_mapper->SetResolveCoincidentTopologyToPolygonOffset();
> edges_mapper->ScalarVisibilityOff(); // coloring edges
>
> edges_mapper->Modified();
>
> vtkActor* edges_actor = vtkActor::New();
> edges_actor->SetMapper(edges_mapper);
> edges_actor->GetProperty()->SetDiffuseColor(0, 0, 0);
> edges_actor->GetProperty()->SetLineWidth(m_iEdgeLineWidth);
> edges_actor->Modified();
> edges_actor->VisibilityOn();
> m_prenderer->AddViewProp(edges_actor);// m_prenderer is
> vtkopenglrenderer
>
> Note: If I render the wireframe actor (edges_actor) by itself it does work
> fine
>
> Thanks
>
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180306/eedfb8a9/attachment.html>
More information about the vtkusers
mailing list