Hello everyone,
Just to announce - the problem is solved! It seems the problem was in
plugin's sources when setting texture coordinates data. So, if in
vtkMyExporter.cpp I remove
tex_coord_data->SetNumberOfComponents(1);
or set number of components to 2, correct texture will be generated!
Thanks everyone on Your help!
Best regards,
Nenad.
On Fri, May 13, 2011 at 11:49 PM, Nenad Vujicic wrote:
> Hello everyone,
>
> Does anyone have idea where could be the problem in uploaded sources?
>
> Thanks,
> Nenad.
>
> On Tue, May 10, 2011 at 12:13 PM, Nenad Vujicic wrote:
>> Dear Utkarsh,
>>
>> Thank You very much, but unfortunately, adding manually copying of
>> parameters didn't solve all problems. I updated test plug-in with
>> manually copying, converting scalars to texture, applying texture to
>> actor and showing resulting actor in vtkRenderWindow. You can find
>> updated sources at
>> http://alas.matf.bg.ac.rs/~mr00053/projects/PVTest.zip.
>>
>> If You load again disk_out_ref.ex2, select H2 and try to export to
>> .my, You'll see in separate vtkRenderWindow same object with applied
>> generated
>> texture which looks very bad. Again, it works fine in v3.8.1. I
>> believe I'm not initializing new actors properly? Do You have some
>> idea how to fix it?
>>
>> Thanks,
>> Nenad.
>>
>>
>> On Mon, May 9, 2011 at 10:02 PM, Utkarsh Ayachit
>> wrote:
>>> The problem is pretty straight forward. Looks like
>>> vtkMapper::ShallowCopy(..) does not copy the state of
>>> InterpolateScalarsBeforeMapping. I will commit a fix for that for next
>>> release. Until then, you'll have to manually copy ivars that you care
>>> about.
>>>
>>> Utkarsh
>>>
>>> On Sun, May 8, 2011 at 10:25 AM, Nenad Vujicic wrote:
Dear Utkarsh,
I uploaded test plugin that shows my problem at
http://alas.matf.bg.ac.rs/~mr00053/projects/PVTest.zip.
After I build and load the plugin from Qt client, I load
disk_out_ref.ex2, select "H2" for mapping scalars, check Interpolate
Scalars on Display tab in Object inspector and go on File->Export
(select .my file). I get 6 message boxes which report 0, 0, 0, 0, 0, 1
(instead of 0, 0, 0, 0, 1, 1) as values for
vtkMapper::InterpolateScalarsBeforeMapping. So, here is first
question: "How to create multiple vtkActor objects from
vtkCompositePolyDataMapper2's input"? I thought that vtkMyExporter.cpp
Ln 138-162 should be fine, but uploaded sources shows different.
Thanks,
Nenad.
On Fri, May 6, 2011 at 2:29 PM, Utkarsh Ayachit
wrote:
> Nenad,
>
> There;s nothing much different about the vtkCompositePolyDataMapper or
> vtkPolyDataMapper as far as the state of the
> InterpolateScalarsBeforeMapping flag goes. I cannot see how that
> variable can return false if it is indeed set to true as you are
> saying. Can you share the plugin?
>
> Utkarsh
>
> On Thu, May 5, 2011 at 6:03 PM, Nenad Vujicic wrote:
>> Hello everyone,
>>
>> Perhaps I was a bit unclear in my previous messages. Here are more
>> details about the problem and test case.
>>
>> I use ParaView v3.10.1 release sources, Visual Studio 2008 SP1, Python
>> 2.7, OpenMPI 1.4.3 on Vista SP2. I compiled sources with standard
>> options (just turned on BUILD_SHARED_LIBS, MPI and Python). I derived
>> new class from vtkExporter, vtkMyExporter, and in
>> vtkMyExporter::WriteData() I call code specified down. The problem is
>> in QMessage line, which reports always 0, even when this flag is
>> turned on. Same is happening with most of other parameters.
>>
>> I believe that learning how to decompose composite ptrActor into
>> several actors with vtkPolyDataMapper mapper and vtkPolyData data will
>> solve all other problems (which occur when generating texture from
>> scalars). At the moment, I'm interested only in actors which use
>> vtkCompositePolyDataMapper2 mappers. As input I use disk_out_ref.ex2
>> with selected H2 (or any other channel) for mapping colors. Does
>> anyone have any idea how this can be done? Btw, this worked perfectly
>> under ParaView v.3.8.1 and with RenderWindow created using VTK 5.4.2
>> (where I create vtkCompositePolyDataMapper2 and populate it manually).
>>
>> Thank You very much for Your help!
>>
>> Best regards,
>> Nenad.
>>
>>
>>
>> 1) Get interactive renderer 'InteractiveRenderer' from
>> vtkMyExporter::RenderWindow
>> 2) For every actor 'ptrActor' (3D actors only) in InteractiveRenderer do:
>>
>> vtkCompositeDataIterator* actor_iterator;
>> vtkCompositePolyDataMapper2* composite_mapper = NULL;
>>
>> // get actor's mapper
>> vtkMapper* mapper = ptrActor->GetMapper();
>> if(mapper == NULL)
>> return true; // discard
>>
>> // get mapper's input
>> vtkCompositeDataSet* composit