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
surfMesh
surfaceFormats
stl
STLsurfaceFormat.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::fileFormats::STLsurfaceFormat
26
27
Description
28
Provide a means of reading/writing STL files (ASCII and binary).
29
30
Note
31
For efficiency, the zones are sorted before creating the faces.
32
The class is thus derived from MeshedSurface.
33
34
SourceFiles
35
STLsurfaceFormat.C
36
STLsurfaceFormatASCII.L
37
38
\*---------------------------------------------------------------------------*/
39
40
#ifndef STLsurfaceFormat_H
41
#define STLsurfaceFormat_H
42
43
#include "
STLsurfaceFormatCore.H
"
44
#include <
surfMesh/MeshedSurface.H
>
45
#include <
surfMesh/MeshedSurfaceProxy.H
>
46
#include <
surfMesh/UnsortedMeshedSurface.H
>
47
48
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50
namespace
Foam
51
{
52
namespace
fileFormats
53
{
54
55
/*---------------------------------------------------------------------------*\
56
Class STLsurfaceFormat Declaration
57
\*---------------------------------------------------------------------------*/
58
59
template
<
class
Face>
60
class
STLsurfaceFormat
61
:
62
public
MeshedSurface
<Face>
63
{
64
// Private Member Functions
65
66
//- Write Face (ASCII)
67
static
inline
void
writeShell
68
(
69
Ostream
&,
70
const
pointField
&,
71
const
Face&
72
);
73
74
//- Write Face (BINARY)
75
static
inline
void
writeShell
76
(
77
ostream&,
78
const
pointField
&,
79
const
Face&,
80
const
label zoneI
81
);
82
83
//- Disallow default bitwise copy construct
84
STLsurfaceFormat
(
const
STLsurfaceFormat<Face>
&);
85
86
//- Disallow default bitwise assignment
87
void
operator=(
const
STLsurfaceFormat<Face>
&);
88
89
90
public
:
91
92
// Constructors
93
94
//- Construct from file name
95
STLsurfaceFormat
(
const
fileName
&);
96
97
98
// Selectors
99
100
//- Read file and return surface
101
static
autoPtr<MeshedSurface<Face>
>
New
(
const
fileName
&
name
)
102
{
103
return
autoPtr<MeshedSurface<Face>
>
104
(
105
new
STLsurfaceFormat<Face>
(
name
)
106
);
107
}
108
109
110
//- Destructor
111
virtual
~STLsurfaceFormat
()
112
{}
113
114
115
// Member Functions
116
117
//- Write surface mesh components by proxy (as ASCII)
118
static
void
writeAscii
119
(
120
const
fileName
&,
121
const
MeshedSurfaceProxy<Face>
&
122
);
123
124
//- Write surface mesh components by proxy (as BINARY)
125
static
void
writeBinary
126
(
127
const
fileName
&,
128
const
MeshedSurfaceProxy<Face>
&
129
);
130
131
//- Write surface mesh components by proxy
132
// as ASCII or BINARY, depending on the extension
133
static
void
write
(
const
fileName
&,
const
MeshedSurfaceProxy<Face>
&);
134
135
//- Write UnsortedMeshedSurface (as ASCII) sorted by zone
136
static
void
writeAscii
137
(
138
const
fileName
&,
139
const
UnsortedMeshedSurface<Face>
&
140
);
141
142
//- Write UnsortedMeshedSurface (as BINARY) unsorted by zone
143
static
void
writeBinary
144
(
145
const
fileName
&,
146
const
UnsortedMeshedSurface<Face>
&
147
);
148
149
//- Write UnsortedMeshedSurface
150
// as ASCII or BINARY, depending on the extension
151
static
void
write
(
const
fileName
&,
const
UnsortedMeshedSurface<Face>
&);
152
153
//- Read from file
154
virtual
bool
read
(
const
fileName
&);
155
156
//- Write object
157
virtual
void
write
(
const
fileName
&
name
)
const
158
{
159
write
(name,
MeshedSurfaceProxy<Face>
(*
this
));
160
}
161
};
162
163
164
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166
}
// End namespace fileFormats
167
}
// End namespace Foam
168
169
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171
#ifdef NoRepository
172
# include "
STLsurfaceFormat.C
"
173
#endif
174
175
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177
#endif
178
179
// ************************ vim: set sw=4 sts=4 et: ************************ //