Revision: 34539 http://brlcad.svn.sourceforge.net/brlcad/?rev=34539&view=rev Author: bob1961 Date: 2009-05-15 18:01:35 +0000 (Fri, 15 May 2009)
Log Message: ----------- Add editing for RHC, RPC and Superell to libged and Archer. Added Paths: ----------- brlcad/trunk/src/libged/scale_rhc.c brlcad/trunk/src/libged/scale_rpc.c brlcad/trunk/src/libged/scale_superell.c Added: brlcad/trunk/src/libged/scale_rhc.c =================================================================== --- brlcad/trunk/src/libged/scale_rhc.c (rev 0) +++ brlcad/trunk/src/libged/scale_rhc.c 2009-05-15 18:01:35 UTC (rev 34539) @@ -0,0 +1,77 @@ +/* S C A L E _ R H C . C + * BRL-CAD + * + * Copyright (c) 2008-2009 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file scale_rhc.c + * + * The scale_rhc command. + */ + +#include "common.h" + +#include <string.h> +#include "bio.h" + +#include "cmd.h" +#include "rtgeom.h" +#include "raytrace.h" + +#include "./ged_private.h" + +int +ged_scale_rhc(struct ged *gedp, struct rt_rhc_internal *rhc, const char *attribute, fastf_t sf) +{ + fastf_t ma, mb; + + RT_RHC_CK_MAGIC(rhc); + + switch (attribute[0]) { + case 'b': + case 'B': + VSCALE(rhc->rhc_B, rhc->rhc_B, sf); + break; + case 'h': + case 'H': + VSCALE(rhc->rhc_H, rhc->rhc_H, sf); + break; + case 'c': + case 'C': + rhc->rhc_c *= sf; + break; + case 'r': + case 'R': + rhc->rhc_r *= sf; + break; + default: + bu_vls_printf(&gedp->ged_result_str, "bad rhc attribute - %s", attribute); + return BRLCAD_ERROR; + } + + return BRLCAD_OK; +} + + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/libged/scale_rhc.c ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: brlcad/trunk/src/libged/scale_rpc.c =================================================================== --- brlcad/trunk/src/libged/scale_rpc.c (rev 0) +++ brlcad/trunk/src/libged/scale_rpc.c 2009-05-15 18:01:35 UTC (rev 34539) @@ -0,0 +1,73 @@ +/* S C A L E _ R P C . C + * BRL-CAD + * + * Copyright (c) 2008-2009 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file scale_rpc.c + * + * The scale_rpc command. + */ + +#include "common.h" + +#include <string.h> +#include "bio.h" + +#include "cmd.h" +#include "rtgeom.h" +#include "raytrace.h" + +#include "./ged_private.h" + +int +ged_scale_rpc(struct ged *gedp, struct rt_rpc_internal *rpc, const char *attribute, fastf_t sf) +{ + fastf_t ma, mb; + + RT_RPC_CK_MAGIC(rpc); + + switch (attribute[0]) { + case 'b': + case 'B': + VSCALE(rpc->rpc_B, rpc->rpc_B, sf); + break; + case 'h': + case 'H': + VSCALE(rpc->rpc_H, rpc->rpc_H, sf); + break; + case 'r': + case 'R': + rpc->rpc_r *= sf; + break; + default: + bu_vls_printf(&gedp->ged_result_str, "bad rpc attribute - %s", attribute); + return BRLCAD_ERROR; + } + + return BRLCAD_OK; +} + + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/libged/scale_rpc.c ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: brlcad/trunk/src/libged/scale_superell.c =================================================================== --- brlcad/trunk/src/libged/scale_superell.c (rev 0) +++ brlcad/trunk/src/libged/scale_superell.c 2009-05-15 18:01:35 UTC (rev 34539) @@ -0,0 +1,78 @@ +/* S C A L E _ S U P E R E L L . C + * BRL-CAD + * + * Copyright (c) 2008-2009 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file scale_superell.c + * + * The scale_superell command. + */ + +#include "common.h" + +#include <string.h> +#include "bio.h" + +#include "cmd.h" +#include "rtgeom.h" +#include "raytrace.h" + +#include "./ged_private.h" + +int +ged_scale_superell(struct ged *gedp, struct rt_superell_internal *superell, const char *attribute, fastf_t sf) +{ + fastf_t ma, mb; + + RT_SUPERELL_CK_MAGIC(superell); + + switch (attribute[0]) { + case 'a': + case 'A': + VSCALE(superell->a, superell->a, sf); + break; + case 'b': + case 'B': + VSCALE(superell->b, superell->b, sf); + break; + case 'c': + case 'C': + VSCALE(superell->c, superell->c, sf); + break; + case '3': + VSCALE(superell->a, superell->a, sf); + VSCALE(superell->b, superell->b, sf); + VSCALE(superell->c, superell->c, sf); + break; + default: + bu_vls_printf(&gedp->ged_result_str, "bad superell attribute - %s", attribute); + return BRLCAD_ERROR; + } + + return BRLCAD_OK; +} + + +/* + * Local Variables: + * tab-width: 8 + * mode: C + * indent-tabs-mode: t + * c-file-style: "stroustrup" + * End: + * ex: shiftwidth=4 tabstop=8 + */ Property changes on: brlcad/trunk/src/libged/scale_superell.c ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits