Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
graph
curve
curve.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Class
25
Foam::curve
26
27
Description
28
A single curve in a graph.
29
30
SourceFiles
31
curve.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef curve_H
36
#define curve_H
37
38
#include <
OpenFOAM/string.H
>
39
#include <
OpenFOAM/primitiveFields.H
>
40
#include <
OpenFOAM/autoPtr.H
>
41
42
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44
namespace
Foam
45
{
46
47
// Forward declaration of friend functions and operators
48
49
class
curve;
50
Ostream&
operator<<
(Ostream&,
const
curve&);
51
52
53
/*---------------------------------------------------------------------------*\
54
Class curve Declaration
55
\*---------------------------------------------------------------------------*/
56
57
class
curve
58
:
59
public
scalarField
60
{
61
62
public
:
63
64
//- The style (line, symbol, etc) of a curve
65
class
curveStyle
66
{
67
68
public
:
69
70
//- Enumeration definitions
71
enum
curveStyleNo
72
{
73
CONTINUOUS
,
74
SYMBOL
,
75
SYMBOL_CURVE
,
76
SYMBOL_WITH_ERROR_BARS
,
77
SYMBOL_WITH_VARIABLE_SIZE
78
};
79
80
81
private
:
82
83
//- Private data
84
curveStyleNo
CurveStyleNo;
85
86
87
public
:
88
89
90
// Constructors
91
92
//- Construct given a curveStyleNo
93
curveStyle
(
const
curveStyleNo
csn)
94
:
95
CurveStyleNo(csn)
96
{}
97
98
//- Construct from Istream
99
curveStyle
(
Istream
& is)
100
:
101
CurveStyleNo(
curveStyleNo
(
readInt
(is)))
102
{}
103
104
105
// Ostream operator
106
107
friend
Ostream
&
operator<<
(
Ostream
& os,
const
curveStyle
& cs)
108
{
109
os << int(cs.CurveStyleNo);
110
return
os;
111
}
112
};
113
114
115
private
:
116
117
// private data
118
119
string
name_;
120
curveStyle style_;
121
122
123
public
:
124
125
// Constructors
126
127
//- Construct as interpolation of an existing curve
128
//curve(const curve&, const label);
129
130
//- Construct from name, style and size
131
curve
132
(
133
const
string
&
name
,
134
const
curveStyle&
style
,
135
const
label l
136
);
137
138
//- Construct from the components
139
curve
140
(
141
const
string
&,
142
const
curveStyle&,
143
const
scalarField
&
y
144
);
145
146
autoPtr<curve>
clone
()
const
147
{
148
return
autoPtr<curve>
(
new
curve
(*
this
));
149
}
150
151
152
// Member functions
153
154
// Access
155
156
const
string
&
name
()
const
157
{
158
return
name_;
159
}
160
161
const
curveStyle
&
style
()
const
162
{
163
return
style_;
164
}
165
166
167
// Friend functions
168
169
//- Gradient of the curve
170
//friend curve grad(const curve&);
171
172
173
// Ostream operator
174
175
friend
Ostream
&
operator<<
(
Ostream
&,
const
curve
&);
176
};
177
178
179
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181
}
// End namespace Foam
182
183
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185
#endif
186
187
// ************************ vim: set sw=4 sts=4 et: ************************ //