// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== global proc int iges_import_options ( string $parent, string $action, string $initialSettings, string $resultCallback ) // // Description: // This script posts the iges file translator options. // The optionsString is of the form: // varName1=value1;varName2=value2;... // // Parameters: // $parent - the elf parent layout for this options layout. It is // always a scrollLayout. // $action - the action to be performed when this method is invoked. // Valid options are: // "query" - construct the options string and // pass it to the resultCallback. // "post" - post all the elf controls. // $initialSettings - the current options string in effect at the // time this script is invoked. // $resultCallback - // This is the proc to be called with the result string. // resultCallback ( string $optionsString ) // // Returns: // 1 if successfull. // 0 otherwise. { int $bResult; string $currentOptions; if ($action == "post") { setParent $parent; formLayout -e -vis false optionsBoxForm; columnLayout -adj true -cal left; frameLayout -cll true -cl false -label (uiRes("m_iges_import_options.kIGESOptions")); columnLayout -adj true; rowLayout -numberOfColumns 3 -columnWidth3 50 150 90; text -label ""; text -label (uiRes("m_iges_import_options.kDefaultTrimCurves")); optionMenuGrp igesDefaultTrimCurvesCollection; menuItem -label (uiRes("m_iges_import_options.kParameterSpace")); menuItem -label (uiRes("m_iges_import_options.kIGESTrimFlag")); menuItem -label (uiRes("m_iges_import_options.kWorldSpace")); setParent ..; rowLayout -numberOfColumns 3 -columnWidth3 50 150 90; text -label ""; text -label (uiRes("m_iges_import_options.kScaleFactor")); floatSliderGrp -min 0.000001 -max 10.0 -fmn 0.000001 -fmx 10.0 -f true -pre 6 -s 1.0 -value 1.0 igesImportScaleFactor; setParent ..; rowLayout -numberOfColumns 3 -columnWidth3 50 150 90; text -label ""; text -label (uiRes("m_iges_import_options.kLevelMapping")); checkBox -v true -label "" igesLevelMappingOn; setParent ..; setParent ..; setParent ..; columnLayout; text -label ""; button -label (uiRes("m_iges_import_options.kDefaults")) -c restoreIgesImportDefaultOptions -w 115 -h 19; setParent ..; setParent ..; formLayout -e -vis true optionsBoxForm; $bResult = 1; } else if ($action == "query") { $currentOptions = $currentOptions + ";defaultTrimCurves=" + `optionMenuGrp -q -sl igesDefaultTrimCurvesCollection`; $currentOptions = $currentOptions + ";scaleFactor=" + `floatSliderGrp -q -v igesImportScaleFactor`; if (`checkBox -q -v igesLevelMappingOn` == 1) $currentOptions = $currentOptions + ";levelMapping=1"; else $currentOptions = $currentOptions + ";levelMapping=0"; eval($resultCallback+" \""+$currentOptions+"\""); $result = 1; } else { $bResult = 0; } return $bResult; } global proc restoreIgesImportDefaultOptions () { optionMenuGrp -e -sl 1 igesDefaultTrimCurvesCollection; floatSliderGrp -e -v 1.0 igesImportScaleFactor; checkBox -e -v true igesLevelMappingOn; }