Commit 8304669b authored by Martin Heistermann's avatar Martin Heistermann

Avoid more uses of dynamic_cast.

parent d246a675
......@@ -108,7 +108,7 @@ bool getObject( int _identifier, HexahedralMeshObject*& _object ) {
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< HexahedralMeshObject* >(object);
_object = hexahedralMeshObject(object);
return ( _object != 0 );
}
......@@ -120,7 +120,7 @@ bool getObject( int _identifier, HexahedralMeshObject*& _object ) {
HexahedralMesh* hexahedralMesh( BaseObjectData* _object ) {
if ( _object->dataType(DATA_HEXAHEDRAL_MESH) ) {
HexahedralMeshObject* object = dynamic_cast< HexahedralMeshObject* >(_object);
HexahedralMeshObject* object = static_cast< HexahedralMeshObject* >(_object);
return object->mesh();
} else
return 0;
......@@ -139,7 +139,7 @@ HexahedralMesh* hexahedralMesh( int _identifier ) {
HexahedralMeshObject* hexahedralMeshObject( BaseObjectData* _object ) {
if ( ! _object->dataType(DATA_HEXAHEDRAL_MESH) )
return 0;
return dynamic_cast< HexahedralMeshObject* >( _object );
return static_cast< HexahedralMeshObject* >( _object );
}
......
......@@ -102,7 +102,7 @@ bool getObject( int _identifier, TetrahedralMeshObject*& _object ) {
BaseObjectData* object = 0;
PluginFunctions::getObject(_identifier,object);
_object = dynamic_cast< TetrahedralMeshObject* >(object);
_object = tetrahedralMeshObject(object);
return ( _object != 0 );
}
......@@ -114,7 +114,7 @@ bool getObject( int _identifier, TetrahedralMeshObject*& _object ) {
TetrahedralMesh* tetrahedralMesh( BaseObjectData* _object ) {
if ( _object->dataType(DATA_TETRAHEDRAL_MESH) ) {
TetrahedralMeshObject* object = dynamic_cast< TetrahedralMeshObject* >(_object);
TetrahedralMeshObject* object = static_cast< TetrahedralMeshObject* >(_object);
return object->mesh();
} else
return 0;
......@@ -133,7 +133,7 @@ TetrahedralMesh* tetrahedralMesh( int _identifier ) {
TetrahedralMeshObject* tetrahedralMeshObject( BaseObjectData* _object ) {
if ( ! _object->dataType(DATA_TETRAHEDRAL_MESH) )
return 0;
return dynamic_cast< TetrahedralMeshObject* >( _object );
return static_cast< TetrahedralMeshObject* >( _object );
}
......
......@@ -298,7 +298,7 @@ void VolumeMeshObject<MeshT>::updateTopology() {
template<class MeshT>
BaseObject* VolumeMeshObject<MeshT>::copy() {
VolumeMeshObject< MeshT >* object = new VolumeMeshObject<MeshT>(*this);
return dynamic_cast<BaseObject*> (object);
return static_cast<BaseObject*> (object);
}
template<class MeshT>
......
......@@ -245,7 +245,7 @@ void TypeHexahedralMeshPlugin::switchRendering() {
if(!PluginFunctions::getObject(objectId, bod))
return;
HexahedralMeshObject* hexMeshObject = dynamic_cast<HexahedralMeshObject*>(bod);
HexahedralMeshObject* hexMeshObject = PluginFunctions::hexahedralMeshObject(bod);
if(hexMeshObject) {
hexMeshObject->meshNode()->set_boundary_only(render_switch_->isChecked());
......@@ -267,7 +267,7 @@ void TypeHexahedralMeshPlugin::setTranslucencyFactor() {
if(!PluginFunctions::getObject(objectId, bod))
return;
HexahedralMeshObject* hexMeshObject = dynamic_cast<HexahedralMeshObject*>(bod);
HexahedralMeshObject* hexMeshObject = PluginFunctions::hexahedralMeshObject(bod);
if(hexMeshObject) {
......
......@@ -208,7 +208,7 @@ void TypePolyhedralMeshPlugin::switchRendering() {
if(!PluginFunctions::getObject(objectId, bod))
return;
PolyhedralMeshObject* polyMeshObject = dynamic_cast<PolyhedralMeshObject*>(bod);
PolyhedralMeshObject* polyMeshObject = PluginFunctions::polyhedralMeshObject(bod);
if(polyMeshObject) {
polyMeshObject->meshNode()->set_boundary_only(render_switch_->isChecked());
......@@ -230,7 +230,7 @@ void TypePolyhedralMeshPlugin::setTranslucencyFactor() {
if(!PluginFunctions::getObject(objectId, bod))
return;
PolyhedralMeshObject* polyMeshObject = dynamic_cast<PolyhedralMeshObject*>(bod);
PolyhedralMeshObject* polyMeshObject = PluginFunctions::polyhedralMeshObject(bod);
if(polyMeshObject) {
......
......@@ -232,7 +232,7 @@ void TypeTetrahedralMeshPlugin::switchRendering() {
if(!PluginFunctions::getObject(objectId, bod))
return;
TetrahedralMeshObject* tetMeshObject = dynamic_cast<TetrahedralMeshObject*>(bod);
TetrahedralMeshObject* tetMeshObject = PluginFunctions::tetrahedralMeshObject(bod);
if(tetMeshObject) {
tetMeshObject->meshNode()->set_boundary_only(render_switch_->isChecked());
......@@ -254,7 +254,8 @@ void TypeTetrahedralMeshPlugin::setTranslucencyFactor() {
if(!PluginFunctions::getObject(objectId, bod))
return;
TetrahedralMeshObject* tetMeshObject = dynamic_cast<TetrahedralMeshObject*>(bod);
TetrahedralMeshObject* tetMeshObject = PluginFunctions::tetrahedralMeshObject(bod);
if(tetMeshObject) {
......
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