OpendTect  6.3
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DataPointSet Class Reference

Set of data points with group selection. More...

Inheritance diagram for DataPointSet:
[legend]

Classes

class  DataRow
 Data point with group. Group 0 means 'inactive', it can never be selected. More...
 
class  Pos
 Real Coord3D-position storable in BinIDValueSet + trc nr. More...
 

Public Types

typedef int RowID
 
typedef int ColID
 
typedef BinIDValueSet::SPos SPos
 
- Public Types inherited from DataPack
typedef FullID::PackID ID
 
typedef FullID::MgrID MgrID
 
- Public Types inherited from Monitorable
typedef int ChangeType
 
typedef int64_t IDType
 
typedef int64_t DirtyCountType
 
typedef CNotifier< Monitorable, ChangeDataChangeDataNotifier
 

Public Member Functions

 DataPointSet (const TypeSet< DataRow > &, const ObjectSet< DataColDef > &, bool is2d, bool minimal=false)
 
 DataPointSet (const TypeSet< DataRow > &, const BufferStringSet &valnms, bool is2d, bool minimal=false)
 
 DataPointSet (const PosVecDataSet &, bool is2d, bool minimal=false)
 
 DataPointSet (const DataPointSet &, const ::Pos::Filter &)
 
 mDeclMonitorableAssignment (DataPointSet)
 
bool is2D () const
 
bool isMinimal () const
 
bool isEmpty () const
 
void setEmpty ()
 
void clearData ()
 Keeps structure. More...
 
int nrCols () const
 
int nrFixedCols () const
 
const char * colName (ColID) const
 
const UnitOfMeasureunit (ColID) const
 
const DataColDefcolDef (ColID i) const
 
ColID indexOf (const char *) const
 
bool validColID (ColID) const
 
int size () const
 
BinID binID (RowID) const
 
Coord coord (RowID) const
 
float z (RowID) const
 
int trcNr (RowID) const
 
Pos pos (RowID) const
 
DataRow dataRow (RowID) const
 
float value (ColID, RowID) const
 
bool setValue (ColID, RowID, float)
 
float * getValues (RowID)
 
const float * getValues (RowID) const
 
unsigned short group (RowID) const
 
bool isSelected (RowID) const
 
int selGroup (RowID) const
 
bool isInactive (RowID rid) const
 
void setGroup (RowID, unsigned short)
 
void setSelected (RowID, int selgrp)
 
void setInactive (RowID, bool)
 
int nrActive () const
 
void purgeInactive ()
 
void purgeSelected (bool selected_rows=true)
 
RowID find (const Pos &) const
 
RowID find (const Pos &, float horradius, float deltaz) const
 
RowID findFirst (const Coord &) const
 
RowID findFirst (const BinID &) const
 
const PosVecDataSetdataSet () const
 
const BinIDValueSetbivSet () const
 
BinIDValueSetbivSet ()
 
PosVecDataSetdataSet ()
 
DataPointSetgetSubselected (int maxsz, const TypeSet< int > *selected_cols=0, bool allow_udf_values=true, const ObjectSet< Interval< float > > *value_ranges=0) const
 
void randomSubselect (int maxsz)
 
int bivSetIdx (ColID idx) const
 
void dataChanged ()
 
void addRow (const DataRow &)
 When finished, you have to call dataChanged() More...
 
bool setRow (const DataRow &)
 
RowID getRowID (BinIDValueSet::SPos) const
 
DataColDefcolDef (ColID i)
 
BinIDValueSet::SPos bvsPos (RowID rid) const
 
 DataPointSet (bool is2d, bool minimal=false)
 
bool extractPositions (::Pos::Provider &, const ObjectSet< DataColDef > &, const ::Pos::Filter *f=0, TaskRunner *tskr=0)
 
void addCol (const char *nm, const char *ref=0, const UnitOfMeasure *un=0)
 or use dataSet() to add columns More...
 
bool simpleCoords () const
 If true, coords are always SI().tranform(b) More...
 
- Public Member Functions inherited from PointDataPack
 mDeclAbstractMonitorableAssignment (PointDataPack)
 
virtual bool isOrdered () const
 If yes, one can draw a line between the pts. More...
 
