OpendTect  6.6
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
typedef MultiID FullID
 
typedef int ID
 
- 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
 
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
 
void dataChanged ()
 
DataRow dataRow (RowID) const
 
PosVecDataSetdataSet ()
 
const PosVecDataSetdataSet () const
 
void dumpInfo (IOPar &) const
 
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
 
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
 
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
 If true, coords are always SI().tranform(b) More...
 
int size () const
 
int trcNr (RowID) const
 
const UnitOfMeasureunit (ColID) const
 
bool validColID (ColID) const
 
float value (ColID, RowID) const
 
float z (RowID) 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 &)
 
virtual ~DataPack ()
 
virtual const char * category () const
 
FullID fullID (int mgrid) const
 
ID id () const
 
virtual bool isOK () const
 
DataPackobtain ()
 
void release ()
 
Threads::LockupdateLock () const
 
- 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
 
- 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 &)
 
virtual const name_typename () const
 
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
 

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)
 
- Protected Member Functions inherited from DataPack
void setCategory (const char *c)
 
void setManager (const DataPackMgr *)
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 

Protected Attributes

TypeSet< BinIDValueSet::SPosbvsidxs_
 
PosVecDataSetdata_
 
bool is2d_
 
bool minimal_
 
const int nrfixedcols_
 
- Protected Attributes inherited from DataPack
const BufferString category_
 
const ID id_
 
const DataPackMgrmanager_
 
int nrusers_
 
Threads::Lock nruserslock_
 
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 ID cNoID ()
 
static ID cUdfID ()
 
static ID getID (const FullID &fid)
 
static Notifier< DataPack > & instanceCreated ()
 
static const char * sKeyCategory ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- 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

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

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
virtual

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
virtual

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 ( IOPar ) const
virtual

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/2]

RowID DataPointSet::findFirst ( const BinID ) const

◆ findFirst() [2/2]

RowID DataPointSet::findFirst ( const Coord ) 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
virtual

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
inlinevirtual

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

Reimplemented from PointDataPack.

◆ size()

int DataPointSet::size ( ) const
inlinevirtual

Implements PointDataPack.

◆ trcNr()

int DataPointSet::trcNr ( RowID  ) const
virtual

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
virtual

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-2022