Skip to content

Draft: vtkGeometryRepresentation: expose coordinate systems

With this draft VTK MR, users can provide a physical to world matrix in vtkRenderWindow, functionality that was previously only meaningfully implemented in the VR subclasses.

This draft change exposes the coordinate system of geometry representations as a property which is forwarded to the underlying actor.

To see this change in action, try the following:

  1. Check out and build this branch (and accompanying VTK branch), making sure python is enabled
  2. Create "Cone1" of some color
  3. Create "Cone2" of a different color
  4. Open the python shell and do the following:
import vtkmodules
from vtkmodules.vtkCommonTransforms import vtkTransform
from vtkmodules.vtkCommonMath import vtkMatrix4x4

tform = vtkTransform()
tform.Translate(5, 0, 0)
m = vtkMatrix4x4()
tform.GetMatrix(m)
m_elts = [m.GetElement(i, j) for i in range(0, 4) for j in range(0, 4)]

rvProxy = GetActiveView()
rvProxy.SetPropertyWithName("PhysicalToWorldMatrix", m_elts)
rvProxy.UpdateVTKObjects()
  1. Select "Cone2" in the pipeline browser
  2. Toggle on the advanced properties in the properties editor and search for "CoordinateSystem"
  3. Change the property value from "World" to "Physical"
  4. Zoom out till you see both cones
  5. Switch "Cone2" coordinate system back and forth between Physical and World

So far, only "Physical" and "World" (the default) are actually supported, i.e. setting the coordinate system to "Device" is the same as choosing "World".

Edited by Scott Wittenburg

Merge request reports