- Public Member Functions inherited from DataPack
 DataPack (const char *categry)
 
 DataPack (const DataPack &)
 
DataPackoperator= (const DataPack &)
 
bool operator== (const DataPack &) const
 
bool operator!= (const DataPack &oth) const
 
virtual DataPackclone () const
 
ChangeType compareWith (const Monitorable &) const
 
int isOK () const
 
ID id () const
 
FullID fullID (MgrID mgrid) const
 
const char * category () const
 
float nrKBytes () const
 
bool dumpInfo (IOPar &iop) const
 
DBKey dbKey () const
 
void setDBKey (const DBKey &_set_to_)
 
int nrArrays () const
 
const ArrayND< float > * arrayData (int iarr) const
 
void release ()
 
DataPackobtain ()
 
- Public Member Functions inherited from SharedObject
 SharedObject (const char *nm=0)
 
 SharedObject (const SharedObject &)
 
SharedObjectoperator= (const SharedObject &)
 
bool operator== (const SharedObject &) const
 
bool operator!= (const SharedObject &oth) const
 
ChangeType compareWith (const Monitorable &) const
 
- Public Member Functions inherited from NamedMonitorable
 NamedMonitorable (const char *nm=0)
 
 NamedMonitorable (const NamedObject &)
 
virtual ~NamedMonitorable ()
 
 NamedMonitorable (const NamedMonitorable &)
 
NamedMonitorableoperator= (const NamedMonitorable &)
 
bool operator== (const NamedMonitorable &) const
 
bool operator!= (const NamedMonitorable &oth) const
 
virtual NamedMonitorablegetClone () const
 
virtual BufferString getName () const
 
virtual void setName (const char *)
 
- Public Member Functions inherited from Monitorable
 Monitorable (const Monitorable &)
 
virtual ~Monitorable ()
 
Monitorableoperator= (const Monitorable &)
 
bool operator== (const Monitorable &) const
 
virtual ChangeDataNotifierobjectChanged () const
 
virtual Notifier< Monitorable > & objectToBeDeleted () const
 
virtual void touch () const
 
virtual DirtyCountType dirtyCount () const
 
void sendChangeNotification (const ChangeData &) const
 
void sendEntireObjectChangeNotification () const
 
void transferNotifsTo (const Monitorable &, const CallBacker *onlyfor=0) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
bool getNameFromPar (const IOPar &)
 
void putNameInPar (IOPar &) const
 

Protected Member Functions

virtual ~DataPointSet ()
 
void initPVDS ()
 
void init (const TypeSet< DataRow > &, const ObjectSet< DataColDef > &)
 
void calcIdxs ()
 
DataColDefgtColDef (ColID) const
 
virtual float gtNrKBytes () const
 
virtual void doDumpInfo (IOPar &) const
 
- Protected Member Functions inherited from PointDataPack
 PointDataPack (const char *)
 
 ~PointDataPack ()
 
- Protected Member Functions inherited from DataPack
void copyAll (const DataPack &)
 
virtual ~DataPack ()
 
virtual const char * gtCategory () const
 
virtual int gtNrArrays () const
 
virtual const ArrayND< float > * gtArrayData (int) const
 
void setManager (const DataPackMgr *)
 
void setCategory (const char *c)
 
- Protected Member Functions inherited from SharedObject
void copyAll (const SharedObject &)
 
virtual ~SharedObject ()
 
- Protected Member Functions inherited from NamedMonitorable
void copyAll (const NamedMonitorable &)
 
- Protected Member Functions inherited from Monitorable
 Monitorable ()
 
void copyAll (const Monitorable &)
 
void sendChgNotif (AccessLocker &, const ChangeData &) const
 calls objectChanged with released lock More...
 
void sendChgNotif (AccessLocker &, ChangeType, IDType) const
 calls objectChanged with released lock More...
 
void sendDelNotif () const
 
void stopChangeNotifications () const
 
void resumeChangeNotifications () const
 
template<class T >
getMemberSimple (const T &) const
 the get function used by mImplSimpleMonitoredGet More...
 
template<class TMember , class TSetTo >
void setMemberSimple (TMember &, TSetTo, ChangeType, IDType)
 the set function used by mImplSimpleMonitoredSet More...
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Protected Attributes

