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

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7785 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 744bf5c9
......@@ -51,8 +51,11 @@ namespace PluginFunctions {
// ===============================================================================
bool getObject( int _identifier , PlaneObject*& _object ) {
if (_identifier == -1)
if ( _identifier == -1 ) {
_object = 0;
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
_object = dynamic_cast< PlaneObject* >(object);
......@@ -65,17 +68,18 @@ bool getObject( int _identifier , PlaneObject*& _object ) {
// ===============================================================================
PlaneNode* planeNode( BaseObjectData* _object ) {
if ( _object->dataType(DATA_PLANE) ) {
PlaneObject* object = dynamic_cast< PlaneObject* >(_object);
return object->planeNode();
} else
return NULL;
return 0;
}
PlaneObject* planeObject( BaseObjectData* _object ) {
if ( ! _object->dataType(DATA_PLANE) )
return NULL;
return 0;
return dynamic_cast< PlaneObject* >( _object );
}
......
......@@ -86,8 +86,10 @@ bool getTargetMeshes( std::vector<PolyMesh*>& _meshes ) {
bool getObject( int _identifier , PolyMeshObject*& _object ) {
if ( _identifier == -1 )
if ( _identifier == -1 ) {
_object = 0;
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
_object = dynamic_cast< PolyMeshObject* >(object);
......@@ -96,8 +98,10 @@ bool getObject( int _identifier , PolyMeshObject*& _object ) {
bool getMesh( int _identifier , PolyMesh*& _mesh ) {
if ( _identifier == -1 )
if ( _identifier == -1 ) {
_mesh = 0;
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
......@@ -108,14 +112,17 @@ bool getMesh( int _identifier , PolyMesh*& _mesh ) {
PolyMeshObject* polyMeshObject = dynamic_cast< PolyMeshObject* > (object);
// Object is not a triangle mesh
if ( polyMeshObject == 0)
if ( polyMeshObject == 0) {
_mesh = 0;
return false;
}
_mesh = polyMeshObject->mesh();
return true;
}
PolyMesh* polyMesh( BaseObjectData* _object ) {
if ( _object == 0 )
return 0;
......@@ -127,6 +134,7 @@ PolyMesh* polyMesh( BaseObjectData* _object ) {
}
PolyMeshObject* polyMeshObject( BaseObjectData* _object ) {
if ( _object == 0 )
return 0;
......@@ -136,6 +144,7 @@ PolyMeshObject* polyMeshObject( BaseObjectData* _object ) {
}
PolyMeshObject* polyMeshObject( int _objectId ) {
if (_objectId == -1)
return 0;
......
......@@ -84,8 +84,10 @@ bool getTargetMeshes( std::vector<TriMesh*>& _meshes ) {
bool getObject( int _identifier , TriMeshObject*& _object ) {
if ( _identifier == -1 )
if ( _identifier == -1 ) {
_object = 0;
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
_object = dynamic_cast< TriMeshObject* >(object);
......@@ -98,8 +100,10 @@ bool getObject( int _identifier , TriMeshObject*& _object ) {
bool getMesh( int _identifier , TriMesh*& _mesh ) {
if ( _identifier == -1 )
if ( _identifier == -1 ) {
_mesh = 0;
return false;
}
BaseObject* object = objectRoot()->childExists( _identifier );
......@@ -123,6 +127,7 @@ bool getMesh( int _identifier , TriMesh*& _mesh ) {
// ===============================================================================
TriMesh* triMesh( BaseObjectData* _object ) {
if ( _object == 0 )
return 0;
......@@ -130,7 +135,7 @@ TriMesh* triMesh( BaseObjectData* _object ) {
TriMeshObject* object = dynamic_cast< TriMeshObject* >(_object);
return object->mesh();
} else
return NULL;
return 0;
}
TriMeshObject* triMeshObject( BaseObjectData* _object ) {
......@@ -138,7 +143,7 @@ TriMeshObject* triMeshObject( BaseObjectData* _object ) {
return 0;
if ( ! _object->dataType(DATA_TRIANGLE_MESH) )
return NULL;
return 0;
return dynamic_cast< TriMeshObject* >( _object );
}
......
Supports Markdown
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