[vtkusers] vtkstreamtracer on a surface

ZACK chihebz at hotmail.com
Tue Mar 6 16:50:27 EST 2018


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


More information about the vtkusers mailing list