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
OpenFlipper-Free
OpenFlipper-Free
Commits
24315f46
Commit
24315f46
authored
Nov 24, 2015
by
Christopher Tenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix several issues with polyline properties thanks to Lukas Prediger
parent
91bb0584
Pipeline
#101
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
ObjectTypes/PolyLine/PolyLineT.cc
ObjectTypes/PolyLine/PolyLineT.cc
+11
-19
No files found.
ObjectTypes/PolyLine/PolyLineT.cc
View file @
24315f46
...
...
@@ -2130,12 +2130,12 @@ typename PolyLineT<PointT>::CustomPropertyHandle PolyLineT<PointT>::custom_prop_
template
<
class
PointT
>
typename
PolyLineT
<
PointT
>::
CustomProperty
*
PolyLineT
<
PointT
>::
custom_prop
(
CustomPropertyHandle
_handle
)
{
return
(
_handle
>=
0
?
cprop_enum
[
_handle
]
:
0
);
return
(
_handle
>=
0
&&
_handle
<
get_num_custom_properties
()
?
cprop_enum
[
_handle
]
:
NULL
);
}
template
<
class
PointT
>
const
typename
PolyLineT
<
PointT
>::
CustomProperty
*
PolyLineT
<
PointT
>::
custom_prop
(
CustomPropertyHandle
_handle
)
const
{
return
(
_handle
>=
0
?
cprop_enum
[
_handle
]
:
0
);
return
(
_handle
>=
0
&&
_handle
<
get_num_custom_properties
()
?
cprop_enum
[
_handle
]
:
NULL
);
}
template
<
class
PointT
>
...
...
@@ -2143,10 +2143,10 @@ typename PolyLineT<PointT>::CustomPropertyHandle PolyLineT<PointT>::
request_custom_property
(
const
std
::
string
&
_name
,
unsigned
int
_prop_size
)
{
typename
CustomProperty
Map
::
iterator
entry
=
custom_propert
ies
.
find
(
_name
);
CustomProperty
*
pcontainer
=
0
;
CustomProperty
Handle
h
=
get_
custom_propert
y_handle
(
_name
);
CustomProperty
*
pcontainer
=
custom_prop
(
h
)
;
if
(
entry
==
custom_properties
.
end
()
)
{
if
(
!
pcontainer
)
{
// create new property container
pcontainer
=
new
CustomProperty
;
...
...
@@ -2164,8 +2164,6 @@ typename PolyLineT<PointT>::CustomPropertyHandle PolyLineT<PointT>::
cprop_enum
.
push_back
(
pcontainer
);
}
else
{
pcontainer
=
entry
->
second
;
if
(
++
pcontainer
->
ref_count
<
1
)
pcontainer
->
ref_count
=
1
;
}
...
...
@@ -2179,7 +2177,7 @@ void PolyLineT<PointT>::
CustomProperty
*
p
=
custom_prop
(
_prop_handle
);
if
(
p
&&
--
p
->
ref_count
<=
0
)
if
(
p
&&
--
(
p
->
ref_count
)
<=
0
)
p
->
prop_data
.
clear
();
}
...
...
@@ -2187,14 +2185,8 @@ template <class PointT>
void
PolyLineT
<
PointT
>::
release_custom_property
(
const
std
::
string
&
_name
)
{
typename
CustomPropertyMap
::
iterator
entry
=
custom_properties
.
find
(
_name
);
if
(
entry
!=
custom_properties
.
end
())
{
CustomProperty
*
p
=
entry
->
second
;
release_custom_property
(
custom_prop_handle
(
p
));
}
CustomPropertyHandle
h
=
get_custom_property_handle
(
_name
);
release_custom_property
(
h
);
}
template
<
class
PointT
>
...
...
@@ -2213,7 +2205,7 @@ template <class PointT>
const
std
::
string
PolyLineT
<
PointT
>::
get_custom_property_name
(
CustomPropertyHandle
_property_handle
)
const
{
CustomProperty
*
p
=
custom_prop
(
_property_handle
);
const
CustomProperty
*
p
=
custom_prop
(
_property_handle
);
if
(
p
)
return
p
->
name
;
...
...
@@ -2379,7 +2371,7 @@ const void* PolyLineT<PointT>::
else
std
::
cerr
<<
"PolyLineT::get_custom_property_buffer - invalid handle"
<<
std
::
endl
;
return
0
;
return
NULL
;
}
template
<
class
PointT
>
...
...
@@ -2395,7 +2387,7 @@ typename PolyLineT<PointT>::CustomPropertyHandle PolyLineT<PointT>::
if
(
_i
<
get_num_custom_properties
())
return
CustomPropertyHandle
(
_i
);
else
return
0
;
return
-
1
;
}
//=============================================================================
...
...
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