Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenMesh
OpenMesh
Commits
aa7cdf74
Commit
aa7cdf74
authored
Jan 09, 2017
by
Jan Möbius
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixMissingProperties' into 'master'
Fix missing properties Closes
#35
See merge request
!115
parents
d1816333
e51fea54
Pipeline
#4102
passed with stage
in 40 minutes and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
10 deletions
+69
-10
src/OpenMesh/Core/Mesh/AttribKernelT.hh
src/OpenMesh/Core/Mesh/AttribKernelT.hh
+64
-2
src/OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh
src/OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh
+3
-4
src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh
src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh
+2
-4
No files found.
src/OpenMesh/Core/Mesh/AttribKernelT.hh
View file @
aa7cdf74
...
...
@@ -211,17 +211,24 @@ public:
elements from traits classes) is not copied.
\note If you want to copy all information, including *custom* properties,
use PolyMeshT::operator=() instead.
TODO: version which copies standard properties specified by the user
*/
template
<
class
_AttribKernel
>
void
assign
(
const
_AttribKernel
&
_other
)
void
assign
(
const
_AttribKernel
&
_other
,
bool
copyStandardProperties
=
false
)
{
//copy standard properties if necessary
if
(
copyStandardProperties
)
this
->
copy_all_kernel_properties
(
_other
);
this
->
assign_connectivity
(
_other
);
for
(
typename
Connectivity
::
VertexIter
v_it
=
Connectivity
::
vertices_begin
();
v_it
!=
Connectivity
::
vertices_end
();
++
v_it
)
{
//assumes Point constructor supports cast from _AttribKernel::Point
set_point
(
*
v_it
,
(
Point
)
_other
.
point
(
*
v_it
));
}
//initialize standard properties if necessary
if
(
copyStandardProperties
)
initializeStandardProperties
();
}
//-------------------------------------------------------------------- points
...
...
@@ -725,6 +732,61 @@ private:
unsigned
int
refcount_fnormals_
;
unsigned
int
refcount_fcolors_
;
unsigned
int
refcount_ftextureIndex_
;
/**
* @brief initializeStandardProperties Initializes the standard properties
* and sets refcount to 1 if found. (e.g. when the copy constructor was used)
*/
void
initializeStandardProperties
()
{
if
(
!
this
->
get_property_handle
(
points_
,
"v:points"
))
{
//mesh has no points?
}
if
(
this
->
get_property_handle
(
vertex_normals_
,
"v:normals"
))
refcount_vnormals_
=
1
;
if
(
this
->
get_property_handle
(
vertex_colors_
,
"v:colors"
))
refcount_vcolors_
=
1
;
if
(
this
->
get_property_handle
(
vertex_texcoords1D_
,
"v:texcoords1D"
))
refcount_vtexcoords1D_
=
1
;
if
(
this
->
get_property_handle
(
vertex_texcoords2D_
,
"v:texcoords2D"
))
refcount_vtexcoords2D_
=
1
;
if
(
this
->
get_property_handle
(
vertex_texcoords3D_
,
"v:texcoords3D"
))
refcount_vtexcoords3D_
=
1
;
if
(
this
->
get_property_handle
(
halfedge_texcoords1D_
,
"h:texcoords1D"
))
refcount_htexcoords1D_
=
1
;
if
(
this
->
get_property_handle
(
halfedge_texcoords2D_
,
"h:texcoords2D"
))
refcount_htexcoords2D_
=
1
;
if
(
this
->
get_property_handle
(
halfedge_texcoords3D_
,
"h:texcoords3D"
))
refcount_htexcoords3D_
=
1
;
if
(
this
->
get_property_handle
(
halfedge_normals_
,
"h:normals"
))
refcount_henormals_
=
1
;
if
(
this
->
get_property_handle
(
halfedge_colors_
,
"h:colors"
))
refcount_hecolors_
=
1
;
if
(
this
->
get_property_handle
(
edge_colors_
,
"e:colors"
))
refcount_ecolors_
=
1
;
if
(
this
->
get_property_handle
(
face_normals_
,
"f:normals"
))
refcount_fnormals_
=
1
;
if
(
this
->
get_property_handle
(
face_colors_
,
"f:colors"
))
refcount_fcolors_
=
1
;
if
(
this
->
get_property_handle
(
face_texture_index_
,
"f:textureindex"
))
refcount_ftextureIndex_
=
1
;
}
};
//=============================================================================
...
...
src/OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh
View file @
aa7cdf74
...
...
@@ -104,10 +104,9 @@ public:
template
<
class
OtherTraits
>
PolyMesh_ArrayKernelT
(
const
TriMesh_ArrayKernelT
<
OtherTraits
>
&
t
)
{
//assign the connectivity (add vertices)
this
->
assign
(
t
);
//copy properties from triMesh
this
->
copy_all_kernel_properties
(
t
);
//assign the connectivity and standard properties
this
->
assign
(
t
,
true
);
}
};
...
...
src/OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh
View file @
aa7cdf74
...
...
@@ -104,10 +104,8 @@ public:
template
<
class
OtherTraits
>
TriMesh_ArrayKernelT
(
const
PolyMesh_ArrayKernelT
<
OtherTraits
>
&
t
)
{
//assign the connectivity (add vertices)
this
->
assign
(
t
);
//copy properties from polyMesh
this
->
copy_all_kernel_properties
(
t
);
//assign the connectivity and standard properties
this
->
assign
(
t
,
true
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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