OpendTect-6_4  6.4
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
 
- Public Types inherited from DataPack
typedef int ID
 
typedef MultiID FullID
 

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 &)
 
 DataPointSet (const DataPointSet &)
 
virtual ~DataPointSet ()
 
DataPointSetoperator= (const 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
 
bool getRange (TrcKeyZSampling &) 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 *tr=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...
 
float nrKBytes () const
 
void dumpInfo (IOPar &) const
 
- Public Member Functions inherited from 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 &dp)
 
virtual ~DataPack ()
 
ID id () const
 
FullID fullID (int mgrid) const
 
virtual const char * category () const
 
virtual bool isOK () const
 
Threads::LockupdateLock () const
 
void release ()
 
DataPackobtain ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Protected Member Functions

void initPVDS ()
 
void init (const TypeSet< DataRow > &, const ObjectSet< DataColDef > &)
 
void calcIdxs ()
 
DataColDefgtColDef (ColID) const
 
- Protected Member Functions inherited from PointDataPack
 PointDataPack (const char *categry)
 
- Protected Member Functions inherited from DataPack
void setManager (const DataPackMgr *)
 
void setCategory (const char *c)
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

PosVecDataSetdata_
 
TypeSet< BinIDValueSet::SPosbvsidxs_
 
bool is2d_
 
bool minimal_
 
const int nrfixedcols_
 
- Protected Attributes inherited from DataPack
const ID id_
 
const BufferString category_
 
int nrusers_
 
Threads::Lock nruserslock_
 
Threads::Lock updatelock_
 
const DataPackMgrmanager_
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Static Protected Attributes

static const int groupcol_
 

Additional Inherited Members

- Static Public Member Functions inherited from DataPack
static ID getID (const FullID &fid)
 
static const char * sKeyCategory ()
 
static ID cNoID ()
 
- 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 ( const DataPointSet )
virtual DataPointSet::~DataPointSet ( )
virtual
DataPointSet::DataPointSet ( bool  is2d,
bool  minimal = false 
)

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!

void DataPointSet::dumpInfo ( IOPar ) const
virtual

Reimplemented from DataPack.

bool DataPointSet::extractPositions ( ::Pos::Provider ,
const ObjectSet< DataColDef > &  ,
const ::Pos::Filter f = 0,
TaskRunner tr = 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
bool DataPointSet::getRange ( TrcKeyZSampling ) 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
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
int DataPointSet::nrActive ( ) const
int DataPointSet::nrCols ( ) const
int DataPointSet::nrFixedCols ( ) const
inline
float DataPointSet::nrKBytes ( ) const
virtual

Implements DataPack.

DataPointSet& DataPointSet::operator= ( const DataPointSet )
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<BinIDValueSet::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. 2019