Compile Time Changes

The following methods have been moved to functions:

cm.core

// world.cm methods moved to functions
Old: extend public void disconnectNonUfosFromUfos(Snapper{} input);
New: public void disconnectNonUfosFromUfos(Snapper{} input);

Old: extend public Snapper{} replaceUfosWithProxySnappers(Snapper{} input, Object->UFOProxySnapper ufoReconnectMap=null);
New: public (Snapper{}) replaceUfosWithProxySnappers(Snapper{} input, 
                                                     UfoData ufoData=null,
                                                     Object->UFOProxySnapper ufoReconnectMap=null);

The following function / arguments have been changed:

cm.core

// coreGlobals.cm
Old: public (function(World world): bool) {} containsUfoDataHooks() : keep;
New: public (function(str->Object):bool) {} containsAuxUfoDataHooks() : keep;

Old: public function(World world) {} clearUfoDataHooks() : keep;
New: public function(str->Object) {} clearAuxUfoDataHooks() : keep;

// worldUfo.cm
Old: public void putContainsUfoDataHooks(function(World world):bool hook);
New: public void putContainsAuxUfoDataHooks(function(str->Object):bool hook);

Old: public void removeContainsUfoDataHooks(function(World world):bool hook);
New: public void removeContainsAuxUfoDataHooks(function(str->Object):bool hook);

Old: public void putClearUfoDataHooks(function(World world) hook);
New: public void putClearAuxUfoDataHooks(function(str->Object) hook);

Old: public void removeClearUfoDataHooks(function(World world) hook);
New: public void removeClearAuxUfoDataHooks(function(str->Object) hook);

cm.core.part

// partDividersInSpace.cm
Old: public PartDivider[] getPartDividers(Space space, bool sort=true);
New: public PartDivider[] defaultPartDividers(bool category=false);

// parts.cm
Old: public PartGroup fetchPartsTree(Space space=mainSpace(),
                                     //bool merge=true,
                                     //bool finalize=true,
                                     bool merge=false,
                                     bool finalize=false,
                                     bool filter=true,
                                     function():bool interrupt=null,
                                     bool progress=false,
                                     ExportFilterSettings exportFilter=null,
                                     PartSeqSorter sorter=null,
                                     PartFetchEnv mergeEnv=null);
New: public PartGroup fetchPartsTree(PartDivider[] dividers,
                                     Space space=mainSpace(),
                                     //bool merge=true,
                                     //bool finalize=true,
                                     bool merge=false,
                                     bool finalize=false,
                                     bool filter=true,
                                     function():bool interrupt=null,
                                     bool progress=false,
                                     ExportFilterSettings exportFilter=null,
                                     PartSeqSorter sorter=null,
                                     PartFetchEnv mergeEnv=null);

Here is an example code snippet that used getPartDividers(..) and fetchPartsTree(..):

Old:
// In extension init / main
World world = session.mainWorld;
if (world) {
	Space space = world.mainSpace;
   
	if (space) {
	    PartDivider[] seq = space.getPartDividers(sort=true);
	    if (seq) for (p in seq) { if (p as CategoryPartDivider) p.enable(true); }
	    //if (seq) for (p in seq) { if (p as CategoryPartDivi    er) p.on = true; }
	}
}

// In chapter creation / print
PartGroup partTree = fetchPartsTree(space=space);

New: 
PartGroup partTree = fetchPartsTree(defaultPartDividers(category=true), space=space);

cm.core.partTag

// partTagsInSpace.cm
Old: public void repairTagsInSpace(Space space);
// partTagsInWorld.cm
New: public void repairTagsInWorld(World world); 

cm.core.ui

// exportFilterDialogV2.cm
Old: public void showFilterSettingsDialogV2(ExportFilterBar exportBar, bool useAutoTags=false, str label=null, bool showViewModes=false);
New: public void showFilterSettingsDialogV2(ExportFilterBar exportBar, str label=null, bool showViewModes=false);

Old: ExportFilterDialogV2(Window parent, bool useAutoTags=false, str label=null, bool showViewModes=false);
New: ExportFilterDialogV2(Window parent, str label=null, bool showViewModes=false);

Old: ExportFilterSubWindowV2(Window parent, 
                             bool useAutoTags=false, 
                             str label=null, bool showViewModes=false, 
                             function(ExportFilterSubWindowV2 exportSub) callback=null);
New: ExportFilterSubWindowV2(Window parent, str label=null, bool showViewModes=false);

Old: public OrderExportDialog orderExportDialog(Window parent, World world,
                                                bool initVisible=true,
                                                Part[] selectedParts=null,
                                                CalculationView view=null) : deprecated;
New: public OrderExportDialog orderExportDialog(Window parent, World world,
                                                bool initVisible=true,
                                                bool show=true,
                                                Part[] selectedParts=null,
                                                CalculationView view=null);

The following fields, methods, classes and functions have been removed:

cm.core.calc

// articleViewTool.cm
Removed: public class ExpandArticleViewTool extends ArticleViewTool : deprecated;
Removed: public class DetailsArticleViewTool extends ArticleViewTool;
Removed: public class FilterArticleViewTool extends ArticleViewTool;
Removed: public class GroupingArticleViewTool extends ArticleViewTool : deprecated;
Removed: public class OrderExportArticleViewTool extends ArticleViewTool : deprecated;
Removed: public class AutoCreateArticleViewTool extends ArticleViewTool;
Removed: public class MergePolicyArticleViewTool extends ArticleViewTool;
Removed: public class PrintArticleViewTool extends ArticleViewTool;
Removed: public class PrintPreviewArticleViewTool extends ArticleViewTool;

