Developer documentation | Axl-2.5.1

axlAbstractDataComposite.cpp
Go to the documentation of this file.
1 /* axlAbstractDataComposite.cpp ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008 - Meriadeg Perrinel, Inria.
5  * Created: Tue Nov 9 17:03:56 2010 (+0100)
6  * Version: $Id$
7  * Last-Updated: Mon Dec 6 15:31:57 2010 (+0100)
8  * By: Meriadeg Perrinel
9  * Update #: 21
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
21 
22 #include <dtkCoreSupport/dtkGlobal.h>
23 #include <QtGui>
24 
25 class axlAbstractDataCompositePrivate
26 {
27 public:
28  QList<dtkAbstractData *> composite;
29 };
30 
31 axlAbstractDataComposite::axlAbstractDataComposite(void) : axlAbstractData(), d(new axlAbstractDataCompositePrivate)
32 {
33  this->setObjectName(this->description());
34  setColor(Qt::white);
35  setOpacity(1.0);
36  setShader("");
37 }
38 
40 {
41  delete d;
42 
43  d = NULL;
44 }
45 
46 void axlAbstractDataComposite::add(dtkAbstractData *data)
47 {
48  d->composite << data;
49 }
50 
51 bool axlAbstractDataComposite::get(dtkAbstractData * data)
52 {
53  return d->composite.contains(data);
54 }
55 
56 
57 void axlAbstractDataComposite::set(QList<dtkAbstractData *> data)
58 {
59  if(d->composite.isEmpty())
60  d->composite = data;
61 }
62 
63 void axlAbstractDataComposite::remove(dtkAbstractData *data)
64 {
65  d->composite.removeOne(data);
66 }
67 
69 {
70  return d->composite.size();
71 }
72 
73 dtkAbstractData *axlAbstractDataComposite::get(int i)
74 {
75  return d->composite.at(i);
76 }
77 
79 {
80  return "DataComposite";
81 }
82 
84 {
85  return "axlDataComposite";
86 }
void add(dtkAbstractData *data)
virtual QString identifier(void) const
void setShader(const QString &shader)
virtual QString description(void) const
void remove(dtkAbstractData *data)
void setOpacity(const double &opacity)
void setColor(double r, double g, double b)
Class axlAbstractData defines an API for all type of axel data.
bool get(dtkAbstractData *data)
void set(QList< dtkAbstractData * > data)