/usr/include/magics/MgQLayerItem.h is in libmagics++-dev 2.22.7.dfsg.1-4.
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 163 164 165 166 167 168 169 170 171 172 | /******************************** LICENSE ********************************
Copyright 2007 European Centre for Medium-Range Weather Forecasts (ECMWF)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************** LICENSE ********************************/
/*!
\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
|