|
Guys... I'll be checking in the new pathline filter later today, just as a heads up for filter writers in general, the pathline filter accepts an Id array which it uses to track particles. If the Id array is not present, it defaults to using the Point Index. This makes the gui messy as you need a combo box for scalar array, and a checkbox to enable/disable this activity. To make this nicer, I have added a new XML property to the StringVectorProperty entity. The cvs log below should sum it up, but in case it is too terse, here is annother explanation. If you need a scalar array for a particluar operation (one example I have all the time is pressure, needed for a custom integration filter). If the array is present, the do whatever is required. If the array is missing from the data (for whatever reason), then do something else. Since the user needs to enter the pressure array name, the combo box is used to select the array. If the pressure array is missing, the user is tempted to select another array (such as density) - but the algorithm fails, and the user has to manually disable it with another checkbox. To make this simpler, I've added "none_string" as a property of the XML so that you get a list of all the scalars in the required domain, with an extra one which can be "Not Present" / "Not Applicable" / or in the case of the pathline filter "Point-Index as ID" instead of a scalar array. If the non_string is absent, the arraylistdomain behaves as uaual, if present and the user selects it, the filter receives an empty string, which can be easily checked for in the filter iteself and the alternative operation performed. I plan on adding another feature in the furure which will be something like default_regex=".*mass.*" - so that the array list will automatically use a regular _expression_ to find the array most likely to be the one you want. some users save "Mass" other "mass" others "Mass_Kg" others "ParticleMass" etc etc, having a regex field to find the most probable one initially will make my life easier. If you think this is a worthwhile addition, please say so. JB cvs log ------ ENH:Add a new tag to the StringVectorProperty XML, which allows one to enter a "none_string" as follows in this example. <ArrayListDomain name="array_list" attribute_type="Scalars" none_string="Point-Index as ID"> <RequiredProperties> <Property name="Input" function="Input"/> </RequiredProperties> </ArrayListDomain> another example would be none_string="Not Available" This permits the filter writer to specify an additional string entry which is added to the usual list of scalars/vectors and effectively permit an array to become optional. In this example, which we require for the ParticlePathline filter, a scalar array can be used as the Id array, but if this is not available, we default to using the point index as the Id. The filter will receive an empty string when the none_string is selected, the code can then skip whatever action it would normally perform with the scalar array. Ken + Eric, -- John Biddiscombe, email:biddisco @ cscs.ch http://www.cscs.ch/ CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07 Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 |
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
