Itasca C++ Interface
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
itascaxd::IRange Class Referenceabstract

Interface to a filter, used as the main method for filtering objects. More...

#include <irange.h>

Public Member Functions

virtual const itasca::IThinggetIThing () const =0
 Returns a const IThing interface pointer for a filter.
 
virtual itasca::IThinggetIThing ()=0
 Returns a IThing interface pointer for a filter.
 
virtual void clear ()=0
 clear all elements, set to union, and remove name
 
virtual const IRangeoperator= (const IRange &ir)=0
 Copy a filter - including name.
 
virtual IRangeclone () const =0
 Creates a new instance of a filter - must be destroyed by the caller.
 
virtual IString getName () const =0
 
virtual void setName (const QString &s)=0
 sets the filter name
 
virtual bool isUnion () const =0
 Indicates if filter is a union of filter elements.
 
virtual void setUnion (bool b)=0
 
virtual int getNumberOfElements () const =0
 Returns the number of RangeElement making up the filter.
 
virtual IRangeElementgetElement (int index) const =0
 Returns the RangeElement at the given index, where index is less than getNumberOfElements().
 
virtual void removeElement (int index)=0
 Removes element at index from the filter, assumes index is less than getNumberOfElements().
 
virtual QStringList getCommandSwitches () const =0
 
virtual const IRangegetNext () const =0
 
virtual bool recursionCheck () const =0
 Checks to see if an infinitely recursive named filter topology has been created.
 
virtual void addElement (const QString &name)=0
 
virtual bool isIn (const itasca::IThing *t) const =0
 
virtual bool isIn (const itasca::IThing &t) const =0
 
virtual bool isIn (const DVect &pos) const =0
 
virtual bool isIn (qint64 index, const TType &type) const =0
 
virtual void save (Archive2 &a) const =0
 
virtual bool restore (Archive2 &a, uint64 label)=0
 
virtual void remap (Archive2 &a)=0
 
virtual void saveElement (Archive2 &a, int index) const =0
 
virtual bool restoreElement (Archive2 &a)=0
 
virtual bool getIsFish () const =0
 Returns true if a filter element is a FISH filter element.
 
virtual bool isThreadSafe () const =0
 
virtual void setUseHidden (bool b)=0
 
virtual bool getUseHidden () const =0
 Returns the current hidden state. See setUseHidden().
 
virtual bool setSelected (bool b)=0
 
virtual bool getSelected () const =0
 Return the current selected state. See setSelected.
 
virtual bool setDeselected (bool b)=0
 
virtual bool getDeselected () const =0
 
virtual bool isDefault () const =0
 
virtual void destroy ()=0
 Destroys the filter.
 

Public Attributes

shared::Signal< IRangeElement *, int > elementChanged
 
shared::Signal< IRangeElement *, bool > notChanged
 
shared::Signal< IRangeElement *, const QString & > byChanged
 
shared::Signal< int32 > listChanged
 
shared::Signal< const QString & > nameChanged
 
shared::Signal< bool > unionChanged
 
shared::Signal< bool > useHiddenChanged
 
shared::Signal< bool > selectedChanged
 
shared::Signal< bool > deselectedChanged
 

Static Public Attributes

static const TType type_ = 0x4c815b93
 The type identification number for this class, for use in convert_cast() and convert_getcast().
 

Detailed Description

Interface to a filter, used as the main method for filtering objects.

This is an interface to the main command processing class. The idea is that you pass an IThing to a Range [isIn()], which decides whether it falls inside or outside.
A Range is a container of Range Elements, and a given IThing must either fall within all of them (intersection, the default) or any of them (union, with setUnion()).
By default a Range is the logical intersection of all its filter elements. If the union flag is set the filter is considered to be the logical union of its elements.

Member Function Documentation

◆ addElement()

virtual void itascaxd::IRange::addElement ( const QString & name)
pure virtual

Attempts to create a new RangeElement matching name, and adds it to the end of the filter if successful.
Does nothing if name is not matched to a RangeElement type.

◆ getCommandSwitches()

virtual QStringList itascaxd::IRange::getCommandSwitches ( ) const
pure virtual

Returns a StringList that can be merged() into a command that will completely re-create this filter.
This does not include the starting keyword (i.e. "filter ...").

◆ getName()

virtual IString itascaxd::IRange::getName ( ) const
pure virtual

This function will NOT automatically add this filter to the list of named filters, and it does NOT do a recursion check.

◆ getNext()

virtual const IRange * itascaxd::IRange::getNext ( ) const
pure virtual

Returns the next filter in the global list of all named filters, assuming this filter is a member.
Returns 0 if at end of list, or not stored in the list.

◆ isIn() [1/4]

virtual bool itascaxd::IRange::isIn ( const DVect & pos) const
pure virtual

Checks if position pos is in the list.
RangeElement checking for a specific type of object will always be ignored.

◆ isIn() [2/4]

virtual bool itascaxd::IRange::isIn ( const itasca::IThing & t) const
pure virtual

Checks if the the IThing is in the list.
Uses t->getLocation() for the position of the object.

◆ isIn() [3/4]

virtual bool itascaxd::IRange::isIn ( const itasca::IThing * t) const
pure virtual

Checks if the the IThing is in the list.
Uses t->getLocation() for the position of the object.

◆ isIn() [4/4]

virtual bool itascaxd::IRange::isIn ( qint64 index,
const TType & type ) const
pure virtual

Checks for an object at location index1 (with index2 sometimes required depending on the index type). type describes the index type being used (must have been registered ahead of time with the filter logic).
This is used for FORTRAN objects in the A array, where an IThing pointer cannot be used.

◆ isThreadSafe()

virtual bool itascaxd::IRange::isThreadSafe ( ) const
pure virtual

Returns true if the all range elements are thread safe meaning that the range can be used in a multithreaded loop. An optional IThing pointer can be provided. If given the IThing pointer is what the range is being applied to - the range elements check the type to ensure that the type isn't used in the range element filter. If it is then the range should not be used in a multithreaded loop. Really, in that case, the range shouldn't be used at all and should throw an error.

◆ setSelected()

virtual bool itascaxd::IRange::setSelected ( bool b)
pure virtual

Sets the Selected state, which defaults to false. By default the filter will ignore the selected state of an IThing. If this is set to true, any object with the selected flag set (t->getSelected()) will be considered in a filter element (note union and intersect still apply to other filter elements), and the hidden attribute will be ignored.

◆ setUnion()

virtual void itascaxd::IRange::setUnion ( bool b)
pure virtual

Sets the filter union flag

See also
isUnion()

◆ setUseHidden()

virtual void itascaxd::IRange::setUseHidden ( bool b)
pure virtual

Sets the Use Hidden state, which defaults to false. By default the filter will filter out all IThings with the hidden flag (t->getHidden()), If this is set to true the filter will ignore the hidden flag.


The documentation for this class was generated from the following file: