Commit 14846061 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'splat_cloud_by_id' into 'master'

Get Splat Cloud Object by Object ID

See merge request !4
parents 9a8e506c 7b04e00b
......@@ -75,16 +75,16 @@ bool getObject( int _identifier, SplatCloudObject *&_object )
{
if( _identifier == BaseObject::NOOBJECT )
{
_object = 0;
_object = nullptr;
return false;
}
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
BaseObjectData* object = nullptr;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast<SplatCloudObject *>( object );
return (_object != 0);
return (_object != nullptr);
}
......@@ -96,15 +96,15 @@ bool getObject( int _identifier, SplatCloudObject *&_object )
ShaderNode* splatShaderNode( BaseObjectData *_object )
{
if( !_object )
return 0;
return nullptr;
if( !_object->dataType( DATA_SPLATCLOUD ) )
return 0;
return nullptr;
SplatCloudObject *object = dynamic_cast<SplatCloudObject *>( _object );
if ( object == 0 )
return 0;
if ( object == nullptr )
return nullptr;
return object->shaderNode();
}
......@@ -116,15 +116,15 @@ ShaderNode* splatShaderNode( BaseObjectData *_object )
SplatCloudNode* splatCloudNode( BaseObjectData *_object )
{
if( !_object )
return 0;
return nullptr;
if( !_object->dataType( DATA_SPLATCLOUD ) )
return 0;
return nullptr;
SplatCloudObject *object = dynamic_cast<SplatCloudObject *>( _object );
if ( object == 0 )
return 0;
if ( object == nullptr )
return nullptr;
return object->splatCloudNode();
}
......@@ -136,15 +136,15 @@ SplatCloudNode* splatCloudNode( BaseObjectData *_object )
SplatCloud* splatCloud( BaseObjectData *_object )
{
if( !_object )
return 0;
return nullptr;
if( !_object->dataType( DATA_SPLATCLOUD ) )
return 0;
return nullptr;
SplatCloudObject *object = dynamic_cast<SplatCloudObject *>( _object );
if ( object == 0 )
return 0;
if ( object == nullptr )
return nullptr;
return object->splatCloud();
}
......@@ -153,13 +153,25 @@ SplatCloud* splatCloud( BaseObjectData *_object )
//----------------------------------------------------------------
SplatCloud* splatCloud( int _objectId )
{
auto object = splatCloudObject(_objectId);
if (object == nullptr)
return nullptr;
return object->splatCloud();
}
//----------------------------------------------------------------
SplatCloudObject* splatCloudObject( BaseObjectData *_object )
{
if( !_object )
return 0;
return nullptr;
if( !_object->dataType( DATA_SPLATCLOUD ) )
return 0;
return nullptr;
return dynamic_cast<SplatCloudObject *>( _object );
}
......@@ -171,14 +183,14 @@ SplatCloudObject* splatCloudObject( BaseObjectData *_object )
SplatCloudObject* splatCloudObject( int _objectId ) {
if (_objectId == BaseObject::NOOBJECT)
return 0;
return nullptr;
// Get object by using the map accelerated plugin function
BaseObjectData* object = 0;
BaseObjectData* object = nullptr;
PluginFunctions::getObject(_objectId,object);
if ( object == 0 )
return 0;
if ( object == nullptr )
return nullptr;
SplatCloudObject* splatCloudObject = dynamic_cast< SplatCloudObject* >(object);
......
......@@ -111,6 +111,15 @@ OBJECTTYPEDLLEXPORT
SplatCloud* splatCloud( BaseObjectData *_object );
/** \brief Get a SplatCloud by its id.
*
* @param _object Id of the object. If the content is a SplatCloud, a
* SplatCloud will be returned. Otherwise a NULL pointer is returned.
*/
OBJECTTYPEDLLEXPORT
SplatCloud* splatCloud( int _objectId );
/** \brief Cast an SplatCloudObject to a SplatCloudObject if possible
*
* @param _object The object should be of type BaseDataObject. If the content is a SplatCloud, a
......
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