Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Classes | Public Member Functions | Static Public Attributes | List of all members
itasca::IThing Class Referenceabstract

Base class for items that will be stored in containers. More...

#include <ithing.h>

Classes

class  BreakLock
 
class  Lock
 
class  LockIf
 

Public Member Functions

virtual const IThinggetIThing () const =0
 Return the IThing interface.
 
virtual IThinggetIThing ()=0
 Return the IThing interface. More...
 
virtual TType getType () const =0
 
virtual QString getTypeName () const =0
 Returns a description of the type of the class.
 
virtual TType getGeneralType () const =0
 
virtual const void * convertToType (const TType &id) const =0
 
virtual void * convertToType (const TType &id)=0
 
template<class T >
const T * convert () const
 
template<class T >
T * convert ()
 
virtual quint64 getID () const =0
 Returns a value - the exact meaning of which is defined by the container and the implementing class.
 
virtual quint64 getCollectionID () const =0
 
virtual bool getIsSet () const =0
 
virtual const IThinggetSet () const =0
 
virtual void getAssociatedThings (const TType &type, FArray< const IThing * > *ret) const =0
 Returns a list of things associated with this thing with TType type.
 
virtual void resetAssociatedThings (FArray< const IThing * > *ret)=0
 Resets any data used with the associated things.
 
virtual QString getName () const =0
 Returns a name string - the exact meaning of which is defined by the container and the implementing class.
 
virtual DVect3 getLocation () const =0
 
virtual DExtent3 getExtent () const =0
 
virtual DVect3 getClosest (const DVect3 &pos) const =0
 
virtual DVect3 getNormal () const =0
 Returns a normal vector representing the orientation of the object, if this is appropriate. 0 vector if it isn't.
 
virtual DVect3 getDisplacementThing () const =0
 Returns the accumulated displacement for things supporting displacement.
 
virtual DVect3 getVelocityThing () const =0
 Returns the instantaneous velocity for things supporting velocity.
 
virtual double getVolume () const =0
 Returns the volume if this is appropraite. 0 is returned otherwise.
 
virtual bool isWithinOrientation (const Orientation3 &orientation, const DVect2 &tol) const =0
 
virtual bool isOnSurface (bool mech=true, bool therm=false, bool fluid=false, bool _or=false) const =0
 Returns TRUE if this is a "Surface", based on the three process criteria.
 
virtual const IContainergetContainer () const =0
 
virtual IContainergetContainer ()=0
 
virtual bool addGroup (const IGroupID &id)=0
 
virtual bool removeGroup (const IGroupID &id)=0
 
virtual uint isInGroup (const FArray< IGroupID > &ids, TType type=0, bool only=false) const =0
 
virtual const IGroupgetGroup (const ISlotID &slot) const =0
 
virtual QString getGroupName (const ISlotID &slot=ISlotID()) const =0
 
virtual uint getGroupList (FArray< IGroupID > *list) const =0
 Return all groups and all slots assigned to the object in a list.
 
virtual void copyGroups (const IThing *t)=0
 Copies group data from one IThing to this, all original group data is lost.
 
virtual void clearGroup ()=0
 
virtual uint getExtraSize () const =0
 Returns the number of extra FISH extra variables for this object.
 
virtual const fish::IParametergetExtra (uint index) const =0
 
virtual void setExtra (uint index, const fish::IParameter &p)=0
 
virtual void clearExtra ()=0
 
virtual bool getHidden () const =0
 Returns the Hide flag at index.
 
virtual bool setHidden (bool b)=0
 Sets the hidden flag at index.
 
virtual bool getSelected () const =0
 Returns the selected flag at index.
 
virtual bool setSelected (bool b)=0
 Sets the selected flag at index.
 
virtual bool getGhost () const =0
 Indicates if the thing is a "ghost", that is actually ownned by a different node.
 
virtual void setGhost (bool b)=0
 
virtual quint64 getContainerOrder () const =0
 
