111 return wordHashSet(*fileExtensionConstructorTablePtr_);
117 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
130 return edgeMeshFormatsCore::checkSupport
146 return edgeMeshFormatsCore::checkSupport
167 return canReadType(ext, verbose);
179 const labelList& ptEds(pointEdges()[ptI]);
195 if (edStat == EXTERNAL)
199 else if (edStat == INTERNAL)
205 if (nExternal == nPtEds)
209 else if (nInternal == nPtEds)
234 else if (nEdNorms == 2)
236 const vector& n0(norms[edNorms[0]]);
237 const vector& n1(norms[edNorms[1]]);
239 if ((n0 & n1) > cosNormalAngleTol_)
243 else if ((fC0tofC1 & n0) > 0.0)
252 else if (nEdNorms > 2)
277 normalVolumeTypes_(0),
279 normalDirections_(0),
281 featurePointNormals_(0),
282 featurePointEdges_(0),
401 label sFEI = featureEdges[i];
404 const labelList& eFaces = edgeFaces[sFEI];
408 label eFI = eFaces[j];
415 surfBaffleRegions[surf[eFI].region()]
471 label nonFeatureStart,
578 return read(unzipName, unzipName.
ext());
582 return read(name, ext);
603 scalar searchDistSqr,
618 scalar searchDistSqr,
672 info[i] = edgeTrees[i].findNearest
682 info[i].setIndex(info[i].index() + sliceStarts[i]);
690 scalar searchRadiusSqr,
705 label index = elems[elemI];
711 dynPointHit.append(nearHit);
721 const scalar searchRadiusSqr,
743 labelList elems = edgeTrees[i].findSphere
751 label index = elems[elemI];
752 label edgeI = edgeTrees[i].shapes().edgeLabels()[index];
757 label hitIndex = index + sliceStarts[i];
766 dynEdgeHit.append(nearHit);
788 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
789 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
828 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
829 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
872 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
873 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
948 return xferMoveTo<extendedEdgeMesh, extendedEdgeMesh>(*this);
988 reversePointMap[i] = newPointi++;
992 reverseFemPointMap[i] = newPointi++;
999 reversePointMap[i] = newPointi++;
1003 reverseFemPointMap[i] = newPointi++;
1010 reversePointMap[i] = newPointi++;
1014 reverseFemPointMap[i] = newPointi++;
1021 reversePointMap[i] = newPointi++;
1025 reverseFemPointMap[i] = newPointi++;
1030 newPoints.
rmap(fem.
points(), reverseFemPointMap);
1044 reverseEdgeMap[i] = newEdgeI++;
1048 reverseFemEdgeMap[i] = newEdgeI++;
1052 label newInternalStart = newEdgeI;
1055 reverseEdgeMap[i] = newEdgeI++;
1059 reverseFemEdgeMap[i] = newEdgeI++;
1063 label newFlatStart = newEdgeI;
1066 reverseEdgeMap[i] = newEdgeI++;
1070 reverseFemEdgeMap[i] = newEdgeI++;
1074 label newOpenStart = newEdgeI;
1077 reverseEdgeMap[i] = newEdgeI++;
1081 reverseFemEdgeMap[i] = newEdgeI++;
1085 label newMultipleStart = newEdgeI;
1088 reverseEdgeMap[i] = newEdgeI++;
1092 reverseFemEdgeMap[i] = newEdgeI++;
1099 newEdges[reverseEdgeMap[i]] =
edge 1101 reversePointMap[e[0]],
1102 reversePointMap[e[1]]
1108 newEdges[reverseFemEdgeMap[i]] =
edge 1110 reverseFemPointMap[e[0]],
1111 reverseFemPointMap[e[1]]
1128 newNormals.append(fem.
normals());
1135 UIndirectList<labelList>(newEdgeNormals, reverseFemEdgeMap) =
1137 forAll(reverseFemEdgeMap, i)
1139 label mapI = reverseFemEdgeMap[i];
1156 UIndirectList<labelList>
1158 newFeaturePointNormals,
1161 UIndirectList<labelList>
1163 newFeaturePointNormals,
1168 label mapI = reverseFemPointMap[i];
1169 labelList& fn = newFeaturePointNormals[mapI];
1185 newRegionEdges.append(reverseEdgeMap[
regionEdges()[i]]);
1189 newRegionEdges.append(reverseFemEdgeMap[fem.
regionEdges()[i]]);
1238 reversePointMap[i] = newPointi++;
1244 reversePointMap[i] = newPointi++;
1260 reverseEdgeMap[i] = newEdgeI++;
1263 label newInternalStart = newEdgeI;
1266 reverseEdgeMap[i] = newEdgeI++;
1277 newEdges[reverseEdgeMap[i]] =
edge 1279 reversePointMap[e[0]],
1280 reversePointMap[e[1]]
1301 newFeaturePointNormals,
1308 newRegionEdges[i] = reverseEdgeMap[
regionEdges()[i]];
1337 Info<<
nl <<
"Writing extendedEdgeMesh components to " << prefix
1342 OBJstream convexFtPtStr(prefix +
"_convexFeaturePts.obj");
1343 Info<<
"Writing convex feature points to " << convexFtPtStr.
name() <<
endl;
1350 OBJstream concaveFtPtStr(prefix +
"_concaveFeaturePts.obj");
1351 Info<<
"Writing concave feature points to " 1359 OBJstream mixedFtPtStr(prefix +
"_mixedFeaturePts.obj");
1360 Info<<
"Writing mixed feature points to " << mixedFtPtStr.
name() <<
endl;
1367 OBJstream mixedFtPtStructureStr(prefix +
"_mixedFeaturePtsStructure.obj");
1368 Info<<
"Writing mixed feature point structure to " 1369 << mixedFtPtStructureStr.
name() <<
endl;
1378 mixedFtPtStructureStr.
write 1386 OBJstream externalStr(prefix +
"_externalEdges.obj");
1387 Info<<
"Writing external edges to " << externalStr.
name() <<
endl;
1395 OBJstream internalStr(prefix +
"_internalEdges.obj");
1396 Info<<
"Writing internal edges to " << internalStr.
name() <<
endl;
1404 OBJstream flatStr(prefix +
"_flatEdges.obj");
1405 Info<<
"Writing flat edges to " << flatStr.
name() <<
endl;
1413 OBJstream openStr(prefix +
"_openEdges.obj");
1414 Info<<
"Writing open edges to " << openStr.
name() <<
endl;
1422 OBJstream multipleStr(prefix +
"_multipleEdges.obj");
1423 Info<<
"Writing multiple edges to " << multipleStr.
name() <<
endl;
1431 OBJstream regionStr(prefix +
"_regionEdges.obj");
1432 Info<<
"Writing region edges to " << regionStr.
name() <<
endl;
1440 OBJstream edgeDirsStr(prefix +
"_edgeDirections.obj");
1441 Info<<
"Writing edge directions to " << edgeDirsStr.
name() <<
endl;
1460 os <<
indent <<
"point classification :" <<
nl;
1462 os <<
indent <<
"convex feature points : " 1466 os <<
indent <<
"concave feature points : " 1470 os <<
indent <<
"mixed feature points : " 1474 os <<
indent <<
"other (non-feature) points : " 1480 os <<
indent <<
"edge classification :" <<
nl;
1482 os <<
indent <<
"external (convex angle) edges : " 1486 os <<
indent <<
"internal (concave angle) edges : " 1490 os <<
indent <<
"flat region edges : " 1494 os <<
indent <<
"open edges : " 1498 os <<
indent <<
"multiply connected edges : " 1520 is.
check(
"operator>>(Istream&, sideVolumeType&)");
1532 os << static_cast<label>(vt);
1541 os <<
"// points" <<
nl 1545 <<
"// concaveStart mixedStart nonFeatureStart" <<
nl 1549 <<
"// internalStart flatStart openStart multipleStart" <<
nl 1554 <<
"// normals" <<
nl 1556 <<
"// normal volume types" <<
nl 1558 <<
"// normalDirections" <<
nl 1560 <<
"// edgeNormals" <<
nl 1562 <<
"// featurePointNormals" <<
nl 1564 <<
"// featurePointEdges" <<
nl 1566 <<
"// regionEdges" <<
nl 1571 os.
check(
"Ostream& operator<<(Ostream&, const extendedEdgeMesh&)");
1597 is.
check(
"Istream& operator>>(Istream&, extendedEdgeMesh&)");
extendedEdgeMesh()
Construct null.
label nonFeatureStart() const
Return the index of the start of the non-feature points.
A simple container for copying or transferring objects of type <T>.
static autoPtr< extendedEdgeMesh > New(const fileName &, const word &ext)
Select constructed from filename (explicit extension)
void transfer(edgeMesh &)
Transfer the contents of the argument and annul the argument.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
Holds (reference to) pointField. Encapsulation of data needed for octree searches. Used for searching for nearest point. No bounding boxes around points. Only overlaps and calcNearest are implemented, rest makes little sense.
static wordHashSet readTypes()
Ostream & indent(Ostream &os)
Indent stream.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
label nRegionEdges() const
Return number of region edges.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
const double e
Elementary charge.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format type?
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList ®ionFeatureEdges, const labelList &feaurePoints)
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
label mixedStart_
Index of the start of the mixed type feature points.
virtual void writeStats(Ostream &os) const
Dump some information.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
Description of feature edges and points.
label multipleStart() const
Return the index of the start of the multiply-connected feature.
label openStart_
Index of the start of the open feature edges.
static const Foam::NamedEnum< sideVolumeType, 4 > sideVolumeTypeNames_
Ostream & endl(Ostream &os)
Add newline and flush stream.
Holds data for octree to work on an edges subset.
virtual void clear()
Clear all storage.
static const Foam::NamedEnum< edgeStatus, 6 > edgeStatusNames_
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
label concaveStart_
Index of the start of the concave feature points.
label openStart() const
Return the index of the start of the open feature edges.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
void add(const extendedEdgeMesh &)
Add extendedEdgeMesh. No filtering of duplicates.
const labelList & featureEdges() const
Return feature edge list.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
virtual Ostream & write(const char)
Write character.
const fileName & name() const
Return the name of the stream.
Initialise the NamedEnum HashTable from the static list of names.
word ext() const
Return file name extension (part after last .)
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
edgeMesh()
Construct null.
label internalStart_
Index of the start of the internal feature edges.
labelListList normalDirections_
Starting directions for the edges.
A list of faces which address into the list of points.
A List obtained as a section of another List.
linePointRef line(const pointField &) const
Return edge line.
const labelListList & pointEdges() const
Return edges.
vectorField pointField
pointField is a vectorField.
void flipNormals()
Flip normals. All concave become convex, all internal external.
label flatStart() const
Return the index of the start of the flat feature edges.
dimensionedScalar cos(const dimensionedScalar &ds)
line< point, const point & > linePointRef
Line using referred points.
labelList regionEdges_
Feature edges which are on the boundary between regions.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
static label convexStart_
Index of the start of the convex feature points - static as 0.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label internalStart() const
Return the index of the start of the internal feature edges.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
label flatStart_
Index of the start of the flat feature edges.
Istream & operator>>(Istream &, directionInfo &)
const edgeList & edges() const
Return edges.
const triSurface & surface() const
cachedRandom rndGen(label(0), -1)
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
~extendedEdgeMesh()
Destructor.
sideVolumeType
Normals point to the outside.
static label externalStart_
Index of the start of the external feature edges - static as 0.
void transfer(extendedEdgeMesh &)
Transfer the contents of the argument and annul the argument.
const labelListList & edgeFaces() const
Return edge-face addressing.
bool hit() const
Is there a hit.
HashSet wordHashSet
A HashSet with word keys.
autoPtr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
Simple random number generator.
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
label mixedStart() const
Return the index of the start of the mixed type feature points.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const Point & rawPoint() const
Return point with no checking.
Istream and Ostream manipulators taking arguments.
OFstream which keeps track of vertices.
const labelList & featurePoints() const
Return feature point list.
const pointField & points() const
Return points.
defineTypeNameAndDebug(combustionModel, 0)
Points connected by edges.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
virtual void writeStats(Ostream &) const
virtual void reset(const Xfer< pointField > &points, const Xfer< edgeList > &edges)
Reset primitive data (points, edges)
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
static edgeStatus classifyEdge(const List< vector > &norms, const labelList &edNorms, const vector &fC0tofC1)
Classify the type of feature edge. Requires face centre 0 to face.
label size() const
Return the number of elements in the UPtrList.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
virtual void clear()
Clear all storage.
void setSize(const label)
Reset size of List.
const point & max() const
Maximum describing the bounding box.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Xfer< extendedEdgeMesh > xfer()
Transfer contents to the Xfer container.
label multipleStart_
Index of the start of the multiply-connected feature edges.
vector point
Point is a vector.
static const Foam::NamedEnum< pointStatus, 4 > pointStatusNames_
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A List with indirect addressing.
Ostream & operator<<(Ostream &, const ensightPart &)
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
static void write(const fileName &, const edgeMesh &)
Write to file.
fileName lessExt() const
Return file name without extension (part before last .)
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Standard boundBox + extra functionality for use in octree.
static label nPointTypes
Number of possible point types (i.e. number of slices)
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
static wordHashSet writeTypes()
Omanip< int > setw(const int i)
const point & min() const
Minimum describing the bounding box.
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Triangulated surface description with patch information.
label nonFeatureStart_
Index of the start of the non-feature points.
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
autoPtr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
label start() const
Return start vertex label.
Holds feature edges/points of surface.
label concaveStart() const
Return the index of the start of the concave feature points.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.