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
STLtriangleI.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
\*---------------------------------------------------------------------------*/
25
26
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27
28
inline
Foam::STLtriangle::STLtriangle
()
29
{}
30
31
32
inline
Foam::STLtriangle::STLtriangle
33
(
34
const
STLpoint
&
normal
,
35
const
STLpoint
& a,
36
const
STLpoint
&
b
,
37
const
STLpoint
& c,
38
unsigned
short
attrib
39
)
40
:
41
normal_(normal),
42
a_(a),
43
b_(b),
44
c_(c),
45
attrib_(attrib)
46
{}
47
48
49
inline
Foam::STLtriangle::STLtriangle
(istream& is)
50
{
51
read(is);
52
}
53
54
55
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
56
57
inline
const
Foam::STLpoint
&
Foam::STLtriangle::normal
()
const
58
{
59
return
normal_;
60
}
61
62
63
inline
const
Foam::STLpoint
&
Foam::STLtriangle::a
()
const
64
{
65
return
a_;
66
}
67
68
69
inline
const
Foam::STLpoint
&
Foam::STLtriangle::b
()
const
70
{
71
return
b_;
72
}
73
74
75
inline
const
Foam::STLpoint
&
Foam::STLtriangle::c
()
const
76
{
77
return
c_;
78
}
79
80
81
inline
unsigned
short
Foam::STLtriangle::attrib
()
const
82
{
83
return
attrib_;
84
}
85
86
87
inline
void
Foam::STLtriangle::read
(istream& is)
88
{
89
is.read(reinterpret_cast<char*>(
this
), 4*
sizeof
(
STLpoint
));
90
is.read(reinterpret_cast<char*>(&attrib_),
sizeof
(STLattrib));
91
}
92
93
94
inline
void
Foam::STLtriangle::write
(ostream& os)
95
{
96
os.write(reinterpret_cast<char*>(
this
), 4*
sizeof
(
STLpoint
));
97
os.write(reinterpret_cast<char*>(&attrib_),
sizeof
(STLattrib));
98
}
99
100
101
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
102
103
inline
Foam::Ostream
&
Foam::operator<<
(
Ostream
& os,
const
STLtriangle
& t)
104
{
105
os << t.normal_ <<
token::SPACE
106
<< t.a_ <<
token::SPACE
107
<< t.b_ <<
token::SPACE
108
<< t.c_ <<
token::SPACE
109
<< t.attrib_;
110
111
return
os;
112
}
113
114
115
// ************************ vim: set sw=4 sts=4 et: ************************ //