virtual void setContainerOrder (quint64 i)=0
 
virtual void save (Archive2 &) const =0
 Archives the Thing to a file (if appropriate).
 
virtual bool restore (Archive2 &, quint64)=0
 
virtual void remap (Archive2 &)=0
 
virtual quint64 getRemapHandle (Archive2 &) const =0
 
virtual void destroy ()=0
 
void addDeleteNotice (IDeleteNotice *delnot) const
 
void removeDeleteNotice (IDeleteNotice *delnot) const
 
void sendDeleteNotice ()
 
void changeToNewPointer (IThing *newPnt)
 

Static Public Attributes

static const TType type_ = 0x4c815a59
 The base type of an IThing.
 
static const uint maxGroupSlot_ = 128
 Maximum number of group slots per object.
 
static const uint maxExtraIndex_ = 128
 Maximum number of extra FISH variables per object.
 

Detailed Description

Base class for items that will be stored in containers.

The interface defines the support needed for tracking pointers, and automatic pointer conversion during archiving. This class also has a primitive run-time type identification system, maintains an integer ID, and returns a single location in space associated with the object.

Member Function Documentation

◆ addGroup()

virtual bool itasca::IThing::addGroup ( const IGroupID id)
pure virtual

Adds a group entry to this object. Returns true on success. If no slot is specified, the default slot is assumed.

◆ convert() [1/2]

template<class T >
const T* itasca::IThing::convert ( ) const
inline

Type specific version of convertToType, that assume that the type id is in T::type_. It also automatically converts the return type to

◆ convert() [2/2]

template<class T >
T* itasca::IThing::convert ( )
inline

Type specific version of convertToType, that assume that the type id is in T::type_. It also automatically converts the return type to

◆ convertToType() [1/2]

virtual const void* itasca::IThing::convertToType ( const TType id) const
pure virtual

This functions is intended as a more efficient version of dynamic_cast, available only for things in the IThing tree, and used when you cannot guarantee that the class hasn't had a base shift. If no match is found, then 0 is returned. See the template version below for type safety, and automatic exception throwing. As a special case, if id is 0, then the return value should be an "upcast" to the most-derived type.

◆ convertToType() [2/2]

virtual void* itasca::IThing::convertToType ( const TType id)
pure virtual

This functions is intended as a more efficient version of dynamic_cast, available only for things in the IThing tree, and used when you cannot guarantee that the class hasn't had a base shift. If no match is found, then 0 is returned. See the template version below for type safety, and automatic exception throwing. As a special case, if id is 0, then the return value should be an "upcast" to the most-derived type.

◆ destroy()

virtual void itasca::IThing::destroy ( )
pure virtual

Calls

delete this;

Necessary because deleting an interface pointer is not possible due to the lack of virtual destructors.

◆ getClosest()

virtual DVect3 itasca::IThing::getClosest ( const DVect3 &  pos) const
pure virtual

Returns the closest point on the IThing to the position pos. By default, returns the same value returns by getLocation(). IThing implementations may choose different degrees to which they return the exact closest point.

◆ getCollectionID()

virtual quint64 itasca::IThing::getCollectionID ( ) const
pure virtual

Returns a value that indicates the ID of some larger grouping of objects. For instance, each SEL element might have a unique ID. But all elements in Cable 5 will have a getCollectionID() of 5. The exact meaning of this is defined by the container and the implementing class.

◆ getContainer() [1/2]

virtual const IContainer* itasca::IThing::getContainer ( ) const
pure virtual

Returns a const pointer to the container this IThing is stored in. May return 0, indicating that this type of thing doesn't keep track of that.

◆ getContainer() [2/2]

virtual IContainer* itasca::IThing::getContainer ( )
pure virtual

Returns a pointer to the container this IThing is stored in. May return 0, indicating that this type of thing doesn't keep track of that.

◆ getContainerOrder()

virtual quint64 itasca::IThing::getContainerOrder ( ) const
pure virtual

