View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015983VTK(No Category)public2016-02-08 08:482016-08-12 09:55
ReporterAlgis 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version6.3.0 
Target VersionFixed in Version 
Summary0015983: VTK crash with OpenFOAM
DescriptionThe simplest OpenFOAM (version 3.0) example (icoFoam.C) with included the simplest VTK (version 6.3.0) example (Arrow.cxx) crashes with "Floating point exception" in window rendering if OpenFOAM functions are called before VTK.

It is enough, that OpenFOAM variable "args"

    Foam::argList args(argc, argv, false);

is defined before renderWindow->Render().

It seems, that OpenFOAM's manager of exceptions intercepts something wrong (as division by 0) in VTK.

Crashing code example simplified as much as possible:
// ============================================================
// VTK includes
// ============================================================

#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle);
VTK_MODULE_INIT(vtkRenderingFreeType);
VTK_MODULE_INIT(vtkRenderingContextOpenGL);

#include <vtkArrowSource.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>

// ============================================================
// OpenFOAM includes
// ============================================================

#define WM_DP
#include "fvCFD.H"

// ============================================================
// MAIN
// ============================================================

int main ( int argc, char *argv[] )
{
  // Create an arrow.
  vtkSmartPointer<vtkArrowSource> arrowSource = vtkSmartPointer<vtkArrowSource>::New();
  arrowSource->Update();
 
  // Create a mapper and actor
  vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
  mapper->SetInputConnection(arrowSource->GetOutputPort());
  mapper->Update();
  vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
  actor->SetMapper(mapper);
 
  // Visualize
  vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
  vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->AddRenderer(renderer);
  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
  renderWindowInteractor->SetRenderWindow(renderWindow);
 
  renderer->AddActor(actor);
  renderer->SetBackground(.1, .2, .3); // Background color dark blue
 
  // ============================================================
  // OpenFOAM
  // ============================================================

  Foam::argList args(argc, argv, false);

  // ============================================================
  // VTK
  // ============================================================

  renderWindow->Render();
  renderWindowInteractor->Start(); // <-- 'Floating point exception' error in trying to manipulate with arrow
  
  // ============================================================
  // END
  // ============================================================
  return EXIT_SUCCESS;
}

TagsNo tags attached.
ProjectTBD
Typecrash
Attached Files

 Relationships

  Notes
(0037452)
Kitware Robot (administrator)
2016-08-12 09:55

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-08 08:48 Algis New Issue
2016-08-12 09:55 Kitware Robot Note Added: 0037452
2016-08-12 09:55 Kitware Robot Status backlog => closed
2016-08-12 09:55 Kitware Robot Resolution open => moved
2016-08-12 09:55 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team