Developer Documentation

element.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41
42
43
44 #ifndef VSI_ELEMENT_HH_
45 #define VSI_ELEMENT_HH_
46
47 //== INCLUDES =================================================================
48 #include <QString>
49 #include <QVector>
50
51 //== NAMESPACES ===============================================================
52 namespace VSI {
53
54 //== FORWARDDECLARATIONS ======================================================
55 class Input;
56 class Output;
57 class InOut;
58 class Context;
59 class Function;
60
61 #define ELEMENT_FLAG_NO_DELETE 0x1
62 #define ELEMENT_FLAG_SKIP_TOOLBOX 0x2
63
64 //== CLASS DEFINITION =========================================================
65
68 class Element {
69
70 public:
71
73 Element (Context *_context, QString _name);
74
76 ~Element ();
77
79 Context *context () const { return context_; };
80
82 QString name () const { return name_; };
83
85 const QString &category () const { return category_; };
86
88 const QString &shortDescription () const { return shortDesc_; };
89
91 const QString &longDescription () const { return longDesc_; };
92
94 const QVector<Input *> &inputs () const { return inputs_; };
95
97 const QVector<Output *> &outputs () const { return outputs_; };
98
100 const QVector <Function*> &functions () const { return functions_; };
101
103 Input *dataIn () { return dataIn_; };
104
106 Output *dataOut () { return dataOut_; };
107
109 unsigned int flags () const { return flags_; };
110
112 QString precode () const { return precode_; };
113
115 QString code () const { return code_; };
116
118 unsigned int getNewId ();
119
121 void setMinId (unsigned int _id);
122
123 friend class Context;
124
125 private:
126 Context *context_;
127
128 QString name_;
129 QString category_;
130 QString shortDesc_;
131 QString longDesc_;
132
133 QString precode_;
134 QString code_;
135
136 QVector <Input*> inputs_;
137 QVector <Output*> outputs_;
138 QVector <Function*> functions_;
139
140 Input *dataIn_;
141 Output *dataOut_;
142
143 unsigned int flags_;
144
145 unsigned int id_;
146 };
147
148 //=============================================================================
149 }
150 //=============================================================================
151
152 #endif
VSI::Element::flags
unsigned int flags() const
Flags.
Definition: element.hh:109
VSI::Element::longDescription
const QString & longDescription() const
Long description.
Definition: element.hh:91
VSI::Element::outputs
const QVector< Output * > & outputs() const
Outputs.
Definition: element.hh:97
VSI::Element::dataIn
Input * dataIn()
Scenegraph input.
Definition: element.hh:103
VSI::Element::dataOut
Output * dataOut()
Scenegraph output.
Definition: element.hh:106
VSI::Element::functions
const QVector< Function * > & functions() const
Functions.
Definition: element.hh:100
VSI::Element::inputs
const QVector< Input * > & inputs() const
Inputs.
Definition: element.hh:94
VSI::Element::precode
QString precode() const
Precode segment.
Definition: element.hh:112
VSI::Element::setMinId
void setMinId(unsigned int _id)
sets the minimum for an unused id
Definition: element.cc:100
VSI::Element::shortDescription
const QString & shortDescription() const
Short description.
Definition: element.hh:88
VSI::Element::getNewId
unsigned int getNewId()
Returns an unused id number.
Definition: element.cc:92
VSI::Element::context
Context * context() const
Context of element.
Definition: element.hh:79
VSI::Element::Element
Element(Context *_context, QString _name)
Constructor.
Definition: element.cc:59
VSI::Element::~Element
~Element()
Destructor.
Definition: element.cc:74
VSI::Element::name
QString name() const
Element name.
Definition: element.hh:82
VSI::Element::code
QString code() const
Code segment.
Definition: element.hh:115
VSI
Definition: baseWidget.cc:72
VSI::Output
Definition: output.hh:60
VSI::Element
Definition: element.hh:68
VSI::Input
Definition: input.hh:60
VSI::Element::category
const QString & category() const
Element category.
Definition: element.hh:85
VSI::Context
Definition: context.hh:70