DiscussionsIssue archiveVisualization and 3D Viewer

Archived discussion

Possible bug in vtk picker?

Visualization and 3D ViewerSat, 12/12/2015 - 02:233 replies

Browse this forum
QuestionAuthor

I am using occ vtk VIS services as so:

            IVtkOCC_Shape::Handle aShapeImpl = m_geometryShapes[anIt.Value()];

            IVtk_ShapeIdList anIdSubList = m_picker->GetPickedSubShapesIds(anIt.Value(), false);

            vtkSmartPointer<IVtkTools_ShapeDataSource> aDataSource = vtkSmartPointer<IVtkTools_ShapeDataSource>::New();
            aDataSource->SetShape(aShapeImpl);

            // Create a new sub-polydata filter for sub-shapes filtering
            vtkSmartPointer<IVtkTools_SubPolyDataFilter> subShapesFilter = IVtkTools_SubPolyDataFilter::New();
            // Set a shape source as an input of the subpolydata filter
            subShapesFilter->SetInputConnection(aDataSource->GetOutputPort());

            // Set ids to the filter to pass only picked sub-shapes
            subShapesFilter->SetData(anIdSubList);
            subShapesFilter->Modified();

            // Output the result into a mapper
            vtkSmartPointer<vtkPolyDataMapper> aMapper = vtkPolyDataMapper::New();
            aMapper->ImmediateModeRenderingOn();
            aMapper->SetResolveCoincidentTopologyPolygonOffsetParameters(1, 2);
            aMapper->AddInputConnection(subShapesFilter->GetOutputPort());

 

If I use GetPickedSubShapesIds(anIt.Value(), false) it returns the top face although mouse coordinates are on the cylindrical surface. I thought it might be a problem with coordinate x, y but it is working correctly on the edges which seems to indicate the x,y are correct. I have also tried changing setTolerance but seems that theres is no effect.

 

 

 

 

 

 

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

Dear Author,

I suggest you to register the issue in OCCT Mantis BugTracker available via the Collaborative portal - http://dev.opencascade.org/index.php?q=home/get_involved.

Best regards

FSR

 

02Commenter-2
03Commenter-3

垃圾