1 #ifndef uigraphicsitem_h 2 #define uigraphicsitem_h 15 #include "uibasemod.h" 37 mQtclass(QGraphicsItem*) qGraphicsItem() {
return qgraphicsitem_; }
38 const mQtclass(QGraphicsItem*) qGraphicsItem()
39 const {
return qgraphicsitem_; }
44 virtual void setAcceptHoverEvents(
bool);
46 virtual void setFiltersChildEvents(
bool);
47 virtual void setMovable(
bool);
48 virtual void setSelectable(
bool);
49 virtual void setSelected(
bool);
50 virtual void setVisible(
bool);
53 virtual bool isFiltersChildEventsEnabled()
const;
54 virtual bool isHoverEventsAccepted()
const;
55 virtual bool isMovable()
const;
56 virtual bool isSelectable()
const;
57 virtual bool isSelected()
const {
return selected_; }
58 virtual bool isVisible()
const;
62 void setPos(
const uiPoint& p );
64 void setPos(
float x,
float y );
65 void moveBy(
float x,
float y);
67 void getScale(
float& sx,
float& sy);
68 void setRotation(
float angle);
69 void setScale(
float sx,
float sy);
73 uiGraphicsItem* getChild(
int);
74 bool isPresent(
const uiGraphicsItem&)
const;
75 int nrChildren()
const;
76 void removeChild(uiGraphicsItem*,
bool withdelete);
78 void addChild(uiGraphicsItem*);
81 void setItemIgnoresTransformations(
bool);
82 bool isItemIgnoresTransformationsEnabled()
const;
83 virtual uiRect boundingRect()
const;
85 virtual void setPenStyle(
const OD::LineStyle&,
bool usetransp=
false);
86 virtual void setPenColor(
const Color&,
bool usetransp=
false);
87 virtual void setFillColor(
const Color&,
bool usetransp=
false);
89 virtual void setTransparency(
float);
100 virtual uiGraphicsItem* findItem(QGraphicsItem*);
102 int id()
const {
return id_; }
103 int getZValue()
const;
106 void rotate(
float angle) { setRotation(angle); }
107 void scale(
float sx,
float sy) { setScale( sx, sy ); }
109 virtual void translateText();
115 uiGraphicsItem(QGraphicsItem*);
117 mQtclass(QGraphicsItem*) qgraphicsitem_;
119 virtual
mQtclass(QGraphicsItem*) mkQtObj() {
return 0; }
123 uiGraphicsItem* parent_;
125 virtual
void stPos(
float,
float);
129 void updateTransform();
131 static
int getNewID();
147 void add( uiGraphicsItem* itm ) { (*this) += itm; }
148 uiGraphicsItem*
get(
int idx ) {
return (*
this)[idx]; }
149 const uiGraphicsItem*
get(
int idx )
const {
return (*
this)[idx]; }
152 void setVisible(
bool yn);
170 void add(uiGraphicsItem*);
171 void remove(uiGraphicsItem*,
bool withdelete);
173 bool isEmpty()
const {
return items_.isEmpty(); }
174 int size()
const {
return items_.size(); }
175 uiGraphicsItem*
getUiItem(
int idx ) {
return gtItm(idx); }
176 const uiGraphicsItem*
getUiItem(
int idx )
const {
return gtItm(idx); }
177 bool isPresent(
const uiGraphicsItem&)
const;
178 virtual uiGraphicsItem* findItem(QGraphicsItem*);
180 virtual bool isVisible()
const;
181 virtual void setVisible(
bool);
182 virtual uiRect boundingRect()
const;
184 {
return qgraphicsitemgrp_; }
188 void translateText();
194 mQtclass(QGraphicsItemGroup*) qgraphicsitemgrp_;
198 uiGraphicsItem* gtItm(
int idx )
const #define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
uiGraphicsItemSet()
Definition: uigraphicsitem.h:145
Definition of a mouse cursor, can be either a predefined shape (from the enum, or a file...
Definition: mousecursor.h:26
#define mQtclass(cls)
Definition: commondefs.h:229
const uiGraphicsItem * getUiItem(int idx) const
Definition: uigraphicsitem.h:176
#define private
Definition: winstreambuf.h:13
bool isOwner() const
Definition: uigraphicsitem.h:168
void hide(const char *, bool yn)
only Windows
int size() const
Definition: uigraphicsitem.h:174
Definition: uistring.h:89
FixedString LineStyle()
Definition: keystrs.h:80
Set of pointers to objects.
Definition: commontypes.h:32
bool owner_
Definition: uigraphicsitem.h:192
ButtonState
Definition: keyenum.h:20
Definition: uigraphicsitem.h:157
bool isEmpty() const
Definition: uigraphicsitem.h:173
#define mFDQtclass(cls)
Definition: commondefs.h:228
mQtclass(QGraphicsItemGroup *) qGraphicsItemGroup()
Definition: uigraphicsitem.h:183
Definition: uigraphicsitem.h:142
bool isvisible_
Definition: uigraphicsitem.h:193
void setIsOwner(bool own)
Definition: uigraphicsitem.h:167
virtual bool validIdx(int64_t) const
Definition: objectset.h:302
OpendTect.
Definition: commontypes.h:29
Notifier with automatic capsule creation.
Definition: callback.h:395
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26
void add(uiGraphicsItem *itm)
Definition: uigraphicsitem.h:147
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:23
Definition: mouseevent.h:73
uiGraphicsItem * getUiItem(int idx)
Definition: uigraphicsitem.h:175
Definition: uigraphicsscene.h:39