Go to the documentation of this file.
59 #ifndef extendedEdgeMesh_H
60 #define extendedEdgeMesh_H
74 class surfaceFeatures;
75 class searchableSurface;
76 class extendedEdgeMesh;
78 Istream&
operator>>(Istream&, extendedEdgeMesh&);
79 Ostream&
operator<<(Ostream&,
const extendedEdgeMesh&);
196 mutable unique_ptr<indexedOctree<treeDataPoint>>
pointTree_;
199 mutable unique_ptr<indexedOctree<treeDataEdge>>
edgeTree_;
238 template<
class Patch>
379 scalar searchDistSqr,
387 scalar searchDistSqr,
411 scalar searchRadiusSqr,
419 const scalar searchRadiusSqr,
525 virtual void clear();
566 const scalar mergeDist,
610 label& pointConcaveStart,
611 label& pointMixedStart,
612 label& pointNonFeatStart,
614 label& edgeInternalStart,
615 label& edgeFlatStart,
616 label& edgeOpenStart,
617 label& edgeMultipleStart
Unclassified (consistency with surfaceFeatures)
const labelListList & normalDirections() const
labelList regionEdges_
Feature edges which are on the boundary between regions.
const pointField & points() const noexcept
Return points.
static void sortedOrder(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge, label &pointConcaveStart, label &pointMixedStart, label &pointNonFeatStart, label &edgeInternalStart, label &edgeFlatStart, label &edgeOpenStart, label &edgeMultipleStart)
Determine the ordering.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
A class for handling words, derived from Foam::string.
A class for handling file names.
void allNearestFeatureEdges(const point &sample, const scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature edges within searchDistSqr of sample.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
not sure when this may be used
Neither concave or convex, on a flat surface.
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
label concaveStart_
Index of the start of the concave feature points.
unique_ptr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
void autoMap(const pointField &subPoints, const edgeList &subEdges, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
Istream & operator>>(Istream &, directionInfo &)
label multipleStart() const
Return the index of the start of the multiply-connected feature.
label mixedStart_
Index of the start of the mixed type feature points.
const List< sideVolumeType > & normalVolumeTypes() const
Return.
bool featurePoint(label ptI) const
Return whether or not the point index is a feature point.
PackedList< 2 > edgeBaffles(label edgeI) const
Return the baffle faces of a specified edge.
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
pointStatus getPointStatus(label ptI) const
Return the pointStatus of a specified point.
static const Enum< sideVolumeType > sideVolumeTypeNames_
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
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.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
label nonFeatureStart() const
Return the index of the start of the non-feature points.
TypeName("extendedEdgeMesh")
Runtime type information.
label concaveStart() const
Return the index of the start of the concave feature points.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
static wordHashSet readTypes()
Summary of supported read file types.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static constexpr label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
A point surrounded by both convex and concave edges.
void setFromStatus(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge)
Order according to point and edge status.
sideVolumeType
Normals point to the outside.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Holds feature edges/points of surface.
Non-pointer based hierarchical recursive searching.
static autoPtr< extendedEdgeMesh > New(const fileName &name, const word &fileType)
Select constructed from filename with given file format.
scalarField samples(nIntervals, Zero)
declareRunTimeSelectionTable(autoPtr, extendedEdgeMesh, fileExtension,(const fileName &name),(name))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label multipleStart_
Index of the start of the multiply-connected feature edges.
virtual void clear()
Clear all storage.
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
static constexpr label nPointTypes
Number of possible point types (i.e. number of slices)
void select(const searchableSurface &surf, const volumeType volType, labelList &pMap, labelList &eMap)
Remove outside/inside edges. volType denotes which side to keep.
static const Enum< pointStatus > pointStatusNames_
static label externalStart_
Index of the start of the external feature edges - static as 0.
label internalStart() const
Return the index of the start of the internal feature edges.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
OBJstream os(runTime.globalPath()/outputName)
vector edgeDirection(label edgeI, label ptI) const
Return the direction of edgeI, pointing away from ptI.
Multiply connected (connected to more than two faces)
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
Fully convex point (w.r.t normals)
label mixedStart() const
Return the index of the start of the mixed type feature points.
static const Enum< edgeStatus > edgeStatusNames_
vectorField normals_
Normals of the features, to be referred to by index by both feature.
void transfer(extendedEdgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
label internalStart_
Index of the start of the internal feature edges.
static label convexStart_
Index of the start of the convex feature points - static as 0.
labelListList normalDirections_
Starting directions for the edges.
label openStart() const
Return the index of the start of the open feature edges.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const edgeList & edges() const noexcept
Return edges.
Description of feature edges and points.
const indexedOctree< treeDataPoint > & pointTree() const
Demand driven construction of octree for feature points.
friend Istream & operator>>(Istream &is, sideVolumeType &vt)
extendedEdgeMesh()
Default construct.
Only connected to a single face.
void add(const extendedEdgeMesh &fem)
Add extendedEdgeMesh. No filtering of duplicates.
void trim(const searchableSurface &surf, const volumeType volType, labelList &pointMap, labelList &edgeMap)
Trim to surface. Keep volType side. Return map from current back.
virtual void writeStats(Ostream &os) const
Dump some information.
unique_ptr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
label externalStart() const
Return the index of the start of the external feature edges.
void flipNormals()
Flip normals. All concave become convex, all internal external.
void nearestFeatureEdge(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
void cut(const searchableSurface &, labelList &pMap, labelList &eMap, labelList &pointsFromEdge, labelList &oldEdge, labelList &surfTri)
Cut edges with surface. Return map from cut points&edges back.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
static wordHashSet writeTypes()
Summary of supported write file types.
label flatStart_
Index of the start of the flat feature edges.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class representing the concept of -1.
label nonFeatureStart_
Index of the start of the non-feature points.
bool read(const fileName &name, const word &ext)
Read from file. Chooses reader based on explicit extension.
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
label convexStart() const
Return the index of the start of the convex feature points.
void allNearestFeaturePoints(const point &sample, scalar searchRadiusSqr, List< pointIndexHit > &info) const
Find all the feature points within searchDistSqr of sample.
label openStart_
Index of the start of the open feature edges.
Mesh data needed to do the Finite Area discretisation.
label flatStart() const
Return the index of the start of the flat feature edges.
~extendedEdgeMesh()=default
Destructor.
friend Ostream & operator<<(Ostream &os, const sideVolumeType &vt)
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
edgeStatus getEdgeStatus(label edgeI) const
Return the edgeStatus of a specified edge.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
A list of faces which address into the list of points.
Minimal example by using system/controlDict.functions: