Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
d48e7665
Commit
d48e7665
authored
Jan 11, 2013
by
Sylvain Thery
Browse files
Merge branch 'master' of cgogn:CGoGN
parents
090b9992
18e13d41
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/Algo/Filtering/functors.h
View file @
d48e7665
...
...
@@ -86,7 +86,7 @@ public:
bool
operator
()(
Dart
d
)
{
typename
PFP
::
REAL
alpha
=
0
;
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
m_map
,
center
,
radius
,
d
,
position
,
alpha
);
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
m_map
,
center
,
radius
,
d
,
position
,
alpha
);
sum
+=
(
1
-
alpha
)
*
attr
[
d
]
+
alpha
*
attr
[
this
->
m_map
.
phi1
(
d
)]
;
++
count
;
return
false
;
...
...
include/Algo/Geometry/intersection.h
View file @
d48e7665
...
...
@@ -31,6 +31,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
Geometry
{
...
...
@@ -83,6 +86,8 @@ bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center,
}
// namespace Geometry
}
// surface
}
// namespace Algo
}
// namespace CGoGN
...
...
include/Algo/Geometry/intersection.hpp
View file @
d48e7665
...
...
@@ -37,6 +37,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
Geometry
{
...
...
@@ -249,6 +252,8 @@ bool intersectionSphereEdge(typename PFP::MAP& map, typename PFP::VEC3& center,
}
// namespace Geometry
}
// Surface
}
// namespace Algo
}
// namespace CGoGN
include/Algo/Selection/collector.h
View file @
d48e7665
...
...
@@ -41,6 +41,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
Selection
{
...
...
@@ -458,9 +461,8 @@ private :
}
// namespace Selection
}
// surface
}
// namespace Algo
}
// namespace CGoGN
#include
"Algo/Selection/collector.hpp"
...
...
include/Algo/Selection/collector.hpp
View file @
d48e7665
...
...
@@ -32,6 +32,9 @@ namespace CGoGN
namespace
Algo
{
namespace
Surface
{
namespace
Selection
{
...
...
@@ -258,7 +261,7 @@ void Collector_WithinSphere<PFP>::computeArea()
typename
PFP
::
VEC3
centerPosition
=
this
->
position
[
this
->
centerDart
];
for
(
std
::
vector
<
Dart
>::
const_iterator
it
=
this
->
insideFaces
.
begin
();
it
!=
this
->
insideFaces
.
end
();
++
it
)
area
+=
Algo
::
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
area
+=
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
for
(
std
::
vector
<
Dart
>::
const_iterator
it
=
this
->
border
.
begin
();
it
!=
this
->
border
.
end
();
++
it
)
{
...
...
@@ -267,16 +270,16 @@ void Collector_WithinSphere<PFP>::computeArea()
if
(
Geom
::
isPointInSphere
(
this
->
position
[
g
],
centerPosition
,
this
->
radius
))
{
// only f is outside
typename
PFP
::
REAL
alpha
,
beta
;
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
*
it
,
this
->
position
,
alpha
);
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
this
->
map
.
phi2
(
f
),
this
->
position
,
beta
);
area
+=
(
alpha
+
beta
-
alpha
*
beta
)
*
Algo
::
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
*
it
,
this
->
position
,
alpha
);
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
this
->
map
.
phi2
(
f
),
this
->
position
,
beta
);
area
+=
(
alpha
+
beta
-
alpha
*
beta
)
*
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
}
else
{
// f and g are outside
typename
PFP
::
REAL
alpha
,
beta
;
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
*
it
,
this
->
position
,
alpha
);
Algo
::
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
this
->
map
.
phi2
(
g
),
this
->
position
,
beta
);
area
+=
alpha
*
beta
*
Algo
::
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
*
it
,
this
->
position
,
alpha
);
Geometry
::
intersectionSphereEdge
<
PFP
>
(
this
->
map
,
centerPosition
,
this
->
radius
,
this
->
map
.
phi2
(
g
),
this
->
position
,
beta
);
area
+=
alpha
*
beta
*
Geometry
::
triangleArea
<
PFP
>
(
this
->
map
,
*
it
,
this
->
position
);
}
}
}
...
...
@@ -1135,13 +1138,15 @@ void Collector_Dijkstra<PFP>::collectBorder(Dart dinit)
template
<
typename
PFP
>
inline
float
Collector_Dijkstra
<
PFP
>::
edgeLength
(
Dart
d
)
{
typename
PFP
::
VEC3
v
=
Algo
::
Geometry
::
vectorOutOfDart
<
PFP
>
(
this
->
map
,
d
,
this
->
position
);
typename
PFP
::
VEC3
v
=
Geometry
::
vectorOutOfDart
<
PFP
>
(
this
->
map
,
d
,
this
->
position
);
return
v
.
norm
();
}
}
// namespace Selection
}
// Surface
}
// namespace Algo
}
// namespace CGoGN
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment