OpendTect  6.3
basemap.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: K. Tingdahl
8  Date: Sep 2009
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "generalmod.h"
14 #include "draw.h"
15 #include "notify.h"
16 #include "namedmonitorable.h"
17 #include "odpresentationmgr.h"
18 
19 namespace OD
20 {
21  class RGBImage;
22  class LineStyle;
23  class MarkerStyle2D;
24 }
25 
26 
27 class MouseEvent;
28 class TaskRunner;
29 template <class T> class ODPolygon;
30 
35 {
36 public:
37 
39 
40  BaseMapObject(const char* nm);
41  ~BaseMapObject();
42 
43  int ID() const { return id_; }
44 
46  virtual void updateGeometry() {}
47 
48  virtual void setType(const char* tp) { typenm_ = tp;}
49  virtual const char* getType() const { return typenm_; }
50 
51  virtual void setDepth(int val);
52  virtual int getDepth() const { return depth_; }
56  virtual int nrShapes() const;
57  virtual const char* getShapeName(int shapeidx) const;
58  virtual void getPoints(int shapeidx,TypeSet<Coord>&) const;
61  virtual bool getBoundingBox(BoundingBox&) const;
63  virtual OD::Alignment getAlignment(int shapeidx) const;
64  virtual float getTextRotation() const { return 0; }
65  virtual Color getColor() const;
66 
67  virtual void setMarkerStyle(int idx,
68  const OD::MarkerStyle2D&) {}
69  virtual const OD::MarkerStyle2D* getMarkerStyle(int shapeidx) const
70  { return 0;}
71  virtual BufferString getImageFileName(int idx) const { return ""; }
72  virtual void getXYScale(int idx,float& scx,float& scy) const
73  { scx = scy = 1.f; }
74  virtual void setXYScale(int idx,float scx,float scy) {}
75 
76  virtual void setLineStyle(int shapeidx,
77  const OD::LineStyle&) {}
78  virtual const OD::LineStyle* getLineStyle(int shapeidx) const { return 0; }
79 
80  virtual void setFillColor(int idx,const Color&) {}
81  virtual const Color getFillColor(int idx) const
82  { return Color::NoColor();}
83 
84  virtual bool fill(int shapeidx) const { return false;}
85  virtual bool close(int shapeidx) const { return false;}
86  virtual bool multicolor(int shapeidx) const { return false;}
87 
88  virtual void setImage(int idx,OD::RGBImage*) {}
89  virtual const OD::RGBImage* getImage(int shapeidx) const { return 0;}
90 
91  virtual const OD::RGBImage* createImage(Coord& origin,Coord& p11) const;
95  virtual const OD::RGBImage* createPreview(int approxdiagonal) const;
99  virtual bool allowHoverEvent(int) const { return true; }
100 
101  virtual bool canRemoveWithPolygon() const { return false; }
102  virtual void removeWithPolygon(const ODPolygon<double>&) {}
103 
104  virtual void getMousePosInfo(Coord3&,TrcKey&,float& val,
105  BufferString& info) const {}
106 
107  virtual bool fillPar(IOPar&) const;
108  virtual bool usePar(const IOPar&,TaskRunner* taskr=0);
109 
116 
117 protected:
118  int depth_;
119  int id_;
121 };
122 
124 
126 mExpClass(General) BaseMap : public OD::PresentationManagedViewer
127 {
128 public:
129 
130  BaseMap();
132  { return theViewerTypeID(); }
134  { return theViewerBasemapTypeID; }
135  virtual void addObject(BaseMapObject*) = 0;
139  virtual void removeObject(const BaseMapObject*) = 0;
140 
141 };
virtual const char * getType() const
Definition: basemap.h:49
virtual const OD::MarkerStyle2D * getMarkerStyle(int shapeidx) const
Definition: basemap.h:69
#define mExpClass(module)
Definition: commondefs.h:157
virtual bool canRemoveWithPolygon() const
Definition: basemap.h:101
virtual int getDepth() const
Definition: basemap.h:52
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:51
Monitorable object with a name. All but name() are MT-safe.
Definition: namedmonitorable.h:20
virtual const OD::RGBImage * getImage(int shapeidx) const
Definition: basemap.h:89
int id_
Definition: basemap.h:119
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Definition: draw.h:119
Notifier< BaseMapObject > zvalueChanged
Definition: basemap.h:114
virtual void setImage(int idx, OD::RGBImage *)
Definition: basemap.h:88
virtual BufferString getImageFileName(int idx) const
Definition: basemap.h:71
(Closed) sequence of connected 2-D coordinates.
Definition: polygon.h:25
virtual void setFillColor(int idx, const Color &)
Definition: basemap.h:80
OD::ViewerTypeID viewerTypeID() const
Definition: basemap.h:131
Notifier< BaseMapObject > changed
Definition: basemap.h:112
virtual void updateGeometry()
Definition: basemap.h:46
void setDepth(IOPar &)
virtual float getTextRotation() const
Definition: basemap.h:64
static OD::ViewerTypeID theViewerTypeID()
Definition: basemap.h:133
Threads::Lock lock_
Definition: basemap.h:45
virtual void setXYScale(int idx, float scx, float scy)
Definition: basemap.h:74
FixedString LineStyle()
Definition: keystrs.h:80
Definition: basemap.h:126
Definition: groupedid.h:40
Definition: draw.h:21
int ID() const
Definition: basemap.h:43
3D point or vector
Definition: commontypes.h:57
Set of (small) copyable elements.
Definition: commontypes.h:26
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
Class that can execute a task.
Definition: task.h:193
virtual const Color getFillColor(int idx) const
Definition: basemap.h:81
virtual bool multicolor(int shapeidx) const
Definition: basemap.h:86
static OD::ViewerTypeID theViewerBasemapTypeID(OD::ViewerTypeID::get(2))
Definition: draw.h:63
virtual void setType(const char *tp)
Definition: basemap.h:48
virtual void setLineStyle(int shapeidx, const OD::LineStyle &)
Definition: basemap.h:76
virtual bool close(int shapeidx) const
Definition: basemap.h:85
CNotifier< BaseMapObject, const uiString & > nameChanged
Definition: basemap.h:115
virtual const OD::LineStyle * getLineStyle(int shapeidx) const
Definition: basemap.h:78
int depth_
Definition: basemap.h:118
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
virtual void getXYScale(int idx, float &scx, float &scy) const
Definition: basemap.h:72
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
Notifier< BaseMapObject > styleChanged
Definition: basemap.h:113
virtual void getMousePosInfo(Coord3 &, TrcKey &, float &val, BufferString &info) const
Definition: basemap.h:104
static GroupID get(GroupNrT i)
Definition: groupedid.h:40
CNotifier< BaseMapObject, const MouseEvent & > rightClicked
Definition: basemap.h:111
virtual void removeWithPolygon(const ODPolygon< double > &)
Definition: basemap.h:102
OpendTect.
Definition: commontypes.h:25
virtual bool allowHoverEvent(int) const
Definition: basemap.h:99
virtual bool fill(int shapeidx) const
Definition: basemap.h:84
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:24
BufferString typenm_
Definition: basemap.h:120
Class for Red, Green, Blue image.
Definition: odimage.h:26
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:26
CNotifier< BaseMapObject, const MouseEvent & > leftClicked
Definition: basemap.h:110
2D point or vector class.
Definition: commontypes.h:58
virtual void setMarkerStyle(int idx, const OD::MarkerStyle2D &)
Definition: basemap.h:67
Geom::PosRectangle< double > BoundingBox
Definition: basemap.h:38
Definition: basemap.h:34
Definition: mouseevent.h:72
static Color NoColor()
Definition: color.h:74

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