SCM

Discussion Forums: help

Monitor Forum | Start New Thread Start New Thread

 

RE: Load .vtk files with color [ reply ]
By: Prasad Samarakoon on 2015-11-10 19:09
[forum:3350]
Thank you Mahnu for your detailed answer.

As you have mentioned in your first point, the stored point data found in the VTK files are managed automatically if we do not erase them inside the method VtkMeshComponent::initPointData().

Answering your second question, the colors are not hidden when the user un-ticks the checkbox.

Warm Regards,
Prasad.

RE: Load .vtk files with color [ reply ]
By: Emmanuel Promayon on 2015-11-10 18:58
[forum:3349]
Thank you Prasad for your answer.

First, you are right I probably answered to quickly.
The demoPointData where initially created for a "demo" purpose, to show how to add data that can then be displayed as a colorscale in the renderer. Now that there is a much better mechanism to handle this in mesh component, I think this whole part can be transfered to a new tutorial code (where the demo data are added)
The methods pointPicked() and cellPicked() should also be removed, and a second tutorial should be created to demonstrates how specific events can be handle when a mesh is interactively picked.
So that's even more code cleaning!

Considering initialPointData, with the new mechanisms, there should be no need to store the point data found in the VTK files. That should managed automatically.

Second question: considering your screen capture, if you click on the checkbox of "Colors" does it not hide them? If not this should be considered a bug (the user has the right to choose if the point data found in the file should be displayed all the time or not!).

Let me know if this is not very clear,
Best regards,
Mahnu

RE: Load .vtk files with color [ reply ]
By: Prasad Samarakoon on 2015-11-04 15:31
[forum:3340]

CamiTK_Output.png (21) downloads
Dear Mahnu,

I tried implementing your suggestions but I am having a conceptual question.

Wouldn't removing everything liked to point data ( attributes: demoPointData, initialPointData, method: showPointData() ) from VtkMeshComponent lead to problems if a user tries to pick a point or a cell?

Would it be a bad idea not to remove PointData from the myGeometry instance in VtkMeshComponent::initPointData() method?
It keeps the picking intact while displaying the colors. The data array is also shown. One of the problems of the data array is that it can't be deactivated. But can't the user always remove it, if he/she doesn't want that?

Thank you in advance.
Warm Regards,
Prasad.

ps: A screen capture of CamiTK is attached with the post.

RE: Load .vtk files with color [ reply ]
By: Prasad Samarakoon on 2015-11-04 10:45
[forum:3339]
Dear Mahnu,

Thank you very much for your detailed reply.

I will follow your advice and file a bug before trying to implement your suggestions. I will post to this thread with the updates and possible further questions.

Warm Regards,
Prasad.

RE: Load .vtk files with color [ reply ]
By: Emmanuel Promayon on 2015-11-03 22:11
[forum:3338]
Dear Prasad,

The colors you are seeing on your VTK viewer are in fact point data associated to the mesh points. Loading of the point data is not yet implemented in CamiTK. I consider this is a bug now that the soon to be released CamiTK 3.5.x has an easy way to visualize every associated data by the new "DataArray/dataModel" handy mechanism now associated with MeshComponent.

MeshComponent now manages directly DataArray (see "Data" tab of the property explorer), where multiple data can be added, displayed or not. Adding/removing/activating data is done by using the newly provided methods.

It should be very easy to fix this bug by updating the MeshComponent::initData() method and do some cleaning in VtkMeshComponent (removing everything linked to point data, e.g., the demoPointData and initialPointData attributes the showPointData() method etc...)

In MeshComponent::initData(), before the dataModel->refresh(), all the point and cell data stored in the myGeometry->getPointSet() should be used to initialize the dataModel.

I suggest you file a new bug. In 3.5, the expected behaviour should be, once check.vtk is loaded, to see in the "Data" tab a new line called "Colors" (the second word of line #50 of check.vtk is the name of the data array), that could be clicked/unclicked to be seen/hidden.

Thank you Prasad for this nearly 10 min of pseudo-coding parenthesis!
Best regards,
Mahnu

RE: Load .vtk files with color [ reply ]
By: Prasad Samarakoon on 2015-11-03 16:37
[forum:3337]

VTK_Output.png (22) downloads
The vtk output.

Load .vtk files with color [ reply ]
By: Prasad Samarakoon on 2015-11-03 16:35
[forum:3336]

check.vtk (17) downloads
Hi All,

I have a custom written .vtk file with color information. (The .vtk file is also attached with the message.)

When I view it in CamiTK, the colors are not shown. But when I view it using vtk, the colors are shown. How can I make the colors visible in CamiTK?

I am using CamiTK 3.5.0 with vtk 5.8.0.

Thank you for all your input in advance.

   
Powered By FusionForge