# vtkBoxRepresentation and related classes

**URL:** https://discourse.vtk.org/t/vtkboxrepresentation-and-related-classes/14086
**Category:** Support
**Created:** [June 19, 2024, 10:43pm UTC](https://discourse.vtk.org/t/vtkboxrepresentation-and-related-classes/14086 "2024-06-19T22:43:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)
#### Post date: [June 19, 2024, 10:43pm UTC](https://discourse.vtk.org/t/vtkboxrepresentation-and-related-classes/14086/1 "2024-06-19T22:43:43Z")

</div>

I am studying the VTK textbook and have also searched the internet. In the textbook I don’t see the vtkBoxRepresentation or other representations. Am I missing something? My current problem actually has to do with Scalar Bars, but I thought there would be more information about the vtkBoxRepresentation class. I would like to understand the relationship between the Widget, the Representation, and the Actor.

As I mentioned, my real interest is these three:  
vtkScalarBarWidget  
vtkScalarBarRepresentation  
vtkScalarBarActor  
and I would like to resize and reposition the Scalar Bar from within the code, not by having the user use the mouse. I tried SetPosition and related functions for the vtkScalarBarActor but that seems not to work. Should I use SetPosition for the vtkScalarBarWidget? Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![whereismymoney](https://discourse.vtk.org/user_avatar/discourse.vtk.org/whereismymoney/32/6859_2.png) [@whereismymoney](https://discourse.vtk.org/u/whereismymoney)
#### Post date: [June 20, 2024, 12:02am UTC](https://discourse.vtk.org/t/vtkboxrepresentation-and-related-classes/14086/2 "2024-06-20T00:02:33Z")

</div>

I have resolved my immediate problems by using GetPosition(), SetPosition(), GetPosition2(), SetPosition2() of vtkScalarBarRepresentation.  
However I did this by trial-and-error, and I would prefer to have a better understanding of the Actor, Widget and Representation (and why it did not work when I tried this with the vtkScalarBarActor, although the code compiled).
