OpendTect-6_4  6.4
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
FlatView::AuxDataEditor Class Reference

Editor for FlatView::AuxData. Allows the end-user to click-drag-release the points in data. Users of the class have the choice if the editor should do the changes for them, or if they want to do changes themself, driven by the callback. More...

Inheritance diagram for FlatView::AuxDataEditor:
[legend]

Public Member Functions

 AuxDataEditor (Viewer &, MouseEventHandler &)
 
virtual ~AuxDataEditor ()
 
int addAuxData (FlatView::AuxData *, bool doedit)
 
void removeAuxData (int id)
 
void enableEdit (int id, bool allowadd, bool allowmove, bool allowdelete)
 
void enablePolySel (int id, bool allowsel)
 
void setAddAuxData (int id)
 Added points will be added to this set. More...
 
int getAddAuxData () const
 
void setView (const Rect &wv, const Geom::Rectangle< int > &mouserect)
 
const Geom::PixRectangle< int > & getMouseArea () const
 
Rect getWorldRect (int dataid) const
 
void limitMovement (const Rect *)
 
bool isDragging () const
 
int getSelPtDataID () const
 
const TypeSet< int > & getSelPtIdx () const
 
const PointgetSelPtPos () const
 
void setSelectionPolygonRectangle (bool)
 If not rectangle, it's a polygon. More...
 
bool getSelectionPolygonRectangle () const
 If not rectangle, it's a polygon. More...
 
const OD::LineStylegetSelectionPolygonLineStyle () const
 
void setSelectionPolygonLineStyle (const OD::LineStyle &)
 
void getPointSelections (TypeSet< int > &ids, TypeSet< int > &idxs) const
 
const Viewerviewer () const
 
Viewerviewer ()
 
Sowersower ()
 
void setSelActive (bool yn)
 
bool isSelActive () const
 
const TypeSet< int > & getIds () const
 
const ObjectSet< AuxData > & getAuxData () const
 
void removePolygonSelected (int dataid)
 If dataid ==-1, all pts inside polygon is removed. More...
 
void setMenuHandler (MenuHandler *)
 
MenuHandlergetMenuHandler ()
 
MouseEventHandlermouseEventHandler ()
 
const PointmarkerPosAt (const Geom::Point2D< int > &mousepos) const
 
void setSelectionPolygonVisible (bool)
 
- 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...
 

Public Attributes

Notifier< AuxDataEditoraddAuxDataChange
 
Notifier< AuxDataEditormovementStarted
 
Notifier< AuxDataEditormovementFinished
 
CNotifier< AuxDataEditor, bool > removeSelected
 
Notifier< AuxDataEditorreleaseSelection
 

Protected Member Functions

void getPointSelections (const ObjectSet< AuxData > &polygon, TypeSet< int > &ids, TypeSet< int > &idxs) const
 
bool removeSelectionPolygon ()
 Returns true if viewer must be notified. More...
 
void mousePressCB (CallBacker *)
 
void mouseReleaseCB (CallBacker *)
 
void mouseMoveCB (CallBacker *)
 
void findSelection (const Geom::Point2D< int > &, int &seldatasetidx, TypeSet< int > *selptidxlist) const
 
bool updateSelection (const Geom::Point2D< int > &)
 
int dataSetIdxAt (const Geom::Point2D< int > &) const
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

Viewerviewer_
 
Sowersower_
 
ObjectSet< AuxDataauxdata_
 
TypeSet< int > ids_
 
BoolTypeSet allowadd_
 
BoolTypeSet allowmove_
 
BoolTypeSet allowremove_
 
BoolTypeSet allowpolysel_
 
BoolTypeSet doedit_
 
int addauxdataid_
 
ObjectSet< AuxDatapolygonsel_
 
OD::LineStyle polygonsellst_
 
bool polygonselrect_
 
bool isselactive_
 
AuxDatafeedback_
 
Geom::Point2D< int > prevpt_
 
Geom::PixRectangle< int > mousearea_
 
