From 997bff11facb00a86ffd7a126a3d9dac66e1d08e Mon Sep 17 00:00:00 2001 From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be> Date: Mon, 30 Jul 2001 13:04:34 +0000 Subject: [PATCH] *** empty log message *** --- Plugin/CutMap.cpp | 6 +++--- Plugin/CutPlane.cpp | 25 ++++++++++++++++++++++++- Plugin/CutPlane.h | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Plugin/CutMap.cpp b/Plugin/CutMap.cpp index c56dfa1627..4929c8f9cc 100644 --- a/Plugin/CutMap.cpp +++ b/Plugin/CutMap.cpp @@ -1,5 +1,5 @@ #include "CutMap.h" -#include "List.h" + #include "List.h" double opt_cut_map_A(OPT_ARGS_NUM) { return 0; @@ -38,7 +38,7 @@ void GMSH_CutMapPlugin::getInfos(char *author, char *copyright, char *help_text) int GMSH_CutMapPlugin::getNbOptions() const { - return 2; + return 5; } StringXNumber *GMSH_CutMapPlugin:: GetOption (int iopt) @@ -59,7 +59,7 @@ double GMSH_CutMapPlugin :: levelset (double x, double y, double z, double val) return A - val; } -extern List_T *Post_ViewList; + extern List_T *Post_ViewList; Post_View *GMSH_CutMapPlugin::execute (Post_View *v) { diff --git a/Plugin/CutPlane.cpp b/Plugin/CutPlane.cpp index 34c49bcba0..86ed156672 100644 --- a/Plugin/CutPlane.cpp +++ b/Plugin/CutPlane.cpp @@ -1,4 +1,5 @@ #include "CutPlane.h" + #include "List.h" /* Plugin Entry : GMSH_RegisterPlugin @@ -15,7 +16,8 @@ StringXNumber CutPlaneOptions_Number[] = { { GMSH_FULLRC, "A" , opt_cut_plane_A , 1. }, { GMSH_FULLRC, "B" , opt_cut_plane_A , 1. }, { GMSH_FULLRC, "C" , opt_cut_plane_A , 1. }, - { GMSH_FULLRC, "D" , opt_cut_plane_A , 1. } + { GMSH_FULLRC, "D" , opt_cut_plane_A , 1. }, + { GMSH_FULLRC, "iView" , opt_cut_plane_A , 1. } }; extern "C" @@ -64,6 +66,27 @@ double GMSH_CutPlanePlugin :: levelset (double x, double y, double z, double val return a * x + b * y + c * z + d; } +extern List_T *Post_ViewList; +Post_View *GMSH_CutPlanePlugin::execute (Post_View *v) +{ + + a = CutPlaneOptions_Number[0].def; + b = CutPlaneOptions_Number[1].def; + c = CutPlaneOptions_Number[2].def; + d = CutPlaneOptions_Number[3].def; + int iView = (int)CutPlaneOptions_Number[4].def; + + if(v)return GMSH_LevelsetPlugin::execute(v); + else + { + if(List_Nbr(Post_ViewList) < iView) + { + Msg(WARNING,"Plugin CutPlane, view %d not loaded\n",iView); + return 0; + } + return GMSH_LevelsetPlugin::execute((Post_View*)List_Pointer_Test(Post_ViewList,iView)); + } +} diff --git a/Plugin/CutPlane.h b/Plugin/CutPlane.h index 814afb2161..4a5d90910e 100644 --- a/Plugin/CutPlane.h +++ b/Plugin/CutPlane.h @@ -21,5 +21,6 @@ public: virtual void CatchErrorMessage (char *errorMessage) const; virtual int getNbOptions() const; virtual StringXNumber *GetOption (int iopt); + virtual Post_View *execute (Post_View *); }; #endif -- GitLab