vtkBorderRepresentation: API needs some rework
Description
The vtkBorderRepresentation
stores two positions for the corners of the rectangle. These are vtkCoordinates
. This API design might be tricky to deal with as the second coordinates is relative to the first one (and so expressing width/height). Although this design is common in VTK, it may not be the most suitable in this case.
Moreover, there is a WindowLocation
parameter that can set the Position of the rectangle, relative to Position2 to fit in the screen. However, when you want to deal with the rectangle (representation) scale, the only possibility is now to set Position2, which won't check if WindowLocation
is set. This means you need to manually call twice the WindowLocation
setter to update it.
Solution
Temporary
!10225 (merged) is making UpdateWindowLocation
public to allow a manual update when needed. This work is made to allow vtkLogoSourceRepresentation
from ParaView to update correctly the location relative to the scale, which is there handled separately from Position2 as the API was not think this way.
Best
The best solution would be to rethink the API to allow easier positioning and scaling manipulation, without needing to call explicitly updates that should be already handled by the base class.