Skip to content
Snippets Groups Projects
Commit ab8fb29a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Better handling of iView option

parent 758bd8e6
No related branches found
No related tags found
No related merge requests found
// $Id: CutMap.cpp,v 1.16 2001-08-06 10:35:47 geuzaine Exp $
// $Id: CutMap.cpp,v 1.17 2001-08-06 10:52:52 geuzaine Exp $
#include "CutMap.h"
#include "List.h"
......@@ -70,17 +70,14 @@ Post_View *GMSH_CutMapPlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutMap: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutMap: View[%d] does not exist",iView);
return 0;
}
}
return GMSH_LevelsetPlugin::execute(vv);
}
void GMSH_CutMapPlugin::Run ()
{
int iView = (int)CutMapOptions_Number[1].def;
if(iView < 0) CutMapOptions_Number[1].def = 0;
execute (0);
}
......@@ -22,6 +22,5 @@ public:
virtual int getNbOptions() const;
virtual StringXNumber* GetOption (int iopt);
virtual Post_View *execute (Post_View *);
virtual void Run();
};
#endif
// $Id: CutPlane.cpp,v 1.14 2001-08-06 10:35:47 geuzaine Exp $
// $Id: CutPlane.cpp,v 1.15 2001-08-06 10:52:52 geuzaine Exp $
#include "CutPlane.h"
#include "List.h"
......@@ -76,20 +76,14 @@ Post_View *GMSH_CutPlanePlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutPlane: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutPlane: View[%d] does not exist",iView);
return 0;
}
}
return GMSH_LevelsetPlugin::execute(vv);
}
void GMSH_CutPlanePlugin::Run ()
{
int iView = (int)CutPlaneOptions_Number[4].def;
if(iView < 0) CutPlaneOptions_Number[4].def = 0;
execute (0);
}
......@@ -23,7 +23,6 @@ public:
virtual int getNbOptions() const;
virtual StringXNumber *GetOption (int iopt);
virtual Post_View *execute (Post_View *);
virtual void Run();
};
#endif
// $Id: CutSphere.cpp,v 1.13 2001-08-06 10:35:47 geuzaine Exp $
// $Id: CutSphere.cpp,v 1.14 2001-08-06 10:52:52 geuzaine Exp $
#include <string.h>
#include "CutSphere.h"
......@@ -77,17 +77,14 @@ Post_View *GMSH_CutSpherePlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutSphere: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin CutSphere: View[%d] does not exist",iView);
return 0;
}
}
return GMSH_LevelsetPlugin::execute(vv);
}
void GMSH_CutSpherePlugin::Run ()
{
int iView = (int)CutSphereOptions_Number[4].def;
if(iView < 0) CutSphereOptions_Number[4].def = 0;
execute (0);
}
......@@ -23,7 +23,6 @@ public:
virtual int getNbOptions() const;
virtual StringXNumber* GetOption (int iopt);
virtual Post_View *execute (Post_View *);
virtual void Run();
};
#endif
// $Id: Skin.cpp,v 1.3 2001-08-06 10:35:47 geuzaine Exp $
// $Id: Skin.cpp,v 1.4 2001-08-06 10:52:52 geuzaine Exp $
#include "Plugin.h"
#include "Skin.h"
......@@ -117,9 +117,12 @@ Post_View *GMSH_SkinPlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Skin: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Skin: View[%d] does not exist",iView);
return 0;
}
}
if(vv->NbSS){
......@@ -156,8 +159,6 @@ Post_View *GMSH_SkinPlugin::execute (Post_View *v)
void GMSH_SkinPlugin::Run ()
{
int iView = (int)SkinOptions_Number[0].def;
if(iView < 0) SkinOptions_Number[0].def = 0;
execute(0);
}
......
// $Id: Smooth.cpp,v 1.3 2001-08-06 10:35:47 geuzaine Exp $
// $Id: Smooth.cpp,v 1.4 2001-08-06 10:52:52 geuzaine Exp $
#include "Plugin.h"
#include "Smooth.h"
......@@ -61,9 +61,12 @@ Post_View *GMSH_SmoothPlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Smooth: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Smooth: View[%d] does not exist",iView);
return 0;
}
}
vv->smooth();
......@@ -72,8 +75,6 @@ Post_View *GMSH_SmoothPlugin::execute (Post_View *v)
void GMSH_SmoothPlugin::Run ()
{
int iView = (int)SmoothOptions_Number[0].def;
if(iView < 0) SmoothOptions_Number[0].def = 0;
execute(0);
}
......
// $Id: Transform.cpp,v 1.3 2001-08-06 10:35:47 geuzaine Exp $
// $Id: Transform.cpp,v 1.4 2001-08-06 10:52:52 geuzaine Exp $
#include "Plugin.h"
#include "Transform.h"
......@@ -95,9 +95,12 @@ Post_View *GMSH_TransformPlugin::execute (Post_View *v)
if(v && iView < 0)
vv = v;
else if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Transform: View[%d] does not exist",iView);
return 0;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){
Msg(WARNING,"Plugin Transform: View[%d] does not exist",iView);
return 0;
}
}
vv->transform(mat);
......@@ -106,8 +109,6 @@ Post_View *GMSH_TransformPlugin::execute (Post_View *v)
void GMSH_TransformPlugin::Run ()
{
int iView = (int)TransformOptions_Number[9].def;
if(iView < 0) TransformOptions_Number[9].def = 0;
execute(0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment