OpendTect  7.0
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 ColID
 
typedef int RowID
 
- Public Types inherited from DataPack
using ID = DataPackID
 
using MgrID = DataPackMgrID
 
- Public Types inherited from ObjectWithName
typedef OD::String name_type
 

Public Member Functions

 DataPointSet (bool is2d, bool minimal=false)
 
 DataPointSet (const DataPointSet &)
 
 DataPointSet (const DataPointSet &, const ::Pos::Filter &)
 
 DataPointSet (const PosVecDataSet &, bool is2d, bool minimal=false)
 
 DataPointSet (const TypeSet< DataRow > &, const BufferStringSet &valnms, bool is2d, bool minimal=false)
 
 DataPointSet (const TypeSet< DataRow > &, const ObjectSet< DataColDef > &, bool is2d, bool minimal=false)
 
virtual ~DataPointSet ()
 
void addCol (const char *nm, const char *ref=0, const UnitOfMeasure *un=0)
 or use dataSet() to add columns More...
 
void addRow (const DataRow &)
 When finished, you have to call dataChanged() More...
 
BinID binID (RowID) const override
 
BinIDValueSetbivSet ()
 
const BinIDValueSetbivSet () const
 
int bivSetIdx (ColID idx) const
 
BinIDValueSet::SPos bvsPos (RowID rid) const
 
void clearData ()
 Keeps structure. More...
 
DataColDefcolDef (ColID i)
 
const DataColDefcolDef (ColID i) const
 
const char * colName (ColID) const
 
Coord coord (RowID) const override
 
void dataChanged ()
 
DataRow dataRow (RowID) const
 
PosVecDataSetdataSet ()
 
const PosVecDataSetdataSet () const
 
void dumpInfo (StringPairSet &) const override
 
bool extractPositions (::Pos::Provider &, const ObjectSet< DataColDef > &, const ::Pos::Filter *f=0, TaskRunner *tr=0, bool filterAccept=true)
 
RowID find (const Pos &) const
 
RowID find (const Pos &, float horradius, float deltaz) const
 
RowID findFirst (const BinID &) const
 
RowID findFirst (const Coord &) const
 
RowID findFirst (const TrcKey &) const
 
::Pos::GeomID geomID (RowID) const
 
bool getRange (TrcKeyZSampling &) const
 
RowID getRowID (BinIDValueSet::SPos) const
 
DataPointSetgetSubselected (int maxsz, const TypeSet< int > *selected_cols=0, bool allow_udf_values=true, const ObjectSet< Interval< float > > *value_ranges=0) const
 
float * getValues (RowID)
 
const float * getValues (RowID) const
 
unsigned short group (RowID) const
 
ColID indexOf (const char *) const
 
bool is2D () const
 
bool isEmpty () const
 
bool isInactive (RowID rid) const
 
bool isMinimal () const
 
bool isSelected (RowID) const
 
int nrActive () const
 
int nrCols () const
 
int nrFixedCols () const
 
float nrKBytes () const override
 
DataPointSetoperator= (const DataPointSet &)
 
Pos pos (RowID) const
 
void purgeInactive ()
 
void purgeSelected (bool selected_rows=true)
 
void randomSubselect (int maxsz)
 
int selGroup (RowID) const
 
void setEmpty ()
 
void setGroup (RowID, unsigned short)
 
void setInactive (RowID, bool)
 
bool setRow (const DataRow &)
 
void setSelected (RowID, int selgrp)
 
bool setValue (ColID, RowID, float)
 
bool simpleCoords () const override
 If true, coords are always SI().tranform(b) More...
 
int size () const override
 
TrcKey trcKey (RowID) const
 
int trcNr (RowID) const override
 
const UnitOfMeasureunit (ColID) const
 
bool validColID (ColID) const
 
float value (ColID, RowID) const
 
float z (RowID) const override
 
- 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
virtual const char * category () const
 
FullID fullID (DataPackMgrID mgrid) const
 
DataPackID id () const
 
virtual bool isOK () const
 
DataPackobtain ()
 
void release ()
 
Threads::LockupdateLock () const
 
- Public Member Functions inherited from SharedObject
 SharedObject (const char *nm=nullptr)
 
 SharedObject (const SharedObject &)
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) 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 detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 
- Public Member Functions inherited from RefCount::Referenced
void addObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
int nrRefs () const
 Only for expert use. More...
 
void ref () const
 
bool refIfReffed () const
 Don't use in production, for debugging. More...
 
void removeObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
bool tryRef () const
 Not for normal use. May become private. More...
 
void unRef () const
 
void unRefNoDelete () const
 

Protected Member Functions

void calcIdxs ()
 
DataColDefgtColDef (ColID) const
 
void init (const TypeSet< DataRow > &, const ObjectSet< DataColDef > &)
 
void initPVDS ()
 
- Protected Member Functions inherited from PointDataPack
 PointDataPack (const char *categry)
 
 ~PointDataPack ()
 
- Protected Member Functions inherited from DataPack
 DataPack (const char *categry)
 
 DataPack (const DataPack &)
 
 ~DataPack ()
 
void setCategory (const char *c)
 
void setManager (const DataPackMgr *)
 
- Protected Member Functions inherited from SharedObject
virtual ~SharedObject ()
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from RefCount::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
virtual ~Referenced ()
 
Referencedoperator= (const Referenced &)
 

Protected Attributes

TypeSet< BinIDValueSet::SPosbvsidxs_
 
PosVecDataSetdata_
 
bool is2d_
 
bool minimal_
 
const int nrfixedcols_
 
- Protected Attributes inherited from DataPack
const BufferString category_
 
const DataPackID id_
 
const DataPackMgrmanager_ = nullptr
 
Threads::Lock updatelock_
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- 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 DataPackID cNoID ()
 
static DataPackID cUdfID ()
 
static DataPackID getID (const FullID &fid)
 
static const char * sKeyCategory ()
 
- Static Public Member Functions inherited from SharedObject
static Notifier< SharedObject > & instanceCreated ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Static Public Member Functions inherited from RefCount::Referenced
static bool isSane (const Referenced *)
 
- Static Protected Member Functions inherited from DataPack
static DataPackID 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 binid_ consists of GeomID and TrcNr.

Do not mix 2D and 3D.

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

◆ ColID

typedef int DataPointSet::ColID

◆ RowID

typedef int DataPointSet::RowID

Constructor & Destructor Documentation

◆ DataPointSet() [1/6]

DataPointSet::DataPointSet ( const TypeSet< DataRow > &  ,
const ObjectSet< DataColDef > &  ,
bool  is2d,
bool  minimal = false 
)

◆ DataPointSet() [2/6]

DataPointSet::DataPointSet ( const TypeSet< DataRow > &  ,
const BufferStringSet valnms,
bool  is2d,
bool  minimal = false 
)

◆ DataPointSet() [3/6]

DataPointSet::DataPointSet ( const PosVecDataSet ,
bool  is2d,
bool  minimal = false 
)

◆ DataPointSet() [4/6]

DataPointSet::DataPointSet ( const DataPointSet ,
const ::Pos::Filter  
)

◆ DataPointSet() [5/6]

DataPointSet::DataPointSet ( const DataPointSet )

◆ ~DataPointSet()

virtual DataPointSet::~DataPointSet ( )
virtual

◆ DataPointSet() [6/6]

DataPointSet::DataPointSet ( bool  is2d,
bool  minimal = false 
)
explicit

Member Function Documentation

◆ addCol()

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

or use dataSet() to add columns

◆ addRow()

void DataPointSet::addRow ( const DataRow )

When finished, you have to call dataChanged()

◆ binID()

BinID DataPointSet::binID ( RowID  ) const
overridevirtual

Implements PointDataPack.

◆ bivSet() [1/2]

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

◆ bivSet() [2/2]

const BinIDValueSet& DataPointSet::bivSet ( ) const
inline

◆ bivSetIdx()

int DataPointSet::bivSetIdx ( ColID  idx) const
inline

◆ bvsPos()

BinIDValueSet::SPos DataPointSet::bvsPos ( RowID  rid) const
inline

◆ calcIdxs()

void DataPointSet::calcIdxs ( )
protected

◆ clearData()

void DataPointSet::clearData ( )

Keeps structure.

◆ colDef() [1/2]

DataColDef& DataPointSet::colDef ( ColID  i)
inline

◆ colDef() [2/2]

const DataColDef& DataPointSet::colDef ( ColID  i) const
inline

◆ colName()

const char* DataPointSet::colName ( ColID  ) const

◆ coord()

Coord DataPointSet::coord ( RowID  ) const
overridevirtual

Reimplemented from PointDataPack.

◆ dataChanged()

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()

DataRow DataPointSet::dataRow ( RowID  ) const

◆ dataSet() [1/2]

PosVecDataSet& DataPointSet::dataSet ( )
inline

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

◆ dataSet() [2/2]

const PosVecDataSet& DataPointSet::dataSet ( ) const
inline

◆ dumpInfo()

void DataPointSet::dumpInfo ( StringPairSet ) const
overridevirtual

Reimplemented from DataPack.

◆ extractPositions()

bool DataPointSet::extractPositions ( ::Pos::Provider ,
const ObjectSet< DataColDef > &  ,
const ::Pos::Filter f = 0,
TaskRunner tr = 0,
bool  filterAccept = true 
)

◆ find() [1/2]

RowID DataPointSet::find ( const Pos ) const

