Commit 679628af authored by Jan Möbius's avatar Jan Möbius
Browse files

Tobias: SplatCloud update



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14995 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c31dd85e
......@@ -356,45 +356,21 @@ public:
*
* @param[in] _handle A handle of the desired property.
* Do *not* use handle-strings inbetween '<' and '>'. These are reserved for predefined properties.
* @param[out] _property A pointer to the new property.
* If the property is already present, the pointer is set to the old property and no new property is created or added.
* Otherwise the pointer is set to the newly created property.
* If the creation fails, the pointer is set to 0 and no new property is added.
* @return For convenience the validity of _property is returned (i.e. _property != 0).
* @return If the property is already present, a pointer to the old property is returned and no new property is created or added.
* Otherwise a pointer to the newly created property is returned.
* If the creation fails, 0 is returned and no new property is added.
*/
///@{
template <typename T> inline bool requestSplatProperty( const PropertyHandleT<T> &_handle ) { SplatPropertyT<T> *temp; return requestSplatProperty( _handle, temp ); }
template <typename T> inline bool requestCloudProperty( const PropertyHandleT<T> &_handle ) { CloudPropertyT<T> *temp; return requestCloudProperty( _handle, temp ); }
template <typename T> bool requestSplatProperty( const PropertyHandleT<T> &_handle, SplatPropertyT<T> *(&_property) ); // no separate methods for const pointers
template <typename T> bool requestCloudProperty( const PropertyHandleT<T> &_handle, CloudPropertyT<T> *(&_property) ); // because methods are not const anyway
template <typename T> SplatPropertyT<T> *requestSplatProperty( const PropertyHandleT<T> &_handle );
template <typename T> CloudPropertyT<T> *requestCloudProperty( const PropertyHandleT<T> &_handle );
template <typename T> inline SplatPropertyT<T> *requestSplatProperty( const BasePropertyHandle &_handle ) { return requestSplatProperty( PropertyHandleT<T>( _handle ) ); }
template <typename T> inline CloudPropertyT<T> *requestCloudProperty( const BasePropertyHandle &_handle ) { return requestCloudProperty( PropertyHandleT<T>( _handle ) ); }
///@}
///@}
//----------------
/** @name Request and set splat-properties. */
///@{
/** \brief Request and set a cloud-property.
*
* This is equivalent to the single parameter version of the requestCloudProperty() method but sets the property's data for convenience.
* Notice that the data is set (overwritten) either if the property is already present or not.
*
* \note Be careful, this method is *not* in O(1).
*
* @param[in] _handle A handle of the desired property.
* Do *not* use handle-strings inbetween '<' and '>'. These are reserved for predefined properties.
* @param[in] _data The new data value.
* @return For convenience the validity of _property is returned (i.e. _property != 0).
*/
template <typename T> inline bool requestCloudProperty( const PropertyHandleT<T> &_handle, const T &_data )
{ CloudPropertyT<T> *prop; if( requestCloudProperty( _handle, prop ) ) { prop->data() = _data; return true; } return false; }
///@}
//----------------
/** @name Release properties. */
///@{
......@@ -406,16 +382,14 @@ public:
*
* @param[in] _handle A handle of the property to remove.
* Do *not* use handle-strings inbetween '<' and '>'. These are reserved for predefined properties.
* @param[out] _property A pointer to the old property.
* If the property is present and will *not* be removed, the pointer is set to the old property.
* Otherwise the pointer is set to 0.
* @return For convenience the validity of _property is returned (i.e. _property != 0).
* @return If the property is present and will *not* be removed, a pointer to the old property is returned.
* Otherwise 0 is returned.
*/
///@{
template <typename T> inline bool releaseSplatProperty( const PropertyHandleT<T> &_handle ) { SplatPropertyT<T> *temp; return releaseSplatProperty( _handle, temp ); }
template <typename T> inline bool releaseCloudProperty( const PropertyHandleT<T> &_handle ) { CloudPropertyT<T> *temp; return releaseCloudProperty( _handle, temp ); }
template <typename T> bool releaseSplatProperty( const PropertyHandleT<T> &_handle, SplatPropertyT<T> *(&_property) );
template <typename T> bool releaseCloudProperty( const PropertyHandleT<T> &_handle, CloudPropertyT<T> *(&_property) );
template <typename T> SplatPropertyT<T> *releaseSplatProperty( const PropertyHandleT<T> &_handle );
template <typename T> CloudPropertyT<T> *releaseCloudProperty( const PropertyHandleT<T> &_handle );
template <typename T> inline SplatPropertyT<T> *releaseSplatProperty( const BasePropertyHandle &_handle ) { return releaseSplatProperty( PropertyHandleT<T>( _handle ) ); }
template <typename T> inline CloudPropertyT<T> *releaseCloudProperty( const BasePropertyHandle &_handle ) { return releaseCloudProperty( PropertyHandleT<T>( _handle ) ); }
///@}
///@}
......@@ -428,20 +402,20 @@ public:
/** \brief Get a pointer to a property.
*
* \note Be careful, this method is *not* in O(1).
* This is the reason why there is no method returning a pointer directly and no hasSplatProperty() or hasCloudProperty() method.
* If you want to check for existence, use the dual parameter version of the getSplatProperty() or getCloudProperty() method once
* and then check for _property != 0 multiple times if needed.
*
* @param[in] _handle A handle of the desired property.
* @param[out] _property A pointer to the property.
* If the property is present, the pointer is set to the property.
* Otherwise the pointer is set to 0.
* return If the property is present, a pointer to the property is returned.
* Otherwise 0 is returned.
*/
///@{
template <typename T> void getSplatProperty( const PropertyHandleT<T> &_handle, SplatPropertyT<T> *(&_property) );
template <typename T> void getSplatProperty( const PropertyHandleT<T> &_handle, const SplatPropertyT<T> *(&_property) ) const;
template <typename T> void getCloudProperty( const PropertyHandleT<T> &_handle, CloudPropertyT<T> *(&_property) );
template <typename T> void getCloudProperty( const PropertyHandleT<T> &_handle, const CloudPropertyT<T> *(&_property) ) const;
template <typename T> SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle );
template <typename T> const SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle ) const;
template <typename T> CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle );
template <typename T> const CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle ) const;
template <typename T> inline SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
template <typename T> inline const SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) const { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
template <typename T> inline CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
template <typename T> inline const CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) const { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
///@}
///@}
......@@ -451,19 +425,25 @@ public:
/** @name Get property maps. */
///@{
/** \brief Get all splat- or cloud-properties.
/** \brief Get all splat-properties.
*
* \note Be careful, std::map's count() method will *not* check for the appropiate type of a property.
* There is no hasSplatProperty() or hasCloudProperty() method because this would *not* be in O(1).
* Instead call the dual parameter version of the getSplatProperty() or getCloudProperty() method once
* and then check for _property != 0 multiple times if needed.
* Instead use something like SplatPropertyT<MyPropType> *myProp = mySplatCloud.getSplatProperty<MyPropType>( "MyPropName" ); once
* and then check for myProp != 0 multiple times if needed.
*
* @return Returns the property map as read-only reference.
*/
///@{
inline const SplatPropertyMap &splatProperties() const { return splatProperties_; }
/** \brief Get all cloud-properties.
*
* \note Be careful, std::map's count() method will *not* check for the appropiate type of a property.
* Instead use something like CloudPropertyT<MyPropType> *myProp = mySplatCloud.getCloudProperty<MyPropType>( "MyPropName" ); once
* and then check for myProp != 0 multiple times if needed.
*
* @return Returns the property map as read-only reference.
*/
inline const CloudPropertyMap &cloudProperties() const { return cloudProperties_; }
///@}
///@}
......@@ -563,15 +543,17 @@ public:
* See the requestSplatProperty() or requestCloudProperty() method for more detail.
*
* \note Be careful, this method is *not* in O(1).
*
* @return Returns true if the predefined property is available, otherwise false.
*/
///@{
inline bool requestPositions() { return requestSplatProperty( POSITIONS_HANDLE, positionsProperty_ ); }
inline bool requestColors() { return requestSplatProperty( COLORS_HANDLE, colorsProperty_ ); }
inline bool requestNormals() { return requestSplatProperty( NORMALS_HANDLE, normalsProperty_ ); }
inline bool requestPointsizes() { return requestSplatProperty( POINTSIZES_HANDLE, pointsizesProperty_ ); }
inline bool requestIndices() { return requestSplatProperty( INDICES_HANDLE, indicesProperty_ ); }
inline bool requestViewlists() { return requestSplatProperty( VIEWLISTS_HANDLE, viewlistsProperty_ ); }
inline bool requestSelections() { return requestSplatProperty( SELECTIONS_HANDLE, selectionsProperty_ ); }
inline bool requestPositions() { positionsProperty_ = requestSplatProperty( POSITIONS_HANDLE ); return (positionsProperty_ != 0); }
inline bool requestColors() { colorsProperty_ = requestSplatProperty( COLORS_HANDLE ); return (colorsProperty_ != 0); }
inline bool requestNormals() { normalsProperty_ = requestSplatProperty( NORMALS_HANDLE ); return (normalsProperty_ != 0); }
inline bool requestPointsizes() { pointsizesProperty_ = requestSplatProperty( POINTSIZES_HANDLE ); return (pointsizesProperty_ != 0); }
inline bool requestIndices() { indicesProperty_ = requestSplatProperty( INDICES_HANDLE ); return (indicesProperty_ != 0); }
inline bool requestViewlists() { viewlistsProperty_ = requestSplatProperty( VIEWLISTS_HANDLE ); return (viewlistsProperty_ != 0); }
inline bool requestSelections() { selectionsProperty_ = requestSplatProperty( SELECTIONS_HANDLE ); return (selectionsProperty_ != 0); }
///@}
///@}
......@@ -588,13 +570,13 @@ public:
* \note Be careful, this method is *not* in O(1).
*/
///@{
inline bool releasePositions() { return releaseSplatProperty( POSITIONS_HANDLE, positionsProperty_ ); }
inline bool releaseColors() { return releaseSplatProperty( COLORS_HANDLE, colorsProperty_ ); }
inline bool releaseNormals() { return releaseSplatProperty( NORMALS_HANDLE, normalsProperty_ ); }
inline bool releasePointsizes() { return releaseSplatProperty( POINTSIZES_HANDLE, pointsizesProperty_ ); }
inline bool releaseIndices() { return releaseSplatProperty( INDICES_HANDLE, indicesProperty_ ); }
inline bool releaseViewlists() { return releaseSplatProperty( VIEWLISTS_HANDLE, viewlistsProperty_ ); }
inline bool releaseSelections() { return releaseSplatProperty( SELECTIONS_HANDLE, selectionsProperty_ ); }
inline void releasePositions() { positionsProperty_ = releaseSplatProperty( POSITIONS_HANDLE ); }
inline void releaseColors() { colorsProperty_ = releaseSplatProperty( COLORS_HANDLE ); }
inline void releaseNormals() { normalsProperty_ = releaseSplatProperty( NORMALS_HANDLE ); }
inline void releasePointsizes() { pointsizesProperty_ = releaseSplatProperty( POINTSIZES_HANDLE ); }
inline void releaseIndices() { indicesProperty_ = releaseSplatProperty( INDICES_HANDLE ); }
inline void releaseViewlists() { viewlistsProperty_ = releaseSplatProperty( VIEWLISTS_HANDLE ); }
inline void releaseSelections() { selectionsProperty_ = releaseSplatProperty( SELECTIONS_HANDLE ); }
///@}
///@}
......@@ -675,13 +657,13 @@ private:
/// Get pointers to predefined splat-properties.
inline void getPredefinedSplatPropertyPointers()
{
getSplatProperty( POSITIONS_HANDLE, positionsProperty_ );
getSplatProperty( COLORS_HANDLE, colorsProperty_ );
getSplatProperty( NORMALS_HANDLE, normalsProperty_ );
getSplatProperty( POINTSIZES_HANDLE, pointsizesProperty_ );
getSplatProperty( INDICES_HANDLE, indicesProperty_ );
getSplatProperty( VIEWLISTS_HANDLE, viewlistsProperty_ );
getSplatProperty( SELECTIONS_HANDLE, selectionsProperty_ );
positionsProperty_ = getSplatProperty( POSITIONS_HANDLE );
colorsProperty_ = getSplatProperty( COLORS_HANDLE );
normalsProperty_ = getSplatProperty( NORMALS_HANDLE );
pointsizesProperty_ = getSplatProperty( POINTSIZES_HANDLE );
indicesProperty_ = getSplatProperty( INDICES_HANDLE );
viewlistsProperty_ = getSplatProperty( VIEWLISTS_HANDLE );
selectionsProperty_ = getSplatProperty( SELECTIONS_HANDLE );
}
/// Get pointers to predefined cloud-properties.
......
......@@ -110,7 +110,7 @@ template <typename T>
template <typename T>
bool SplatCloud::requestSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::SplatPropertyT<T> *(&_property) )
SplatCloud::SplatPropertyT<T> *SplatCloud::requestSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
SplatPropertyMap::iterator iter = splatProperties_.find( _handle );
......@@ -119,35 +119,32 @@ bool SplatCloud::requestSplatProperty( const SplatCloud::PropertyHandleT<T> &_ha
if( iter != splatProperties_.end() )
{
// try to cast
_property = dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
SplatPropertyT<T> *oldProp = dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
// check if cast failed and property in map has different type. if so, return failure (_property is 0)
if( _property == 0 )
return false;
// increase number of requests and return success (_property is a valid pointer)
// if found property is of the right type, increase number of requests
if( oldProp != 0 )
++iter->second.numRequests_;
return true;
// return pointer to old property
return oldProp;
}
// create new property
_property = new SplatPropertyT<T>( _handle, numSplats_ );
// if out of memory, abort and return failure (_property is 0)
if( _property == 0 )
return false;
SplatPropertyT<T> *newProp = new SplatPropertyT<T>( _handle, numSplats_ );
// if creation went wrong, free memory and return failure (_property will be set to 0)
if( _property->data_.size() != numSplats_ )
// if creation went wrong, free memory and reset pointer
if( newProp->data_.size() != numSplats_ )
{
delete _property;
_property = 0;
return false;
delete newProp;
newProp = 0;
}
// insert new property map entry and return success (_property is a valid pointer)
splatProperties_[ _handle ] = SplatPropertyMapEntry( _property, 1 );
return true;
// if pointer is valid, insert new property map entry
if( newProp != 0 )
splatProperties_[ _handle ] = SplatPropertyMapEntry( newProp, 1 );
// return pointer to new property
return newProp;
}
......@@ -155,7 +152,7 @@ bool SplatCloud::requestSplatProperty( const SplatCloud::PropertyHandleT<T> &_ha
template <typename T>
bool SplatCloud::requestCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::CloudPropertyT<T> *(&_property) )
SplatCloud::CloudPropertyT<T> *SplatCloud::requestCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
CloudPropertyMap::iterator iter = cloudProperties_.find( _handle );
......@@ -164,27 +161,25 @@ bool SplatCloud::requestCloudProperty( const SplatCloud::PropertyHandleT<T> &_ha
if( iter != cloudProperties_.end() )
{
// try to cast
_property = dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
// check if cast failed and property in map has different type. if so, return failure (_property is 0)
if( _property == 0 )
return false;
CloudPropertyT<T> *oldProp = dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
// increase number of requests and return success (_property is a valid pointer)
// if found property is of the right type, increase number of requests
if( oldProp != 0 )
++iter->second.numRequests_;
return true;
// return pointer to old property
return oldProp;
}
// create new property
_property = new CloudPropertyT<T>( _handle );
CloudPropertyT<T> *newProp = new CloudPropertyT<T>( _handle );
// if out of memory, abort and return failure (_property is 0)
if( _property == 0 )
return false;
// if pointer is valid, insert new property map entry
if( newProp != 0 )
cloudProperties_[ _handle ] = CloudPropertyMapEntry( newProp, 1 );
// insert new property map entry and return success (_property is a valid pointer)
cloudProperties_[ _handle ] = CloudPropertyMapEntry( _property, 1 );
return true;
// return pointer to new property
return newProp;
}
......@@ -192,34 +187,38 @@ bool SplatCloud::requestCloudProperty( const SplatCloud::PropertyHandleT<T> &_ha
template <typename T>
bool SplatCloud::releaseSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::SplatPropertyT<T> *(&_property) )
SplatCloud::SplatPropertyT<T> *SplatCloud::releaseSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
SplatPropertyMap::iterator iter = splatProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == splatProperties_.end()) ? 0 : dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
// if *not* found, abort
if( iter == splatProperties_.end() )
return 0;
// if a property with the same name but a different type is present, do *not* remove any property
// if *not* a valid pointer, abort and return failure (_property is 0)
if( _property == 0 )
return false;
// try to cast
SplatPropertyT<T> *prop = dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
// check if found property is of the right type
if( prop != 0 )
{
// decrease number of request
--iter->second.numRequests_;
// check if property should *not* be removed yet. if so, return success (_property is a valid pointer)
if( iter->second.numRequests_ != 0 )
return true;
// check if property should be removed now
if( iter->second.numRequests_ == 0 )
{
// free memory of property and reset pointer
delete _property;
_property = 0;
delete prop;
prop = 0;
// remove property map entry and return false because _property is 0
// remove property map entry
splatProperties_.erase( iter );
return false;
}
}
// return pointer to property
return prop;
}
......@@ -227,34 +226,38 @@ bool SplatCloud::releaseSplatProperty( const SplatCloud::PropertyHandleT<T> &_ha
template <typename T>
bool SplatCloud::releaseCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::CloudPropertyT<T> *(&_property) )
SplatCloud::CloudPropertyT<T> *SplatCloud::releaseCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
CloudPropertyMap::iterator iter = cloudProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == cloudProperties_.end()) ? 0 : dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
// if *not* found, abort
if( iter == cloudProperties_.end() )
return 0;
// if a property with the same name but a different type is present, do *not* remove any property
// if *not* a valid pointer, abort and return failure (_property is 0)
if( _property == 0 )
return false;
// try to cast
CloudPropertyT<T> *prop = dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
// check if found property is of the right type
if( prop != 0 )
{
// decrease number of request
--iter->second.numRequests_;
// check if property should *not* be removed yet. if so, return success (_property is a valid pointer)
if( iter->second.numRequests_ != 0 )
return true;
// check if property should be removed now
if( iter->second.numRequests_ == 0 )
{
// free memory of property and reset pointer
delete _property;
_property = 0;
delete prop;
prop = 0;
// remove property map entry and return false because _property is 0
// remove property map entry
cloudProperties_.erase( iter );
return false;
}
}
// return pointer to property
return prop;
}
......@@ -262,13 +265,13 @@ bool SplatCloud::releaseCloudProperty( const SplatCloud::PropertyHandleT<T> &_ha
template <typename T>
void SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::SplatPropertyT<T> *(&_property) )
SplatCloud::SplatPropertyT<T> *SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
SplatPropertyMap::const_iterator iter = splatProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == splatProperties_.end()) ? 0 : dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
// if *not* found or cast fails return 0, otherwise return a valid pointer
return (iter == splatProperties_.end()) ? 0 : dynamic_cast<SplatPropertyT<T> *>( iter->second.property_ );
}
......@@ -276,13 +279,13 @@ void SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle
template <typename T>
void SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle, const SplatCloud::SplatPropertyT<T> *(&_property) ) const
const SplatCloud::SplatPropertyT<T> *SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle ) const
{
// try to find property map entry
SplatPropertyMap::const_iterator iter = splatProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == splatProperties_.end()) ? 0 : dynamic_cast<const SplatPropertyT<T> *>( iter->second.property_ );
// if *not* found or cast fails return 0, otherwise return a valid pointer
return (iter == splatProperties_.end()) ? 0 : dynamic_cast<const SplatPropertyT<T> *>( iter->second.property_ );
}
......@@ -290,13 +293,13 @@ void SplatCloud::getSplatProperty( const SplatCloud::PropertyHandleT<T> &_handle
template <typename T>
void SplatCloud::getCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle, SplatCloud::CloudPropertyT<T> *(&_property) )
SplatCloud::CloudPropertyT<T> *SplatCloud::getCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle )
{
// try to find property map entry
CloudPropertyMap::const_iterator iter = cloudProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == cloudProperties_.end()) ? 0 : dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
// if *not* found or cast fails return 0, otherwise return a valid pointer
return (iter == cloudProperties_.end()) ? 0 : dynamic_cast<CloudPropertyT<T> *>( iter->second.property_ );
}
......@@ -304,11 +307,11 @@ void SplatCloud::getCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle
template <typename T>
void SplatCloud::getCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle, const SplatCloud::CloudPropertyT<T> *(&_property) ) const
const SplatCloud::CloudPropertyT<T> *SplatCloud::getCloudProperty( const SplatCloud::PropertyHandleT<T> &_handle ) const
{
// try to find property map entry
CloudPropertyMap::const_iterator iter = cloudProperties_.find( _handle );
// set _property to 0 if *not* found or cast fails, otherwise to a valid pointer
_property = (iter == cloudProperties_.end()) ? 0 : dynamic_cast<const CloudPropertyT<T> *>( iter->second.property_ );
// if *not* found or cast fails return 0, otherwise return a valid pointer
return (iter == cloudProperties_.end()) ? 0 : dynamic_cast<const CloudPropertyT<T> *>( iter->second.property_ );
}
......@@ -564,28 +564,42 @@ QString SplatCloudObject::getObjectinfo()
{
output += " #Splats: " + QString::number( splatCloud_->numSplats() );
output += ", Splat-Properties:";
output += "; Splat-Properties: ";
if( splatCloud_->splatProperties().empty() )
{
output += " none";
output += "-none-";
}
else
{
SplatCloud::SplatPropertyMap::const_iterator splatPropertyIter;
for( splatPropertyIter = splatCloud_->splatProperties().begin(); splatPropertyIter != splatCloud_->splatProperties().end(); ++splatPropertyIter )
output += QString( " " ) + splatPropertyIter->first.c_str();
SplatCloud::SplatPropertyMap::const_iterator splatPropertyIter = splatCloud_->splatProperties().begin();
while( true )
{
output += splatPropertyIter->first.c_str();
if( ++splatPropertyIter == splatCloud_->splatProperties().end() )
break;
output += ", ";
}
}
output += ", Cloud-Properties:";
output += "; Cloud-Properties: ";
if( splatCloud_->cloudProperties().empty() )
{
output += " none";
output += "-none-";
}
else
{
SplatCloud::CloudPropertyMap::const_iterator cloudPropertyIter;
for( cloudPropertyIter = splatCloud_->cloudProperties().begin(); cloudPropertyIter != splatCloud_->cloudProperties().end(); ++cloudPropertyIter )
output += QString( " " ) + cloudPropertyIter->first.c_str();
SplatCloud::CloudPropertyMap::const_iterator cloudPropertyIter = splatCloud_->cloudProperties().begin();
while( true )
{
output += cloudPropertyIter->first.c_str();
if( ++cloudPropertyIter == splatCloud_->cloudProperties().end() )
break;
output += ", ";
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment