/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun deleteOb(inst, p)= let p -> [object init] in SO3ObjectShowBoundingBox object 0; 0;; fun cbHide(inst, from, action, param, rep, p)= let p -> [object init] in SO3ObjectShowBoundingBox object 0; mutate p <- [_ 0]; 0;; fun cbShow(inst, from, action, param, rep, p)= let p -> [object init] in SO3ObjectShowBoundingBox object 1; mutate p <- [_ 1]; 0;; fun cbSetObject(inst, from, action, param, rep, p)= let p -> [object init] in let V3DgetObjectByName c3dXsession param -> obj in ( SO3ObjectShowBoundingBox object 0; if (obj == nil) then nil else SO3ObjectShowBoundingBox obj init; mutate p <- [obj _]; ); 0;; fun newOb(inst)= let (getPluginInstanceParam inst "object") -> objname in let (atoi (getPluginInstanceParam inst "init")) -> init in let if (init == nil) then 0 else init -> init in let V3DgetObjectByName c3dXsession objname -> object in let [object init] -> p in ( if (init == 0) then nil else SO3ObjectShowBoundingBox object 1; PluginRegisterAction inst "Hide" mkfun6 @cbHide p; PluginRegisterAction inst "Show" mkfun6 @cbShow p; PluginRegisterAction inst "Set object" mkfun6 @cbSetObject p; setPluginInstanceCbDel inst mkfun2 @deleteOb p; ); 0;; fun IniPlug(file)= PlugRegister @newOb nil; setPluginEditor @dynamicedit; 0;;