OpendTect-6_4  6.4
uivispartserv.h
Go to the documentation of this file.
1 #ifndef uivispartserv_h
2 #define uivispartserv_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: A.H. Bril
9  Date: Mar 2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uivismod.h"
16 #include "uiapplserv.h"
17 
18 #include "trckeyzsampling.h"
19 #include "datapack.h"
20 #include "keyboardevent.h"
21 #include "menuhandler.h"
22 #include "mouseevent.h"
23 #include "ranges.h"
24 #include "thread.h"
25 #include <typeinfo>
26 
27 class BufferStringSet;
28 class DataPointSet;
30 class PickSet;
32 class SeisTrcBuf;
33 class SurfaceInfo;
34 class TaskRunner;
35 class ZAxisTransform;
36 class uiMenuHandler;
37 class uiMPEMan;
39 class uiSlicePos3DDisp;
40 class uiToolBar;
42 class uiVisModeMgr;
43 class uiVisPickRetriever;
44 class uiDirLightDlg;
45 template <class T> class Selector;
46 
47 namespace Attrib { class SelSpec; }
48 namespace FlatView { class DataDispPars; }
49 namespace Threads { class Mutex; }
50 namespace visBase { class DataObject; class EventCatcher; }
51 namespace visSurvey { class Scene; }
52 namespace ColTab { class Sequence; class MapperSetup; }
53 namespace ZDomain { class Info; }
54 
55 
62  friend class uiMenuHandler;
63  friend class uiVisModeMgr;
64 
65 public:
67  ~uiVisPartServer();
68 
69  const char* name() const;
70  /*<\returns the partservers name */
71  NotifierAccess& removeAllNotifier();
72  /*<\Returns a notifier that is triggered
73  when the entire visualization is
74  closed. All visBase::DataObjects
75  must then be unrefed. */
76 
77  void setMouseCursorExchange(MouseCursorExchange*);
78 
79  visBase::DataObject* getObject( int id ) const;
80  int highestID() const;
81  void addObject( visBase::DataObject*, int sceneid,
82  bool saveinsessions);
83  void shareObject(int sceneid,int id);
84  void findObject(const std::type_info&,TypeSet<int>&);
85  void findObject(const MultiID&, TypeSet<int>& );
86  void removeObject(visBase::DataObject*,int sceneid);
87  void removeObject(int id,int sceneid);
88  void setObjectName(int,const uiString&);
89  uiString getObjectName(int) const;
90  Pos::GeomID getGeomID(int) const;
91 
94 
95  void removeSelection();
96 
97  int addScene(visSurvey::Scene* =0);
101  void removeScene(int);
102  NotifierAccess& nrScenesChange() { return nrscenesChange; }
103  bool clickablesInScene(const char* trackertype,
104  int sceneid) const;
105  const ObjectSet<visSurvey::Scene>& getAllScenes() const { return scenes_; }
106  void getSceneIds(TypeSet<int>& sceneids) const;
107 
108  void getChildIds(int id,TypeSet<int>&) const;
113  bool hasAttrib(int) const;
114  enum AttribFormat { None, Cube, Traces, RandomPos, OtherFormat };
130  AttribFormat getAttributeFormat(int id,int attrib) const;
131  bool canHaveMultipleAttribs(int id) const;
132  bool canAddAttrib(int id,int nrattribstoadd=1) const;
133  bool canRemoveAttrib(int id) const;
134  bool canRemoveDisplay(int id) const;
135  int addAttrib(int id);
136  void removeAttrib(int id,int attrib);
137  int getNrAttribs(int id) const;
138  void getAttribPosName(int id,int attrib,uiString&) const;
140  bool swapAttribs(int id,int attrib0,int attrib1);
141  void showAttribTransparencyDlg(int id,int attrib);
142  unsigned char getAttribTransparency(int id,int attrib) const;
143  void setAttribTransparency(int id,int attrib, unsigned char);
144  const TypeSet<Attrib::SelSpec>* getSelSpecs(int id,int attrib) const;
145  const Attrib::SelSpec* getSelSpec(int id,int attrib) const;
146 
147  void setSelSpec(int id,int attrib,const Attrib::SelSpec&);
148  void setSelSpecs(int id,int attrib,
149  const TypeSet<Attrib::SelSpec>&);
150  void setUserRefs(int id,int attrib,BufferStringSet*);
151  bool interpolationEnabled(int id) const;
154  void enableInterpolation(int id,bool yn);
157  bool isAngle(int id,int attrib) const;
159  void setAngleFlag(int id, int attrib, bool yn);
161  bool isAttribEnabled(int id,int attrib) const;
162  void enableAttrib(int id,int attrib,bool yn);
163  bool hasSingleColorFallback(int id) const;
164  void setTranslation(int visid,const Coord3& shift);
165  Coord3 getTranslation(int visid) const;
166 
167  //Volume data stuff
168  TrcKeyZSampling getTrcKeyZSampling(int id,int attrib=-1) const;
169  const RegularSeisDataPack* getCachedData(int id,int attrib) const;
170  bool setCubeData(int id,int attrib,
171  const RegularSeisDataPack*);
173  bool setDataPackID(int id,int attrib,DataPack::ID);
174  DataPack::ID getDataPackID(int id,int attrib) const;
175  DataPack::ID getDisplayedDataPackID(int id,int attrib) const;
176  DataPackMgr::ID getDataPackMgrID(int id) const;
177  int currentVersion(int id,int attrib) const;
178 
179  //Trace data
180  void getDataTraceBids(int id,TypeSet<BinID>&) const;
181  Interval<float> getDataTraceRange(int id) const;
182 
183  // See visSurvey::SurfaceDisplay for details
184  void getRandomPos(int visid,DataPointSet&) const;
185  void getRandomPosCache(int visid,int attrib,
186  DataPointSet& ) const;
187  void setRandomPosData(int visid, int attrib,
188  const DataPointSet*);
189 
190  bool hasMaterial(int id) const;
191  void setMaterial(int id);
192  bool hasColor(int id) const;
193  void setColor(int id,const Color&);
194 
195  bool blockMouseSelection(bool yn);
198  bool disabMenus(bool yn);
200  void createToolBars();
201  bool disabToolBars(bool yn);
204  bool showMenu(int id,int menutype=0,const TypeSet<int>* =0,
205  const Coord3& = Coord3::udf());
211  MenuHandler* getMenuHandler();
212  MenuHandler* getToolBarHandler();
213 
214  MultiID getMultiID(int) const;
215 
216  int getSelObjectId() const;
217  int getSelAttribNr() const;
218  void setSelObjectId(int visid,int attrib=-1);
219  void setCurInterObjID(int visid);
220  int getCurInterObjID() const;
221  int getSceneID(int visid) const;
222  const ZDomain::Info* zDomainInfo(int sceneid) const;
225  //Events and their functions
226  void unlockEvent();
230  int getEventObjId() const;
231  /*<\returns the id that triggered the event */
232  int getEventAttrib() const;
233  /*<\returns the attrib that triggered the event */
234 
235  static int evUpdateTree();
236  void triggerTreeUpdate();
237 
238  static int evSelection();
239  /*<! Get the id with getEventObjId() */
240 
241  static int evDeSelection();
242  /*<! Get the id with getEventObjId() */
243 
244  static int evGetNewData();
249  void calculateAllAttribs();
250  void calculateAllAttribs(int);
251  bool calculateAttrib(int id,int attrib,bool newsel,
252  bool ignorelocked=false);
253  bool calcManipulatedAttribs(int id);
254 
255  void movePlaneAndCalcAttribs(int,const TrcKeyZSampling&);
256 
257  bool canHaveMultipleTextures(int) const;
258  int nrTextures(int id,int attrib) const;
259  void selectTexture(int id,int attrib,int texture);
260  int selectedTexture(int id,int attrib) const;
261 
262  static int evMouseMove();
263  Coord3 getMousePos() const;
264  int zFactor() const { return zfactor_; }
265  BufferString getMousePosVal() const;
266  BufferString getMousePosString() const { return mouseposstr_; }
267  void getObjectInfo(int id,BufferString&) const;
268 
269  static int evKeyboardEvent();
271  const KeyboardEvent& getKeyboardEvent() const { return kbevent_; }
272  static int evMouseEvent();
274  const MouseEvent& getMouseEvent() const { return mouseevent_; }
275  void setSceneEventHandled();
276 
277  static int evSelectAttrib();
278 
279  static int evInteraction();
280  /*<! Get the id with getEventObjId() */
281  BufferString getInteractionMsg(int id) const;
285  static int evViewAll();
286  static int evToHomePos();
287 
288  // ColorTable stuff
289  void fillDispPars(int id,int attrib,
290  FlatView::DataDispPars&,bool) const;
291  const ColTab::MapperSetup* getColTabMapperSetup(int id,int attrib,
292  int version=mUdf(int)) const;
293  void setColTabMapperSetup(int id,int attrib,
294  const ColTab::MapperSetup&);
295  const ColTab::Sequence* getColTabSequence(int id,int attrib) const;
296  bool canSetColTabSequence(int id) const;
297  void setColTabSequence(int id,int attrib,
298  const ColTab::Sequence&);
299  bool canHandleColTabSeqTrans(int id,int attr) const;
300 
301  const TypeSet<float>* getHistogram(int id,int attrib) const;
302 
303  void displayMapperRangeEditForAttrbs(int id);
304  void displayMapperRangeEditForAttribs(int id,
305  int attribid);
306 
307  static int evColorTableChange();
308  void displaySceneColorbar(bool);
309  void manageSceneColorbar(int);
310  bool sceneColorbarDisplayed();
311 
312  Color getSceneAnnotCol(int);
313 
314  //General stuff
315  bool deleteAllObjects();
316  void setZStretch();
317  void setDirectionalLight();
318  bool setWorkingArea();
319  void setOnlyAtSectionsDisplay(int id,bool);
320  bool displayedOnlyAtSections(int id) const;
321  static int evViewModeChange();
322  void setViewMode(bool yn,bool notify=true);
323  void setSoloMode(bool,TypeSet< TypeSet<int> >,int);
324  bool isSoloMode() const;
325  bool isViewMode() const;
326  typedef enum { View, Interactive, Pick } WorkMode;
327  void setWorkMode(WorkMode,bool notify=true);
328  WorkMode getWorkMode() const;
329  enum SelectionMode { Polygon, Rectangle };
330  void setSelectionMode(SelectionMode);
331  SelectionMode getSelectionMode() const;
332  void turnSelectionModeOn(bool);
333  bool isSelectionModeOn() const;
335  void setZAxisTransform(int sceneid,ZAxisTransform*,
336  TaskRunner*);
337  const ZAxisTransform* getZAxisTransform(int sceneid) const;
338  visBase::EventCatcher* getEventCatcher(int sceneid);
339 
340  const Selector<Coord3>* getCoordSelector(int scene) const;
341  void turnOn(int,bool,bool doclean=false);
342  bool isOn(int) const;
343  void updateDisplay(bool,int,int refid=-1);
344  void setTopBotImg(int sceneid);
345 
346  bool canDuplicate(int) const;
347  int duplicateObject(int id,int sceneid);
350  // Tracking stuff
351  void turnSeedPickingOn(bool yn);
352  static int evPickingStatusChange();
353  static int evDisableSelTracker();
354  static int evShowMPESetupDlg();
355  static int evShowMPEParentPath();
356 
357  void reportTrackingSetupActive(bool yn);
358  bool isTrackingSetupActive() const;
359 
360  bool isPicking() const;
365  void getPickingMessage(BufferString&) const;
366 
367  static int evShowSetupGroupOnTop();
368  bool showSetupGroupOnTop(const char* grpnm);
369  const char* getTopSetupGroupName() const;
370 
371  void initMPEStuff();
372  static int evStoreEMObject();
373  static int evStoreEMObjectAs();
374  void storeEMObject(bool storeas);
375 
377  { return slicepostools_; }
378 
379  bool writeSceneToFile(int id,
380  const uiString& dlgtitle) const;
381 
382  bool usePar(const IOPar&);
383  void fillPar(IOPar&) const;
384 
385  bool canBDispOn2DViewer(int id) const;
386  bool isVerticalDisp(int id) const;
387 
388  void lock(int id,bool yn);
389  bool isLocked(int id) const;
390 
391  bool sendVisEvent(int);
392  void setMoreObjectsToDoHint(int sceneid,bool yn);
393  bool getMoreObjectsToDoHint(int sceneid) const;
395 
396 protected:
397 
398  void createMenuCB(CallBacker*);
399  void addToToolBarCB(CallBacker*);
400  void handleMenuCB(CallBacker*);
401 
402  visSurvey::Scene* getScene(int);
403  const visSurvey::Scene* getScene(int) const;
404 
405  bool selectAttrib(int id, int attrib);
406  void updateManipulatorStatus(visBase::DataObject*,
407  bool issel) const;
408 
409  void setMarkerPos(const TrcKeyValue&,
410  int dontsetscene);
411 
412  bool isManipulated(int id) const;
413  void acceptManipulation(int id);
414  bool resetManipulation(int id);
415 
416  void setUpConnections(int id);
418  void removeConnections(int id);
419 
420  void updateDraggers();
421  int getTypeSetIdx(int);
422 
424 
427 
430 
433 
435  int zfactor_;
441 
443  const char* topsetupgroupname_;
444  bool viewmode_;
445  WorkMode workmode_;
453 
454  int seltype_;
456 
457  void mouseCursorCB(CallBacker*);
458  void rightClickCB(CallBacker*);
459  void selectObjCB(CallBacker*);
460  void deselectObjCB(CallBacker*);
461  void updateSelObjCB(CallBacker*);
462  void interactionCB(CallBacker*);
463  void mouseMoveCB(CallBacker*);
464  void keyEventCB(CallBacker*);
465  void mouseEventCB(CallBacker*);
466  void vwAll(CallBacker*);
467  void toHome(CallBacker*);
468  void colTabChangeCB(CallBacker*);
469 
470  void mapperRangeEditChanged(CallBacker*);
471  void sequenceEditChanged(CallBacker*);
472 
476 
478 
479  static const char* sKeyWorkArea();
480  static const char* sKeyAppVel();
481 
486 
488 
490 
491  void triggerObjectMoved(int id);
492 
493 public:
494 };
495 
496 
498 {
499 public:
502 
503  bool allowTurnOn(int,bool);
504 
505 protected:
506 
508 };
509 
510 #endif
Definition: uivispartserv.h:114
Definition: uitoolbar.h:31
int seltype_
Definition: uivispartserv.h:454
MouseEvent mouseevent_
Definition: uivispartserv.h:439
#define mExpClass(module)
Definition: commondefs.h:160
Definition: trckeyvalue.h:27
Threads::Mutex & eventmutex_
Definition: uivispartserv.h:447
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
void turnOn(int flag)
Overrides the envirnonment variable.
uiTreeItemTBHandler * toolbar_
Definition: uivispartserv.h:426
Definition: menuhandler.h:187
MenuItem resmnuitem_
Definition: uivispartserv.h:475
Set of data points with group selection.
Definition: datapointset.h:48
const MouseEvent & getMouseEvent() const
Definition: uivispartserv.h:274
Surface info name/attribname with an ID (usually the EM-ID).
Definition: surfaceinfo.h:21
int eventattrib_
Definition: uivispartserv.h:449
Definition: uivispickretriever.h:22
MenuItem changematerialmnuitem_
Definition: uivispartserv.h:474
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Maps from [0,1] -> Color.
Definition: coltabsequence.h:37
int eventobjid_
Definition: uivispartserv.h:448
BufferString mouseposval_
Definition: uivispartserv.h:436
SelectionMode selectionmode_
Definition: uivispartserv.h:455
The Visualization Part Server.
Definition: uivispartserv.h:60
Interface class for Notifier. See comments there.
Definition: callback.h:161
ObjectSet< visSurvey::Scene > scenes_
Definition: uivispartserv.h:423
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:65
PickSet
Definition: picksetfact.h:19
uiDirLightDlg * dirlightdlg_
Definition: uivispartserv.h:489
bool issolomode_
Definition: uivispartserv.h:446
uiVisPartServer & visserv
Definition: uivispartserv.h:507
int ID
Each Mgr has its own ID.
Definition: datapack.h:147
Keyboard event.
Definition: keyboardevent.h:23
Definition: uimenuhandler.h:89
Definition: uimapperrangeeditordlg.h:27
uiSlicePos3DDisp * getUiSlicePos() const
Definition: uivispartserv.h:376
static const Coord3 & udf()
int selattrib_
Definition: uivispartserv.h:450
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
MenuItem resetmanipmnuitem_
Definition: uivispartserv.h:473
int ID
Definition: datapack.h:38
Used for displaying a polyline, preview for a random line created throught well path.
Definition: visarrowdisplay.h:20
bool isAngle(DataType)
Definition: mouseevent.h:202
int mapperrgeditordisplayid_
Definition: uivispartserv.h:451
FixedString None()
Definition: keystrs.h:90
Data display parameters.
Definition: flatview.h:187
Definition: uimenuhandler.h:27
bool blockmenus_
Definition: uivispartserv.h:483
uiSlicePos3DDisp * slicepostools_
Definition: uivispartserv.h:429
~uiVisModeMgr()
Definition: uivispartserv.h:501
Notifier< uiVisPartServer > nrscenesChange
Definition: uivispartserv.h:485
interface to threads that should be portable.
Definition: atomic.h:28
Coord3 xytmousepos_
Definition: uivispartserv.h:434
uiMenuHandler & menu_
Definition: uivispartserv.h:425
KeyboardEvent kbevent_
Definition: uivispartserv.h:438
bool allowTurnOn(int, bool)
NotifierAccess & nrScenesChange()
Definition: uivispartserv.h:102
visSurvey::Scene * sceneeventsrc_
Definition: uivispartserv.h:440
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
Definition: menuhandler.h:76
Toolbar for setting slice position _ 3D visualization display.
Definition: uivisslicepos3d.h:28
bool isOn(int flag=0xffff)
Class that can execute a task.
Definition: task.h:169
Definition: uivisdirlightdlg.h:28
FixedString Cube()
Definition: keystrs.h:51
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Notifier< uiVisPartServer > keyEvent
Definition: uivispartserv.h:270
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
uiMultiMapperRangeEditWin * multirgeditwin_
Definition: uivispartserv.h:431
Notifier< uiVisPartServer > mouseEvent
Definition: uivispartserv.h:273
uiVisPickRetriever * pickretriever_
Definition: uivispartserv.h:484
const char * topsetupgroupname_
Definition: uivispartserv.h:443
AttribFormat
Definition: uivispartserv.h:114
Database for 3D objects.
Definition: vissurvscene.h:76
int curinterpobjid_
Definition: uivispartserv.h:452
WorkMode workmode_
Definition: uivispartserv.h:445
int zFactor() const
Definition: uivispartserv.h:264
Interface for classes that select on basis of a key.
Definition: selector.h:25
Setup class for colortable Mapper.
Definition: coltabmapper.h:35
MouseCursorExchange * mousecursorexchange_
Definition: uivispartserv.h:487
WorkMode
Definition: uivispartserv.h:326
uiVisModeMgr * vismgr_
Definition: uivispartserv.h:482
bool mapperrgeditinact_
Definition: uivispartserv.h:432
bool tracksetupactive_
Definition: uivispartserv.h:442
BufferString getMousePosString() const
Definition: uivispartserv.h:266
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
A cartesian coordinate in 3D space.
Definition: coord.h:72
Index_Type GeomID
Definition: commontypes.h:52
BufferString mouseposstr_
Definition: uivispartserv.h:437
Definition: visannot.h:43
TypeSet< TypeSet< int > > displayids_
Definition: uivispartserv.h:477
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Notifier< uiVisPartServer > selectionmodeChange
Definition: uivispartserv.h:334
uiMPEMan * mpetools_
Definition: uivispartserv.h:428
Services from application level to &#39;Part servers&#39;.
Definition: uiapplserv.h:24
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
SelectionMode
Definition: uivispartserv.h:329
Notifier< uiVisPartServer > planeMovedEvent
Definition: uivispartserv.h:394
Definition: picklocation.h:21
uiVisModeMgr(uiVisPartServer *)
CNotifier< uiVisPartServer, int > objectRemoved
Definition: uivispartserv.h:93
set of seismic traces.
Definition: seisbuf.h:31
Color Table
Definition: coltab.h:22
Specifies an attribute selection (ID or output number of NN).
Definition: attribsel.h:45
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
Dialog for tracking properties.
Definition: uimpeman.h:38
const KeyboardEvent & getKeyboardEvent() const
Definition: uivispartserv.h:271
const ObjectSet< visSurvey::Scene > & getAllScenes() const
Definition: uivispartserv.h:105
bool viewmode_
Definition: uivispartserv.h:444
Makes available certain services that are needed on a higher level.
Definition: uiapplserv.h:48
#define mClass(module)
Definition: commondefs.h:164
Definition: seistype.h:26
CNotifier< uiVisPartServer, int > objectAdded
Definition: uivispartserv.h:92
Base class for z-axis transforms.
Definition: zaxistransform.h:37
int zfactor_
Definition: uivispartserv.h:435
Definition: bitmap2rgb.h:18
Definition: uivispartserv.h:497
Definition: mouseevent.h:73
Definition: visevent.h:87
Information of z-domain.
Definition: zdomain.h:91
Compound key consisting of ints.
Definition: multiid.h:25
Semblance Attribute.
Definition: attribdataholder.h:25
Definition: zdomain.h:20

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