59 #ifndef Foam_extendedEdgeMesh_H 60 #define Foam_extendedEdgeMesh_H 74 class surfaceFeatures;
75 class searchableSurface;
76 class extendedEdgeMesh;
78 Istream&
operator>>(Istream&, extendedEdgeMesh&);
79 Ostream&
operator<<(Ostream&,
const extendedEdgeMesh&);
196 mutable std::unique_ptr<indexedOctree<treeDataPoint>>
pointTree_;
199 mutable std::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
extendedEdgeMesh()
Default construct.
label nonFeatureStart() const
Return the index of the start of the non-feature points.
pointStatus getPointStatus(label ptI) const
Return the pointStatus of a specified point.
label convexStart() const
Return the index of the start of the convex feature points.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
static const Enum< sideVolumeType > sideVolumeTypeNames_
A class for handling file names.
static autoPtr< extendedEdgeMesh > New(const fileName &name, const word &fileType)
Select constructed from filename with given file format.
static wordHashSet readTypes()
Summary of supported read file types.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
declareRunTimeSelectionTable(autoPtr, extendedEdgeMesh, fileExtension,(const fileName &name),(name))
const pointField & points() const noexcept
Return points.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
const labelListList & normalDirections() const
void nearestFeaturePoint(const point &sample, scalar searchDistSqr, pointIndexHit &info) const
Find nearest surface edge for the sample point.
TypeName("extendedEdgeMesh")
Runtime type information.
void transfer(extendedEdgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
PtrList< indexedOctree< treeDataEdge > > edgeTreesByType_
Individual search trees for each type of edge.
label mixedStart_
Index of the start of the mixed type feature points.
const List< sideVolumeType > & normalVolumeTypes() const
Return.
void select(const searchableSurface &surf, const volumeType volType, labelList &pMap, labelList &eMap)
Remove outside/inside edges. volType denotes which side to keep.
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)...
Description of feature edges and points.
label multipleStart() const
Return the index of the start of the multiply-connected feature.
void trim(const searchableSurface &surf, const volumeType volType, labelList &pointMap, labelList &edgeMap)
Trim to surface. Keep volType side. Return map from current back.
label openStart_
Index of the start of the open feature edges.
scalarField samples(nIntervals, Zero)
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format type?
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.
virtual void clear()
Clear all storage.
bool featurePoint(label ptI) const
Return whether or not the point index is a feature point.
const vectorField & normals() const
Return the normals of the surfaces adjacent to the feature edges.
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 an object (often a face) and a point. It carries the info of ...
List< sideVolumeType > normalVolumeTypes_
Type per normal: which side of normal to mesh.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
~extendedEdgeMesh()=default
Destructor.
void writeObj(const fileName &prefix) const
Write all components of the extendedEdgeMesh as obj files.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
A point surrounded by both convex and concave edges.
bool mergePointsAndSort(const scalar mergeDist, labelList &pointMap, labelList &edgeMap)
Geometric merge points. Returns true if any points merged.
std::unique_ptr< indexedOctree< treeDataEdge > > edgeTree_
Search tree for all edges.
static constexpr label nPointTypes
Number of possible point types (i.e. number of slices)
void add(const extendedEdgeMesh &fem)
Add extendedEdgeMesh. No filtering of duplicates.
void setFromStatus(const List< extendedEdgeMesh::pointStatus > &pointStat, const List< extendedEdgeMesh::edgeStatus > &edgeStat, labelList &sortedToOriginalPoint, labelList &sortedToOriginalEdge)
Order according to point and edge status.
friend Ostream & operator<<(Ostream &os, const sideVolumeType &vt)
edgeStatus getEdgeStatus(label edgeI) const
Return the edgeStatus of a specified edge.
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.
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.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
labelList regionEdges_
Feature edges which are on the boundary between regions.
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.
A class for handling words, derived from Foam::string.
label flatStart_
Index of the start of the flat feature edges.
Istream & operator>>(Istream &, directionInfo &)
sideVolumeType
Normals point to the outside.
static label externalStart_
Index of the start of the external feature edges - static as 0.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
static const Enum< edgeStatus > edgeStatusNames_
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
void autoMap(const pointField &subPoints, const edgeList &subEdges, const labelList &pointMap, const labelList &edgeMap)
Update with derived geometry.
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
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.
Fully convex point (w.r.t normals)
label externalStart() const
Return the index of the start of the external feature edges.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
not sure when this may be used
PackedList< 2 > edgeBaffles(label edgeI) const
Return the baffle faces of a specified edge.
OBJstream os(runTime.globalPath()/outputName)
const labelListList & featurePointEdges() const
Return the edge labels for a given feature point. Edges are.
Mesh data needed to do the Finite Area discretisation.
Only connected to a single face.
const PtrList< indexedOctree< treeDataEdge > > & edgeTreesByType() const
Demand driven construction of octree for boundary edges by type.
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)
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
label multipleStart_
Index of the start of the multiply-connected feature edges.
Non-pointer based hierarchical recursive searching.
const Foam::Enum< fileTag > fileExtension
File extension (without ".") for some vtk XML file content types.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const edgeList & edges() const noexcept
Return edges.
static const Enum< pointStatus > pointStatusNames_
bool read(const fileName &name, const word &ext)
Read from file. Chooses reader based on explicit extension.
friend Istream & operator>>(Istream &is, sideVolumeType &vt)
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
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()
Summary of supported write file types.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Neither concave or convex, on a flat surface.
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.
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.
Multiply connected (connected to more than two faces)
void nearestFeatureEdgeByType(const point &sample, const scalarField &searchDistSqr, List< pointIndexHit > &info) const
Find the nearest point on each type of feature edge.
vector edgeDirection(label edgeI, label ptI) const
Return the direction of edgeI, pointing away from ptI.
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.
std::unique_ptr< indexedOctree< treeDataPoint > > pointTree_
Search tree for all feature points.
Unclassified (consistency with surfaceFeatures)
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.