Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 830
    • Issues 830
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 240
    • Merge requests 240
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTKVTK
  • Issues
  • #391
Closed
Open
Issue created Nov 19, 2003 by Kitware Robot@kwrobotOwner

vtkOBBTree crashes with non-polydata datasets due to unsafe pointer cast.

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


This line in vtkOBBTree::ComputeOBB(vtkIdList*,...) ... ((vtkPolyData *)this->DataSet)->GetCellPoints( cellId, numPts, ptIds ); ... causes obbtree to crash with e.g. unstructured grid datasets. (Short term) fixes:

  1. The line should be replaced by: vtkPolyData *polydata; polydata = vtkPolyData::SafeDownCast(this->DataSet); if (polydata == NULL) { vtkErrorMacro(<< "Input dataset not vtkPolyData"); return; } polydata->GetCellPoints( cellId, numPts, ptIds );
  2. The limitation should be documented.
  3. Alternatively, the method vtkOBBTree::SetDataSet(vtkPolyData *) should be defined thus preventing the user from calling the base class method (using the C++ no-overloading-across-scopes feature). (Longer term) fixes:
  4. Modify the locator to use the vtkOBBTree::ComputeOBB(vtkPoints*,...) when the input is not polydata.
  5. Wait for vtkMesh :-)
Assignee
Assign to
Time tracking