[OpendTect_Developers] new static class allows easy access to current attributes sets from a plugin
Helene Huck
helene.huck at dgbes.com
Tue Aug 24 15:46:00 CEST 2010
Hi all,
Since OpendTect version 4.1.1, there are dedicated descriptions sets for
stored data used in the visualization; this was necessary so that moving
elements could keep displaying stored cubes even after loading a new
attribute set. We used this rework as an opportunity to hold all the
descriptions in a single object, the Attrib::DescSetsHolder. This new
object is accessible from anywhere and of course, that's the interesting
part, from your plugins.
The new class Attrib::DescSetsHolder
(/include/AttributeEngine/attribdescsetsholder.h) holds Attrib::DescSet
Managers for live attributes and Attrib::DescSets for stored data, both
in 2D and 3D. Stored data used only for visualization purpose are
collected in the dedicated Attrib::DescSet whereas stored data used as
input for attributes are collected as usual via the attribute DescSet
manager. The description of a stored cube can eventually be present in 2
sets but, as this is only a description, it is a cheap price to pay to
get more clarity and reliability.
The Attrib::DescSetsHolder is a static object reachable from anywhere
using Attrib::DSHolder() function, this is especially handy while
building plugins. The sets of descriptions can then be retrieved using
function getDescSet(bool is2d,bool isstored). A good example can be seen
in the user interface of the stratal amplitude
(plugins/uiHorizonAttrib/uistratamp.cc, since patch release 4.1.1a) :
const Attrib::DescSet* ads = Attrib::DSHolder().getDescSet(false,false);
inpfld_ = new uiAttrSel( this, *ads, "Quantity to output" );
The first line of code is getting a pointer to the Attrib::DescSet of
current 3D attributes set, which is then used in the second line to
create an input field. It was previously only possible to select stored
cubes as input for stratal amplitude, using the static
Attrib::DescSetsHolder allows the user to select attributes as well.
Best regards,
Helene
--
--
-- Helene Huck
-- Geophysical software engineer
-- dGB Earth Sciences B.V.
-- Nijverheidstraat 11-2, 7511 JM Enschede, The Netherlands
-- mailto: helene.huck at dgbes.com, http://www.dgbes.com
-- Tel: +31 53 4315155 , Fax: +31 53 4315104
More information about the Developers
mailing list