Newer
Older
// $Id: CutPlane.cpp,v 1.18 2001-08-11 23:25:50 geuzaine Exp $
StringXNumber CutPlaneOptions_Number[] = {
{ GMSH_FULLRC, "B" , NULL , 0. },
{ GMSH_FULLRC, "C" , NULL , 0. },
{ GMSH_FULLRC, "D" , NULL , 0.01 },
};
extern "C"
{
GMSH_Plugin *GMSH_RegisterCutPlanePlugin ()
{
GMSH_CutPlanePlugin::GMSH_CutPlanePlugin()
{
}
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)");
"Cuts a 3D scalar view with the plane\n"
"A*X + B*Y + C*Z + D = 0.\n"
"Script name: Plugin(CutPlane).");
}
int GMSH_CutPlanePlugin::getNbOptions() const
{
return sizeof(CutPlaneOptions_Number)/sizeof(StringXNumber);
StringXNumber* GMSH_CutPlanePlugin:: GetOption (int iopt)
}
void GMSH_CutPlanePlugin::CatchErrorMessage (char *errorMessage) const
{
strcpy(errorMessage,"CutPlane failed...");
double GMSH_CutPlanePlugin :: levelset (double x, double y, double z, double val) const
return CutPlaneOptions_Number[0].def * x +
CutPlaneOptions_Number[1].def * y +
CutPlaneOptions_Number[2].def * z +
CutPlaneOptions_Number[3].def ;
Post_View *GMSH_CutPlanePlugin::execute (Post_View *v)
{
int iView = (int)CutPlaneOptions_Number[4].def;
_orientation = ORIENT_PLANE;
_ref[0] = CutPlaneOptions_Number[0].def;
_ref[1] = CutPlaneOptions_Number[1].def;
_ref[2] = CutPlaneOptions_Number[2].def;
else{
if(!v && iView < 0) iView = 0;
if(!(vv = (Post_View*)List_Pointer_Test(Post_ViewList,iView))){