View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014484VTK(No Category)public2013-12-20 12:212014-01-02 18:53
ReporterDoug Hoppes 
Assigned ToWill Schroeder 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6.0.0 
Target VersionFixed in Version 
Summary0014484: Glyph3D source is not being displayed accurately
Description I’m using a glyph3D to display some polydata and I noticed that the line does not go through the center of each of the spheres in the glyph. They are both using the same polydata.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Filespng file icon glyph_error.png [^] (135,744 bytes) 2013-12-20 12:21


? file icon linedata.vtk [^] (5,961 bytes) 2013-12-20 12:22
txt file icon code_segment.txt [^] (1,276 bytes) 2013-12-20 12:24 [Show Content]
png file icon ProgramOutput.png [^] (17,676 bytes) 2014-01-02 18:50

 Relationships

  Notes
(0032115)
Will Schroeder (manager)
2014-01-02 14:51
edited on: 2014-01-02 18:52

Investigating problem:

Works in ParaView and with a little program I wrote. It looks to be an application integration error. I'm guessing the pipeline is not updating properly (since the glyphs were not connected to the Glypher via a connection/port (i.e., pGlyph->SetInputData(pEditingPointData->GetOutput()); may be the problem in your application).

Here is the program....I'll attach an image somewhere.

/*=========================================================================

  Program: Visualization Toolkit
  Module: Bug.cxx

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm [^] for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE. See the above copyright notice for more information.

=========================================================================*/
// First include the required header files for the VTK classes we are using.
#include "vtkSphereSource.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkSmartPointer.h"
#include "vtkSphere.h"
#include "vtkGlyph3D.h"
#include "vtkPolyDataReader.h"

int main()
{
  // Load in the line
  vtkSmartPointer<vtkPolyDataReader> Reader = vtkSmartPointer<vtkPolyDataReader>::New();
  Reader->SetFileName("C:/D/gitVTK/Bugs/0014484-Glyph-Alignment/linedata.vtk");

  // Create the glyph representation
  vtkSmartPointer<vtkSphereSource> Sphere = vtkSmartPointer<vtkSphereSource>::New();
  Sphere->SetThetaResolution(16);
  Sphere->SetRadius(0.025);
  Sphere->SetPhiResolution(16);

  // Create the glyph object
  vtkSmartPointer<vtkGlyph3D> Glyph = vtkSmartPointer<vtkGlyph3D>::New();
  Glyph->SetSourceConnection(Sphere->GetOutputPort());
  Glyph->SetInputConnection(Reader->GetOutputPort());
  Glyph->ScalingOff();
  Glyph->SetScaleModeToDataScalingOff();
  Glyph->GeneratePointIdsOn();
  Glyph->Update();

  // Visualize the glyphs
  vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
  mapper->SetInputConnection(Glyph->GetOutputPort());
  mapper->SetScalarVisibility(0);

  vtkSmartPointer<vtkActor> SelectionGlyph = vtkSmartPointer<vtkActor>::New();
  SelectionGlyph->SetMapper(mapper);

  // Visualize the line
  vtkSmartPointer<vtkPolyDataMapper> mapper2 = vtkSmartPointer<vtkPolyDataMapper>::New();
  mapper2->SetInputConnection(Reader->GetOutputPort());
  mapper2->SetScalarVisibility(0);

  vtkSmartPointer<vtkActor> Line = vtkSmartPointer<vtkActor>::New();
  Line->SetMapper(mapper2);

  //
  // Create the Renderer and assign actors to it. A renderer is like a
  // viewport. It is part or all of a window on the screen and it is
  // responsible for drawing the actors it has. We also set the background
  // color here.
  //
  vtkSmartPointer<vtkRenderer> ren1 = vtkSmartPointer<vtkRenderer>::New();
  ren1->AddActor( SelectionGlyph );
  ren1->AddActor( Line );

  //
  // Finally we create the render window which will show up on the screen.
  // We put our renderer into the render window using AddRenderer. We also
  // set the size to be 300 pixels by 300.
  //
  vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();
  renWin->AddRenderer( ren1 );
  renWin->SetSize( 300, 300 );

  vtkSmartPointer<vtkRenderWindowInteractor> iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();
  iren->SetRenderWindow(renWin);

  iren->Initialize();
  iren->Start();

  return 0;
}

(0032121)
Will Schroeder (manager)
2014-01-02 18:53

See note. It looks like an update error, Glyph3D is working fine.

 Issue History
Date Modified Username Field Change
2013-12-20 12:21 Doug Hoppes New Issue
2013-12-20 12:21 Doug Hoppes File Added: glyph_error.png
2013-12-20 12:22 Doug Hoppes File Added: linedata.vtk
2013-12-20 12:24 Doug Hoppes File Added: code_segment.txt
2014-01-02 14:51 Will Schroeder Note Added: 0032115
2014-01-02 14:51 Will Schroeder Assigned To => Will Schroeder
2014-01-02 14:51 Will Schroeder Status backlog => active development
2014-01-02 18:48 Will Schroeder Note Edited: 0032115
2014-01-02 18:50 Will Schroeder File Added: 0014484-ProgramOutput.png
2014-01-02 18:52 Will Schroeder Note Edited: 0032115
2014-01-02 18:53 Will Schroeder Note Added: 0032121
2014-01-02 18:53 Will Schroeder Status active development => closed
2014-01-02 18:53 Will Schroeder Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team