Rect curview_
 
MouseEventHandlermousehandler_
 
bool mousedown_
 
bool hasmoved_
 
int seldatasetidx_
 
TypeSet< int > selptidx_
 
Point selptcoord_
 
Rectmovementlimit_
 
MenuHandlermenuhandler_
 

Friends

class Sower
 

Detailed Description

Editor for FlatView::AuxData. Allows the end-user to click-drag-release the points in data. Users of the class have the choice if the editor should do the changes for them, or if they want to do changes themself, driven by the callback.

Constructor & Destructor Documentation

FlatView::AuxDataEditor::AuxDataEditor ( Viewer ,
MouseEventHandler  
)
virtual FlatView::AuxDataEditor::~AuxDataEditor ( )
virtual

Member Function Documentation

int FlatView::AuxDataEditor::addAuxData ( FlatView::AuxData ,
bool  doedit 
)
Parameters
doeditsays whether this object should change the auxdata, or if the user of the objects should do it.
Returns
an id of the new set.
int FlatView::AuxDataEditor::dataSetIdxAt ( const Geom::Point2D< int > &  ) const
protected
void FlatView::AuxDataEditor::enableEdit ( int  id,
bool  allowadd,
bool  allowmove,
bool  allowdelete 
)
void FlatView::AuxDataEditor::enablePolySel ( int  id,
bool  allowsel 
)
void FlatView::AuxDataEditor::findSelection ( const Geom::Point2D< int > &  ,
int &  seldatasetidx,
TypeSet< int > *  selptidxlist 
) const
protected
int FlatView::AuxDataEditor::getAddAuxData ( ) const
Returns
the id of the set that new points will be added to
const ObjectSet<AuxData>& FlatView::AuxDataEditor::getAuxData ( ) const
const TypeSet<int>& FlatView::AuxDataEditor::getIds ( ) const
MenuHandler* FlatView::AuxDataEditor::getMenuHandler ( )
const Geom::PixRectangle<int>& FlatView::AuxDataEditor::getMouseArea ( ) const
inline
void FlatView::AuxDataEditor::getPointSelections ( TypeSet< int > &  ids,
TypeSet< int > &  idxs 
) const

Each point within the limits of the polygons will be put in the typesets.

void FlatView::AuxDataEditor::getPointSelections ( const ObjectSet< AuxData > &  polygon,
TypeSet< int > &  ids,
TypeSet< int > &  idxs 
) const
protected

Each point within the limits of the polygons will be put in the typesets.

const OD::LineStyle& FlatView::AuxDataEditor::getSelectionPolygonLineStyle ( ) const
bool FlatView::AuxDataEditor::getSelectionPolygonRectangle ( ) const

If not rectangle, it's a polygon.

int FlatView::AuxDataEditor::getSelPtDataID ( ) const
const TypeSet<int>& FlatView::AuxDataEditor::getSelPtIdx ( ) const
const Point& FlatView::AuxDataEditor::getSelPtPos ( ) const
Rect FlatView::AuxDataEditor::getWorldRect ( int  dataid) const
bool FlatView::AuxDataEditor::isDragging ( ) const
inline
bool FlatView::AuxDataEditor::isSelActive ( ) const
inline
void FlatView::AuxDataEditor::limitMovement ( const Rect )

When movement starts, the movement is unlimited. Movement can be limited once the movement started by calling limitMovement.

const Point* FlatView::AuxDataEditor::markerPosAt ( const Geom::Point2D< int > &  mousepos) const
MouseEventHandler& FlatView::AuxDataEditor::mouseEventHandler ( )
inline
void FlatView::AuxDataEditor::mouseMoveCB ( CallBacker )
protected
void FlatView::AuxDataEditor::mousePressCB ( CallBacker )
protected
void FlatView::AuxDataEditor::mouseReleaseCB ( CallBacker )
protected
void FlatView::AuxDataEditor::removeAuxData ( int  id)
void FlatView::AuxDataEditor::removePolygonSelected ( int  dataid)

If dataid ==-1, all pts inside polygon is removed.

bool FlatView::AuxDataEditor::removeSelectionPolygon ( )
protected

Returns true if viewer must be notified.

void FlatView::AuxDataEditor::setAddAuxData ( int  id)

Added points will be added to this set.

void FlatView::AuxDataEditor::setMenuHandler ( MenuHandler )
void FlatView::AuxDataEditor::setSelActive ( bool  yn)
void FlatView::AuxDataEditor::setSelectionPolygonLineStyle ( const OD::LineStyle )
void FlatView::AuxDataEditor::setSelectionPolygonRectangle ( bool  )

If not rectangle, it's a polygon.

void FlatView::AuxDataEditor::setSelectionPolygonVisible ( bool  )
void FlatView::AuxDataEditor::setView ( const Rect wv,
const Geom::Rectangle< int > &  mouserect 
)

User of the class must ensure that both the wv and the mouserect are up to date at all times.

Sower& FlatView::AuxDataEditor::sower ( )
inline
bool FlatView::AuxDataEditor::updateSelection ( const Geom::Point2D< int > &  )
protected
Returns
true if something is selected
const Viewer& FlatView::AuxDataEditor::viewer ( ) const
inline
Viewer& FlatView::AuxDataEditor::viewer ( )
inline

Friends And Related Function Documentation

friend class Sower
friend

Member Data Documentation

Notifier<AuxDataEditor> FlatView::AuxDataEditor::addAuxDataChange
int FlatView::AuxDataEditor::addauxdataid_
protected
BoolTypeSet FlatView::AuxDataEditor::allowadd_
protected
BoolTypeSet FlatView::AuxDataEditor::allowmove_
protected
BoolTypeSet FlatView::AuxDataEditor::allowpolysel_
protected
BoolTypeSet FlatView::AuxDataEditor::allowremove_
protected
ObjectSet<AuxData> FlatView::AuxDataEditor::auxdata_
protected
Rect FlatView::AuxDataEditor::curview_
protected
BoolTypeSet FlatView::AuxDataEditor::doedit_
protected
AuxData* FlatView::AuxDataEditor::feedback_
protected
bool FlatView::AuxDataEditor::hasmoved_
protected
TypeSet<int> FlatView::AuxDataEditor::ids_
protected
bool FlatView::AuxDataEditor::isselactive_
protected
MenuHandler* FlatView::AuxDataEditor::menuhandler_
protected
Geom::PixRectangle<int> FlatView::AuxDataEditor::mousearea_
protected
bool FlatView::AuxDataEditor::mousedown_
protected
MouseEventHandler& FlatView::AuxDataEditor::mousehandler_
protected
Notifier<AuxDataEditor> FlatView::AuxDataEditor::movementFinished
Rect* FlatView::AuxDataEditor::movementlimit_
protected
Notifier<AuxDataEditor> FlatView::AuxDataEditor::movementStarted
ObjectSet<AuxData> FlatView::AuxDataEditor::polygonsel_
protected
OD::LineStyle FlatView::AuxDataEditor::polygonsellst_
protected
bool FlatView::AuxDataEditor::polygonselrect_
protected
Geom::Point2D<int> FlatView::AuxDataEditor::prevpt_
protected
Notifier<AuxDataEditor> FlatView::AuxDataEditor::releaseSelection
CNotifier<AuxDataEditor,bool> FlatView::AuxDataEditor::removeSelected

if getSelPtDataID==-1 selection polygon changed else If selPtIdx()==-1, position should be added, else point moved. Boolean is true if this is the end of user interaction

int FlatView::AuxDataEditor::seldatasetidx_
protected
Point FlatView::AuxDataEditor::selptcoord_
protected
TypeSet<int> FlatView::AuxDataEditor::selptidx_
protected
Sower* FlatView::AuxDataEditor::sower_
protected
Viewer& FlatView::AuxDataEditor::viewer_
protected

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