Quantcast

VTK *.app Abort trap:6

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

VTK *.app Abort trap:6

henlau
Hi all,

I was trying to visualize my actor on mac but seems like it is not working.
I got the following error when the program was adding the actor to the renderer:
Abort trap: 6

Does anyone know what that means? How am I able to solve it?
My code is just simply visualizing the vtkHedgeHog.

TIA
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK *.app Abort trap:6

Bill Lorensen
Can you provide a small, compilable file that illustrates the problem!? And the Cmakelists.txt file.

On Apr 10, 2017 8:07 PM, "henlau" <[hidden email]> wrote:
Hi all,

I was trying to visualize my actor on mac but seems like it is not working.
I got the following error when the program was adding the actor to the
renderer:
Abort trap: 6

Does anyone know what that means? How am I able to solve it?
My code is just simply visualizing the vtkHedgeHog.

TIA



--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-app-Abort-trap-6-tp5742788.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK *.app Abort trap:6

henlau
Below is my code:

    //Creating vectors and points for hedgehog
    static int dims[3] = {1430, 1557, 151};
    float x[3], v[3];
    int offset, kOffset, jOffset, k, deltaHeight, componentNum;
    vtkStructuredGrid* reformedWeatherGrid = c2p->GetStructuredGridOutput();
    reformedWeatherGrid->SetDimensions(dims[0], dims[1], dims[2]);

    vtkFloatArray* vector = vtkFloatArray::New();
    vector->SetNumberOfComponents(3);
    vector->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);

    vtkPoints* points = vtkPoints::New();
    points->Allocate(dims[0]*dims[1]*dims[2]);

    v[2] = 0.0;
    deltaHeight = dims[0] * dims[1];
    for(int height = 1; height < dims[2]; height++){
      x[2] = height;
      kOffset = height*dims[0]*dims[1];
      for(int lat = 1; lat < dims[1]; lat++){
        jOffset = lat*dims[0];
        for(int lon = 1; lon < dims[0]; lon++){
          x[0] = lon;
          x[1] = lat;
          componentNum = height*lat*lon;
          v[0] = reformedWeatherGrid->GetPointData()->GetArray("ua")->GetComponent(componentNum, 0);
          v[1] = reformedWeatherGrid->GetPointData()->GetArray("va")->GetComponent(componentNum,0);
          offset = lon+jOffset+kOffset;
          points->InsertPoint(offset,x);
          vector->InsertTuple(offset,v);
        }
      }
    }

    //Set points and vector to the structuredgrid
    reformedWeatherGrid->SetPoints(points);
    reformedWeatherGrid->GetPointData()->SetVectors(vector);
    reformedWeatherGrid->Print(std::cout);

    //HedgeHog
    vtkHedgeHog* hedgehog = vtkHedgeHog::New();
    hedgehog->SetInputData(reformedWeatherGrid);
    hedgehog->SetScaleFactor(0.05);
    hedgehog->Print(std::cout);

    vtkPolyDataMapper* hhMapper = vtkPolyDataMapper::New();
    hhMapper->SetInputConnection(hedgehog->GetOutputPort());

    vtkActor* hhActor = vtkActor::New();
    hhActor->SetMapper(hhMapper);
   
    //Renderer, render window
    ......

Just now I tried with a smaller dimension, like 300x300x151 and it works. Is that because of my computer not able to handle such large amount of data?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK *.app Abort trap:6

henlau
In reply to this post by Bill Lorensen
And this is my CMakeList.txt


cmake_minimum_required(VERSION 2.8)

PROJECT(main)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

add_executable(main MACOSX_BUNDLE main)

if(VTK_LIBRARIES)
  target_link_libraries(main ${VTK_LIBRARIES})
else()
  target_link_libraries(main vtkHybrid vtkWidgets)
endif()
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: VTK *.app Abort trap:6

Sean McBride
In reply to this post by henlau
On Mon, 10 Apr 2017 18:07:57 -0700, henlau said:

>Just now I tried with a smaller dimension, like 300x300x151 and it works. Is
>that because of my computer not able to handle such large amount of data?

Not "your computer", but it could well be that somewhere there is 32 bit arithmetic that is overflowing.  You might try enabling UBSan to detect if this is so:

<http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html>

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...