Go to the documentation of this file.
26 #include "triSurface.H"
39 static scalar colourMap[] =
60 os <<
"AC3Db" <<
endl;
64 const word& pName = myPatches[patchI].name();
66 label colourI = patchI % 8;
67 label colourCompI = 3 * colourI;
69 os <<
"MATERIAL \"" << pName <<
"Mat\" rgb "
70 << colourMap[colourCompI] <<
' ' << colourMap[colourCompI+1]
71 <<
' ' << colourMap[colourCompI+2]
72 <<
" amb 0.2 0.2 0.2 emis 0 0 0 spec 0.5 0.5 0.5 shi 10"
77 os <<
"OBJECT world" <<
endl
78 <<
"kids " << myPatches.size() <<
endl;
87 const surfacePatch& sp = myPatches[patchI];
89 os <<
"OBJECT poly" <<
endl
90 <<
"name \"" << sp.
name() <<
'"' <<
endl;
100 include[faceI] =
true;
110 os <<
"numvert " << patch.nPoints() <<
endl;
112 forAll(patch.localPoints(), ptI)
114 const point& pt = patch.localPoints()[ptI];
116 os << pt.
x() <<
' ' << pt.y() <<
' ' << pt.z() <<
endl;
119 os <<
"numsurf " << patch.localFaces().size() <<
endl;
121 forAll(patch.localFaces(), faceI)
123 const labelledTri&
f = patch.localFaces()[faceI];
125 os <<
"SURF 0x20" <<
endl
126 <<
"mat " << patchI <<
endl
127 <<
"refs " <<
f.size() <<
endl;
129 os <<
f[0] <<
" 0 0" <<
endl;
130 os <<
f[1] <<
" 0 0" <<
endl;
131 os <<
f[2] <<
" 0 0" <<
endl;
134 os <<
"kids 0" <<
endl;
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
triSurface subsetMesh(const boolList &include, labelList &pointMap, labelList &faceMap) const
Return new surface. Returns pointMap, faceMap from.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void writeAC(Ostream &) const
Write to Ostream in AC3D format. Always sorted by patch.
Istream and Ostream manipulators taking arguments.
triSurface()
Construct null.
List< bool > boolList
Bool container classes.
label size() const
Return the number of elements in the UList.
surfacePatchList calcPatches(labelList &faceMap) const
Sort faces according to region. Returns patch list.
vector point
Point is a vector.
List< surfacePatch > surfacePatchList
virtual const fileName & name() const
Return the name of the stream.