/* ----------------------------------------------------------------------------- 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 ----------------------------------------------------------------------------- */ struct PlugPointSize = [ PPS_instance : PInstance, PPS_fSize : F ]mkPlugPointSize;; fun deleteOb(inst, obstr)= SO3SceneSetMaterialsPointSize (V3DgetSession c3dXsession) 1.5; 0;; fun cbSetSize(inst, from, action, param, reply, obstr)= let (atof param) -> value in if (value == nil) then nil else ( SO3SceneSetMaterialsPointSize (V3DgetSession c3dXsession) value; set obstr.PPS_fSize = value; SendPluginEvent inst "Modified" param nil; ); 0;; fun cbLoaded(inst, obstr)= SO3SceneSetMaterialsPointSize (V3DgetSession c3dXsession) obstr.PPS_fSize; 0;; fun newOb(inst)= let atof (getPluginInstanceParam inst "pointsize") -> pointsize in let if pointsize == nil then 1.5 else pointsize -> pointsize in let mkPlugPointSize [inst pointsize] -> obstr in ( if inst.INST_groupstr.GRP_project.PRJ_bPluginsLoaded then ( SO3SceneSetMaterialsPointSize (V3DgetSession c3dXsession) pointsize; 0; ) else ( setPluginInstanceCbAllPluginsLoaded inst mkfun2 @cbLoaded obstr; 0; ); PluginRegisterAction inst "Set size" mkfun6 @cbSetSize obstr; setPluginInstanceCbDel inst mkfun2 @deleteOb obstr; ); 0;; fun IniPlug(file)= PlugRegister @newOb nil; setPluginEditor @dynamicedit; 0;;