◆ find() [2/2]

RowID DataPointSet::find ( const Pos ,
float  horradius,
float  deltaz 
) const

◆ findFirst() [1/3]

RowID DataPointSet::findFirst ( const BinID ) const

◆ findFirst() [2/3]

RowID DataPointSet::findFirst ( const Coord ) const

◆ findFirst() [3/3]

RowID DataPointSet::findFirst ( const TrcKey ) const

◆ geomID()

::Pos::GeomID DataPointSet::geomID ( RowID  ) const

◆ getRange()

bool DataPointSet::getRange ( TrcKeyZSampling ) const

◆ getRowID()

RowID DataPointSet::getRowID ( BinIDValueSet::SPos  ) const

◆ getSubselected()

DataPointSet* DataPointSet::getSubselected ( int  maxsz,
const TypeSet< int > *  selected_cols = 0,
bool  allow_udf_values = true,
const ObjectSet< Interval< float > > *  value_ranges = 0 
) const

◆ getValues() [1/2]

float* DataPointSet::getValues ( RowID  )

◆ getValues() [2/2]

const float* DataPointSet::getValues ( RowID  ) const

◆ group()

unsigned short DataPointSet::group ( RowID  ) const

◆ gtColDef()

DataColDef& DataPointSet::gtColDef ( ColID  ) const
protected

◆ indexOf()

ColID DataPointSet::indexOf ( const char *  ) const

◆ init()

void DataPointSet::init ( const TypeSet< DataRow > &  ,
const ObjectSet< DataColDef > &   
)
protected

◆ initPVDS()

void DataPointSet::initPVDS ( )
protected

◆ is2D()

bool DataPointSet::is2D ( ) const
inline

◆ isEmpty()

bool DataPointSet::isEmpty ( ) const
inline

◆ isInactive()

bool DataPointSet::isInactive ( RowID  rid) const
inline

◆ isMinimal()

bool DataPointSet::isMinimal ( ) const
inline

◆ isSelected()

bool DataPointSet::isSelected ( RowID  ) const

◆ nrActive()

int DataPointSet::nrActive ( ) const

◆ nrCols()

int DataPointSet::nrCols ( ) const

◆ nrFixedCols()

int DataPointSet::nrFixedCols ( ) const
inline

◆ nrKBytes()

float DataPointSet::nrKBytes ( ) const
overridevirtual

Implements DataPack.

◆ operator=()

DataPointSet& DataPointSet::operator= ( const DataPointSet )

◆ pos()

Pos DataPointSet::pos ( RowID  ) const

◆ purgeInactive()

void DataPointSet::purgeInactive ( )

◆ purgeSelected()

void DataPointSet::purgeSelected ( bool  selected_rows = true)

◆ randomSubselect()

void DataPointSet::randomSubselect ( int  maxsz)

◆ selGroup()

int DataPointSet::selGroup ( RowID  ) const

◆ setEmpty()

void DataPointSet::setEmpty ( )

◆ setGroup()

void DataPointSet::setGroup ( RowID  ,
unsigned short   
)

◆ setInactive()

void DataPointSet::setInactive ( RowID  ,
bool   
)

◆ setRow()

bool DataPointSet::setRow ( const DataRow )

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

◆ setSelected()

void DataPointSet::setSelected ( RowID  ,
int  selgrp 
)

◆ setValue()

bool DataPointSet::setValue ( ColID  ,
RowID  ,
float   
)

◆ simpleCoords()

bool DataPointSet::simpleCoords ( ) const
inlineoverridevirtual

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

Reimplemented from PointDataPack.

◆ size()

int DataPointSet::size ( ) const
inlineoverridevirtual

Implements PointDataPack.

◆ trcKey()

TrcKey DataPointSet::trcKey ( RowID  ) const

◆ trcNr()

int DataPointSet::trcNr ( RowID  ) const
overridevirtual

Reimplemented from PointDataPack.

◆ unit()

const UnitOfMeasure* DataPointSet::unit ( ColID  ) const

◆ validColID()

bool DataPointSet::validColID ( ColID  ) const

◆ value()

float DataPointSet::value ( ColID  ,
RowID   
) const

◆ z()

float DataPointSet::z ( RowID  ) const
overridevirtual

Implements PointDataPack.

Member Data Documentation

◆ bvsidxs_

TypeSet<BinIDValueSet::SPos> DataPointSet::bvsidxs_
protected

◆ data_

PosVecDataSet& DataPointSet::data_
protected

◆ groupcol_

const int DataPointSet::groupcol_
staticprotected

◆ is2d_

bool DataPointSet::is2d_
protected

◆ minimal_

bool DataPointSet::minimal_
protected

◆ nrfixedcols_

const int DataPointSet::nrfixedcols_
protected

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