Alex,<br>I will try your suggestions - using VTKActor to see difference and different frame rates.<br><br>I have one more question that's not related to rendering performance. It concerns opacity.<br><br>I was alteast expecting to see different images when I specify opacity < 1 for the grid.<br>
<br>Shouldn't a transparent image look different when I render all cells (all layers) than when I render just surface cells?<br><br><br>Thanks again,<br>Bhanu<br><br><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 4:49 PM, Alex Malyushytskyy <span dir="ltr"><<a href="mailto:alexmalvtk@gmail.com" target="_blank">alexmalvtk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">LOD (level of details) technique consists of run time assessment of<br>
performance and building a special model which will be used in certain<br>
circumstances and on the one hand would look as close as possible to<br>
the original, but on another hand allows achieve desired or better<br>
performance.<br>
That what LOD actor does, crude models will be silently created and<br>
displayed during rotation or when actor is moved.<br>
<br>
Now assume there are 2 model - lets say 1st is your unstructured grid,<br>
another is result of dataSetSurfaceFilter.<br>
Since both are using LOD actors, the following might happen:<br>
<br>
1st model is found to be too big to be displayed and as a result crude<br>
model with N1 number of nodes is created and displayed<br>
2nd model is found to be too big to be displayed and as a result crude<br>
model with N2 number of nodes is created and displayed<br>
or it is small enough , so it is displayed as is (but lets say still<br>
have N2 nodes)<br>
<br>
Now N1 might be mostly the same as N2.<br>
And you see no difference in performance during transition or rotation.<br>
Basically this means that LOD actor does his job well enough.<br>
I bet if you were using regular actors you would see a huge<br>
performance increase.<br>
<br>
If you need further performance you may just specify different frame rate.<br>
>From <a href="http://www.vtk.org/doc/release/4.0/html/classvtkLODActor.html" target="_blank">http://www.vtk.org/doc/release/4.0/html/classvtkLODActor.html</a>:<br>
<br>
"To control the frame rate, you typically set the<br>
vtkRenderWindowInteractor DesiredUpdateRate and StillUpdateRate. This<br>
then will cause vtkLODActor to adjust its LOD to fulfill the requested<br>
update rate.<br>
For greater control on levels of detail, see also vtkLODProp3D. That<br>
class allows arbitrary definition of each LOD.<br>
"<br>
<br>
Hope this helps,<br>
<br>
Alex<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Tue, Apr 2, 2013 at 2:18 PM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>> wrote:<br>
> Alex,<br>
><br>
> To be specific in one of my cases, No. of surfaces rendered were reduced<br>
> from 6163542 to 373626 assuming grid has hexahedrons each with 6 surfaces. I<br>
> got the number 373626 by doing<br>
><br>
> dataSetSurfaceFilter->GetOutput()->GetNumberOfCells()<br>
><br>
> Thats a significant reduction of number of surfaces. These are rendered<br>
> using VTKLODActor.<br>
><br>
> Can you please explain what you mean by "actually shown primitives during<br>
> rotation". What are the shown primitives?<br>
><br>
> I am just adding the output of the dataSetSurfaceFilter to a<br>
> vtkDataSetMapper and then to a vtkLODActor.<br>
><br>
> All I know if no. of surfaces are reduced. Do I need to do/check something<br>
> else?<br>
><br>
> If you need something specific to answer more specifically, I can provide<br>
> the details. It would be a great help.<br>
><br>
> Thanks,<br>
> Bhanu<br>
><br>
><br>
> ---------- Forwarded message ----------<br>
> From: Alex Malyushytskyy <<a href="mailto:alexmalvtk@gmail.com">alexmalvtk@gmail.com</a>><br>
> Date: Tue, Apr 2, 2013 at 4:03 PM<br>
> Subject: Re: [vtkusers] Help with VtkDatasetsurface filter<br>
> To: "<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
><br>
><br>
> You may get only general advice asking general questions.<br>
> Compare the number of nodes/cells you are you are getting from<br>
> vtkDataSetSurfaceFilter with<br>
> such in the unstructured grid,<br>
> Even though it may be significantly decreased in some cases, for<br>
> example if LOD actors are used, they may decrease actually shown<br>
> primitives during rotation approximately to the same number and you<br>
> will not see any difference in the performance.<br>
><br>
> Regards,<br>
> Alex<br>
><br>
><br>
> On Tue, Apr 2, 2013 at 8:27 AM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>> wrote:<br>
>> Hi All,<br>
>> I was wondering if anyone would be kind enough to answer the following<br>
>> query<br>
>> for me.<br>
>><br>
>> I had posted this a while back and still havent found the reason why<br>
>> vtkDataSetSurfaceFilter hasn't made rendering any faster. The interaction<br>
>> and rendering time to rotate zoom etc seem to be just the same as though I<br>
>> rendered all cells in the unstructured grid.<br>
>> The reason I chose to introduce rendering just surface cells in the first<br>
>> place was to make rendering faster. But I am surprised it doesnt make any<br>
>> difference at all :(.<br>
>> Any words or ideas?<br>
>><br>
>> Thanks so much<br>
>> Bhanu<br>
>><br>
>><br>
>><br>
>> On Mon, Mar 11, 2013 at 4:30 PM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>> wrote:<br>
>>><br>
>>> One related question though. I started using Surface Filter really only<br>
>>> for performance reasons.<br>
>>><br>
>>> I was thinking if I rendered just surface cells, the rendering and<br>
>>> rotation etc would be must faster.<br>
>>> However I do not find it any different than when I render all cells. What<br>
>>> am I missing?<br>
>>> Any reasons anyone can think of, please let me know.<br>
>>><br>
>>><br>
>>><br>
>>> Thanks,<br>
>>> Bhanu<br>
>>><br>
>>><br>
>>><br>
>>> On Mon, Mar 11, 2013 at 4:12 PM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> David,<br>
>>>> As you suggested, I got it to work using SetGlobalIds and then<br>
>>>> retrieving<br>
>>>> that using GetGlobalIds. Many thanks for your patience and help.<br>
>>>><br>
>>>><br>
>>>> -Bhanu<br>
>>>><br>
>>>><br>
>>>> On Wed, Mar 6, 2013 at 11:41 AM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>> David,<br>
>>>>><br>
>>>>> I am using vtk 5.2 - is it possible that this function was not defined<br>
>>>>> in that version.<br>
>>>>><br>
>>>>> I get the error that SetOriginalCellIdsName is not a member of<br>
>>>>> vtkDataSetSurfaceFilter :(<br>
>>>>><br>
>>>>> Bhanu<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On Wed, Mar 6, 2013 at 10:36 AM, David E DeMarle<br>
>>>>> <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>> wrote:<br>
>>>>>><br>
>>>>>> Give DSF a name for the array.<br>
>>>>>> SetOriginalCellIdsName("idsintoDSForsomething")<br>
>>>>>> Then retrieve it from the output like<br>
>>>>>> DSF->GetOutput()->GetCellData()->GetArray("idsintoDSForsomething")<br>
>>>>>><br>
>>>>>><br>
>>>>>> David E DeMarle<br>
>>>>>> Kitware, Inc.<br>
>>>>>> R&D Engineer<br>
>>>>>> 21 Corporate Drive<br>
>>>>>> Clifton Park, NY 12065-8662<br>
>>>>>> Phone: 518-881-4909<br>
>>>>>><br>
>>>>>><br>
>>>>>> On Wed, Mar 6, 2013 at 11:29 AM, Bhanu Hariharan <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>>>>>> wrote:<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> David,<br>
>>>>>>><br>
>>>>>>> I had turned on PassThroughCell. But I do not know how to access the<br>
>>>>>>> new Ids array after the fact.<br>
>>>>>>> VTK Doc says something about a 'OrginalCellIds' but I am not sure how<br>
>>>>>>> to access this.<br>
>>>>>>> So I extracted the output of DSF to a vtkPolyData but still cant<br>
>>>>>>> figure out how to get to that new Ids array.<br>
>>>>>>> Any help with that is really appreciated.<br>
>>>>>>><br>
>>>>>>> I will try your other suggestion in the meantime.<br>
>>>>>>><br>
>>>>>>> Thanks,<br>
>>>>>>> Bhanu<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Wed, Mar 6, 2013 at 9:25 AM, David E DeMarle<br>
>>>>>>> <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>> wrote:<br>
>>>>>>>><br>
>>>>>>>> Sorry for the confusion, it has been a long time since I added that<br>
>>>>>>>> code the DataSetSurfaceFilter. Turning PassThroughCell/PointIds in<br>
>>>>>>>> fact<br>
>>>>>>>> generates a new Ids array, which you can retrieve after the fact to<br>
>>>>>>>> do the<br>
>>>>>>>> lookups into the data that is input to the DSF and extract<br>
>>>>>>>> particular<br>
>>>>>>>> cells/points by their offset (n'th cell in the cell array, n'th<br>
>>>>>>>> point in the<br>
>>>>>>>> point array)<br>
>>>>>>>><br>
>>>>>>>> However I still recommend making your own ids array and using that<br>
>>>>>>>> instead of PassThrough. vtkIdFilter will generate them for you. The<br>
>>>>>>>> array<br>
>>>>>>>> marked as the active global ids array is treated specially by most<br>
>>>>>>>> filters<br>
>>>>>>>> in that they try to preserve it across operations (including<br>
>>>>>>>> threshold and<br>
>>>>>>>> DSF). We added this to VTK a few years ago specifically for this<br>
>>>>>>>> case of<br>
>>>>>>>> finding out where particular result values come from (and in<br>
>>>>>>>> particular for<br>
>>>>>>>> surface selection). So the Threshold and surface filter will push<br>
>>>>>>>> globalIDS<br>
>>>>>>>> forward just fine. Once you get a result, grab the active globaIDs<br>
>>>>>>>> array,<br>
>>>>>>>> look for the values in it, and look them up in the original data.<br>
>>>>>>>> The<br>
>>>>>>>> extract selections filter will do the job of looking them up in the<br>
>>>>>>>> original<br>
>>>>>>>> data and pulling them out as a new dataset.<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> David E DeMarle<br>
>>>>>>>> Kitware, Inc.<br>
>>>>>>>> R&D Engineer<br>
>>>>>>>> 21 Corporate Drive<br>
>>>>>>>> Clifton Park, NY 12065-8662<br>
>>>>>>>> Phone: 518-881-4909<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> On Wed, Mar 6, 2013 at 10:02 AM, Bhanu Hariharan<br>
>>>>>>>> <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>>>>>>>> wrote:<br>
>>>>>>>>><br>
>>>>>>>>> David,<br>
>>>>>>>>> Thanks for replying. However I have a doubt.<br>
>>>>>>>>> Are you suggesting the VTKUnstructuredgrid should have an globalids<br>
>>>>>>>>> array? Is that what the member is called - globalIds? I actually<br>
>>>>>>>>> pass<br>
>>>>>>>>> VTKUnstructuredgrid to a VTKThreshold filter and then pass that<br>
>>>>>>>>> filter to<br>
>>>>>>>>> VTKdatasetsurfacefilter.<br>
>>>>>>>>><br>
>>>>>>>>> Perhaps you can post a couple lines of code. That would be very<br>
>>>>>>>>> helpful.<br>
>>>>>>>>> Thanks,<br>
>>>>>>>>> Bhanu<br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>>> On Tue, Mar 5, 2013 at 6:55 PM, David E DeMarle<br>
>>>>>>>>> <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>> wrote:<br>
>>>>>>>>>><br>
>>>>>>>>>> The input data should have a globalids array containing a unique<br>
>>>>>>>>>> value for each cell. If it does, extract will preserve it. After<br>
>>>>>>>>>> the<br>
>>>>>>>>>> extraction, use that array in the polydata to do the look up to<br>
>>>>>>>>>> the original<br>
>>>>>>>>>> cell in the unstructured grid.<br>
>>>>>>>>>><br>
>>>>>>>>>> On Mar 5, 2013 6:00 PM, "Bhanu Hariharan" <<a href="mailto:bhanu@petrotel.com">bhanu@petrotel.com</a>><br>
>>>>>>>>>> wrote:<br>
>>>>>>>>>>><br>
>>>>>>>>>>> Hi All,<br>
>>>>>>>>>>><br>
>>>>>>>>>>> I need some help doing the following. Please could one of you<br>
>>>>>>>>>>> guide me on how.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> I use a vtkDataSetSurfaceFilter on VTKUnstructuredGrid to render<br>
>>>>>>>>>>> skin of that grid. That works fine and I can see the number of<br>
>>>>>>>>>>> surfaces<br>
>>>>>>>>>>> shown by grabbing the<br>
>>>>>>>>>>> dataSetSurfaceFilter->GetOutput()->GetNumberOfCells().<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> I need a way to map the surface back to the original cell id.<br>
>>>>>>>>>>> That<br>
>>>>>>>>>>> is if I have 2 cells and I render just skin, number of surfaces<br>
>>>>>>>>>>> rendered are<br>
>>>>>>>>>>> 10. I need to be able to pick on any of these 10 surfaces and map<br>
>>>>>>>>>>> them back<br>
>>>>>>>>>>> to either of the the 2 grid cells.<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> <a href="http://www.vtk.org/doc" target="_blank">http://www.vtk.org/doc</a> says :<br>
>>>>>>>>>>><br>
>>>>>>>>>>> If PassThroughCellIdsOn is 1, then the output polygonal dataset<br>
>>>>>>>>>>> will have a celldata array that holds the cell index of the<br>
>>>>>>>>>>> original 3D cell<br>
>>>>>>>>>>> that produced each output cell. This is useful for cell picking.<br>
>>>>>>>>>>> I turned the PassThroughCellIds On and I have UseStrips turned<br>
>>>>>>>>>>> off.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> Then I did<br>
>>>>>>>>>>> vtkPolyData *surfacePolyData = dataSetSurfaceFilter->GetOutput();<br>
>>>>>>>>>>><br>
>>>>>>>>>>> But I do not see how I can access that celldata array that holds<br>
>>>>>>>>>>> the original 3D cells for the surfaces.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> Please can anyone advise on how.<br>
>>>>>>>>>>><br>
>>>>>>>>>>> Thanks in advance.<br>
>>>>>>>>>>> Bhanu<br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>><br>
>>>>>>>>>>> _______________________________________________<br>
>>>>>>>>>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>>>>>>>>>><br>
>>>>>>>>>>> Visit other Kitware open-source projects at<br>
>>>>>>>>>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>>>>>>>>>><br>
>>>>>>>>>>> Please keep messages on-topic and check the VTK FAQ at:<br>
>>>>>>>>>>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>>>>>>>>>>><br>
>>>>>>>>>>> Follow this link to subscribe/unsubscribe:<br>
>>>>>>>>>>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>>>>>>>>>>><br>
>>>>>>>>><br>
>>>>>>>><br>
>>>>>>><br>
>>>>>><br>
>>>>><br>
>>>><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
</div></div></blockquote></div><br>