VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2023-11-09T11:01:58-05:00https://gitlab.kitware.com/vtk/vtk/-/issues/19162Add support for tensor detection for CGNS reader2023-11-09T11:01:58-05:00Mickael PHILITAdd support for tensor detection for CGNS readerAccording to CGNS standard notation, tensor can be detected from the end of components names
For instance, the Reynolds stress symmetric tensor follow this rule:
| Name | Physical quantity | Units |
| ------...According to CGNS standard notation, tensor can be detected from the end of components names
For instance, the Reynolds stress symmetric tensor follow this rule:
| Name | Physical quantity | Units |
| ---------------- | ---------------------------- | --------- |
| ReynoldsStressXX | Reynolds stress −ρ(u′u′)ave | M/(LT2) |
| ReynoldsStressXY | Reynolds stress −ρ(u′v′)ave | M/(LT2) |
| ReynoldsStressXZ | Reynolds stress −ρ(u′w′)ave | M/(LT2) |
| ReynoldsStressYY | Reynolds stress −ρ(v′v′)ave | M/(LT2) |
| ReynoldsStressYZ | Reynolds stress −ρ(v′w′)ave | M/(LT2) |
| ReynoldsStressZZ | Reynolds stress −ρ(w′w′)ave | M/(LT2) |
The expected behavior of CGNS reader would be to detect that component ends with:
XX XY XZ YY YZ ZZ (for symmetric tensor)
A leading underscore could also be supported even if it is out of the standard scope.
If YX or ZX is found, it would mean that the tensor is not symmetric.
Support of tensor in CGNS is really a must have for people doing turbulence modeling.Mickael PHILITMickael PHILIThttps://gitlab.kitware.com/vtk/vtk/-/issues/17690SIGSEGV on vtkCompositeDataProbeFilter() with PassPartialArraysOn()2023-11-09T07:47:08-05:00t-ikegamiSIGSEGV on vtkCompositeDataProbeFilter() with PassPartialArraysOn()VTK8.2 crashes when vtkCompositeDataProbeFilter() is applied on vtkMultiBlockDataSet(), when
- PassPartialArrays is enabled, and
- PointData entries are not identical among components.
The following python script runs OK with VTK8.0.1, ...VTK8.2 crashes when vtkCompositeDataProbeFilter() is applied on vtkMultiBlockDataSet(), when
- PassPartialArrays is enabled, and
- PointData entries are not identical among components.
The following python script runs OK with VTK8.0.1, but crashes on VTK8.2.
```
import numpy as np
import vtk
from vtk.util.numpy_support import numpy_to_vtk
#------------------------------------------------------------------------
# Create MultiBlockDataSet, with uneven PointData.
#------------------------------------------------------------------------
xz = np.linspace(-1, 1, 11)
y0 = np.linspace(0, 1, 6)
y1 = np.linspace(-1, 0, 6)
rect0 = vtk.vtkRectilinearGrid()
rect0.SetDimensions(len(xz), len(y0), len(xz))
rect0.SetXCoordinates(numpy_to_vtk(xz, deep = 1))
rect0.SetYCoordinates(numpy_to_vtk(y0, deep = 1))
rect0.SetZCoordinates(numpy_to_vtk(xz, deep = 1))
rect1 = vtk.vtkRectilinearGrid()
rect1.SetDimensions(len(xz), len(y1), len(xz))
rect1.SetXCoordinates(numpy_to_vtk(xz, deep = 1))
rect1.SetYCoordinates(numpy_to_vtk(y1, deep = 1))
rect1.SetZCoordinates(numpy_to_vtk(xz, deep = 1))
ar = vtk.vtkDoubleArray()
ar.SetNumberOfComponents(1)
ar.SetNumberOfTuples(rect0.GetNumberOfPoints())
ar.FillComponent(0, 0.0)
ar.SetName("Dummy")
rect0.GetPointData().AddArray(ar)
mb = vtk.vtkMultiBlockDataSet()
mb.SetNumberOfBlocks(2)
mb.SetBlock(0, rect0)
mb.SetBlock(1, rect1)
wr = vtk.vtkXMLMultiBlockDataWriter()
wr.SetFileName("test.vtm")
wr.SetInputData(mb)
wr.Write()
#------------------------------------------------------------------------
# Probe MutiBlockDataSet
#------------------------------------------------------------------------
ln = vtk.vtkLineSource()
ln.SetPoint1(0, -0.99, 0)
ln.SetPoint2(0, 0.99, 0)
ln.SetResolution(10)
pr = vtk.vtkCompositeDataProbeFilter()
pr.PassPartialArraysOn()
pr.SetInputConnection(ln.GetOutputPort())
pr.SetSourceData(mb)
pr.Update() # crashes on VTK8.2
ds = pr.GetOutput()
pd = ds.GetPointData()
for i in range(pd.GetNumberOfArrays()) :
print(pd.GetArray(i).GetName())
from vtk.util.numpy_support import vtk_to_numpy
print(vtk_to_numpy(ds.GetPointData().GetArray("Dummy")))
```
This causes crash of Paraview 5.6 on "Plot Over Line".
It crashes in vtkDataArray::InterpolateTuple().
I couldn't track the issue down, but vtkDataSetAttributesFieldList::InterpolatePoint seems suspicious.Charles GueunetCharles Gueunethttps://gitlab.kitware.com/vtk/vtk/-/issues/19156vtkSurfaceNets3D does not preserve triangle/quad orientation2023-11-08T08:38:48-05:00Bryn LloydvtkSurfaceNets3D does not preserve triangle/quad orientationvtkSurfaceNets3D does not correctly preserve polygon orientation. If I want to extract surfaces from a labelfield and obtain each labels surface with correct triangle orientation (normal pointing outwards) I would first need to run e.g. ...vtkSurfaceNets3D does not correctly preserve polygon orientation. If I want to extract surfaces from a labelfield and obtain each labels surface with correct triangle orientation (normal pointing outwards) I would first need to run e.g. `vtkPolyDataNormals`. This seems a shame, as I loose some of the performance (and the result may be incorrect).
What I expected was that the `BoundaryLabels` array would store two labels
- the first component would correspond to the triangle/quad stored in `Polys`
- the second would be the label corresponding to a triangle with opposite orientation
If I extract label surfaces like this and render using backface culling, I see half of the triangles have the wrong orientation.
The culprit is [here](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkSurfaceNets3D.cxx?ref_type=heads#L963):
```cpp
void WriteScalarTuple(T s0, T s1, T backgroundLabel, vtkIdType quadId)
{
T* scalars = this->NewScalars + 2 * quadId;
if (s0 == backgroundLabel || (s1 != backgroundLabel && s0 > s1))
{
// Background label is placed last; s0<s1 if both inside
std::swap(s0, s1);
}
*scalars++ = s0; // write 2-tuple
*scalars++ = s1;
} // WriteScalarTuple
```
If I comment out the `std::swap(s0, s1)` the orientation information is preserved.
If it is important to not have the background label in the first component, then I guess this could be corrected by flipping the quad in [`GenerateQuadsImpl::operator(...)`](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Filters/Core/vtkSurfaceNets3D.cxx?ref_type=heads#L809), or as a postprocessing pass. I think the "BoundaryLabels" array could also just be documented.
![incorrect_orientation](/uploads/10ad99d6098de43faaffc701ec42dfb4/incorrect_orientation.gif)https://gitlab.kitware.com/vtk/vtk/-/issues/17509Test dependencies can want modules that don't get enabled2023-11-06T22:50:22-05:00Ben BoeckelTest dependencies can want modules that don't get enabledTest dependencies can end up requesting modules that never get provided. This happens when a module is toposorted after one which has been scanned, but has a test dependency on a module that had not been decided yet. To fix, a followup s...Test dependencies can end up requesting modules that never get provided. This happens when a module is toposorted after one which has been scanned, but has a test dependency on a module that had not been decided yet. To fix, a followup scan should be performed using modules requested but for which a `_provided` boolean has not been set at all yet.
# How do I know I have this issue?
If you enable testing and you get an error similar to:
```
CMake Error at CMake/vtkModule.cmake:2416 (message):
The VTK::somedep dependency is missing for VTK::somedepender.
Call Stack (most recent call first):
CMakeLists.txt:335 (vtk_module_build)
```
that goes away when testing is disabled.
# I'm seeing this issue, what do I do?
You can explicitly enable the `VTK::somedepender` module with `-DVTK_MODULE_ENABLE_VTK_somedepender=WANT`. This will enable the module explicitly and request any dependencies it needs. Alternatively, you can enable the `VTK::somedep` module, but this may need to be repeated for each missing dependency.https://gitlab.kitware.com/vtk/vtk/-/issues/19151vtkPolyDataSilhouette does not account for parallel projection2023-11-06T05:52:02-05:00Alex KaszynskivtkPolyDataSilhouette does not account for parallel projectionSeems that `vtkPolyDataSilhouette` doesn't account for parallel projection. MWE:
#### Working
```py
import vtk
# Create sphere
sphereSource = vtk.vtkSphereSource()
sphereSource.SetThetaResolution(100)
sphereSource.SetPhiResolution(100...Seems that `vtkPolyDataSilhouette` doesn't account for parallel projection. MWE:
#### Working
```py
import vtk
# Create sphere
sphereSource = vtk.vtkSphereSource()
sphereSource.SetThetaResolution(100)
sphereSource.SetPhiResolution(100)
sphereSource.Update()
mesh = sphereSource.GetOutput()
# Initialize renderer and render window
renderer = vtk.vtkRenderer()
renderer.SetBackground(1.0, 1.0, 1.0)
# renderer.GetActiveCamera().SetParallelProjection(1)
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
# Initialize render window interactor
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
# Create mapper for sphere
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(mesh)
# Create actor for sphere
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetColor(0.6784313725490196, 0.8470588235294118, 0.9019607843137255)
actor.GetProperty().LightingOff()
# Add sphere actor to renderer and reset the camera
renderer.AddActor(actor)
renderer.ResetCamera()
renderer.GetActiveCamera().Dolly(1.3)
# Create silhouette
silhouette = vtk.vtkPolyDataSilhouette()
silhouette.SetInputData(mesh)
silhouette.SetCamera(renderer.GetActiveCamera())
silhouette.BorderEdgesOff()
# Create mapper and actor for silhouette
silhouetteMapper = vtk.vtkPolyDataMapper()
silhouetteMapper.SetInputConnection(silhouette.GetOutputPort())
silhouetteActor = vtk.vtkActor()
silhouetteActor.SetMapper(silhouetteMapper)
silhouetteActor.GetProperty().SetLineWidth(4)
silhouetteActor.GetProperty().SetColor(0, 0, 0) # Black
# Add silhouette actor to renderer
renderer.AddActor(silhouetteActor)
# Start rendering
renderWindow.Render()
renderWindowInteractor.Start()
```
![tmp](/uploads/6d7837b513493522e167535e5ba63513/tmp.png)
#### Not Working
Uncommenting:
```py
renderer.GetActiveCamera().SetParallelProjection(1)
```
Causes the silhouette to be inside the view of the circle:
![tmp2](/uploads/e8fa77555f17068b446cf4a3e3663f26/tmp2.png)https://gitlab.kitware.com/vtk/vtk/-/issues/18956Rendering fails when VTKHDF file is greater than 2 GB in size2023-11-06T03:33:27-05:00KayceeRendering fails when VTKHDF file is greater than 2 GB in sizeI would like to convert a stack of 2D PNG images into a VTKHDF file, and subsequently render a single slice of interest in an interactive window. When the VTKHDF file is less than 2 GB in size, the rendering works fine, but when it is gr...I would like to convert a stack of 2D PNG images into a VTKHDF file, and subsequently render a single slice of interest in an interactive window. When the VTKHDF file is less than 2 GB in size, the rendering works fine, but when it is greater than 2 GB, I get the following error.
```
HDF5-DIAG: Error detected in HDF5 (1.13.1) thread 0:
#000: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5D.c line 1021 in vtkhdf5_H5Dread(): can't synchronously read data
major: Dataset
minor: Read failed
#001: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5D.c line 970 in H5D__read_api_common(): can't read data
major: Dataset
minor: Read failed
#002: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5VLcallback.c line 2079 in vtkhdf5_H5VL_dataset_read(): dataset read failed
major: Virtual Object Layer
minor: Read failed
#003: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5VLcallback.c line 2046 in H5VL__dataset_read(): dataset read failed
major: Virtual Object Layer
minor: Read failed
#004: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5VLnative_dataset.c line 294 in vtkhdf5_H5VL__native_dataset_read(): can't read data
major: Dataset
minor: Read failed
#005: C:\glr\builds\vtk\vtk-ci-ext\0\ThirdParty\hdf5\vtkhdf5\src\H5Dio.c line 147 in vtkhdf5_H5D__read(): no output buffer
major: Invalid arguments to routine
minor: Bad value
2023-04-20 12:05:35.704 ( 10.539s) [ ]vtkHDFReaderImplementat:942 ERR| vtkHDFReader (0000027B47E4D300): Error H5Dread start: 0, 0, 0 count: 240, 3000, 3000
2023-04-20 12:05:35.755 ( 10.590s) [ ] vtkHDFReader.cxx:391 ERR| vtkHDFReader (0000027B47E4D300): Error reading array PNGImage
2023-04-20 12:05:35.764 ( 10.599s) [ ] vtkExecutive.cxx:741 ERR| vtkCompositeDataPipeline (0000027B47E52C20): Algorithm vtkHDFReader (0000027B47E4D300) returned failure for request: vtkInformation (0000027B47D383E0)
Debug: Off
Modified Time: 171
Reference Count: 1
Registered Events: (none)
Request: REQUEST_DATA
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0
2023-04-20 12:05:36.350 ( 11.186s) [ ] vtkImageData.cxx:1412 ERR| vtkImageData (0000027B47F0C870): No Scalar Field has been specified - assuming 1 component!
```
**Methods to reproduce:**
**Data**: I'm providing an example png image file as an attachment here. Please copy this file to a separate folder on your system and run the following script to generate several copies of the file in the same folder. We will create 300 copies and give each of them a unique name.
```
import shutil
folderName = r'path\to\data'
fileName = 'example00000.png'
for k in range(1, 300):
shutil.copy2(folderName + '\\' + fileName, folderName + r'\\example{}.png'.format(str(k).zfill(5))
```
**Code**: The code below will take as input the path to the folder containing these images (in folder_path variable) and create an HDF file in the same folder, plot a single slice using matplotlib, and then render the first slice using VTK. The num_images variable controls how many images you want to use to create the HDF file. If it is over 239, the resulting HDF file is over 2 GB and throws an error.
```
import h5py
from PIL import Image
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import glob
import vtk
def create_vtkhdf_dataset(output_file, image_dir, image_height, image_width, num_images, pixel_size_xy, pixel_size_z):
with h5py.File(output_file,'w') as hdffile:
# write support data
vtkhdf_group = hdffile.create_group("VTKHDF")
vtkhdf_group.attrs.create("Version", [1, 0])
vtkhdf_group.attrs.create("Type", np.string_("ImageData"))
whole_extent = (0, image_width-1, 0, image_height-1, 0, num_images-1)
vtkhdf_group.attrs.create("WholeExtent", whole_extent)
vtkhdf_group.attrs.create("Origin", (0.0, 0.0, 0.0))
vtkhdf_group.attrs.create("Spacing", (pixel_size_xy, pixel_size_xy, pixel_size_z))
vtkhdf_group.attrs.create("Direction", (1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0))
# create the pointdata group and the dataset inside it
field_data_group = vtkhdf_group.create_group("PointData")
field_data_group.attrs.create('Scalars', np.string_("PNGImage"))
dset = field_data_group.create_dataset('PNGImage',dtype=np.uint8,shape=(num_images,image_height,image_width))
image_filenames = glob.glob(image_dir + '\\*.png')
# Iterate over the PNG image files and add them to the dataset
for i, filename in enumerate(tqdm(image_filenames[:num_images])):
with Image.open(filename) as img:
img = np.asarray(img)
dset[i, :, :] = img.reshape((image_height, image_width))
# To access individual 2D image slices from the HDF5 file, we can define a method like this:
def get_image_slice(hdf5_file, index):
with h5py.File(hdf5_file, "r") as f:
img_data = f["VTKHDF"]["PointData"]["PNGImage"][index, :, :]
return img_data
def render_data(file):
reader = vtk.vtkHDFReader()
reader.SetFileName(file)
reader.Update()
# Instead, this worked when I took the reader output, but only when num_images = 238, not 240
outDS = reader.GetOutput()
outDS.GetPointData().SetScalars(outDS.GetPointData().GetArray("PNGImage"))
imageXY = vtk.vtkExtractVOI()
imageXY.SetInputConnection(reader.GetOutputPort())
imageXY.SetVOI(0, 2999, 0, 2999, 0, 0)
# This did not work - got the same error 'No scalar Field has been specified - assuming 1 component!'
# outDS = imageXY.GetOutput()
# outDS.GetPointData().SetScalars(outDS.GetPointData().GetArray("PNGImage"))
imageXY.Update()
XYSliceActor = vtk.vtkImageActor()
XYSliceActor.SetPosition(-1500, -1500, -500)
XYSliceActor.GetMapper().SetInputConnection(imageXY.GetOutputPort())
ip = vtk.vtkImageProperty()
ip.SetColorWindow(255)
ip.SetColorLevel(128)
ip.SetAmbient(0.0)
ip.SetDiffuse(1.0)
ip.SetOpacity(1.0)
ip.SetInterpolationTypeToLinear()
XYSliceActor.SetProperty(ip)
XYSliceActor.Update()
colors = vtk.vtkNamedColors()
# Create the Renderer
renderer = vtk.vtkRenderer()
renderer.AddActor(XYSliceActor)
renderer.ResetCamera()
renderer.SetBackground(colors.GetColor3d('Silver'))
# Create the RendererWindow
renderer_window = vtk.vtkRenderWindow()
renderer_window.AddRenderer(renderer)
renderer_window.SetWindowName('ReadImageData')
# Create the RendererWindowInteractor and display the VTKHDF file
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(renderer_window)
interactor.Initialize()
interactor.Start()
if __name__ == '__main__':
# Define the paths to the PNG images and the output HDF5 file
# Specify path to the PNG images
folder_path = r'path\to\data'
image_dir = folder_path
output_file = folder_path + '\stack.hdf'
image_height = 3000
image_width = 3000
# Works when this is 238, but not 240
num_images = 240
pixel_size = 1
pixel_size_z = 1
# Create the dataset
create_vtkhdf_dataset(output_file, image_dir, image_height, image_width, num_images, pixel_size, pixel_size_z)
# The method takes the path to the HDF5 file and the index of the image slice to retrieve.
# It returns the image data as a numpy array.
# Example usage:
img_slice = get_image_slice(output_file, num_images - 10)
plt.imshow(img_slice)
plt.show()
render_data(output_file)
```
Any help would be really appreciated. The goal here is to find a format that will let me convert a large number of 2D png images into a format with significantly fewer files and render a single slice. The memory on my computer is limited, so I do need the file format conversion to happen one image at a time. I will not be able to create a numpy array with all the data beforehand. The rendering should not read the full dataset into memory either, just the requested 2D slice.
Tagging @julien.fausty based on our discussion on Discourse.
Please let me know if you need any additional information.
Thanks,
Chaitanya
![example00000](/uploads/a60e9d4ee1718d98b7af1d3c91095ffb/example00000.png)https://gitlab.kitware.com/vtk/vtk/-/issues/19133Extend template instantiation for Python wrapping2023-11-02T10:36:16-04:00David GobbiExtend template instantiation for Python wrappingThe Python wrappers can handle C++ class templates, when they are able to guess which instantiations of those templates need to be wrapped. As an example, when array templates such as `vtkSOADataArrayTemplate` are wrapped, Python classes...The Python wrappers can handle C++ class templates, when they are able to guess which instantiations of those templates need to be wrapped. As an example, when array templates such as `vtkSOADataArrayTemplate` are wrapped, Python classes are generated for `vtkSOADataArrayTemplate<double>`, `vtkSOADataArrayTemplate<long long>`, etc. The wrappers do this because they are aware of which types are used by `vtkInstantiateTemplateMacro` (from `vtkType.h`), and they know that VTK uses this macro to instantiate its array templates.
But what happens when the wrappers encounter a class template, but cannot guess how it will be instantiated? A recent example of this is `vtkTemporalAlgorithm` in `CommonExecutionModel`:
```c++
template <class AlgorithmT>
class vtkTemporalAlgorithm : public AlgorithmT
```
Wrapping instances of this template is easy in theory, but when we're wrapping `vtkTemporalAlgorithm.h`, we don't yet know what what `AlgorithmT` might be. We don't know that until we encounter an instantiation, e.g. in `vtkTemporalStatistics.h`:
```c++
#include "vtkPassInputTypeAlgorithm.h"
#include "vtkTemporalAlgorithm.h"
class vtkTemporalStatistics : public vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>
```
Currently, `vtkTemporalStatistics` is wrapped by using a preprocessor trick to fool the wrappers into seeing the following declaration instead, which removes `vtkTemporalAlgorithm` and inherits directly from `vtkPassInputTypeAlgorithm`:
```c++
class vtkTemporalStatistics : public vtkPassInputTypeAlgorithm
```
For more information on how this trick is implemented, see [these comments in the header file](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10104/diffs?commit_id=8cfb0c28c956745128de60edc9fa47dd18922720#938aa20d190c39b72e9047e3f3d415e649d2181c_0_45 "New `NO_PRIOR_TEMPORAL_ACCESS` key for in situ"). This trick comes at a cost, because the wrappers miss any APIs that were defined in `vtkTemporalAlgorithm`.
To avoid this trick and its costs, we need to wrap `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>` _during_ the wrapping of `vtkTemporalStatistics.h`. In other words, when the wrappers see `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>` in `vtkTemporalStatistics.h`, they have to find the definition of `vtkTemporalAlgorithm` in `vtkTemporalAlgorithm.h`, and then generate a wrapper class for `vtkTemporalAlgorithm<vtkPassInputTypeAlgorithm>`. Implementing this would take some work, but it's doable. And it's also a very general answer to the question "how can the wrappers know which template instantiations need to be wrapped?".
As a general solution, this "automated instantiation" would have to handle the situations where the same template instantiation occurs multiple times. Take the simple example of the fictitious instantiation `vtkMyClass<int>`. Even if this instantiation appears multiple times in the same header file, we only want to generate the class wrapper code for it once. This would be easy to do, since `vtkWrapPython.c` would know if the class wrapper for `vtkMyClass<int>` had already been generated. If `vtkMyClass<int>` appears in more than one wrapped header, or perhaps even in different modules, then some kind of global mechanism would be needed to ensure that only one Python class object for `vtkMyClass<int>` is created. Since module-loading occurs at runtime, the Python `vtkMyClass` template object would have to keep a list of which instantiations of this template had been loaded.
Since a substantial (but measurable) amount of work would be needed to resolve this issue, it's worth asking, should we fix it? Currently, there is a documented work-around for `vtkTemporalAlgorithm` (which entails hiding vtkTemporalAlgorithm from the wrappers). But if templated VTK filters become more widespread, then a more general solution (like the one discussed above) might become necessary.https://gitlab.kitware.com/vtk/vtk/-/issues/17522vtkBillboardTextActor3D's transformation is ignored when in a vtkAssembly2023-11-02T05:11:50-04:00Jonathan JacksonvtkBillboardTextActor3D's transformation is ignored when in a vtkAssemblyWhen creating a vtkBillboardTextActor3D as such:
```
vtkBillboardTextActor3D* textActor = vtkBillboardTextActor3D::New();
textActor->SetInput("testaaarossslaaa");
textActor->SetPosition(6.0, 6.0, 6.0);
textActor->GetTextProperty()->S...When creating a vtkBillboardTextActor3D as such:
```
vtkBillboardTextActor3D* textActor = vtkBillboardTextActor3D::New();
textActor->SetInput("testaaarossslaaa");
textActor->SetPosition(6.0, 6.0, 6.0);
textActor->GetTextProperty()->SetFontSize(12);
textActor->GetTextProperty()->SetColor(1.0, 1.0, .4);
textActor->GetTextProperty()->SetJustificationToCentered();
```
And adding it to a vtkAssembly as such
```
vtkAssembly* assembly = vtkAssembly::New();
assembly->AddPart(textActor);
renderer->AddActor(assembly)
```
The vtkBillboardTextActor3D will always be shown at the origin whereas if
we add it directly to the vtkRenderer, it will properly show up at {6.0, 6.0, 6.0}
```
renderer->AddActor(textActor)
```https://gitlab.kitware.com/vtk/vtk/-/issues/19150vtkMultiVolume remove and add again will slow render2023-11-02T05:06:55-04:00hgyxb llvtkMultiVolume remove and add again will slow renderversion:VTK-9.3.0.rc1
repeat step:
1. add a vtkMultiVolume to window, e.g. m_pRender->AddViewProp(prop)
2. remove it, e.g. m_pRender->RemoveViewProp(prop);
3. add the vtkMultiVolume to window again, e.g. m_pRender->AddViewProp(prop)
4....version:VTK-9.3.0.rc1
repeat step:
1. add a vtkMultiVolume to window, e.g. m_pRender->AddViewProp(prop)
2. remove it, e.g. m_pRender->RemoveViewProp(prop);
3. add the vtkMultiVolume to window again, e.g. m_pRender->AddViewProp(prop)
4. do some render, it will render slow than do some render at step 1.
I compare the code difference, it's difference is as below:
```c++
void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren, vtkVolume* vol){
...
// when at step 3,
// below NeedToInitializeResources is always true, this->Impl->InitializationTime.ModifiedTime is always 0
// so this->Impl->UpdateInputs(ren, vol) will always Initialize Resources, and it slow render.
this->Impl->NeedToInitializeResources =
(this->Impl->ReleaseResourcesTime.GetMTime() > this->Impl->InitializationTime.GetMTime());
this->ComputeReductionFactor(vol->GetAllocatedRenderTime());
if (!this->Impl->SharedDepthTextureObject)
{
this->Impl->CaptureDepthTexture(ren);
}
vtkMTimeType renderPassTime = this->GetRenderPassStageMTime(vol);
const auto multiVol = vtkMultiVolume::SafeDownCast(vol);
this->Impl->MultiVolume = multiVol && this->GetInputCount() > 1 ? multiVol : nullptr;
this->Impl->ClearRemovedInputs(renWin);
if (!this->Impl->UpdateInputs(ren, vol))
{
return;
}
}
```https://gitlab.kitware.com/vtk/vtk/-/issues/19149Fix PIMPL error reporting clean up2023-10-30T22:26:52-04:00Stephen McDowellFix PIMPL error reporting clean upA client prepared a fix to the error reporting for `vtkPNGReader` and we looked around and found a handful of other cases worth addressing. PIMPL classes should not be lazy and drop an attached object just because `this` is not a `vtkOb...A client prepared a fix to the error reporting for `vtkPNGReader` and we looked around and found a handful of other cases worth addressing. PIMPL classes should not be lazy and drop an attached object just because `this` is not a `vtkObject` provided it has access to a valid instance.
- [ ] `vtkPNGReader` ([prototype](https://github.com/RobotLocomotion/drake/commit/4972f631ce189a09e5272b5e2716201b3156d298), VTK MR: [todo @svenevs])
- [ ] `vtkHyperTreeGridGeometricLocator::RecurseTreesFunctor`
- [ ] `ComputeHTGCellsInFrustumFunctor`
- [ ] `vtkClipDataSet::RequestData`
- [ ] `FieldsWorker` in `Filters/HyperTree/vtkHyperTreeGridGradient.cxx`
- [ ] various instances in `IO/Geometry/vtkGLTFReader.cxx`
- [ ] `CreateVTKTextureFromGLTFTexture`
- [ ] `ComputeFunctor::Execute in IO/Parallel/vtkMultiBlockPLOT3DReader.cxx`
- [ ] various instances in `vtkOpenXRManager`
CC @ben.boeckel @mwestphal @yohann.bearzihttps://gitlab.kitware.com/vtk/vtk/-/issues/19147OBJ Reader regression, cells with bad points2023-10-30T10:50:15-04:00Charles GueunetOBJ Reader regression, cells with bad pointsOpening [this obj file](/uploads/74a7e9796d10248011e07e58bc70dd18/valve.obj) with the current VTK Obj reader leads to a few invalid cells, here is a ParaView screenshot:
![image](/uploads/9d1321d89ca214ee0fde45147b6a30f9/image.png)
Som...Opening [this obj file](/uploads/74a7e9796d10248011e07e58bc70dd18/valve.obj) with the current VTK Obj reader leads to a few invalid cells, here is a ParaView screenshot:
![image](/uploads/9d1321d89ca214ee0fde45147b6a30f9/image.png)
Somehow, the bug appeared between ParaView 5.11.0 and 5.11.1, as this file opens perfectly in ParaView 5.11.0.https://gitlab.kitware.com/vtk/vtk/-/issues/19146build qt6.6+emscripten3.1.37+vtk9.3 failed2023-10-29T20:47:16-04:00Raymond Chenbuild qt6.6+emscripten3.1.37+vtk9.3 failedHello,
I am tring to build VTK with QT in Emscripten but the build status is failed.
- vtk: I am using `master` branch at commit `45dc32e949`
- qt: version is 6.6.0. qt is supported to be build on emscripten https://doc-snapshots.qt.io...Hello,
I am tring to build VTK with QT in Emscripten but the build status is failed.
- vtk: I am using `master` branch at commit `45dc32e949`
- qt: version is 6.6.0. qt is supported to be build on emscripten https://doc-snapshots.qt.io/qt6-dev/wasm.html
- emscritpen: 3.1.37
## the build info
```
Consolidate compiler generated dependencies of target kissfft
Consolidate compiler generated dependencies of target zlib
Consolidate compiler generated dependencies of target pugixml
Consolidate compiler generated dependencies of target fmt
Consolidate compiler generated dependencies of target verdict
Consolidate compiler generated dependencies of target token
Consolidate compiler generated dependencies of target jpeg
Consolidate compiler generated dependencies of target vtksys
[ 0%] Built target kissfft
[ 1%] Built target zlib
Consolidate compiler generated dependencies of target glew
[ 2%] Built target jpeg
[ 2%] Built target pugixml
[ 2%] Built target fmt
Consolidate compiler generated dependencies of target doubleconversion
[ 2%] Built target glew
Consolidate compiler generated dependencies of target lz4
[ 2%] Built target token
Consolidate compiler generated dependencies of target expat
[ 3%] Built target verdict
[ 3%] Built target vtksys
Consolidate compiler generated dependencies of target ogg
[ 3%] Built target lz4
Consolidate compiler generated dependencies of target lzma
Consolidate compiler generated dependencies of target jsoncpp
[ 3%] Built target expat
[ 4%] Built target doubleconversion
Consolidate compiler generated dependencies of target libxml2
Consolidate compiler generated dependencies of target tokenize
[ 4%] Built target ogg
Consolidate compiler generated dependencies of target png
[ 5%] Built target jsoncpp
Consolidate compiler generated dependencies of target tiff
[ 6%] Built target png
[ 6%] Built target tokenize
[ 7%] Built target libxml2
[ 9%] Built target lzma
Consolidate compiler generated dependencies of target metaio
Consolidate compiler generated dependencies of target freetype
Consolidate compiler generated dependencies of target theora
[ 10%] Built target tiff
Consolidate compiler generated dependencies of target libharu
[ 11%] Built target theora
[ 13%] Built target libharu
[ 14%] Built target freetype
[ 15%] Built target metaio
Consolidate compiler generated dependencies of target CommonCore
[ 23%] Built target CommonCore
Consolidate compiler generated dependencies of target DICOMParser
Consolidate compiler generated dependencies of target CommonSystem
Consolidate compiler generated dependencies of target CommonMath
[ 23%] Built target DICOMParser
[ 23%] Built target CommonSystem
[ 24%] Built target CommonMath
Consolidate compiler generated dependencies of target CommonMisc
Consolidate compiler generated dependencies of target CommonTransforms
[ 24%] Built target CommonMisc
[ 25%] Built target CommonTransforms
Consolidate compiler generated dependencies of target CommonDataModel
[ 33%] Built target CommonDataModel
Consolidate compiler generated dependencies of target CommonColor
[ 33%] Built target CommonColor
Consolidate compiler generated dependencies of target CommonComputationalGeometry
Consolidate compiler generated dependencies of target CommonExecutionModel
[ 34%] Built target CommonComputationalGeometry
[ 36%] Built target CommonExecutionModel
Consolidate compiler generated dependencies of target FiltersTopology
Consolidate compiler generated dependencies of target IOMovie
Consolidate compiler generated dependencies of target IOVideo
Consolidate compiler generated dependencies of target FiltersTensor
Consolidate compiler generated dependencies of target ImagingMath
[ 36%] Built target FiltersTopology
[ 36%] Built target IOMovie
[ 36%] Built target IOVideo
[ 36%] Built target FiltersTensor
Consolidate compiler generated dependencies of target FiltersProgrammable
Consolidate compiler generated dependencies of target IOCore
Consolidate compiler generated dependencies of target FiltersGeometryPreview
Consolidate compiler generated dependencies of target FiltersSelection
Consolidate compiler generated dependencies of target FiltersReduction
Consolidate compiler generated dependencies of target ImagingCore
[ 37%] Built target ImagingMath
[ 37%] Built target FiltersProgrammable
[ 37%] Built target FiltersGeometryPreview
[ 37%] Built target FiltersSelection
Consolidate compiler generated dependencies of target IOOggTheora
[ 38%] Built target FiltersReduction
[ 38%] Built target IOOggTheora
[ 39%] Built target IOCore
Consolidate compiler generated dependencies of target IOTecplotTable
Consolidate compiler generated dependencies of target IOPLY
Consolidate compiler generated dependencies of target IOXMLParser
[ 40%] Built target IOTecplotTable
[ 40%] Built target IOPLY
Consolidate compiler generated dependencies of target FiltersCore
[ 40%] Built target IOXMLParser
Consolidate compiler generated dependencies of target IOLegacy
[ 41%] Built target ImagingCore
Consolidate compiler generated dependencies of target IOLSDyna
Consolidate compiler generated dependencies of target ImagingStencil
Consolidate compiler generated dependencies of target ImagingSources
Consolidate compiler generated dependencies of target ImagingColor
[ 41%] Built target IOLSDyna
Consolidate compiler generated dependencies of target IOImage
[ 42%] Built target ImagingStencil
Consolidate compiler generated dependencies of target IOXML
Consolidate compiler generated dependencies of target ImagingStatistics
[ 42%] Built target ImagingSources
[ 43%] Built target ImagingColor
Consolidate compiler generated dependencies of target ImagingFourier
[ 43%] Built target ImagingStatistics
Consolidate compiler generated dependencies of target ImagingGeneral
[ 44%] Built target IOLegacy
[ 44%] Built target ImagingFourier
Consolidate compiler generated dependencies of target ParallelCore
[ 45%] Built target ImagingGeneral
[ 46%] Built target ParallelCore
[ 47%] Built target IOImage
Consolidate compiler generated dependencies of target IOSegY
[ 48%] Built target IOXML
Consolidate compiler generated dependencies of target ImagingMorphological
Consolidate compiler generated dependencies of target ImagingHybrid
Consolidate compiler generated dependencies of target IOAsynchronous
[ 48%] Built target IOSegY
[ 48%] Built target IOAsynchronous
Consolidate compiler generated dependencies of target IOParallelXML
[ 48%] Built target ImagingMorphological
[ 48%] Built target ImagingHybrid
[ 48%] Built target IOParallelXML
[ 51%] Built target FiltersCore
Consolidate compiler generated dependencies of target FiltersAMR
Consolidate compiler generated dependencies of target FiltersGeometry
Consolidate compiler generated dependencies of target FiltersCellGrid
[ 52%] Built target FiltersAMR
[ 52%] Built target FiltersGeometry
[ 53%] Built target FiltersCellGrid
Consolidate compiler generated dependencies of target FiltersVerdict
Consolidate compiler generated dependencies of target IOCellGrid
[ 53%] Built target FiltersVerdict
[ 54%] Built target IOCellGrid
Consolidate compiler generated dependencies of target FiltersGeneral
[ 58%] Built target FiltersGeneral
Consolidate compiler generated dependencies of target ParallelDIY
Consolidate compiler generated dependencies of target FiltersSMP
Consolidate compiler generated dependencies of target IOEnSight
Consolidate compiler generated dependencies of target FiltersTexture
Consolidate compiler generated dependencies of target FiltersHyperTree
Consolidate compiler generated dependencies of target FiltersStatistics
[ 58%] Built target ParallelDIY
[ 58%] Built target FiltersSMP
[ 58%] Built target IOEnSight
[ 58%] Built target FiltersTexture
Consolidate compiler generated dependencies of target FiltersSources
[ 59%] Built target FiltersHyperTree
[ 60%] Built target FiltersStatistics
Consolidate compiler generated dependencies of target FiltersImaging
[ 60%] Built target FiltersImaging
Consolidate compiler generated dependencies of target FiltersExtraction
[ 61%] Built target FiltersSources
Consolidate compiler generated dependencies of target FiltersGeneric
Consolidate compiler generated dependencies of target FiltersModeling
[ 62%] Built target FiltersGeneric
[ 63%] Built target FiltersExtraction
[ 64%] Built target FiltersModeling
Consolidate compiler generated dependencies of target IOCityGML
Consolidate compiler generated dependencies of target RenderingCore
[ 64%] Built target IOCityGML
Consolidate compiler generated dependencies of target FiltersFlowPaths
Consolidate compiler generated dependencies of target FiltersPoints
[ 65%] Built target FiltersFlowPaths
[ 66%] Built target FiltersPoints
[ 71%] Built target RenderingCore
Consolidate compiler generated dependencies of target TestingRendering
Consolidate compiler generated dependencies of target RenderingUI
Consolidate compiler generated dependencies of target RenderingLOD
Consolidate compiler generated dependencies of target RenderingImage
Consolidate compiler generated dependencies of target RenderingFreeType
Consolidate compiler generated dependencies of target InteractionStyle
[ 71%] Built target RenderingLOD
[ 71%] Built target TestingRendering
Consolidate compiler generated dependencies of target FiltersHybrid
[ 72%] Built target RenderingImage
[ 72%] Built target RenderingUI
[ 72%] Built target RenderingFreeType
Consolidate compiler generated dependencies of target RenderingVolume
Consolidate compiler generated dependencies of target DomainsChemistry
Consolidate compiler generated dependencies of target RenderingSceneGraph
Consolidate compiler generated dependencies of target RenderingContext2D
Consolidate compiler generated dependencies of target RenderingAnnotation
[ 72%] Built target InteractionStyle
[ 73%] Built target RenderingSceneGraph
Consolidate compiler generated dependencies of target InfovisCore
[ 73%] Built target DomainsChemistry
[ 74%] Built target FiltersHybrid
Consolidate compiler generated dependencies of target RenderingVtkJS
Consolidate compiler generated dependencies of target RenderingLabel
Consolidate compiler generated dependencies of target RenderingHyperTreeGrid
Consolidate compiler generated dependencies of target IOChemistry
[ 74%] Built target RenderingVtkJS
[ 74%] Built target RenderingHyperTreeGrid
[ 75%] Built target RenderingVolume
[ 75%] Built target RenderingContext2D
[ 76%] Built target RenderingAnnotation
Consolidate compiler generated dependencies of target FiltersTemporal
[ 76%] Built target IOChemistry
[ 76%] Built target RenderingLabel
[ 76%] Built target FiltersTemporal
Consolidate compiler generated dependencies of target IOGeometry
Consolidate compiler generated dependencies of target FiltersParallel
[ 77%] Built target InfovisCore
[ 78%] Built target IOGeometry
Consolidate compiler generated dependencies of target IOInfovis
Consolidate compiler generated dependencies of target IOMotionFX
Consolidate compiler generated dependencies of target IOImport
Consolidate compiler generated dependencies of target ChartsCore
Consolidate compiler generated dependencies of target InfovisLayout
Consolidate compiler generated dependencies of target IOExport
[ 78%] Built target IOMotionFX
Consolidate compiler generated dependencies of target RenderingOpenGL2
[ 78%] Built target IOImport
[ 79%] Built target IOInfovis
Consolidate compiler generated dependencies of target IOFDS
[ 79%] Built target IOFDS
[ 81%] Built target FiltersParallel
[ 82%] Built target IOExport
Consolidate compiler generated dependencies of target FiltersParallelImaging
Consolidate compiler generated dependencies of target IOParallel
Consolidate compiler generated dependencies of target IOExportPDF
[ 82%] Built target IOExportPDF
[ 82%] Built target FiltersParallelImaging
[ 83%] Built target ChartsCore
[ 84%] Built target InfovisLayout
[ 85%] Built target IOParallel
[ 91%] Built target RenderingOpenGL2
Consolidate compiler generated dependencies of target DomainsChemistryOpenGL2
Consolidate compiler generated dependencies of target RenderingVolumeOpenGL2
[ 91%] Built target DomainsChemistryOpenGL2
[ 92%] Built target RenderingVolumeOpenGL2
Consolidate compiler generated dependencies of target InteractionWidgets
[ 97%] Built target InteractionWidgets
Consolidate compiler generated dependencies of target InteractionImage
Consolidate compiler generated dependencies of target ViewsCore
[ 97%] Automatic MOC for target GUISupportQt
[ 98%] Built target InteractionImage
[ 98%] Built target ViewsCore
Consolidate compiler generated dependencies of target ViewsContext2D
[ 98%] Built target ViewsContext2D
Consolidate compiler generated dependencies of target ViewsInfovis
[ 99%] Built target ViewsInfovis
[ 99%] Built target GUISupportQt_autogen
[ 99%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/GUISupportQt_autogen/mocs_compilation.cpp.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKApplication.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKInteractor.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKOpenGLNativeWidget.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QFilterTreeProxyModel.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKOpenGLStereoWidget.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKOpenGLWindow.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKInteractorAdapter.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKRenderWindowAdapter.cxx.o
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKTableModelAdapter.cxx.o
/home/chenruifeng/projects/packages/vtk/master/vtk/GUISupport/Qt/QVTKOpenGLWindow.cxx:255:43: error: use of undeclared identifier 'GL_BACK_LEFT'
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
^
/home/chenruifeng/projects/packages/vtk/master/vtk/GUISupport/Qt/QVTKOpenGLWindow.cxx:257:43: error: use of undeclared identifier 'GL_BACK_RIGHT'
this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize));
^
/home/chenruifeng/projects/packages/vtk/master/vtk/GUISupport/Qt/QVTKOpenGLWindow.cxx:262:43: error: use of undeclared identifier 'GL_BACK_LEFT'
this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
^
3 errors generated.
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/vtkEventQtSlotConnect.cxx.o
em++: error: '/home/chenruifeng/projects/packages/emsdk_qt/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -I/home/chenruifeng/projects/packages/emsdk_qt/upstream/emscripten/cache/sysroot/include/SDL2 --sysroot=/home/chenruifeng/projects/packages/emsdk_qt/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DGLEW_STATIC -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -Dkiss_fft_scalar=double -DvtkRenderingCore_AUTOINIT_INCLUDE="/home/chenruifeng/projects/packages/vtk/wasm/build_qt/CMakeFiles/vtkModuleAutoInit_be7301261a49b13d6a9b1d9e110eacd8.h" -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/GUISupport/Qt/GUISupportQt_autogen/include -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/GUISupport/Qt -I/home/chenruifeng/projects/packages/vtk/master/vtk/GUISupport/Qt -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/Core -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/Core -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/token/vtktoken/token -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/token/vtktoken/token -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/token/vtktoken -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/token/vtktoken -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/nlohmannjson/vtknlohmannjson -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/nlohmannjson/vtknlohmannjson -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/nlohmannjson/vtknlohmannjson/include -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Rendering/Core -I/home/chenruifeng/projects/packages/vtk/master/vtk/Rendering/Core -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/DataModel -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/DataModel -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/Math -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/Math -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/kissfft/vtkkissfft -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/kissfft/vtkkissfft -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/Transforms -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/Transforms -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/ExecutionModel -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/ExecutionModel -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Filters/Core -I/home/chenruifeng/projects/packages/vtk/master/vtk/Filters/Core -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/Misc -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/Misc -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Rendering/OpenGL2 -I/home/chenruifeng/projects/packages/vtk/master/vtk/Rendering/OpenGL2 -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Filters/General -I/home/chenruifeng/projects/packages/vtk/master/vtk/Filters/General -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/IO/Image -I/home/chenruifeng/projects/packages/vtk/master/vtk/IO/Image -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Imaging/Core -I/home/chenruifeng/projects/packages/vtk/master/vtk/Imaging/Core -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Rendering/HyperTreeGrid -I/home/chenruifeng/projects/packages/vtk/master/vtk/Rendering/HyperTreeGrid -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Rendering/UI -I/home/chenruifeng/projects/packages/vtk/master/vtk/Rendering/UI -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/glew/vtkglew -I/home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/glew/vtkglew -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Interaction/Widgets -I/home/chenruifeng/projects/packages/vtk/master/vtk/Interaction/Widgets -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Filters/Sources -I/home/chenruifeng/projects/packages/vtk/master/vtk/Filters/Sources -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Rendering/Context2D -I/home/chenruifeng/projects/packages/vtk/master/vtk/Rendering/Context2D -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Common/System -I/home/chenruifeng/projects/packages/vtk/master/vtk/Common/System -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Filters/Extraction -I/home/chenruifeng/projects/packages/vtk/master/vtk/Filters/Extraction -I/home/chenruifeng/projects/packages/vtk/wasm/build_qt/Interaction/Style -I/home/chenruifeng/projects/packages/vtk/master/vtk/Interaction/Style -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/Utilities/KWIML -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/Utilities/KWIML -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/Utilities/KWSys -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/Utilities/KWSys -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/token -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/token -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/nlohmannjson -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/nlohmannjson -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/kissfft -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/kissfft -isystem /home/chenruifeng/projects/packages/vtk/wasm/build_qt/ThirdParty/glew -isystem /home/chenruifeng/projects/packages/vtk/master/vtk/ThirdParty/glew -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include/QtOpenGL -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include/QtCore -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/mkspecs/wasm-emscripten -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include/QtGui -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include/QtWidgets -isystem /home/chenruifeng/projects/packages/qt/wasm/qtbase/include/QtOpenGLWidgets -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++17 -MD -MT GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKOpenGLWindow.cxx.o -MF CMakeFiles/GUISupportQt.dir/QVTKOpenGLWindow.cxx.o.d -c /home/chenruifeng/projects/packages/vtk/master/vtk/GUISupport/Qt/QVTKOpenGLWindow.cxx -o CMakeFiles/GUISupportQt.dir/QVTKOpenGLWindow.cxx.o' failed (returned 1)
[100%] Building CXX object GUISupport/Qt/CMakeFiles/GUISupportQt.dir/vtkQWidgetRepresentation.cxx.o
gmake[2]: *** [GUISupport/Qt/CMakeFiles/GUISupportQt.dir/build.make:182: GUISupport/Qt/CMakeFiles/GUISupportQt.dir/QVTKOpenGLWindow.cxx.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:5512: GUISupport/Qt/CMakeFiles/GUISupportQt.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
```
the error is raised at `vtk/GUISupport/Qt/QVTKOpenGLWindow.cxx:255:43: error: use of undeclared identifier 'GL_BACK_LEFT'`
and I also see some issues about this
- https://discourse.vtk.org/t/is-it-possible-to-build-vtkguisupportqt-in-wasm/11078
- https://discourse.vtk.org/t/is-it-possible-to-build-vtkguisupportqt-in-webassembly/11076/5
can you give me some advices?
Thankshttps://gitlab.kitware.com/vtk/vtk/-/issues/19145vtkPythonStdStreamCaptureHelper: support doctests2023-10-27T13:16:05-04:00Ben BoeckelvtkPythonStdStreamCaptureHelper: support doctestsOur stream wrapper is missing some APIs to faithfully impersonate a stream: https://docs.python.org/3/library/io.html#id1
Cc: @dgobbiOur stream wrapper is missing some APIs to faithfully impersonate a stream: https://docs.python.org/3/library/io.html#id1
Cc: @dgobbihttps://gitlab.kitware.com/vtk/vtk/-/issues/19134[VTK 9.2.2] QQuickVTKRenderItem captureScreenshot() always returns the first ...2023-10-25T11:28:54-04:00Antonio Capobianco[VTK 9.2.2] QQuickVTKRenderItem captureScreenshot() always returns the first captured screenshotCalling captureScreenshot() of QQuickVTKRenderItem class will always return the same vtkImageData generated on the first call.
Used environment:
- Qt 6.5.2
- VTK 9.2.2
- MSVC2019 64bit
- Compiler: Microsoft Visual C++ Compiler 16.11.32...Calling captureScreenshot() of QQuickVTKRenderItem class will always return the same vtkImageData generated on the first call.
Used environment:
- Qt 6.5.2
- VTK 9.2.2
- MSVC2019 64bit
- Compiler: Microsoft Visual C++ Compiler 16.11.32510.428 (amd64)
- CMake 3.21.1
- Example to reproduce the issue: [conesrc.zip](/uploads/37f09cf4db5645ad785ece0b4ae1fae0/conesrc.zip)https://gitlab.kitware.com/vtk/vtk/-/issues/19138Please clarify DataArray byte array format requirements for .vtu files2023-10-23T11:25:46-04:00samuelpmishPlease clarify DataArray byte array format requirements for .vtu filesHi,
I'm trying to target .vtu output for a meshing tool, and when implementing the official file format specification here:
https://examples.vtk.org/site/VTKFileFormats/#unstructuredgrid
there seem to be important aspects of the forma...Hi,
I'm trying to target .vtu output for a meshing tool, and when implementing the official file format specification here:
https://examples.vtk.org/site/VTKFileFormats/#unstructuredgrid
there seem to be important aspects of the formatting that are never mentioned. The byte arrays in <DataArray> tags are apparently supposed to have a header that encodes the number of (unencoded) bytes in the array (which is surprising, because base64 encodings need no such header). I only figured this out after several hours of debugging and eventually finding a helpful unofficial document about the format here: https://www.earthmodels.org/software/vtk-and-paraview/vtk-file-formats
Can https://examples.vtk.org/site/VTKFileFormats/ please be updated to better reflect the file format requirements (specifically, byte array header requirements for compressed/uncompressed data)? At present, this official page is the top search result, so it's important to completely document the file format requirements!
Thank you,
Samhttps://gitlab.kitware.com/vtk/vtk/-/issues/19135vtkColorTransferFunction + vtkImageData: Unexpected NaN opacity?2023-10-23T04:51:54-04:00MG HuvtkColorTransferFunction + vtkImageData: Unexpected NaN opacity?When I rendering an ImageData with many nan value, it works expected when the opacity of the lowest value is 0.0. Otherwise the nan value is still visible. How to always hide the nan value.
Opacity setting:
`
value_rng = img.GetSca...When I rendering an ImageData with many nan value, it works expected when the opacity of the lowest value is 0.0. Otherwise the nan value is still visible. How to always hide the nan value.
Opacity setting:
`
value_rng = img.GetScalarRange()
opacity_pf = vtkPiecewiseFunction()
opacity_pf.AddPoint(value_rng[0], 0.2) # the NaN value is still visible unless 0.0 here!
opacity_pf.AddPoint(value_rng[1], 1.0)
`
Color setting:
`
color_tf = vtkColorTransferFunction()
color_tf.AddRGBPoint(value_rng[0], 1.0, 0.0, 0.0) # red for low value
color_tf.AddRGBPoint(valur_rng[1], 0.0, 0.0, 1.0) # green for high value
color_tf.SetNanOpacity(0.0) # has no effect
color_tf.Build()
`
A demo is attached here, all eight corners in the demo cubic are expected to be opacity (invisible).
![vtkVolume_NaN](/uploads/d4ed93a6755983486128d522fe749481/vtkVolume_NaN.png)
[vtkVolume_NaN.py](/uploads/3cf238e3403de47d56d4fba5e0f9c535/vtkVolume_NaN.py)https://gitlab.kitware.com/vtk/vtk/-/issues/19073QVTKOpenGLNativeWidget Mac trackpad events appear incorrect in VTK (9.1, 9.2,...2023-10-20T10:49:54-04:00stewartboogertQVTKOpenGLNativeWidget Mac trackpad events appear incorrect in VTK (9.1, 9.2, 9.3-rc2) with Qt6QVTKOpenGLNativeWidget appears to send a left-mouse-down event when the cursor is moved over the widget in Qt6. This is using a standard apple laptop trackpad and this issue does not occur with an external mouse. So moving the cursor (wi...QVTKOpenGLNativeWidget appears to send a left-mouse-down event when the cursor is moved over the widget in Qt6. This is using a standard apple laptop trackpad and this issue does not occur with an external mouse. So moving the cursor (without clicking) over the widget causes the model to rotate with the default interactor.
This is reproducible with the [Minimal VTK-Qt app](https://examples.vtk.org/site/Cxx/Qt/MinimalQtVTKApp/) for VTK 9.1, 9.2, 9.3-rc2, master (18e8040) in Qt6 (tested with Ventura 13.5, Qt 6.5.1 from homebrew). Qt 5.15.10 with VTK 9.1, 9.2, 9.3-rc2 and master (18e8040) does not appear to have a problemhttps://gitlab.kitware.com/vtk/vtk/-/issues/19057vtkFiltersHybrid should be split into more modules2023-10-19T17:54:30-04:00Mathieu Westphal (Kitware)vtkFiltersHybrid should be split into more modulesvtkFiltersHybrid contains two types of filters, temporal manipulation filters and rendering related filters. I'm not sure as to what was that module supposed to contain initially but the dependency against vtkRenderingCore makes most of ...vtkFiltersHybrid contains two types of filters, temporal manipulation filters and rendering related filters. I'm not sure as to what was that module supposed to contain initially but the dependency against vtkRenderingCore makes most of the filters here unusable in other core filters.
The following filters should be moved into their own rendering related module (`Filters/Rendering` ):
- vtkAdaptiveDataSetSurfaceFilter
- vtkDepthSortPolyData
- vtkPolyDataSilhouette
- vtkRenderLargeImage
The following filters should be moved into their own temporal related modele (`Filters/Temporal` /):
- vtkDSPFilterGroup/vtkDSPFilterDefinition
- vtkForceTime
- vtkGenerateTimeSteps
- vtkTemporal*
Other filters should be moved to other related modules:
- vtkBSplineTransform/vtkGridTransform -> Common/Transform
- vtkEarthSource -> Filters/Sources
- vtkFacetReader -> IO/Geometry
- vtkGreedyTerrainDecimation -> Filters/General
- vtkWeightedTransformFilter -> Filters/General
- vtkImageToPolyDataFilter -> Filters/General
- vtkImplicitModeler -> Filters/General
- vtkPCAAnalysisFilter -> Filters/General
- vtkProcrustesAlignmentFilter -> Filters/General
- vtkProjectedTerrainPath -> Filters/General
- vtkTransformToGrid -> Filters/Generalhttps://gitlab.kitware.com/vtk/vtk/-/issues/17746Wrong node numbering for high-order Lagrange hexahedron and tetrahedron cells2023-10-19T13:01:29-04:00Florian MaurinWrong node numbering for high-order Lagrange hexahedron and tetrahedron cellsThe node numbering used in the code is not corresponding to the one provided by the documentation that can be found here:
https://blog.kitware.com/wp-content/uploads/2018/09/Source_Issue_43.pdf
Here is the high resolution pdf, to be ab...The node numbering used in the code is not corresponding to the one provided by the documentation that can be found here:
https://blog.kitware.com/wp-content/uploads/2018/09/Source_Issue_43.pdf
Here is the high resolution pdf, to be able to zoom on the node numbers!
[VtkLagrangeNodeNumbering.pdf](/uploads/d18be24480da192e4b70568f050d114f/VtkLagrangeNodeNumbering.pdf)
@dcthomp, @bob.obara, and @tjcorona
![image](/uploads/a0dc0173a41d3cf6b03a9266c0e23688/image.png)https://gitlab.kitware.com/vtk/vtk/-/issues/19129Name mangling issue when combining VTK + QT for webasm build (Emscripten) for...2023-10-17T19:35:05-04:00ruell magpayoName mangling issue when combining VTK + QT for webasm build (Emscripten) for FreetypeFollow this steps in the original post including the versions:
https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/8
issue is ...Follow this steps in the original post including the versions:
https://discourse.vtk.org/t/vtk-qt-in-emscripten-webassembly-opengl-error-unknown-type-name-pfnglpushdebuggroupproc-did-you-mean-pfnglpushdebuggroupkhrproc/12447/8
issue is freetype conflict in definitions between QT 6.5.0 and any version of VTK including 9.3.0
```
wasm-ld: error: duplicate symbol: ft_mem_realloc
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)
wasm-ld: error: duplicate symbol: FT_GlyphLoader_CheckPoints
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)
wasm-ld: error: duplicate symbol: FT_GlyphLoader_CheckSubGlyphs
>>> defined in ../../dependencies/VTK-9.2.6/lib\\libvtkfreetype-9.2.a(ftbase.c.o)
>>> defined in C:/Qt/6.5.0/wasm_singlethread/lib/libQt6BundledFreetype.a(ftbase.c.o)
```