00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 namespace Foam
00032 {
00033
00034
00035
00036
00037 inline STLtriangle::STLtriangle()
00038 {}
00039
00040
00041
00042 inline STLtriangle::STLtriangle
00043 (
00044 const STLpoint& normal,
00045 const STLpoint& a,
00046 const STLpoint& b,
00047 const STLpoint& c,
00048 short region
00049 )
00050 :
00051 normal_(normal),
00052 a_(a),
00053 b_(b),
00054 c_(c),
00055 region_(region)
00056 {}
00057
00058
00059
00060 inline STLtriangle::STLtriangle(istream& is)
00061 {
00062 read(is);
00063 }
00064
00065
00066
00067
00068 inline const STLpoint& STLtriangle::a() const
00069 {
00070 return a_;
00071 }
00072
00073 inline const STLpoint& STLtriangle::b() const
00074 {
00075 return b_;
00076 }
00077
00078 inline const STLpoint& STLtriangle::c() const
00079 {
00080 return c_;
00081 }
00082
00083 inline short STLtriangle::region() const
00084 {
00085 return region_;
00086 }
00087
00088
00089 inline void STLtriangle::read(istream& is)
00090 {
00091 is.read(reinterpret_cast<char*>(this), 4*sizeof(STLpoint));
00092 is.read(reinterpret_cast<char*>(®ion_), 2);
00093 }
00094
00095
00096 inline void STLtriangle::write(ostream& os)
00097 {
00098 os.write(reinterpret_cast<char*>(this), 4*sizeof(STLpoint));
00099 os.write(reinterpret_cast<char*>(®ion_), 2);
00100 }
00101
00102
00103
00104 inline Ostream& operator<<(Ostream& os, const STLtriangle& stlt)
00105 {
00106 os << stlt.normal_ << token::SPACE
00107 << stlt.a_ << token::SPACE
00108 << stlt.b_ << token::SPACE
00109 << stlt.c_ << token::SPACE
00110 << stlt.region_;
00111
00112 return os;
00113 }
00114
00115
00116
00117
00118 }
00119
00120