PosVecDataSetdata_
 
TypeSet< SPosbvsidxs_
 
bool is2d_
 
bool minimal_
 
const int nrfixedcols_
 
- Protected Attributes inherited from DataPack
const ID id_
 
const BufferString category_
 
DBKey dbkey_
 
const DataPackMgrmanager_
 
- Protected Attributes inherited from Monitorable
Threads::Lock accesslock_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Static Protected Attributes

static const int groupcol_
 

Additional Inherited Members

- Static Public Member Functions inherited from DataPack
static Notifier< DataPack > & instanceCreated ()
 
static const char * sKeyCategory ()
 
static ID cNoID ()
 
static ChangeType cDBKeyChg ()
 
- Static Public Member Functions inherited from SharedObject
static Notifier< SharedObject > & instanceCreated ()
 
- Static Public Member Functions inherited from NamedMonitorable
static Notifier< NamedMonitorable > & instanceCreated ()
 
static ChangeType cNameChange ()
 
- Static Public Member Functions inherited from Monitorable
static Notifier< Monitorable > & instanceCreated ()
 defines static instanceCreated() More...
 
static ChangeType cEntireObjectChange ()
 
static ChangeType cNoChange ()
 
static IDType cUnspecChgID ()
 
static IDType cEntireObjectChgID ()
 
static ChangeType changeNotificationTypeOf (CallBacker *)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Types inherited from Monitorable
typedef Threads::Atomic< DirtyCountTypeDirtyCounter
 
- Static Protected Member Functions inherited from DataPack
static ID getNewID ()
 ensures a global data pack ID More...
 
static float sKb2MbFac ()
 1 / 1024 More...
 

Detailed Description

Set of data points with group selection.

The idea is to generate a set of data points, which are then put in different groups. The data is transferred into a BinIDValueSet for performance, but a fixed int addressing becomes available.

The design is based on the model that you extract data in some way which should then be quickly accessible. The data set is not meant to be manipulated other than via setSelected() and setGroup().

For data associated with 2D seismics, you can specify that the DataPointSet needs to be 2D; then also 'trcNr() can be used.

For large sets, you may not be interested in precise X and Y, and grouping/selection. Then specify the 'minimal' flag on construction.

Member Typedef Documentation

typedef int DataPointSet::ColID
typedef int DataPointSet::RowID

Constructor & Destructor Documentation

DataPointSet::DataPointSet ( const TypeSet< DataRow > &  ,
const ObjectSet< DataColDef > &  ,
bool  is2d,
bool  minimal = false 
)
DataPointSet::DataPointSet ( const TypeSet< DataRow > &  ,
const BufferStringSet valnms,
bool  is2d,
bool  minimal = false 
)
DataPointSet::DataPointSet ( const PosVecDataSet ,
bool  is2d,
bool  minimal = false 
)
DataPointSet::DataPointSet ( const DataPointSet ,
const ::Pos::Filter  
)
DataPointSet::DataPointSet ( bool  is2d,
bool  minimal = false 
)
virtual DataPointSet::~DataPointSet ( )
protectedvirtual

Member Function Documentation

void DataPointSet::addCol ( const char *  nm,
const char *  ref = 0,
const UnitOfMeasure un = 0 
)

or use dataSet() to add columns

void DataPointSet::addRow ( const DataRow )

When finished, you have to call dataChanged()

BinID DataPointSet::binID ( RowID  ) const
virtual

Implements PointDataPack.

const BinIDValueSet& DataPointSet::bivSet ( ) const
inline
BinIDValueSet& DataPointSet::bivSet ( )

The idea is to manage vectors with the selection mechanism. But if you really must remove vectors, this may be your access point

int DataPointSet::bivSetIdx ( ColID  idx) const
inline
BinIDValueSet::SPos DataPointSet::bvsPos ( RowID  rid) const
inline
void DataPointSet::calcIdxs ( )
protected
void DataPointSet::clearData ( )

Keeps structure.

const DataColDef& DataPointSet::colDef ( ColID  i) const
inline
DataColDef& DataPointSet::colDef ( ColID  i)
inline
const char* DataPointSet::colName ( ColID  ) const
Coord DataPointSet::coord ( RowID  ) const
virtual

