# vtkRectf and vtkRectd not available in Java wrapper

**URL:** https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486
**Category:** Support
**Created:** [September 28, 2022, 12:32pm UTC](https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486 "2022-09-28T12:32:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Martin3d](https://discourse.vtk.org/user_avatar/discourse.vtk.org/martin3d/32/4303_2.png) [@Martin3d](https://discourse.vtk.org/u/Martin3d)
#### Post date: [September 28, 2022, 12:32pm UTC](https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486/1 "2022-09-28T12:32:30Z")

</div>

Hi,

As the title said, I can’t find vtkRectf neither vtkRectd in the Java generated wrapper… although I get a java file generated for vtkRect. However the generated java class is not public hence can not be imported.

Looking at the source code of [vtkRect.h](https://github.com/Kitware/VTK/blob/master/Common/DataModel/vtkRect.h) shows that in C++ vtkRect is an abstract template class and their concrete counterparts (f/d) are nested in the same .h file.

Could anyone experienced on the Java wrapper confirm that the **nested class pattern is the reason for the concrete classes not being generated**?

This prevents from configuring a `vtkChartXYZ`

```java
vtkChartXYZ chart = new vtkChartXYZ();
chart.SetGeometry(new vtkRectd(10.0, 10.0, 630, 470));

```

Leading to

 ![image](https://discourse.vtk.org/uploads/default/original/2X/2/22010bf48eba7a71309317567c21efaff8d0c428.png)

Thanks

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [September 28, 2022, 4:08pm UTC](https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486/2 "2022-09-28T16:08:37Z")

</div>

The only classes available to the Java wrapper are the ones that inherit from `vtkObjectBase`. The `vtkRect`, `vtkColor`, `vtkVector`, and `vtkVariant` classes aren’t available.

A partial list of the VTK rules for Java wrapping is as follows:

1. The class must derive from `vtkObjectBase`
2. Templates are not wrapped (classes that inherit from concrete templates can be wrapped)
3. Only one class per header file is wrapped (the class the header file is named after)
4. Nested classes are not wrapped

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [September 29, 2022, 1:51am UTC](https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486/3 "2022-09-29T01:51:59Z")

</div>

Adding `SetPlotHeight()/SetPlotWidth()/SetMarginLeft()/SetMarginBottom()` methods to **vtkChartXYZ** in the VTK source code would be the easiest solution.

---

<div class="post-metadata">

### Author: ![Martin3d](https://discourse.vtk.org/user_avatar/discourse.vtk.org/martin3d/32/4303_2.png) [@Martin3d](https://discourse.vtk.org/u/Martin3d)
#### Post date: [September 29, 2022, 1:04pm UTC](https://discourse.vtk.org/t/vtkrectf-and-vtkrectd-not-available-in-java-wrapper/9486/4 "2022-09-29T13:04:03Z")

</div>

Thank you all for the clarifications and suggestions.
