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
STLtriangle.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::STLtriangle
26
27
Description
28
A triangle representation for STL files.
29
30
SourceFiles
31
STLtriangleI.H
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef STLtriangle_H
36
#define STLtriangle_H
37
38
#include "
STLpoint.H
"
39
#include <
OpenFOAM/Istream.H
>
40
#include <
OpenFOAM/Ostream.H
>
41
42
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44
namespace
Foam
45
{
46
47
/*---------------------------------------------------------------------------*\
48
Class STLtriangle Declaration
49
\*---------------------------------------------------------------------------*/
50
51
class
STLtriangle
52
{
53
// Private data
54
55
//- Attribute is 16-bit
56
typedef
unsigned
short
STLattrib;
57
58
//- The face normal, many programs write zore or other junk
59
STLpoint
normal_;
60
61
//- The three points defining the triangle
62
STLpoint
a_, b_, c_;
63
64
//- The attribute information could for colour or solid id, etc
65
STLattrib attrib_;
66
67
68
public
:
69
70
// Constructors
71
72
//- Construct null
73
inline
STLtriangle
();
74
75
//- Construct from components
76
inline
STLtriangle
77
(
78
const
STLpoint
&
normal
,
79
const
STLpoint
&
a
,
80
const
STLpoint
&
b
,
81
const
STLpoint
&
c
,
82
unsigned
short
attrib
83
);
84
85
//- Construct from istream (read binary)
86
inline
STLtriangle
(istream&);
87
88
89
// Member Functions
90
91
// Access
92
93
inline
const
STLpoint
&
normal
()
const
;
94
inline
const
STLpoint
&
a
()
const
;
95
inline
const
STLpoint
&
b
()
const
;
96
inline
const
STLpoint
&
c
()
const
;
97
inline
unsigned
short
attrib
()
const
;
98
99
100
// Read
101
102
//- Read from istream (binary)
103
inline
void
read
(istream&);
104
105
106
// Write
107
108
//- Write to ostream (binary)
109
inline
void
write
(ostream&);
110
111
112
// Ostream operator
113
114
inline
friend
Ostream
&
operator<<
(
Ostream
&,
const
STLtriangle
&);
115
};
116
117
118
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120
}
// End namespace Foam
121
122
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124
#include "
STLtriangleI.H
"
125
126
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127
128
#endif
129
130
// ************************ vim: set sw=4 sts=4 et: ************************ //