diff --git a/Plugin/Cutplane/CutPlane.cpp b/Plugin/Cutplane/CutPlane.cpp deleted file mode 100644 index a5a7b4d39c6e9f9728f5bdafab58975bd5a1e3ce..0000000000000000000000000000000000000000 --- a/Plugin/Cutplane/CutPlane.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include "CutPlane.h" -#include "List.h" -#include "Views.h" -#include "Iso.h" -/* - Plugin Entry : GMSH_RegisterPlugin - */ - -double opt_cut_plane_A(OPT_ARGS_NUM) -{ -} - -StringXNumber CutPlaneOptions_Number[] = { - { GMSH_FULLRC, "A" , opt_cut_plane_A , 1. } -}; - -extern "C" -{ - GMSH_Plugin *GMSH_RegisterCutPlanePlugin () - { - return new GMSH_CutPlanePlugin (1.0,0.0,0.0,0.0); - } -} - - -GMSH_CutPlanePlugin::GMSH_CutPlanePlugin(double A, double B, double C, double D) - :a(A),b(B),c(C),d(D) -{ -} - -void GMSH_CutPlanePlugin::getName(char *name) const -{ - strcpy(name,"Cut Plane"); -} - -void GMSH_CutPlanePlugin::getInfos(char *author, char *copyright, char *help_text) const -{ - strcpy(author,"J.-F. Remacle (remacle@scorec.rpi.edu)"); - strcpy(copyright,"DGR (www.multiphysics.com)"); - strcpy(help_text,"This Plugins cuts a view with a plane a x + b y + c z + d = 0"); -} - -int GMSH_CutPlanePlugin::getNbOptions() const -{ - return 4; -} - -void GMSH_CutPlanePlugin:: GetOption (int iopt, StringXNumber *option) const -{ - *option = CutPlaneOptions_Number[iopt]; -} - -void GMSH_CutPlanePlugin::CatchErrorMessage (char *errorMessage) const -{ - strcpy(errorMessage,"CutPlane Failed..."); -} - -Post_View *GMSH_CutPlanePlugin::execute (Post_View *v) -{ - - int i,nb,edtet[6][2] = {{0,1},{0,2},{0,3},{1,2},{1,3},{2,3}}; - // for all scalar simplices - if(v->NbSS) - { - nb = List_Nbr(v->ST) / v->NbST ; - for(i = 0 ; i < List_Nbr(v->ST) ; i+=nb) - { - double levels[4],Xp[4],Yp[4],Zp[4]; - double *X = (double*)List_Pointer_Fast(v->SS,i); - double *Y = (double*)List_Pointer_Fast(v->SS,i+4); - double *Z = (double*)List_Pointer_Fast(v->SS,i+8); - for(int j=0;j<4;j++)levels[j] = levelset(X[j],Y[j],Z[j]); - double *VAL = (double*)List_Pointer_Fast(v->SS,i+12); - int nx = 0; - for(int k=0;k<6;k++) - { - if(levels[edtet[k][0]] * levels[edtet[k][1]] <= 0.0) - { - InterpolateIso(X,Y,Z,levels,0.0, - edtet[k][0],edtet[k][1], - &Xp[nx],&Yp[nx],&Zp[nx]); - nx++; - } - } - if(nx == 3) - { - } - } - } - - return 0; -} - -double GMSH_CutPlanePlugin :: levelset (double x, double y, double z) -{ - return a * x + b * y + c * z + d; -} - - - - - - - diff --git a/Plugin/Cutplane/CutPlane.h b/Plugin/Cutplane/CutPlane.h deleted file mode 100644 index 6c840281a570225f7488bab314d33eb056ca7889..0000000000000000000000000000000000000000 --- a/Plugin/Cutplane/CutPlane.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _CUTPLANE_H_ -#define _CUTPLANE_H -#include "../Plugin.h" -extern "C" -{ - GMSH_Plugin *GMSH_RegisterCutPlanePlugin (); -} - -class GMSH_CutPlanePlugin : public GMSH_Post_Plugin -{ - /*Plane a x + b y + c z + d = 0*/ - double a,b,c,d; - virtual double levelset (double x, double y, double z); -public: - GMSH_CutPlanePlugin(double A, double B, double C, double D); - virtual void getName (char *name) const; - virtual void getInfos (char *author, - char *copyright, - char *help_text) const; - virtual void CatchErrorMessage (char *errorMessage) const; - virtual int getNbOptions() const; - virtual void GetOption (int iopt, StringXNumber *option) const; - virtual Post_View *execute (Post_View *); -}; -#endif diff --git a/Plugin/Cutplane/Makefile b/Plugin/Cutplane/Makefile deleted file mode 100644 index e20568d8a605359ecff10cb539a85fc8fbc684bc..0000000000000000000000000000000000000000 --- a/Plugin/Cutplane/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# $Id: Makefile,v 1.5 2001-03-10 19:55:07 remacle Exp $ -# -# Makefile for "libAdapt.a" -# - -.IGNORE: - -CC = c++ -AR = ar ruvs -RM = rm -RANLIB = ranlib - -LIB = ../../lib/libCutPlane.a -INCLUDE = -I../../Common -I../../DataStr -I../ -I../../Graphics - -C_FLAGS = -g -Wall -OS_FLAGS = -VERSION_FLAGS = - -RMFLAGS = -f -CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE) - -SRC = CutPlane.cpp - -OBJ = $(SRC:.cpp=.o) - -.SUFFIXES: .o .cpp - -$(LIB): $(OBJ) - $(AR) $(LIB) $(OBJ) - -.cpp.o: - $(CC) $(CFLAGS) -c $< - -clean: - $(RM) $(RMFLAGS) *.o - -lint: - $(LINT) $(CFLAGS) $(SRC) - -depend: - (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \ - $(CC) -MM $(CFLAGS) ${SRC} \ - ) >Makefile.new - cp Makefile Makefile.bak - cp Makefile.new Makefile - $(RM) $(RMFLAGS) Makefile.new - -# DO NOT DELETE THIS LINE -CutPlane.o: CutPlane.cpp CutPlane.h ../Plugin.h diff --git a/Plugin/Makefile b/Plugin/Makefile index b84e722e51fabdc071dd9d8e80bb11159ce18eb7..c51c18aa27410758d2f99260c75ff2795c33e6b9 100644 --- a/Plugin/Makefile +++ b/Plugin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 2001-03-10 19:55:07 remacle Exp $ +# $Id: Makefile,v 1.5 2001-03-10 20:27:02 remacle Exp $ # # Makefile for "libAdapt.a" # @@ -20,7 +20,7 @@ VERSION_FLAGS = RMFLAGS = -f CFLAGS = $(C_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE) $(GUI_INCLUDE) -SRC = Plugin.cpp CutPlane.cpp +SRC = Plugin.cpp CutPlane.cpp CutSphere.cpp LevelsetPlugin.cpp OBJ = $(SRC:.cpp=.o) diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp index e940efa50e0ed54bdc5ec4333b284904ecf53320..e594d36d94d4d2b032dfe4b9a9952395da95a5c6 100644 --- a/Plugin/Plugin.cpp +++ b/Plugin/Plugin.cpp @@ -5,7 +5,8 @@ #include "PluginManager.h" #include "Message.h" #include <FL/filename.H> -#include "CutPlane/CutPlane.h" +#include "CutPlane.h" +#include "CutSphere.h" using namespace std; @@ -46,6 +47,7 @@ void GMSH_PluginManager::RegisterDefaultPlugins() char ext[6]; allPlugins.insert(std::pair<char*,GMSH_Plugin*>("Cut Plane" ,GMSH_RegisterCutPlanePlugin())); + allPlugins.insert(std::pair<char*,GMSH_Plugin*>("Cut Sphere" ,GMSH_RegisterCutSpherePlugin())); char *homeplugins = getenv ("GMSHPLUGINSHOME");