Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Özgür Ozan Sen
ogs
Commits
3dc8a350
Commit
3dc8a350
authored
10 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[GeoLib] Impl. of computeAndInsertAllIntersectionPoints().
Conflicts: GeoLib/AnalyticalGeometry.cpp
parent
82e78473
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
GeoLib/AnalyticalGeometry.cpp
+23
-1
23 additions, 1 deletion
GeoLib/AnalyticalGeometry.cpp
GeoLib/AnalyticalGeometry.h
+11
-0
11 additions, 0 deletions
GeoLib/AnalyticalGeometry.h
with
34 additions
and
1 deletion
GeoLib/AnalyticalGeometry.cpp
+
23
−
1
View file @
3dc8a350
...
...
@@ -155,7 +155,7 @@ bool lineSegmentIntersect(
return
false
;
}
bool
lineSegmentsIntersect
(
const
GeoLib
::
Polyline
*
ply
,
bool
lineSegmentsIntersect
(
const
GeoLib
::
Polyline
*
ply
,
size_t
&
idx0
,
size_t
&
idx1
,
GeoLib
::
Point
&
intersection_pnt
)
...
...
@@ -435,4 +435,26 @@ bool isCoplanar(const GeoLib::Point& a, const GeoLib::Point& b, const GeoLib::Po
return
(
sqr_scalar_triple
/
normalisation_factor
<
1e-11
);
}
void
computeAndInsertAllIntersectionPoints
(
GeoLib
::
PointVec
&
pnt_vec
,
std
::
vector
<
GeoLib
::
Polyline
*>
&
plys
)
{
for
(
auto
it0
(
plys
.
begin
());
it0
!=
plys
.
end
();
it0
++
)
{
auto
it1
(
it0
);
it1
++
;
for
(;
it1
!=
plys
.
end
();
it1
++
)
{
GeoLib
::
Point
s
;
for
(
std
::
size_t
i
(
0
);
i
<
(
*
it0
)
->
getNumberOfPoints
()
-
1
;
i
++
)
{
for
(
std
::
size_t
j
(
0
);
j
<
(
*
it1
)
->
getNumberOfPoints
()
-
1
;
j
++
)
{
if
(
lineSegmentIntersect
(
*
(
*
it0
)
->
getPoint
(
i
),
*
(
*
it0
)
->
getPoint
(
i
+
1
),
*
(
*
it1
)
->
getPoint
(
j
),
*
(
*
it1
)
->
getPoint
(
j
+
1
),
s
))
{
std
::
size_t
const
id
(
pnt_vec
.
push_back
(
new
GeoLib
::
Point
(
s
)));
(
*
it0
)
->
insertPoint
(
i
+
1
,
id
);
(
*
it1
)
->
insertPoint
(
j
+
1
,
id
);
}
}
}
}
}
}
}
// end namespace GeoLib
This diff is collapsed.
Click to expand it.
GeoLib/AnalyticalGeometry.h
+
11
−
0
View file @
3dc8a350
...
...
@@ -17,6 +17,7 @@
// GeoLib
#include
"Triangle.h"
#include
"PointVec.h"
// MathLib
#include
"LinAlg/Dense/DenseMatrix.h"
...
...
@@ -166,6 +167,16 @@ double scalarTriple(MathLib::Vector3 const& u, MathLib::Vector3 const& v, MathLi
const
GeoLib
::
Point
&
c
,
const
GeoLib
::
Point
&
d
);
/**
* Method first compute the intersection points of line segements of GeoLib::Polyline objects
* (@see computeIntersectionPoints()) and pushs each intersection point in the GeoLib::PointVec
* pnt_vec. For each intersection an id is returned. This id is used to split the two
* intersecting straight line segments in four straight line segments.
*/
void
computeAndInsertAllIntersectionPoints
(
GeoLib
::
PointVec
&
pnt_vec
,
std
::
vector
<
GeoLib
::
Polyline
*>
&
plys
);
}
// end namespace GeoLib
#endif
/* ANALYTICAL_GEOMETRY_H_ */
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