Alex,<br><br>To be specific in one of my cases, No. of surfaces rendered were reduced from 6163542 to 373626 assuming grid has hexahedrons each with 6 surfaces. I got the number 373626 by doing <br><br>dataSetSurfaceFilter->GetOutput()->GetNumberOfCells()<br>
<br>Thats a significant reduction of number of surfaces. These are rendered using VTKLODActor.<br><br>Can you please explain what you mean by "actually shown
primitives during rotation". What are the shown primitives? <br><br>I am just adding the output of the dataSetSurfaceFilter to a vtkDataSetMapper and then to a vtkLODActor.<br><br>All I know if no. of surfaces are reduced. Do I need to do/check something else?<br>
<br>If you need something specific to answer more specifically, I can provide the details. It would be a great help.<br><br>Thanks,<br>Bhanu<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Alex Malyushytskyy</b> <span dir="ltr"><<a href="mailto:alexmalvtk@gmail.com">alexmalvtk@gmail.com</a>></span><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>
<div class="HOEnZb"><div class="h5"><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 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>> 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 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 fact<br>
>>>>>>> generates a new Ids array, which you can retrieve after the fact to do the<br>
>>>>>>> lookups into the data that is input to the DSF and extract particular<br>
>>>>>>> cells/points by their offset (n'th cell in the cell array, n'th 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 array<br>
>>>>>>> marked as the active global ids array is treated specially by most filters<br>
>>>>>>> in that they try to preserve it across operations (including threshold and<br>
>>>>>>> DSF). We added this to VTK a few years ago specifically for this case of<br>
>>>>>>> finding out where particular result values come from (and in particular for<br>
>>>>>>> surface selection). So the Threshold and surface filter will push globalIDS<br>
>>>>>>> forward just fine. Once you get a result, grab the active globaIDs array,<br>
>>>>>>> look for the values in it, and look them up in the original data. The<br>
>>>>>>> extract selections filter will do the job of looking them up in the 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 <<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 pass<br>
>>>>>>>> VTKUnstructuredgrid to a VTKThreshold filter and then pass that 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 the<br>
>>>>>>>>> extraction, use that array in the polydata to do the look up to 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 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. That<br>
>>>>>>>>>> is if I have 2 cells and I render just skin, number of surfaces rendered are<br>
>>>>>>>>>> 10. I need to be able to pick on any of these 10 surfaces and map 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 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 <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: <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>
</div></div></div><br>