// =========================================================================== // 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 atfChangeCommand () { // ---------------------------------------- // Tessellate objects // ---------------------------------------- int $tesselate = `radioButtonGrp -query -select atfTessellateObjectsGrp`; // ---------------------------------------- // Enable aruba tessellation // ---------------------------------------- formLayout -edit -visible ($tesselate == 2) atfCustomLayout; // ---------------------------------------- // Enable atf customization // ---------------------------------------- formLayout -edit -visible ($tesselate == 3) atfLegacyCustomLayout; // ---------------------------------------- // ATF Stitching Services // ---------------------------------------- int $stitching = `checkBoxGrp -query -value1 atfStitchingServicesGrp`; formLayout -edit -visible $stitching atfStitchingLayout; } global proc int atfFileOptions ( string $parent, string $action, string $initialSettings, string $resultCallback ) // // Description: // This script posts the ATF file accessor options. // // Parameters: // $parent - the elf parent layout for this options layout. It is // always a scrollLayout. // $action - the action that is to be performed with this invocation // of this proc. Valid options are: // "query" - construct the options string and pass it // to the resultCallback. // "post" - post all the elf controls. // $resultCallback - // This is the proc to be called with the result string. // resultCallback ( string $optionsString ) // // Returns: // 1 if successfull. // 0 otherwise. // { int $result; string $currentOptions; string $optionList[]; string $optionBreakDown[]; int $index; if ($action == "post") { setUITemplate -pushTemplate DefaultTemplate; setParent $parent; columnLayout -adjustableColumn true atfOptionsCol; // ---------------------------------------- // Tessellate objects // ---------------------------------------- string $label = getPluginResource("ATFPlugin", "kTessellateObjects"); string $annotation = getPluginResource("ATFPlugin", "kTessellateObjectsAnnot"); string $noneTessellation = getPluginResource("ATFPlugin", "kNoneTessellation"); string $arubaTessellation = getPluginResource("ATFPlugin", "kArubaTessellation"); string $atfTessellation = getPluginResource("ATFPlugin", "kATFTessellation"); radioButtonGrp -numberOfRadioButtons 3 -vertical -changeCommand "atfChangeCommand()" -label $label -label1 $noneTessellation -label2 $arubaTessellation -label3 $atfTessellation -annotation $annotation atfTessellateObjectsGrp; // ---------------------------------------- // Aruba customization // ---------------------------------------- formLayout -visible false atfCustomLayout; columnLayout -adjustableColumn true atfCustomOptionsCol; // ---------------------------------------- // Chordal Deviation // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kChordalDeviation"); $annotation = getPluginResource("ATFPlugin", "kChordalDeviationAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -value 0.0015 -minValue 0.001 -maxValue 5.0 -precision 4.0 -fieldMinValue 0.001 -fieldMaxValue 5.0 atfChordalDeviationGrp; // ---------------------------------------- // Min Chord Length // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kMinChordLength"); $annotation = getPluginResource("ATFPlugin", "kMinChordLengthAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -value 0.01 -minValue 0.01 -maxValue 10.0 -precision 2.0 -fieldMinValue 0.01 -fieldMaxValue 10.0 atfMinChordLengthGrp; // ---------------------------------------- // Max Chord Length // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kMaxChordLength"); $annotation = getPluginResource("ATFPlugin", "kMaxChordLengthAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -value 100.0 -minValue 1.0 -maxValue 100.0 -precision 2.0 -fieldMinValue 0.01 -fieldMaxValue 100.0 atfMaxChordLengthGrp; // ---------------------------------------- // Sample Type // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kSampleType"); optionMenuGrp -label $label atfSampleTypeGrp; $label = getPluginResource("ATFPlugin", "kSampleType_EntireDomain"); menuItem -label $label; $label = getPluginResource("ATFPlugin", "kSampleType_G1Segments"); menuItem -label $label; $label = getPluginResource("ATFPlugin", "kSampleType_PerSpan"); menuItem -label $label; $label = getPluginResource("ATFPlugin", "kSampleType_KnotValues"); menuItem -label $label; $label = getPluginResource("ATFPlugin", "kSampleType_Adaptively"); menuItem -label $label; optionMenuGrp -edit -select 3 atfSampleTypeGrp; // ---------------------------------------- // Adaptive // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kAdaptive"); $annotation = getPluginResource("ATFPlugin", "kAdaptiveAnnot"); checkBoxGrp -numberOfCheckBoxes 1 -value1 1 -label "" -label1 $label -annotation $annotation atfAdaptiveGrp; // ---------------------------------------- // Samples // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kSamples"); $annotation = getPluginResource("ATFPlugin", "kSamplesAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -value 8 -minValue 1 -maxValue 64 -precision 0.0 -fieldMinValue 1 -fieldMaxValue 64 atfSamplesGrp; // ---------------------------------------- // Normal Tolerance // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kNormalTolerance"); $annotation = getPluginResource("ATFPlugin", "kNormalToleranceAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -minValue 0.0 -maxValue 90.0 -precision 1.0 -fieldMinValue 0.0 -fieldMaxValue 90.0 atfNormalToleranceGrp; setParent ..; setParent ..; // ---------------------------------------- // ATF customization // ---------------------------------------- formLayout -visible false atfLegacyCustomLayout; columnLayout -adjustableColumn true atfLegacyCustomOptionsCol; // ---------------------------------------- // Legacy Normal Tolerance // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kLegacyNormalTolerance"); $annotation = getPluginResource("ATFPlugin", "kLegacyNormalToleranceAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -minValue 0.0 -maxValue 45.0 -precision 1.0 -fieldMinValue 0.0 -fieldMaxValue 45.0 atfLegacyNormalToleranceGrp; // ---------------------------------------- // Legacy Surface Tolerance // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kLegacySurfaceTolerance"); $annotation = getPluginResource("ATFPlugin", "kLegacySurfaceToleranceAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -minValue 0.0 -maxValue 100.0 -precision 1.0 -fieldMinValue 0.0 -fieldMaxValue 100.0 atfLegacySurfaceToleranceGrp; // ---------------------------------------- // Legacy Grid Aspect Ratio // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kLegacyGridAspectRatio"); $annotation = getPluginResource("ATFPlugin", "kLegacyGridAspectRatioAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -minValue 0.0 -maxValue 100.0 -precision 1.0 -fieldMinValue 0.0 -fieldMaxValue 100.0 atfLegacyGridAspectRatioGrp; // ---------------------------------------- // Legacy Max Edge Length // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kLegacyMaxEdgeLength"); $annotation = getPluginResource("ATFPlugin", "kLegacyMaxEdgeLengthAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -minValue 0.0 -maxValue 100.0 -precision 6.0 -fieldMinValue 0.0 -fieldMaxValue 100.0 atfLegacyMaxEdgeLengthGrp; setParent ..; setParent ..; // ---------------------------------------- // ATF Stitching Services // ---------------------------------------- $label = getPluginResource("ATFPlugin", "kStitchingServices"); $annotation = getPluginResource("ATFPlugin", "kStitchingServicesAnnot"); $isEnabledIndication = getPluginResource("ATFPlugin", "kIsEnabledIndication"); checkBoxGrp -numberOfCheckBoxes 1 -vertical -changeCommand "atfChangeCommand()" -label $label -label1 $isEnabledIndication -annotation $annotation atfStitchingServicesGrp; formLayout -visible false atfStitchingLayout; columnLayout -adjustableColumn true atfStitchingCustomOptionsCol; $label = getPluginResource("ATFPlugin", "kStitchingTolerance"); $annotation = getPluginResource("ATFPlugin", "kStitchingToleranceAnnot"); floatSliderGrp -label $label -annotation $annotation -field true -value 1.0 -minValue 0.0 -maxValue 45.0 -precision 1.0 -fieldMinValue 0.0 -fieldMaxValue 45.0 atfStitchingToleranceGrp; $label = getPluginResource("ATFPlugin", "kStitchSepSettings"); $annotation = getPluginResource("ATFPlugin", "kStitchingSepAnot"); $byGroup = getPluginResource("ATFPlugin", "kStitchSepByGroup"); $byLayer = getPluginResource("ATFPlugin", "kStitchSepByLayer"); $byGeomSet = getPluginResource("ATFPlugin", "kStitchSepByGeomSet"); $byStyle = getPluginResource("ATFPlugin", "kStitchSepByStyle"); checkBoxGrp -numberOfCheckBoxes 4 -vertical -changeCommand "atfChangeCommand()" -label $label -label1 $byGroup -label2 $byLayer -label3 $byGeomSet -label4 $byStyle -annotation $annotation atfStitchingSepGrp; setParent ..; setParent ..; // Now set to current settings. $currentOptions = $initialSettings; if (size($currentOptions) > 0) { int $enableTessellation = false; tokenize($currentOptions, ";", $optionList); for ($index = 0; $index < size($optionList); $index++) { tokenize($optionList[$index], "=", $optionBreakDown); if ($optionBreakDown[0] == "ts") { $enableTessellation = $optionBreakDown[1]; if ($enableTessellation) { radioButtonGrp -edit -select 2 atfTessellateObjectsGrp; } else { radioButtonGrp -edit -select 1 atfTessellateObjectsGrp; } } else if ($optionBreakDown[0] == "cd") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfChordalDeviationGrp; } else if ($optionBreakDown[0] == "icl") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfMinChordLengthGrp; } else if ($optionBreakDown[0] == "mcl") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfMaxChordLengthGrp; } else if ($optionBreakDown[0] == "s") { int $i = $optionBreakDown[1]; if ($i != 0) { optionMenuGrp -edit -select $i atfSampleTypeGrp; } } else if ($optionBreakDown[0] == "adp") { int $i = $optionBreakDown[1]; checkBoxGrp -edit -value1 $i atfAdaptiveGrp; } else if ($optionBreakDown[0] == "smp") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfSamplesGrp; } else if ($optionBreakDown[0] == "ant") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfNormalToleranceGrp; } else if ($enableTessellation && ($optionBreakDown[0] == "leg")) { int $i = $optionBreakDown[1]; if ($i) { radioButtonGrp -edit -select 3 atfTessellateObjectsGrp; } } else if ($optionBreakDown[0] == "nt") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfLegacyNormalToleranceGrp; } else if ($optionBreakDown[0] == "st") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfLegacySurfaceToleranceGrp; } else if ($optionBreakDown[0] == "gar") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfLegacyGridAspectRatioGrp; } else if ($optionBreakDown[0] == "mel") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfLegacyMaxEdgeLengthGrp; } /// /* Stitching Services Options */ /// else if ($optionBreakDown[0] == "sso") { float $v = $optionBreakDown[1]; checkBoxGrp -edit -value1 $v atfStitchingServicesGrp; } /// Tolerance else if ($optionBreakDown[0] == "stol") { float $v = $optionBreakDown[1]; floatSliderGrp -edit -value $v atfStitchingToleranceGrp; } /// Seperation // Group else if ($optionBreakDown[0] == "ssps1") { int $v = $optionBreakDown[1]; if ($v != 0) { checkBoxGrp -edit -value1 $v atfStitchingSepGrp; } } else if ($optionBreakDown[0] == "ssps2") { int $v = $optionBreakDown[1]; if ($v != 0) { checkBoxGrp -edit -value2 $v atfStitchingSepGrp; } } else if ($optionBreakDown[0] == "ssps3") { int $v = $optionBreakDown[1]; if ($v != 0) { checkBoxGrp -edit -value3 $v atfStitchingSepGrp; } } else if ($optionBreakDown[0] == "ssps4") { int $v = $optionBreakDown[1]; if ($v != 0) { checkBoxGrp -edit -value4 $v atfStitchingSepGrp; } } } // end for atfChangeCommand(); } setUITemplate -popTemplate; $result = 1; } else if ($action == "query") { int $i; float $v; $i = `radioButtonGrp -query -select atfTessellateObjectsGrp`; if ($i == 1) { $i = 0; } else { $i = 1; } $currentOptions = $currentOptions + "ts=" + $i; $i = 1; $currentOptions = $currentOptions + ";ec=" + $i; $v = `floatSliderGrp -query -value atfChordalDeviationGrp`; $currentOptions = $currentOptions + ";cd=" + $v; $v = `floatSliderGrp -query -value atfMinChordLengthGrp`; $currentOptions = $currentOptions + ";icl=" + $v; $v = `floatSliderGrp -query -value atfMaxChordLengthGrp`; $currentOptions = $currentOptions + ";mcl=" + $v; $i = `optionMenuGrp -query -select atfSampleTypeGrp`; $currentOptions = $currentOptions + ";s=" + $i; $i = `checkBoxGrp -query -value1 atfAdaptiveGrp`; $currentOptions = $currentOptions + ";adp=" + $i; $v = `floatSliderGrp -query -value atfSamplesGrp`; $currentOptions = $currentOptions + ";smp=" + $v; $v = `floatSliderGrp -query -value atfNormalToleranceGrp`; $currentOptions = $currentOptions + ";ant=" + $v; $i = `radioButtonGrp -query -select atfTessellateObjectsGrp`; if ($i == 3) { $i = 1; } else { $i = 0; } $currentOptions = $currentOptions + ";leg=" + $i; $i = 1; $currentOptions = $currentOptions + ";en=" + $i; $v = `floatSliderGrp -query -value atfLegacyNormalToleranceGrp`; $currentOptions = $currentOptions + ";nt=" + $v; $v = `floatSliderGrp -query -value atfLegacySurfaceToleranceGrp`; $currentOptions = $currentOptions + ";st=" + $v; $v = `floatSliderGrp -query -value atfLegacyGridAspectRatioGrp`; $currentOptions = $currentOptions + ";gar=" + $v; $v = `floatSliderGrp -query -value atfLegacyMaxEdgeLengthGrp`; $currentOptions = $currentOptions + ";mel=" + $v; /* Stitching Services */ $i = `checkBoxGrp -query -value1 atfStitchingServicesGrp`; $currentOptions = $currentOptions + ";sso=" + $i; /// Tolerance $v = `floatSliderGrp -query -value atfStitchingToleranceGrp`; $currentOptions = $currentOptions + ";stol=" + $v; /// Separations $i = `checkBoxGrp -query -value1 atfStitchingSepGrp`; $currentOptions = $currentOptions + ";ssps1=" + $i; $i = `checkBoxGrp -query -value2 atfStitchingSepGrp`; $currentOptions = $currentOptions + ";ssps2=" + $i; $i = `checkBoxGrp -query -value3 atfStitchingSepGrp`; $currentOptions = $currentOptions + ";ssps3=" + $i; $i = `checkBoxGrp -query -value4 atfStitchingSepGrp`; $currentOptions = $currentOptions + ";ssps4=" + $i; eval($resultCallback+" \""+$currentOptions+"\""); $result = 1; } else { $result = 0; } return $result; }