@@ -110,6 +110,7 @@ void IExportControl.Init(Viewport view, AppConfig config, bool hasSelectElements
110110 new FeatureInfo ( FeatureType . ExportSvfzip , Strings . FeatureNameExportSvfzip , Strings . FeatureDescriptionExportSvfzip , true , false ) ,
111111 new FeatureInfo ( FeatureType . EnableQuantizedAttributes , Strings . FeatureNameEnableQuantizedAttributes , Strings . FeatureDescriptionEnableQuantizedAttributes , true , false ) ,
112112 new FeatureInfo ( FeatureType . EnableTextureWebP , Strings . FeatureNameEnableTextureWebP , Strings . FeatureDescriptionEnableTextureWebP , true , false ) ,
113+ new FeatureInfo ( FeatureType . EnableTextureKtx2 , string . Empty , string . Empty , true , false ) ,
113114 new FeatureInfo ( FeatureType . EnableEmbedGeoreferencing , Strings . FeatureNameEnableEmbedGeoreferencing , Strings . FeatureDescriptionEnableEmbedGeoreferencing , true , false ) ,
114115 new FeatureInfo ( FeatureType . EnableUnlitMaterials , Strings . FeatureNameEnableUnlitMaterials , Strings . FeatureDescriptionEnableUnlitMaterials , true , false ) ,
115116 new FeatureInfo ( FeatureType . AutoAlignOriginToSiteCenter , Strings . FeatureNameAutoAlignOriginToSiteCenter , Strings . FeatureDescriptionAutoAlignOriginToSiteCenter , true , false ) ,
@@ -193,8 +194,24 @@ void IExportControl.Init(Viewport view, AppConfig config, bool hasSelectElements
193194
194195 cbContentType . Items . Clear ( ) ;
195196 cbContentType . Items . Add ( new ItemValue < int > ( Strings . ContentTypeBasic , 0 ) ) ;
197+ cbContentType . Items . Add ( new ItemValue < int > ( Strings . ContentTypeBasicLod , 10 ) ) ;
196198 cbContentType . Items . Add ( new ItemValue < int > ( Strings . ContentTypeShellOnlyByElement , 3 ) ) ;
197199 cbContentType . Items . Add ( new ItemValue < int > ( Strings . ContentTypeShellOnlyByMesh , 2 ) ) ;
200+
201+ cbTextureCompressTypes . Items . Clear ( ) ;
202+ cbTextureCompressTypes . Items . Add ( new ItemValue < int > ( @"KTX2 (v1.83+)" , 0 ) ) ;
203+ cbTextureCompressTypes . Items . Add ( new ItemValue < int > ( @"WebP (v1.54+)" , 1 ) ) ;
204+ cbTextureCompressTypes . Left = cbEnableTextureCompress . Left + cbEnableTextureCompress . Width ;
205+ cbTextureCompressTypes . Enabled = cbEnableTextureCompress . Checked & cbEnableTextureCompress . Enabled ;
206+
207+ cbEnableTextureCompress . CheckedChanged += ( sender , e ) =>
208+ {
209+ cbTextureCompressTypes . Enabled = cbEnableTextureCompress . Checked & cbEnableTextureCompress . Enabled ;
210+ } ;
211+ cbEnableTextureCompress . EnabledChanged += ( sender , e ) =>
212+ {
213+ cbTextureCompressTypes . Enabled = cbEnableTextureCompress . Checked & cbEnableTextureCompress . Enabled ;
214+ } ;
198215 }
199216
200217 bool IExportControl . Run ( )
@@ -248,11 +265,21 @@ void SetFeature(FeatureType featureType, bool selected)
248265 SetFeature ( FeatureType . GenerateModelsDb , cbGeneratePropDbSqlite . Checked ) ;
249266 SetFeature ( FeatureType . ExportSvfzip , cbExportSvfzip . Checked ) ;
250267 SetFeature ( FeatureType . EnableQuantizedAttributes , cbEnableQuantizedAttributes . Checked ) ;
251- SetFeature ( FeatureType . EnableTextureWebP , cbEnableTextureWebP . Checked ) ;
268+ // SetFeature(FeatureType.EnableTextureWebP, cbEnableTextureCompress .Checked);
252269 SetFeature ( FeatureType . GenerateThumbnail , cbGenerateThumbnail . Checked ) ;
253270 SetFeature ( FeatureType . EnableCesiumPrimitiveOutline , cbGenerateOutline . Checked ) ;
254271 SetFeature ( FeatureType . EnableUnlitMaterials , cbEnableUnlitMaterials . Checked ) ;
255272
273+ SetFeature ( FeatureType . EnableTextureWebP , false ) ;
274+ SetFeature ( FeatureType . EnableTextureKtx2 , false ) ;
275+ if ( cbEnableTextureCompress . Checked )
276+ {
277+ var textureCompressType = cbTextureCompressTypes . GetSelectedValue < int > ( ) == 1
278+ ? FeatureType . EnableTextureWebP
279+ : FeatureType . EnableTextureKtx2 ;
280+ SetFeature ( textureCompressType , true ) ;
281+ }
282+
256283 #endregion
257284
258285 var isCancelled = false ;
@@ -357,12 +384,13 @@ void IExportControl.Reset()
357384 cbExcludeModelPoints . Checked = true ;
358385 cbExcludeUnselectedElements . Checked = false ;
359386
360- cbUseDraco . Checked = false ;
387+ cbUseDraco . Checked = true ;
361388 //cbUseExtractShell.Checked = false;
362389 cbGeneratePropDbSqlite . Checked = true ;
363390 cbExportSvfzip . Checked = false ;
364391 cbEnableQuantizedAttributes . Checked = true ;
365- cbEnableTextureWebP . Checked = true ;
392+ cbEnableTextureCompress . Checked = true ;
393+ cbTextureCompressTypes . SetSelectedValue ( 0 ) ;
366394 //cbEmbedGeoreferencing.Checked = true;
367395 cbGenerateThumbnail . Checked = false ;
368396 cbGenerateOutline . Checked = false ;
@@ -417,7 +445,7 @@ private void cbVisualStyle_SelectedIndexChanged(object sender, EventArgs e)
417445 }
418446
419447 var excludeTexture = _Features . FirstOrDefault ( x => x . Type == FeatureType . ExcludeTexture ) ? . Selected ?? false ;
420- cbEnableTextureWebP . Enabled = ! excludeTexture ;
448+ cbEnableTextureCompress . Enabled = ! excludeTexture ;
421449 }
422450
423451 /// <summary>
@@ -461,7 +489,7 @@ bool IsAllowFeature(FeatureType feature)
461489 return _Features . Any ( x => x . Type == feature && x . Selected ) ;
462490 }
463491
464- #region 基本
492+ #region 基本
465493 {
466494 //视觉样式
467495 var visualStyle = _VisualStyles . FirstOrDefault ( x => x . Key == config . VisualStyle ) ??
@@ -477,9 +505,9 @@ bool IsAllowFeature(FeatureType feature)
477505 _LevelOfDetailDefault ;
478506 cbLevelOfDetail . SelectedItem = levelOfDetail ;
479507 }
480- #endregion
508+ #endregion
481509
482- #region 排除
510+ #region 排除
483511 {
484512 toolTip1 . SetToolTip ( cbExcludeLines , Strings . FeatureDescriptionExcludeLines ) ;
485513 toolTip1 . SetToolTip ( cbExcludeModelPoints , Strings . FeatureDescriptionExcludePoints ) ;
@@ -502,16 +530,16 @@ bool IsAllowFeature(FeatureType feature)
502530
503531 cbExcludeUnselectedElements . Enabled = _HasSelectElements ;
504532 }
505- #endregion
533+ #endregion
506534
507- #region 高级
535+ #region 高级
508536 {
509537 toolTip1 . SetToolTip ( cbUseDraco , Strings . FeatureDescriptionUseGoogleDraco ) ;
510538 //toolTip1.SetToolTip(cbUseExtractShell, Strings.FeatureDescriptionExtractShell);
511539 toolTip1 . SetToolTip ( cbGeneratePropDbSqlite , Strings . FeatureDescriptionGenerateModelsDb ) ;
512540 toolTip1 . SetToolTip ( cbExportSvfzip , Strings . FeatureDescriptionExportSvfzip ) ;
513541 toolTip1 . SetToolTip ( cbEnableQuantizedAttributes , Strings . FeatureDescriptionEnableQuantizedAttributes ) ;
514- toolTip1 . SetToolTip ( cbEnableTextureWebP , Strings . FeatureDescriptionEnableTextureWebP ) ;
542+ // toolTip1.SetToolTip(cbEnableTextureCompress , Strings.FeatureDescriptionEnableTextureWebP);
515543 toolTip1 . SetToolTip ( cbGenerateThumbnail , Strings . FeatureDescriptionGenerateThumbnail ) ;
516544 toolTip1 . SetToolTip ( cbGenerateOutline , Strings . FeatureDescriptionEnableCesiumPrimitiveOutline ) ;
517545 toolTip1 . SetToolTip ( cbEnableUnlitMaterials , Strings . FeatureDescriptionEnableUnlitMaterials ) ;
@@ -543,7 +571,18 @@ bool IsAllowFeature(FeatureType feature)
543571
544572 if ( IsAllowFeature ( FeatureType . EnableTextureWebP ) )
545573 {
546- cbEnableTextureWebP . Checked = true ;
574+ cbEnableTextureCompress . Checked = true ;
575+ cbTextureCompressTypes . SetSelectedValue ( 1 ) ;
576+ }
577+ else if ( IsAllowFeature ( FeatureType . EnableTextureKtx2 ) )
578+ {
579+ cbEnableTextureCompress . Checked = true ;
580+ cbTextureCompressTypes . SetSelectedValue ( 0 ) ;
581+ }
582+ else
583+ {
584+ cbEnableTextureCompress . Checked = false ;
585+ cbTextureCompressTypes . SetSelectedValue ( 0 ) ;
547586 }
548587
549588 if ( IsAllowFeature ( FeatureType . GenerateThumbnail ) )
@@ -561,7 +600,7 @@ bool IsAllowFeature(FeatureType feature)
561600 cbEnableUnlitMaterials . Checked = true ;
562601 }
563602 }
564- #endregion
603+ #endregion
565604
566605 #region 3D Tiles
567606
@@ -600,20 +639,6 @@ private void cbAutoOpen_CheckedChanged(object sender, EventArgs e)
600639 {
601640 }
602641
603-
604- private bool TryGetDoubleFromTextBox ( TextBox tb , out double value )
605- {
606- if ( double . TryParse ( tb . Text , out value ) )
607- {
608- errorProvider1 . SetError ( tb , null ) ;
609- return true ;
610- }
611-
612- errorProvider1 . SetError ( tb , Strings . InvalidFormat ) ;
613- tb . Focus ( ) ;
614- return false ;
615- }
616-
617642 private class VisualStyleInfo
618643 {
619644 public string Key { get ; }
@@ -629,37 +654,36 @@ public VisualStyleInfo(string key, string text, Dictionary<FeatureType, bool> fe
629654 Features = features ;
630655 }
631656
632- #region Overrides of Object
657+ #region Overrides of Object
633658
634659 public override string ToString ( )
635660 {
636661 return Text ;
637662 }
638663
639- #endregion
664+ #endregion
640665 }
641666
642-
643667 private class ComboItemInfo
644668 {
645- public int Value { get ; }
669+ public int Value { get ; }
646670
647- private string Text { get ; }
671+ private string Text { get ; }
648672
649673 public ComboItemInfo ( int value , string text )
650674 {
651675 Value = value ;
652676 Text = text ;
653677 }
654678
655- #region Overrides of Object
679+ #region Overrides of Object
656680
657681 public override string ToString ( )
658682 {
659683 return Text ;
660684 }
661685
662- #endregion
686+ #endregion
663687 }
664688
665689 private void ShowMessageBox ( string message )
@@ -669,7 +693,7 @@ private void ShowMessageBox(string message)
669693
670694 private bool ShowConfirmBox ( string message )
671695 {
672- return MessageBox . Show ( ParentForm , message , ParentForm . Text ,
696+ return MessageBox . Show ( ParentForm , message , ParentForm ? . Text ,
673697 MessageBoxButtons . OKCancel ,
674698 MessageBoxIcon . Question ,
675699 MessageBoxDefaultButton . Button2 ) == DialogResult . OK ;
0 commit comments