Reimplemented from PointDataPack.

void DataPointSet::dataChanged ( )
inline

When data modified, you want to call this. all RowIDs may change In case you want to change the definition of a col

DataRow DataPointSet::dataRow ( RowID  ) const
const PosVecDataSet& DataPointSet::dataSet ( ) const
inline
PosVecDataSet& DataPointSet::dataSet ( )
inline

To add/remove columns. Never remove the position columns!

virtual void DataPointSet::doDumpInfo ( IOPar ) const
protectedvirtual

Reimplemented from DataPack.

bool DataPointSet::extractPositions ( ::Pos::Provider ,
const ObjectSet< DataColDef > &  ,
const ::Pos::Filter f = 0,
TaskRunner tskr = 0 
)
RowID DataPointSet::find ( const Pos ) const
RowID DataPointSet::find ( const Pos ,
float  horradius,
float  deltaz 
) const
RowID DataPointSet::findFirst ( const Coord ) const
RowID DataPointSet::findFirst ( const BinID ) const
RowID DataPointSet::getRowID ( BinIDValueSet::SPos  ) const
DataPointSet* DataPointSet::getSubselected ( int  maxsz,
const TypeSet< int > *  selected_cols = 0,
bool  allow_udf_values = true,
const ObjectSet< Interval< float > > *  value_ranges = 0 
) const
float* DataPointSet::getValues ( RowID  )
const float* DataPointSet::getValues ( RowID  ) const
unsigned short DataPointSet::group ( RowID  ) const
DataColDef& DataPointSet::gtColDef ( ColID  ) const
protected
virtual float DataPointSet::gtNrKBytes ( ) const
protectedvirtual

Implements DataPack.

ColID DataPointSet::indexOf ( const char *  ) const
void DataPointSet::init ( const TypeSet< DataRow > &  ,
const ObjectSet< DataColDef > &   
)
protected
void DataPointSet::initPVDS ( )
protected
bool DataPointSet::is2D ( ) const
inline
bool DataPointSet::isEmpty ( ) const
inline
bool DataPointSet::isInactive ( RowID  rid) const
inline
bool DataPointSet::isMinimal ( ) const
inline
bool DataPointSet::isSelected ( RowID  ) const
DataPointSet::mDeclMonitorableAssignment ( DataPointSet  )
int DataPointSet::nrActive ( ) const
int DataPointSet::nrCols ( ) const
int DataPointSet::nrFixedCols ( ) const
inline
Pos DataPointSet::pos ( RowID  ) const
void DataPointSet::purgeInactive ( )
void DataPointSet::purgeSelected ( bool  selected_rows = true)
void DataPointSet::randomSubselect ( int  maxsz)
int DataPointSet::selGroup ( RowID  ) const
void DataPointSet::setEmpty ( )
void DataPointSet::setGroup ( RowID  ,
unsigned  short 
)
void DataPointSet::setInactive ( RowID  ,
bool   
)
bool DataPointSet::setRow ( const DataRow )

Can be add or change Returns whether it's an add (see addRow)

void DataPointSet::setSelected ( RowID  ,
int  selgrp 
)
bool DataPointSet::setValue ( ColID  ,
RowID  ,
float   
)
bool DataPointSet::simpleCoords ( ) const
inlinevirtual

If true, coords are always SI().tranform(b)

Reimplemented from PointDataPack.

int DataPointSet::size ( ) const
inlinevirtual

Implements PointDataPack.

int DataPointSet::trcNr ( RowID  ) const
virtual

Reimplemented from PointDataPack.

const UnitOfMeasure* DataPointSet::unit ( ColID  ) const
bool DataPointSet::validColID ( ColID  ) const
float DataPointSet::value ( ColID  ,
RowID   
) const
float DataPointSet::z ( RowID  ) const
virtual

Implements PointDataPack.

Member Data Documentation

TypeSet<SPos> DataPointSet::bvsidxs_
protected
PosVecDataSet& DataPointSet::data_
protected
const int DataPointSet::groupcol_
staticprotected
bool DataPointSet::is2d_
protected
bool DataPointSet::minimal_
protected
const int DataPointSet::nrfixedcols_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017