/usr/include/magics/MgQLayerItem.h is in libmagics++-dev 2.30.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | /*
* (C) Copyright 1996-2016 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
*/
/*!
\file MgQLayerItem.h
\brief Definition of MgQLayerItem.
\author Graphics Section, ECMWF
Started: February 2010
*/
#ifndef _MgQLayerItem_H
#define _MgQLayerItem_H
#include <Layer.h>
#include "MgQ.h"
using magics::Layer;
using magics::SceneLayer;
class QImage;
class QPainter;
class MgQHistoItem;
class MgQLayoutItem;
class MgQMagnifierLayoutItem;
class MgQRootItem;
class MgQScene;
class MgQStepItem;
class MgQLayerState
{
public:
QString name_;
QString id_;
int stackLevel_;
float alpha_;
bool visible_;
};
class MgQSceneLayerItem : public QGraphicsItem
{
public:
enum {Type = MgQ::SceneLayerItemType};
MgQSceneLayerItem(const SceneLayer &sc) : sceneLayer_(sc) {};
~MgQSceneLayerItem() {};
const SceneLayer& sceneLayer() {return sceneLayer_;};
void addProjectorItem(MgQLayoutItem *n) {projectorItems_ << n;}
QList<MgQLayoutItem*> projectorItems() {return projectorItems_;}
MgQLayoutItem* findProjectorItem(QPointF);
int type() const {return Type;}
QRectF boundingRect() const {return QRectF();}
void paint(QPainter *, const QStyleOptionGraphicsItem *,
QWidget *) {};
protected:
const SceneLayer& sceneLayer_;
QList<MgQLayoutItem*> projectorItems_;
};
class MgQLayerItem : public QGraphicsItem
{
public:
enum {Type = MgQ::LayerItemType};
enum InfoImageType {HistoImage};
MgQLayerItem(Layer &,MgQLayoutItem *,int);
~MgQLayerItem();
QString name() const {return QString::fromStdString(layer_.name());}
Layer& layer() {return layer_;};
void setLayerAlpha(float);
void setLayerVisibility(bool);
float layerAlpha() const;
bool layerVisibility() const;
void updateLayer(const MgQLayerItem*);
MgQRootItem* rootItem() {return rootItem_;}
void setStep(int step,MgQStepItem* item) {steps_[step]=item;}
void setStepVisible(int,bool);
bool stepCached(int);
void clearStep(int);
int stepNum() {return steps_.count();}
bool magnifierDataEnabled() {return magnifierDataEnabled_;}
void setMagnifierDataEnabled(bool b) {magnifierDataEnabled_=b;}
MgQLayoutItem* parentLayoutItem() {return layout_;}
MgQMagnifierLayoutItem *magnifierLayoutItem();
int type() const {return Type;}
QRectF boundingRect() const {return QRectF();}
void paint(QPainter *, const QStyleOptionGraphicsItem *,
QWidget *widget=0);
void setStackLevel(int);
int stackLevel();
void saveLayerState(MgQLayerState*);
MgQLayoutItem* topLayoutItem();
void renderPreview();
const QImage& preview() const {return previewImg_;}
MgQHistoItem* histoItem(int);
MgQHistoItem* resetHistoItem(int);
void addHistoItem(MgQHistoItem *);
QPixmap histoPixmap(int,QSize);
protected:
enum RootItemOwner {MainScene,AlphaScene,PreviewScene};
void checkAlphaDeviceSize(QRect);
void addContentsToScene(RootItemOwner);
Layer& layer_;
MgQRootItem* rootItem_;
RootItemOwner rootItemOwner_;
MgQLayoutItem* layout_;
MgQScene *alphaScene_;
static QImage *alphaDevice_;
static QPainter* alphaPainter_;
MgQScene *previewScene_;
QImage *previewDevice_;
QPainter* previewPainter_;
QImage previewImg_;
QGraphicsScene *histoScene_;
QImage *histoDevice_;
QPainter* histoPainter_;
QList<MgQStepItem*> steps_;
QList<MgQHistoItem*> histoItems_;
MgQMagnifierLayoutItem *magnifierLayout_;
bool magnifierDataEnabled_;
};
#endif
|