Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polymesh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Philip Trettner
polymesh
Commits
65025e1a
Commit
65025e1a
authored
4 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
fixed span for ref types, copy_from with spans
parent
7679582c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/polymesh/attributes.hh
+3
-2
3 additions, 2 deletions
src/polymesh/attributes.hh
src/polymesh/impl/impl_attributes.hh
+1
-1
1 addition, 1 deletion
src/polymesh/impl/impl_attributes.hh
src/polymesh/tmp.hh
+5
-3
5 additions, 3 deletions
src/polymesh/tmp.hh
with
9 additions
and
6 deletions
src/polymesh/attributes.hh
+
3
−
2
View file @
65025e1a
...
...
@@ -7,6 +7,7 @@
#include
<polymesh/cursors.hh>
#include
<polymesh/detail/unique_array.hh>
#include
<polymesh/ranges.hh>
#include
<polymesh/span.hh>
#include
<polymesh/tmp.hh>
#include
<polymesh/view.hh>
...
...
@@ -121,8 +122,8 @@ public:
// template <class ReadT, class WriteT>
// void view(ReadT&& r, WriteT&& w) && = delete;
/// copies as much data as possible from the given
vector
void
copy_from
(
s
td
::
vector
<
AttrT
>
const
&
data
);
/// copies as much data as possible from the given
range of data
void
copy_from
(
s
pan
<
AttrT
const
>
data
);
/// copies as much data as possible from the given array
void
copy_from
(
AttrT
const
*
data
,
int
cnt
);
/// copies as much data as possible from the given attribute
...
...
This diff is collapsed.
Click to expand it.
src/polymesh/impl/impl_attributes.hh
+
1
−
1
View file @
65025e1a
...
...
@@ -63,7 +63,7 @@ AttrT const& edge_attribute<AttrT>::operator()(halfedge_handle h) const
}
template
<
class
tag
,
class
AttrT
>
void
primitive_attribute
<
tag
,
AttrT
>::
copy_from
(
s
td
::
vector
<
AttrT
>
const
&
data
)
void
primitive_attribute
<
tag
,
AttrT
>::
copy_from
(
s
pan
<
AttrT
const
>
data
)
{
std
::
copy_n
(
data
.
data
(),
std
::
min
(
int
(
data
.
size
()),
this
->
size
()),
this
->
data
());
}
...
...
This diff is collapsed.
Click to expand it.
src/polymesh/tmp.hh
+
5
−
3
View file @
65025e1a
...
...
@@ -103,9 +103,11 @@ struct constant_rational
namespace
detail
{
template
<
class
Container
,
class
ElementT
>
auto
contiguous_range_test
(
Container
*
c
)
->
decltype
(
static_cast
<
ElementT
*>
(
c
->
data
()),
static_cast
<
size_t
>
(
c
->
size
()),
0
);
auto
contiguous_range_test
(
int
)
->
decltype
(
static_cast
<
ElementT
*>
(
std
::
declval
<
Container
>
().
data
()),
//
static_cast
<
size_t
>
(
std
::
declval
<
Container
>
().
size
()),
std
::
true_type
{});
template
<
class
Container
,
class
ElementT
>
char
contiguous_range_test
(
...
);
std
::
false_type
contiguous_range_test
(
char
);
template
<
class
Container
,
class
ElementT
,
class
=
void
>
struct
is_range_t
:
std
::
false_type
...
...
@@ -139,7 +141,7 @@ struct is_range_t<Container,
}
template
<
class
Container
,
class
ElementT
>
static
constexpr
bool
is_contiguous_range
=
sizeof
(
detail
::
contiguous_range_test
<
Container
,
ElementT
>
(
nullptr
))
==
sizeof
(
int
)
;
static
constexpr
bool
is_contiguous_range
=
decltype
(
detail
::
contiguous_range_test
<
Container
,
ElementT
>
(
0
))
::
value
;
template
<
class
Container
,
class
ElementT
>
static
constexpr
bool
is_range
=
detail
::
is_range_t
<
Container
,
ElementT
>::
value
;
...
...
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