// =========================================================================== // 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 stlImportOptions ( string $parent, string $action, string $initialSettings, string $resultCallback ) // // Description: // This script posts the Stereolithagraphy file importer 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; string $optionList[]; string $optionBreakDown[]; int $index; if ($action == "post") { setParent $parent; rowColumnLayout -nc 2 -cw 1 200 -cw 2 500 mergeRow; checkBox -label (uiRes("m_stlImportOptions.kMergeVerticesWithTolerance")) -onc "floatSliderGrp -e -en true vertexTolerance" -ofc "floatSliderGrp -e -en false vertexTolerance" mergeVertices ; floatSliderGrp -en false -precision 6 -field true -min 0 -max 1 -fmn 0 -fmx 0 vertexTolerance ; floatSliderGrp -e -v 0.005 vertexTolerance; setParent..; //columnLayout -adj true; // floatSliderGrp -label _L10N(kMergeVertexTolerance,"Merge vertex tolerance:") -precision 6 -field true -min 0 -max 1 -fmn 0 -fmx 0 -value 0.005 vertexTolerance; //setParent ..; $result = 1; } else if ($action == "query") { $currentOptions = $currentOptions + ";mergeVertices=" + (`checkBox -q -v mergeVertices`) ; $currentOptions = $currentOptions + ";vertexTolerance=" + (`floatSliderGrp -q -v vertexTolerance`) ; eval($resultCallback+" \""+$currentOptions+"\""); $result = 1; } else { $bResult = 0; } return $bResult; }