Indicates the original order location of the thing in the main container before mpi distribution.

◆ getExtent()

virtual DExtent3 itasca::IThing::getExtent ( ) const
pure virtual

Returns an extent in space associated with the IThing. By default, returns an empty extent (DExtent::nothing). This value is used by the cell space logic.

◆ getExtra()

virtual const fish::IParameter* itasca::IThing::getExtra ( uint  index) const
pure virtual

Returns an interface to the FISH extra variables for this object. May be null if no extra variables have ever been specified.

◆ getGeneralType()

virtual TType itasca::IThing::getGeneralType ( ) const
pure virtual

This function returns a constant character string indicating the "general" type. For non-polymorphic objects this will be the same as getType(). Polymorphic objects should override this function to return a "base" type, use to indicate the general class of object. For instance for histories, getType() will return historytime and historyzone, but getGeneralType() should be overridden to return "history" for all of them.

◆ getGroup()

virtual const IGroup* itasca::IThing::getGroup ( const ISlotID slot) const
pure virtual

Returns the group entry directly in this object at that slot, or null if it does not exist. An invalid slot will always return null, and ANY slot will use slot 0 (default).

◆ getGroupName()

virtual QString itasca::IThing::getGroupName ( const ISlotID slot = ISlotID()) const
pure virtual

Returns the group name directly in this object at that slot, or the null name if it does not exist. The group_ and groupName_ parts of id are ignored. If all slots are specified, then returns a concatenation of all groups in all slots.

◆ getIsSet()

virtual bool itasca::IThing::getIsSet ( ) const
pure virtual

Returns a boolean indicating whether or not this is a set - a set is a container of things. The RangeElementSet works based on this identifier

◆ getIThing()

virtual IThing* itasca::IThing::getIThing ( )
pure virtual

Return the IThing interface.

◆ getLocation()

virtual DVect3 itasca::IThing::getLocation ( ) const
pure virtual

Returns a location in space associated with the IThing. By default, returns the origin. This value is used by the Range logic to filter objects based on position.

◆ getSet()

virtual const IThing* itasca::IThing::getSet ( ) const
pure virtual

Returns the iThing that is the set pointer. When checking with the RangeElementSet this is the IThing that is checked for being in filter if the returned IThing is a set (i.e., returns true for getIsSet).

◆ getType()

virtual TType itasca::IThing::getType ( ) const
pure virtual

This function returns a character string indicating the type. It may be compared directly by pointer value (fast), or a string comparison may be given. Used mostly for save/restore – to indicate the object type for polymorphic containers.

◆ isInGroup()

virtual uint itasca::IThing::isInGroup ( const FArray< IGroupID > &  ids,
TType  type = 0,
bool  only = false 
) const
pure virtual

Returns number of matches with ALL groups in ids. Applied either to this object directly, or possibly to connected objects. (For example, gridpoints in FLAC3D are considered a member of a group if any zones connected to them are in that group). If the type field is non-zero, will find matches in that type only in the heirarchy. If ONLY is given, no groups can be in the object in addition to those specified in ids.

◆ isWithinOrientation()

virtual bool itasca::IThing::isWithinOrientation ( const Orientation3 orientation,
const DVect2 &  tol 
) const
pure virtual

Returns TRUE if object can be considered to be part of the orientation specified, withing the tolerance. If Orientation is wasDefinedByNormal() then only tol.x() is considered, which is an angle in radians. Otherwise tol.x() is the angle from dip, and tol.y() is the angle from dip direction.

◆ removeGroup()

virtual bool itasca::IThing::removeGroup ( const IGroupID id)
pure virtual

Removes all entries matching g or name from this object, if not slot is specified. Returns true if one or more entries were removed. If by_ is not 0, an error occurs.

◆ setExtra()

virtual void itasca::IThing::setExtra ( uint  index,
const fish::IParameter p 
)
pure virtual

Returns an interface to the FISH extra variables for this object. May be null if no extra variables have ever been specified.


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