MantisBT - VTK
View Issue Details
0014484VTK(No Category)public2013-12-20 12:212014-01-02 18:53
Doug Hoppes 
Will Schroeder 
normalminorhave not tried
closedfixed 
6.0.0 
 
TBD
incorrect functionality
0014484: Glyph3D source is not being displayed accurately
 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.
No tags attached.
png glyph_error.png (135,744) 2013-12-20 12:21
https://www.vtk.org/Bug/file/9577/glyph_error.png
png

? linedata.vtk (5,961) 2013-12-20 12:22
https://www.vtk.org/Bug/file/9578/linedata.vtk
txt code_segment.txt (1,276) 2013-12-20 12:24
https://www.vtk.org/Bug/file/9579/code_segment.txt
png ProgramOutput.png (17,676) 2014-01-02 18:50
https://www.vtk.org/Bug/file/9589/ProgramOutput.png
png
Issue History
2013-12-20 12:21Doug HoppesNew Issue
2013-12-20 12:21Doug HoppesFile Added: glyph_error.png
2013-12-20 12:22Doug HoppesFile Added: linedata.vtk
2013-12-20 12:24Doug HoppesFile Added: code_segment.txt
2014-01-02 14:51Will SchroederNote Added: 0032115
2014-01-02 14:51Will SchroederAssigned To => Will Schroeder
2014-01-02 14:51Will SchroederStatusbacklog => active development
2014-01-02 18:48Will SchroederNote Edited: 0032115bug_revision_view_page.php?bugnote_id=32115#r704
2014-01-02 18:50Will SchroederFile Added: 0014484-ProgramOutput.png
2014-01-02 18:52Will SchroederNote Edited: 0032115bug_revision_view_page.php?bugnote_id=32115#r705
2014-01-02 18:53Will SchroederNote Added: 0032121
2014-01-02 18:53Will SchroederStatusactive development => closed
2014-01-02 18:53Will SchroederResolutionopen => fixed

Notes
(0032115)
Will Schroeder   
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   
2014-01-02 18:53   
See note. It looks like an update error, Glyph3D is working fine.