Commit f5399d51 authored by Dirk Wilden's avatar Dirk Wilden
Browse files

switch case -> if changed

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6279 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0612c55f
......@@ -64,25 +64,20 @@ void SelectionPlugin::selectEdges( int objectId , idList _edgeList ) {
if ( _edgeList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectEdges(PluginFunctions::triMesh(object), _edgeList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectEdges(PluginFunctions::polyMesh(object), _edgeList);
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::selectEdges( PluginFunctions::polyLine(object) , _edgeList );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
#ifdef ENABLE_BSPLINECURVE_SUPPORT
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::selectEdges( PluginFunctions::splineCurve(object) , _edgeList );
break;
#endif
default:
else{
emit log(LOGERR,"selectEdges : Unsupported object Type" );
return;
}
......@@ -111,24 +106,19 @@ void SelectionPlugin::unselectEdges( int objectId , idList _edgeList ) {
if ( _edgeList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::unselectEdges(PluginFunctions::triMesh(object), _edgeList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::unselectEdges(PluginFunctions::polyMesh(object), _edgeList);
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::unselectEdges( PluginFunctions::polyLine(object) , _edgeList );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::unselectEdges( PluginFunctions::splineCurve(object) , _edgeList );
break;
#endif
default:
else{
emit log(LOGERR,"unselectEdges : Unsupported object Type" );
return;
}
......@@ -155,24 +145,19 @@ void SelectionPlugin::selectAllEdges( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectAllEdges(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectAllEdges(PluginFunctions::polyMesh(object));
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::selectAllEdges( PluginFunctions::polyLine(object) );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::selectAllEdges( PluginFunctions::splineCurve(object) );
break;
#endif
default:
else{
emit log(LOGERR,"selectAllEdges : Unsupported object Type" );
return;
}
......@@ -191,24 +176,19 @@ void SelectionPlugin::clearEdgeSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::clearEdgeSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::clearEdgeSelection(PluginFunctions::polyMesh(object));
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::clearEdgeSelection( PluginFunctions::polyLine(object) );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::clearEdgeSelection( PluginFunctions::splineCurve(object) );
break;
#endif
default:
else{
emit log(LOGERR,"clearEdgeSelection : Unsupported object Type" );
return;
}
......@@ -227,24 +207,19 @@ void SelectionPlugin::invertEdgeSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::invertEdgeSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::invertEdgeSelection(PluginFunctions::polyMesh(object));
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::invertEdgeSelection( PluginFunctions::polyLine(object) );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::invertEdgeSelection( PluginFunctions::splineCurve(object) );
break;
#endif
default:
else{
emit log(LOGERR,"invertEdgeSelection : Unsupported object Type" );
return;
}
......@@ -263,25 +238,20 @@ void SelectionPlugin::selectBoundaryEdges( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectBoundaryEdges(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectBoundaryEdges(PluginFunctions::polyMesh(object));
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
emit log(LOGERR,"selectBoundaryEdges : Not implemented on PolyLines" );
// PolyLineSelection::selectAllEdges( PluginFunctions::polyLine(object) );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
emit log(LOGERR,"selectBoundaryEdges : Not implemented on BSplineCurves" );
break;
#endif
default:
else{
emit log(LOGERR,"selectBoundaryEdges : Unsupported object Type" );
return;
}
......@@ -302,24 +272,19 @@ idList SelectionPlugin::getEdgeSelection( int objectId )
emit scriptInfo( "getEdgeSelection( ObjectId )" );
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
return MeshSelection::getEdgeSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
return MeshSelection::getEdgeSelection(PluginFunctions::polyMesh(object));
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
return PolyLineSelection::getEdgeSelection( PluginFunctions::polyLine(object) );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
return BSplineCurveSelection::getEdgeSelection( PluginFunctions::splineCurve(object) );
break;
#endif
default:
else{
emit log(LOGERR,"getEdgeSelection : Unsupported object Type" );
return idList(0);
}
......
......@@ -54,14 +54,11 @@ void SelectionPlugin::selectFaces( int objectId , idList _faceList ) {
if ( _faceList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectFaces(PluginFunctions::triMesh(object), _faceList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectFaces(PluginFunctions::polyMesh(object), _faceList);
break;
default:
else{
emit log(LOGERR,"selectFaces : Unsupported object Type" );
return;
}
......@@ -90,14 +87,11 @@ void SelectionPlugin::unselectFaces( int objectId , idList _faceList ) {
if ( _faceList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::unselectFaces(PluginFunctions::triMesh(object), _faceList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::unselectFaces(PluginFunctions::polyMesh(object), _faceList);
break;
default:
else{
emit log(LOGERR,"unselectFaces : Unsupported object Type" );
return;
}
......@@ -124,14 +118,11 @@ void SelectionPlugin::selectAllFaces( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectAllFaces(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectAllFaces(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"selectAllFaces : Unsupported object Type" );
return;
}
......@@ -150,14 +141,11 @@ void SelectionPlugin::clearFaceSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::clearFaceSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::clearFaceSelection(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"clearFaceSelection : Unsupported object Type" );
return;
}
......@@ -176,14 +164,11 @@ void SelectionPlugin::invertFaceSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::invertFaceSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::invertFaceSelection(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"invertFaceSelection : Unsupported object Type" );
return;
}
......@@ -202,14 +187,11 @@ void SelectionPlugin::selectBoundaryFaces( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectBoundaryFaces(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectBoundaryFaces(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"selectBoundaryFaces : Unsupported object Type" );
return;
}
......@@ -229,14 +211,11 @@ void SelectionPlugin::shrinkFaceSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::shrinkFaceSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::shrinkFaceSelection(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"shrinkFaceSelection : Unsupported object Type" );
return;
}
......@@ -255,14 +234,11 @@ void SelectionPlugin::growFaceSelection( int objectId )
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::growFaceSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::growFaceSelection(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"growFaceSelection : Unsupported object Type" );
return;
}
......@@ -283,14 +259,11 @@ idList SelectionPlugin::getFaceSelection( int objectId )
emit scriptInfo( "getFaceSelection( ObjectId )" );
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
return MeshSelection::getFaceSelection(PluginFunctions::triMesh(object));
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
return MeshSelection::getFaceSelection(PluginFunctions::polyMesh(object));
break;
default:
else{
emit log(LOGERR,"getFaceSelection : Unsupported object Type" );
return idList(0);
}
......
......@@ -54,16 +54,13 @@ void SelectionPlugin::selectHandleVertices( int objectId , idList _vertexList )
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH ){
MeshSelection::setArea(PluginFunctions::triMesh(object) , _vertexList , HANDLEAREA, true);
update_regions( PluginFunctions::triMesh(object) );
break;
case DATA_POLY_MESH :
} else if ( object->dataType() == DATA_POLY_MESH ){
MeshSelection::setArea(PluginFunctions::polyMesh(object) , _vertexList , HANDLEAREA, true);
update_regions( PluginFunctions::polyMesh(object) );
break;
default:
} else {
emit log(LOGERR,"selectHandleVertices : Unsupported object Type" );
return;
}
......@@ -92,14 +89,11 @@ void SelectionPlugin::unselectHandleVertices( int objectId , idList _vertexList
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , _vertexList , HANDLEAREA, false);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , _vertexList , HANDLEAREA, false);
break;
default:
else {
emit log(LOGERR,"unselectHandleVertices : Unsupported object Type" );
return;
}
......@@ -125,14 +119,11 @@ void SelectionPlugin::clearHandleVertices( int objectId ) {
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , HANDLEAREA, false);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , HANDLEAREA, false);
break;
default:
else {
emit log(LOGERR,"clearHandleVertices : Unsupported object Type" );
return;
}
......@@ -150,14 +141,11 @@ void SelectionPlugin::setAllHandleVertices( int objectId ) {
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , HANDLEAREA, true);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , HANDLEAREA, true);
break;
default:
else {
emit log(LOGERR,"setAllHandleVertices : Unsupported object Type" );
return;
}
......@@ -177,14 +165,11 @@ idList SelectionPlugin::getHandleVertices( int objectId ) {
emit scriptInfo( "getHandleVertices( ObjectId )" );
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
return MeshSelection::getArea(PluginFunctions::triMesh(object) , HANDLEAREA);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
return MeshSelection::getArea(PluginFunctions::polyMesh(object) , HANDLEAREA);
break;
default:
else {
emit log(LOGERR,"getHandleVertices : Unsupported object Type" );
return idList(0);;
}
......
......@@ -54,16 +54,13 @@ void SelectionPlugin::selectModelingVertices( int objectId , idList _vertexList
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH ){
MeshSelection::setArea(PluginFunctions::triMesh(object) , _vertexList , AREA, true);
update_regions( PluginFunctions::triMesh(object) );
break;
case DATA_POLY_MESH :
} else if ( object->dataType() == DATA_POLY_MESH ){
MeshSelection::setArea(PluginFunctions::polyMesh(object) , _vertexList , AREA, true);
update_regions( PluginFunctions::polyMesh(object) );
break;
default:
} else {
emit log(LOGERR,"selectModelingVertices : Unsupported object Type" );
return;
}
......@@ -92,14 +89,11 @@ void SelectionPlugin::unselectModelingVertices( int objectId , idList _vertexLis
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , _vertexList , AREA, false);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , _vertexList , AREA, false);
break;
default:
else{
emit log(LOGERR,"unselectModelingVertices : Unsupported object Type" );
return;
}
......@@ -125,14 +119,11 @@ void SelectionPlugin::clearModelingVertices( int objectId ) {
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , AREA, false);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , AREA, false);
break;
default:
else{
emit log(LOGERR,"clearModelingVertices : Unsupported object Type" );
return;
}
......@@ -150,14 +141,11 @@ void SelectionPlugin::setAllModelingVertices( int objectId ) {
return;
}
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::setArea(PluginFunctions::triMesh(object) , AREA, true);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::setArea(PluginFunctions::polyMesh(object) , AREA, true);
break;
default:
else{
emit log(LOGERR,"setAllModelingVertices : Unsupported object Type" );
return;
}
......@@ -176,14 +164,11 @@ idList SelectionPlugin::getModelingVertices( int objectId ) {
emit scriptInfo( "getModelingVertices( ObjectId )" );
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
return MeshSelection::getArea(PluginFunctions::triMesh(object) , AREA);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
return MeshSelection::getArea(PluginFunctions::polyMesh(object) , AREA);
break;
default:
else{
emit log(LOGERR,"getModelingVertices : Unsupported object Type" );
return idList(0);
}
......
......@@ -62,24 +62,19 @@ void SelectionPlugin::selectVertices( int objectId , idList _vertexList ) {
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::selectVertices(PluginFunctions::triMesh(object), _vertexList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::selectVertices(PluginFunctions::polyMesh(object), _vertexList);
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::selectVertices( PluginFunctions::polyLine(object) , _vertexList );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :
else if ( object->dataType() == DATA_BSPLINE_CURVE )
BSplineCurveSelection::selectVertices( PluginFunctions::splineCurve(object) , _vertexList );
break;
#endif
default:
else {
emit log(LOGERR,"selectAllVertices : Unsupported object Type" );
return;
}
......@@ -108,24 +103,19 @@ void SelectionPlugin::unselectVertices( int objectId , idList _vertexList ) {
if ( _vertexList.size() == 0 )
return;
switch ( object->dataType( ) ) {
case DATA_TRIANGLE_MESH :
if ( object->dataType() == DATA_TRIANGLE_MESH )
MeshSelection::unselectVertices(PluginFunctions::triMesh(object), _vertexList);
break;
case DATA_POLY_MESH :
else if ( object->dataType() == DATA_POLY_MESH )
MeshSelection::unselectVertices(PluginFunctions::polyMesh(object), _vertexList);
break;
#ifdef ENABLE_POLYLINE_SUPPORT
case DATA_POLY_LINE :
else if ( object->dataType() == DATA_POLY_LINE )
PolyLineSelection::unselectVertices( PluginFunctions::polyLine(object) , _vertexList );
break;
#endif
#ifdef ENABLE_BSPLINECURVE_SUPPORT
case DATA_BSPLINE_CURVE :