Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feliks Kiszkurno
ogs-feliks
Commits
cc58e8d5
Commit
cc58e8d5
authored
10 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
add a general searching function for any geometric types in MeshNodeSearcher
parent
2e84c1dc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MeshGeoToolsLib/MeshNodeSearcher.cpp
+22
-0
22 additions, 0 deletions
MeshGeoToolsLib/MeshNodeSearcher.cpp
MeshGeoToolsLib/MeshNodeSearcher.h
+7
-0
7 additions, 0 deletions
MeshGeoToolsLib/MeshNodeSearcher.h
with
29 additions
and
0 deletions
MeshGeoToolsLib/MeshNodeSearcher.cpp
+
22
−
0
View file @
cc58e8d5
...
@@ -75,6 +75,28 @@ MeshNodeSearcher::~MeshNodeSearcher()
...
@@ -75,6 +75,28 @@ MeshNodeSearcher::~MeshNodeSearcher()
}
}
}
}
std
::
vector
<
std
::
size_t
>
MeshNodeSearcher
::
getMeshNodeIDs
(
GeoLib
::
GeoObject
const
&
geoObj
)
{
std
::
vector
<
std
::
size_t
>
vec_nodes
;
switch
(
geoObj
.
getGeoType
())
{
case
GeoLib
::
GEOTYPE
::
POINT
:
{
auto
node_id
=
this
->
getMeshNodeIDForPoint
(
*
dynamic_cast
<
const
GeoLib
::
PointWithID
*>
(
&
geoObj
));
if
(
node_id
)
vec_nodes
.
push_back
(
*
node_id
);
break
;
}
case
GeoLib
::
GEOTYPE
::
POLYLINE
:
vec_nodes
=
this
->
getMeshNodeIDsAlongPolyline
(
*
dynamic_cast
<
const
GeoLib
::
Polyline
*>
(
&
geoObj
));
break
;
case
GeoLib
::
GEOTYPE
::
SURFACE
:
vec_nodes
=
this
->
getMeshNodeIDsAlongSurface
(
*
dynamic_cast
<
const
GeoLib
::
Surface
*>
(
&
geoObj
));
break
;
default
:
break
;
}
return
vec_nodes
;
}
boost
::
optional
<
std
::
size_t
>
MeshNodeSearcher
::
getMeshNodeIDForPoint
(
GeoLib
::
Point
const
&
pnt
)
const
boost
::
optional
<
std
::
size_t
>
MeshNodeSearcher
::
getMeshNodeIDForPoint
(
GeoLib
::
Point
const
&
pnt
)
const
{
{
auto
*
found
=
_mesh_grid
.
getNearestPoint
(
pnt
.
getCoords
());
auto
*
found
=
_mesh_grid
.
getNearestPoint
(
pnt
.
getCoords
());
...
...
This diff is collapsed.
Click to expand it.
MeshGeoToolsLib/MeshNodeSearcher.h
+
7
−
0
View file @
cc58e8d5
...
@@ -51,6 +51,13 @@ public:
...
@@ -51,6 +51,13 @@ public:
explicit
MeshNodeSearcher
(
MeshLib
::
Mesh
const
&
mesh
);
explicit
MeshNodeSearcher
(
MeshLib
::
Mesh
const
&
mesh
);
virtual
~
MeshNodeSearcher
();
virtual
~
MeshNodeSearcher
();
/**
* Searches for the nearest mesh nodes on the given geometric object (point, polyline, surface).
* @param geoObj a GeoLib::GeoObject where the nearest mesh node is searched for
* @return a vector of mesh node ids
*/
std
::
vector
<
std
::
size_t
>
getMeshNodeIDs
(
GeoLib
::
GeoObject
const
&
geoObj
);
/**
/**
* Searches for the node nearest by the given point. If there are two nodes
* Searches for the node nearest by the given point. If there are two nodes
* with the same distance the id of the one that was first found will be
* with the same distance the id of the one that was first found will be
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment