Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
schwede
openstructure
Commits
851cd4e7
Commit
851cd4e7
authored
2 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
GDT function for Vec3List
parent
dded2583
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/geom/pymod/export_vec3.cc
+1
-0
1 addition, 0 deletions
modules/geom/pymod/export_vec3.cc
modules/geom/src/vec3.cc
+17
-0
17 additions, 0 deletions
modules/geom/src/vec3.cc
modules/geom/src/vec3.hh
+1
-0
1 addition, 0 deletions
modules/geom/src/vec3.hh
with
19 additions
and
0 deletions
modules/geom/pymod/export_vec3.cc
+
1
−
0
View file @
851cd4e7
...
@@ -126,5 +126,6 @@ void export_Vec3()
...
@@ -126,5 +126,6 @@ void export_Vec3()
.
def
(
"GetRMSD"
,
&
Vec3List
::
GetRMSD
,(
arg
(
"other"
)))
.
def
(
"GetRMSD"
,
&
Vec3List
::
GetRMSD
,(
arg
(
"other"
)))
.
def
(
"GetGDTHA"
,
&
Vec3List
::
GetGDTHA
,
(
arg
(
"other"
),
arg
(
"norm"
)
=
true
))
.
def
(
"GetGDTHA"
,
&
Vec3List
::
GetGDTHA
,
(
arg
(
"other"
),
arg
(
"norm"
)
=
true
))
.
def
(
"GetGDTTS"
,
&
Vec3List
::
GetGDTTS
,
(
arg
(
"other"
),
arg
(
"norm"
)
=
true
))
.
def
(
"GetGDTTS"
,
&
Vec3List
::
GetGDTTS
,
(
arg
(
"other"
),
arg
(
"norm"
)
=
true
))
.
def
(
"GetGDT"
,
&
Vec3List
::
GetGDT
,
(
arg
(
"other"
),
arg
(
"thresh"
),
arg
(
"norm"
)
=
true
))
;
;
}
}
This diff is collapsed.
Click to expand it.
modules/geom/src/vec3.cc
+
17
−
0
View file @
851cd4e7
...
@@ -181,6 +181,23 @@ Real Vec3List::GetGDTTS(const Vec3List& other, bool norm) const
...
@@ -181,6 +181,23 @@ Real Vec3List::GetGDTTS(const Vec3List& other, bool norm) const
return
norm
&&
!
this
->
empty
()
?
static_cast
<
Real
>
(
n
)
/
(
this
->
size
()
*
4
)
:
n
;
return
norm
&&
!
this
->
empty
()
?
static_cast
<
Real
>
(
n
)
/
(
this
->
size
()
*
4
)
:
n
;
}
}
Real
Vec3List
::
GetGDT
(
const
Vec3List
&
other
,
Real
thresh
,
bool
norm
)
const
{
if
(
this
->
size
()
!=
other
.
size
())
{
String
m
=
"Inconsistent sizes in Vec3List::GetNWithin"
;
throw
GeomException
(
m
);
}
int
n
=
0
;
Real
squared_thresh
=
thresh
*
thresh
;
for
(
uint
i
=
0
;
i
<
this
->
size
();
++
i
)
{
Real
squared_d
=
geom
::
Length2
((
*
this
)[
i
]
-
other
[
i
]);
if
(
squared_d
<
squared_thresh
)
{
++
n
;
}
}
return
norm
&&
!
this
->
empty
()
?
static_cast
<
Real
>
(
n
)
/
(
this
->
size
())
:
n
;
}
std
::
pair
<
Line3
,
Real
>
Vec3List
::
FitCylinder
(
const
Vec3
&
initial_direction
)
const
std
::
pair
<
Line3
,
Real
>
Vec3List
::
FitCylinder
(
const
Vec3
&
initial_direction
)
const
{
{
Vec3
center
=
this
->
GetCenter
();
Vec3
center
=
this
->
GetCenter
();
...
...
This diff is collapsed.
Click to expand it.
modules/geom/src/vec3.hh
+
1
−
0
View file @
851cd4e7
...
@@ -342,6 +342,7 @@ public:
...
@@ -342,6 +342,7 @@ public:
Real
GetRMSD
(
const
Vec3List
&
other
)
const
;
Real
GetRMSD
(
const
Vec3List
&
other
)
const
;
Real
GetGDTHA
(
const
Vec3List
&
other
,
bool
norm
=
true
)
const
;
Real
GetGDTHA
(
const
Vec3List
&
other
,
bool
norm
=
true
)
const
;
Real
GetGDTTS
(
const
Vec3List
&
other
,
bool
norm
=
true
)
const
;
Real
GetGDTTS
(
const
Vec3List
&
other
,
bool
norm
=
true
)
const
;
Real
GetGDT
(
const
Vec3List
&
other
,
Real
thresh
,
bool
norm
=
true
)
const
;
//This function fits a cylinder to the positions in Vec3List
//This function fits a cylinder to the positions in Vec3List
//It takes as argument an initial guess for the direction.
//It takes as argument an initial guess for the direction.
...
...
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