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