OpendTect-6_4  6.4
basemap.h
Go to the documentation of this file.
1 #ifndef basemap_h
2 #define basemap_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: Sep 2009
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "generalmod.h"
16 #include "draw.h"
17 #include "namedobj.h"
18 #include "threadlock.h"
19 
20 namespace OD { class RGBImage; }
21 
22 class MarkerStyle2D;
23 class MouseEvent;
24 class TaskRunner;
25 template <class T> class ODPolygon;
26 
31 {
32 public:
33 
35 
36  BaseMapObject(const char* nm);
37  ~BaseMapObject();
38 
39  int ID() const { return id_; }
40 
42  virtual void updateGeometry() {}
43 
44  virtual void setType(const char* tp) { typenm_ = tp;}
45  virtual const char* getType() const { return typenm_; }
46 
47  virtual void setDepth(int val);
48  virtual int getDepth() const { return depth_; }
52  virtual int nrShapes() const;
53  virtual const char* getShapeName(int shapeidx) const;
54  virtual void getPoints(int shapeidx,TypeSet<Coord>&) const;
57  virtual bool getBoundingBox(BoundingBox&) const;
58  virtual Alignment getAlignment(int shapeidx) const;
59  virtual float getTextRotation() const { return 0; }
60  virtual Color getColor() const;
61 
62  virtual void setMarkerStyle(int idx,const MarkerStyle2D&) {}
63  virtual const MarkerStyle2D* getMarkerStyle(int shapeidx) const { return 0;}
64  virtual BufferString getImageFileName(int idx) const { return ""; }
65  virtual void getXYScale(int idx,float& scx,float& scy) const
66  { scx = scy = 1.f; }
67  virtual void setXYScale(int idx,float scx,float scy) {}
68 
69  virtual void setLineStyle(int idx,const OD::LineStyle&) {}
70  virtual const OD::LineStyle* getLineStyle(int shapeidx) const { return 0; }
71 
72  virtual void setFillColor(int idx,const Color&) {}
73  virtual const Color getFillColor(int idx) const
74  { return Color::NoColor();}
75 
76  virtual bool fill(int shapeidx) const { return false;}
77  virtual bool close(int shapeidx) const { return false;}
78  virtual bool multicolor( int shapeidx ) const
79  { return false; }
80 
81  virtual void setImage(int idx,OD::RGBImage*) {}
82  virtual const OD::RGBImage* getImage(int shapeidx) const { return 0;}
83 
84  virtual const OD::RGBImage* createImage(Coord& origin,Coord& p11) const;
88  virtual const OD::RGBImage* createPreview(int approxdiagonal) const;
92  virtual bool allowHoverEvent(int) const { return true; }
93 
94  virtual bool canRemoveWithPolygon() const { return false; }
95  virtual void removeWithPolygon(const ODPolygon<double>&) {}
96 
97  virtual void getMousePosInfo(Coord3&,TrcKey&,float& val,
98  BufferString& info) const {}
99 
100  virtual bool fillPar(IOPar&) const;
101  virtual bool usePar(const IOPar&,TaskRunner* taskr=0);
102 
109 
110 protected:
111  int depth_;
112  int id_;
114 };
115 
116 
119 {
120 public:
121 
122  virtual void addObject(BaseMapObject*) = 0;
126  virtual void removeObject(const BaseMapObject*) = 0;
127 
128 };
129 
130 
131 #endif
virtual const char * getType() const
Definition: basemap.h:45
#define mExpClass(module)
Definition: commondefs.h:160
virtual bool canRemoveWithPolygon() const
Definition: basemap.h:94
virtual int getDepth() const
Definition: basemap.h:48
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
virtual const MarkerStyle2D * getMarkerStyle(int shapeidx) const
Definition: basemap.h:63
Definition: draw.h:21
virtual const OD::RGBImage * getImage(int shapeidx) const
Definition: basemap.h:82
virtual void setLineStyle(int idx, const OD::LineStyle &)
Definition: basemap.h:69
int id_
Definition: basemap.h:112
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Definition: draw.h:60
Definition: draw.h:118
Notifier< BaseMapObject > zvalueChanged
Definition: basemap.h:107
virtual void setImage(int idx, OD::RGBImage *)
Definition: basemap.h:81
virtual BufferString getImageFileName(int idx) const
Definition: basemap.h:64
(Closed) sequence of connected 2-D coordinates.
Definition: polygon.h:27
virtual void setFillColor(int idx, const Color &)
Definition: basemap.h:72
Notifier< BaseMapObject > changed
Definition: basemap.h:105
virtual void updateGeometry()
Definition: basemap.h:42
A cartesian coordinate in 2D space.
Definition: coord.h:25
void setDepth(IOPar &)
virtual float getTextRotation() const
Definition: basemap.h:59
Threads::Lock lock_
Definition: basemap.h:41
virtual void setXYScale(int idx, float scx, float scy)
Definition: basemap.h:67
Notifier< BaseMapObject > stylechanged
Definition: basemap.h:106
Definition: basemap.h:118
int ID() const
Definition: basemap.h:39
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Class that can execute a task.
Definition: task.h:169
virtual const Color getFillColor(int idx) const
Definition: basemap.h:73
virtual bool multicolor(int shapeidx) const
Definition: basemap.h:78
virtual void setType(const char *tp)
Definition: basemap.h:44
virtual bool close(int shapeidx) const
Definition: basemap.h:77
CNotifier< BaseMapObject, const uiString & > nameChanged
Definition: basemap.h:108
virtual const OD::LineStyle * getLineStyle(int shapeidx) const
Definition: basemap.h:70
int depth_
Definition: basemap.h:111
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
virtual void getXYScale(int idx, float &scx, float &scy) const
Definition: basemap.h:65
A cartesian coordinate in 3D space.
Definition: coord.h:72
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Object with a name.
Definition: namedobj.h:35
virtual void getMousePosInfo(Coord3 &, TrcKey &, float &val, BufferString &info) const
Definition: basemap.h:97
CNotifier< BaseMapObject, const MouseEvent & > rightClicked
Definition: basemap.h:104
virtual void removeWithPolygon(const ODPolygon< double > &)
Definition: basemap.h:95
OpendTect.
Definition: commontypes.h:29
virtual bool allowHoverEvent(int) const
Definition: basemap.h:92
virtual bool fill(int shapeidx) const
Definition: basemap.h:76
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
BufferString typenm_
Definition: basemap.h:113
virtual void setMarkerStyle(int idx, const MarkerStyle2D &)
Definition: basemap.h:62
Class for Red, Green, Blue image.
Definition: odimage.h:28
Represents a unique trace position in one of the surveys that OpendTect is managing.
Definition: trckey.h:28
CNotifier< BaseMapObject, const MouseEvent & > leftClicked
Definition: basemap.h:103
Geom::PosRectangle< double > BoundingBox
Definition: basemap.h:34
Definition: basemap.h:30
Definition: mouseevent.h:73
static Color NoColor()
Definition: color.h:75

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