// filterArticleViewDialog.cm
Removed: public class FilterArticleViewDialog extends ModalDialog;
Removed: public class HideFilteredArticleViewTool extends ArticleViewTool;
Removed: public class RemoveExplicitArticleViewTool extends ArticleViewTool;
Removed: public void giveSettingsToSpace(ArticleView this, Space space=null);
Removed: public ExportFilterSettings getFilter(ArticleView this) : deprecated;

// partMergeDialog.cm
Removed: public void showPartMergeDialog(Window parent, Space space) : deprecated;
Removed: public class ColumnPartFetchEnv2 extends ExtendedPartMergeEnv : deprecated;

cm.core.part

// partDividerDialog.cm
Removed: public void showPartDividerDialog(Window parent, Space space=null) : deprecated;
Removed: public void updatePartDividerDialog() : deprecated;
Removed: public void closePartDividerDialog() : deprecated;
Removed: public class PartDividerDialog extends DialogWindow : deprecated;

// partDividersInSpace.cm
Removed: public void putPartDivider(Space space, PartDivider divider);
Removed: public PartDivider[] autoUpdatePartDividers(Space space, PartDivider[] dividers, bool turnOnNew=false);
Removed: public void putPartDividers(Space space, PartDivider[] dividers);
Removed: public void removeTagCategoryPartDivider(Space space, PartTagCategory category);
Removed: public PartDivider[] repairPartDividers(Space space, PartDivider[] dividers);

cm.core.settings

// exportFilterBar.cm
Removed: public class AutoTagsPartExportFilterBar extends ExportFilterBar : deprecated;

ExportFilterBar
    Removed: public bool horizontal;
    Removed: public CheckBox filter;
    Removed: final public void minimalSizeTweak(int h, int w=-1);

// Use `masterEnabled()` instead of `filter.isChecked()` instead:
Old: if (filter as ExportFilterBar) if (!filter.filter.?isChecked()) return;
New: if (filter as ExportFilterBar) if (!filter.masterEnabled()) return;

cm.core.ui

// exportFilterDialog.cm
Removed: public void showFilterSettingsDialog(ExportFilterBar exportBar, bool useAutoTags=false, str label=null);
Removed: public class ExportFilterDialog extends DialogWindow;
Removed: public class ExportFilterSubWindow extends SubWindow;

// exportFilterDialogV2.cm
ExportFilterSubWindowV2
    Removed: public CheckBox all : deprecated;
    Removed: public CheckBox unCategorized : deprecated;
    Removed: public PDItem treeViewItem : copy=null, stream=null, ignore modify notice, deprecated;
    Removed: public PartDivider[] partDividers : deprecated;
    Removed: final public sorted str->symbol alpabeticallySortedAvailableCategories() : deprecated;
    Removed: final public void rebuildItems() : deprecated;
    Removed: final public void updateTags(TreeViewItem item, bool include) : deprecated;
    Removed: extend public void enableDegreeOfTriGroup(TreeViewItem item) : deprecated;
    Removed: final public void turnOnFilters(bool v=true) : deprecated;
    Removed: final public void turnOnExplicitMode(bool v=true) : deprecated;

// orderExportDialog.cm
OrderExportDialog
    Removed: public ExportFilterBar exportFilter;

Runtime/Behavior Changes

COM Cache Changes

In an effort to lessen drawing file size, CustomerOwnMaterials are no longer stored in World.auxiliaryData and have been moved to World.cachedData.

Note: This means unused COMs are no longer saved with the drawing.

For direct access to a COM, we advise usage of cm.abstract.material.customerOwnMaterials(World world)

Example:

if (CustomerOwnMaterial com = customerOwnMaterials(mainWorld()).?find(myKey)) {
   // do something with your COM
}

Compontent

Updated the base constructor to call initialize.

Old:
public constructor() { /** Default */ }

New:
public constructor() {
    super(null);
    initialize();
}

Property Stretch

Added a bool to allow for code to check whether the animation is in the doSuperStretch() method.

Added a call to droped() when it inserts snappers from super stretch

View mode changes

setDefaultViewModes() now acts on mainWorld() instead of activeWorld(), so it is no longer dependent on the last view that was made active.

Old:
/**
 * Set default view modes.
 */
public void setDefaultViewModes() {
    if (World world = activeWorld()) {
        if ((ViewMode[]) viewModes = defaultViewModes()) {
            world.setViewModes(viewModes);
        }
    }
}


New:
/**
 * Set default view modes.
 */
public void setDefaultViewModes() {
    if (World world = mainWorld(selectWorldIfNull=false)) {
        if ((ViewMode[]) viewModes = defaultViewModes()) {
            world.setViewModes(viewModes);
        }
    }
}

calculation.cm

Added new fields to calculateWorldPrice for BOM analytics purpose.

Old: public double calculateWorldPrice(Space space, bool ignoreGlobalAdjustments=false, bool abortable=false, Int partCount=null) {
New: public double calculateWorldPrice(Space space, bool ignoreGlobalAdjustments=false, bool abortable=false, Int partCount=null,
									   Timespan timelimit=null, Datetime deadline=null, bool flushSomePrices=false) {

cm.subset.doubleRange.cm

An issue was fixed in the DoubleRange and DoubleSubRange classes which could potientially cause an infinite loop.

old:
    public Object next(Object o) {
        (...)
	    if (res > maxV) return maxV;
        (...)
    }
New:
    public Object next(Object o) {
        (...)
	    if (res > maxV) return null;
        (...)
    }
Old:
    public Object previous(Object o)  {
        (...)
	    if (res < minV) return minV;
        (...)
    }
New:
    public Object previous(Object o)  {
        (...)
	    if (res < minV) return null;
        (...)
    }

cm.subset.gProp.cm

Added: public class ToolTipGProp extends GProp {}