Loading...
Searching...
No Matches
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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::curve
28
29Description
30 A single curve in a graph.
31
32SourceFiles
33 curve.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_curve_H
38#define Foam_curve_H
39
40#include "autoPtr.H"
41#include "point.H"
42#include "primitiveFields.H"
43#include "word.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class curve;
53
55/*---------------------------------------------------------------------------*\
56 Class curve Declaration
57\*---------------------------------------------------------------------------*/
58
59class curve
60:
61 public scalarField
62{
63public:
64
65 //- The style (line, symbol, etc) of a curve
66 class curveStyle
67 {
68 public:
69
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
100 :
101 CurveStyleNo(curveStyleNo(readInt(is)))
102 {}
103
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
115private:
116
117 // Private Data
118
119 string name_;
120
121 curveStyle style_;
122
123
124public:
125
126 // Constructors
127
128 //- Construct from name, style and size
129 curve
130 (
131 const string& name,
132 const curveStyle& style,
133 const label l
134 );
135
136 //- Construct from the components
137 curve
138 (
139 const string&,
140 const curveStyle&,
141 const scalarField& y
142 );
143
144 autoPtr<curve> clone() const
145 {
146 return autoPtr<curve>::New(*this);
147 }
148
149
150 // Member Functions
151
152 // Access
154 const string& name() const
155 {
156 return name_;
157 }
158
159 const curveStyle& style() const
160 {
161 return style_;
162 }
164
165 // Ostream operator
166
167 friend Ostream& operator<<(Ostream&, const curve&);
169
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173} // End namespace Foam
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177#endif
178
179// ************************************************************************* //
scalar y
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
The style (line, symbol, etc) of a curve.
Definition curve.H:64
friend Ostream & operator<<(Ostream &os, const curveStyle &cs)
Definition curve.H:112
curveStyle(Istream &is)
Construct from Istream.
Definition curve.H:104
curveStyle(const curveStyleNo csn)
Construct given a curveStyleNo.
Definition curve.H:96
curveStyleNo
Enumeration definitions.
Definition curve.H:71
A single curve in a graph.
Definition curve.H:57
friend Ostream & operator<<(Ostream &, const curve &)
const curveStyle & style() const
Definition curve.H:168
autoPtr< curve > clone() const
Definition curve.H:153
const string & name() const
Definition curve.H:163
curve(const string &name, const curveStyle &style, const label l)
Construct from name, style and size.
Definition curve.C:27
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
int readInt(Istream &is)
Read int from stream.
Definition intIO.C:73
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
Specialisations of Field<T> for scalar, vector and tensor.