[Igarden-commit] Garden/source/LayoutDB MaterialCollection.h, 1.5, 1.5.2.1 MaterialCollection.cpp,
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2006-11-26 01:22:57
|
Update of /cvsroot/igarden/Garden/source/LayoutDB In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6938 Modified Files: Tag: Release_branch_v1 MaterialCollection.h MaterialCollection.cpp Layout.h Layout.cpp Log Message: Unify plant and hardscape palettes & improve speed Index: Layout.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Layout.h,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -C2 -d -r1.18.2.1 -r1.18.2.2 *** Layout.h 15 Nov 2006 03:59:06 -0000 1.18.2.1 --- Layout.h 26 Nov 2006 01:22:52 -0000 1.18.2.2 *************** *** 28,32 **** class PlanView; class Layer; - class MaterialCollection; class LayerSet; --- 28,31 ---- *************** *** 35,38 **** --- 34,38 ---- #include "XGSDynArray.h" #include "XGXMLObject.h" + #include "MaterialCollection.h" class c4_Storage; *************** *** 55,62 **** --- 55,81 ---- const int kSwitchPlotMsg = 'Swtc'; + const long kRegenAllPlantsGroup = 0; + const long kRegenPlotGroup = 1; + const long kBackgroundGroup = 2; + const long kCommonPlantGroup = 3; + const long kCommonHardscapeGroup = 4; + const long kUserDefaultGroup = 5; + const long kFirstUserFormedGroup = 6; + typedef XGSDynArray<Material*> materialArray_t; typedef XGSDynArray<PathElement*> pathELementArray_t; typedef void (*elementCB_t)(Element *element, void *ref); + class PaletteGroup + { + public: + PaletteGroup (String &name) { _name = name; } + PaletteGroup (const char *name) { _name.SetCString(name); } + ~PaletteGroup() { for(long n = _palettes.Length() -1; n >= 0; n--) delete (_palettes[n]); } + + String _name; + XGDynArray <MaterialCollection*> _palettes; + }; + class Layout : public XGSend { *************** *** 82,88 **** virtual ~Layout(); void ParseXML( ClientDocument * doc, XGXMLObject *obj ); void Draw(PlanView* view); ! void DoSave(); ! void DoLoad(bool isNew); void SaveAsXML(RGXMLWriter &writer); Layer* LookupLayer(rsuid_t& uid); --- 101,107 ---- virtual ~Layout(); void ParseXML( ClientDocument * doc, XGXMLObject *obj ); + void LoadInitialPalettes(materialArray_t *allMaterials); void Draw(PlanView* view); ! void LoadOldFileFormat(); void SaveAsXML(RGXMLWriter &writer); Layer* LookupLayer(rsuid_t& uid); *************** *** 106,113 **** void AddToSelect(planRectangle_t within, SelectedElements* selected, PlanView* view); void ToggleSelect(planRectangle_t within, SelectedElements* selected, PlanView* view); ! void AddPalette(MaterialCollection* palette); ! void RemovePalette(MaterialCollection* palette); ! Int32 GetNumPalettes(); ! MaterialCollection *GetIndexedPalette(Int32 layer); bool TestOverlap(Element* testElement, overlapAction_t action); bool GetElementsAtPoint(planPoint_t point, PlanView* view, XGDynArray<Element*>& results); --- 125,135 ---- void AddToSelect(planRectangle_t within, SelectedElements* selected, PlanView* view); void ToggleSelect(planRectangle_t within, SelectedElements* selected, PlanView* view); ! long NumPaletteGroups(); ! String GetGroupName(long index); ! long GetGroupIndex(String &groupName); // Creates group if needed ! ! long NumPalettes(long group); ! MaterialCollection* GetPaletteByGroupAndIndex(long group, long index); ! void AddPalette(long group, MaterialCollection *palette); bool TestOverlap(Element* testElement, overlapAction_t action); bool GetElementsAtPoint(planPoint_t point, PlanView* view, XGDynArray<Element*>& results); *************** *** 117,122 **** MaterialRef* FindMaterial( materialID_t materialID ); - void SaveLayoutSettings(PlanView* view); - void RestoreLayoutSettings(PlanView* view); UInt32 GetUnusedMaterial(materialID_t materialID, UInt32 count, UInt32& numPurchased, UInt32& numFromUnused); void AddUnusedMaterial(materialID_t materialID, UInt32 count, UInt32 numPurchased); --- 139,142 ---- *************** *** 129,132 **** --- 149,157 ---- private: #pragma warn_hidevirtual off + void ParseOnePaletteEntry(XGXMLObject *subTree, const char *region, long group); + void EliminateBogusPaletteEntries(); + void InitPaletteGroups(); + void InitBlankLayout(); + XGDynArray<GardenPlot*> _gardenPlots; long _currentPlotIndex; *************** *** 138,151 **** // attributes ! XGDynArray <Layer*> _layers; ! Layer* _unusedMaterial; ! DatabaseFile* _database; ! ClientDocument* _document; ! bool _newLayout; ! Layer* _writableLayer; ! XGDynArray <MaterialCollection*> _materialPalettes; ! XGDynArray<LayerSet*> _layerSets; ! bool _translateToGL; ! bool _fixBeta1Layers; }; --- 163,176 ---- // attributes ! XGDynArray <Layer*> _layers; ! Layer* _unusedMaterial; ! DatabaseFile* _database; ! ClientDocument* _document; ! bool _newLayout; ! Layer* _writableLayer; ! XGDynArray<PaletteGroup*> _paletteGroups; ! XGDynArray<LayerSet*> _layerSets; ! bool _translateToGL; ! bool _fixBeta1Layers; }; Index: Layout.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/Layout.cpp,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -C2 -d -r1.27.2.1 -r1.27.2.2 *** Layout.cpp 1 Nov 2006 03:18:29 -0000 1.27.2.1 --- Layout.cpp 26 Nov 2006 01:22:52 -0000 1.27.2.2 *************** *** 39,45 **** --- 39,155 ---- #include "PointPath.h" #include "SourceMaterialFile.h" + #include "XGXMLDOMParser.h" using yaaf::XGXMLData; + // --------------------------------------------------------------------------- + /// Layout + // [...1590 lines suppressed...] - bool found; - GardenPlot *plot; - - numPlots = NumPlots(); - for(plotIndex = 0, found = false; plotIndex < numPlots; plotIndex++) - { - plot = GetIndexedPlot(plotIndex); - plot->getPlotID(testPlotID); - if(uid == testPlotID) - { - plot->GetName(name); - found = true; - break; - } - } - - return found; - } --- 1180,1182 ---- Index: MaterialCollection.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/MaterialCollection.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** MaterialCollection.cpp 13 Jan 2006 22:48:43 -0000 1.6 --- MaterialCollection.cpp 26 Nov 2006 01:22:52 -0000 1.6.2.1 *************** *** 6,10 **** // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF // ANY KIND, either express or implied. See the License for the specific language governing rights and ! // limitations under the License. // // The Original Code is iGarden Layout. --- 6,10 ---- // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF // ANY KIND, either express or implied. See the License for the specific language governing rights and ! // limitations under the License. // // The Original Code is iGarden Layout. *************** *** 25,28 **** --- 25,29 ---- #include "ViewClass.h" #include "MyAssert.h" + #include "SourceMaterialFile.h" enum matCollectProp_t *************** *** 32,105 **** }; - - void MaterialCollection::ReloadCache() - { - UInt32 n, numDBItems, arraySize; - MaterialElem_t elem; - materialID_t uid; - Material* material; - ClientDocument* doc; - - numDBItems = _items.Length(); - arraySize = _cache.Length(); - doc = _layout->GetDocument(); - for(n = arraySize; n < numDBItems; n++) - { - material = _items[n]; - MyAssert(material != NULL); - elem.dbIndex = n; - elem.name = material->GetDisplayName(kUsePreferencesSetting); - _cache.push_back(elem); - } - } - - void MaterialCollection::SortByName() - { - UInt32 numItems; - MaterialElem_t intermediate; - bool NoSwaps; - - // ReloadCache(); - - numItems = _cache.Length(); - for (unsigned int i = 0; i < (numItems - 1); ++i) - { - NoSwaps = true; // Checks to see if any swaps happened - - for (unsigned int j = 1; j < (numItems - i); ++j) - { - if (_cache[j - 1].name > _cache[j].name) - { - intermediate = _cache[j-1]; - _cache[j-1] = _cache[j]; - _cache[j] = intermediate; - - // There was a swap, so set the flag false - if (NoSwaps) - NoSwaps = false; - } - } - - // If the sort didn't do anything (i.e. if the array is - // sorted), then stop the algorithm. - if (NoSwaps) - break; - } - } - - // --------------------------------------------------------------------------- - // MaterialCollection::MaterialCollection( DatabaseFile* file, Layout* layout, UInt32 nd ) // --------------------------------------------------------------------------- // ! /* The constructor for layer. */ ! ! ! ! MaterialCollection::MaterialCollection( DatabaseFile* file, Layout* layout, UInt32 nd ) { _name = String(""); _isModified = false; _layout = layout; - _fixed = false; _compat = new DBPersist(file, kPaletteCID, nd); } --- 33,45 ---- }; // --------------------------------------------------------------------------- + // MaterialCollection // ! MaterialCollection::MaterialCollection( DatabaseFile* file, Layout* layout, UInt32 nd) { _name = String(""); _isModified = false; + _needsSort = true; _layout = layout; _compat = new DBPersist(file, kPaletteCID, nd); } *************** *** 109,135 **** _name = String(""); _isModified = false; _layout = layout; - _fixed = false; _compat = NULL; } - // --------------------------------------------------------------------------- - // MaterialCollection::~MaterialCollection() - // --------------------------------------------------------------------------- - // - MaterialCollection::~MaterialCollection() { } - // --------------------------------------------------------------------------- - // void MaterialCollection::AddMaterial( Material * item ) - // --------------------------------------------------------------------------- - // - /* Add an element to the layer, which will cause the element to be displayed when it comes into view, and cause the elment to be persisted when the Layer is persisted. This operation may expand the size of the layer if the element extends off of the side, and causes an immediate update to the region where it is placed. */ ! void ! MaterialCollection::AddMaterial( Material * item ) { materialID_t uid; --- 49,74 ---- _name = String(""); _isModified = false; + _needsSort = false; _layout = layout; _compat = NULL; } + // --------------------------------------------------------------------------- + /// ~MaterialCollection() + // MaterialCollection::~MaterialCollection() { } ! // --------------------------------------------------------------------------- ! /// AddMaterial ! /// Add an element to the layer, which will cause the element to be displayed when ! /// it comes into view, and cause the elment to be persisted when the Layer is persisted. ! /// This operation may expand the size of the layer if the element extends off of the side, ! /// and causes an immediate update to the region where it is placed. */ ! // ! void MaterialCollection::AddMaterial( Material * item ) { materialID_t uid; *************** *** 137,152 **** item->GetObjectID(uid.species); item->GetVariantID(uid.variant); - _items.push_back(item); SetModified(); } // --------------------------------------------------------------------------- ! // void MaterialCollection::RemoveMaterial( Material * item ) ! // --------------------------------------------------------------------------- // - /* Remove an element from the layer, and stop persisting the element. This operation may shrink the size of the layer, and causes an immediate update to the region where the element was placed. */ ! void ! MaterialCollection::RemoveMaterial( Material * item ) { bool found = false; --- 76,93 ---- item->GetObjectID(uid.species); item->GetVariantID(uid.variant); SetModified(); + _items.push_back(item); + _needsSort = true; } + + // --------------------------------------------------------------------------- ! /// RemoveMaterial ! /// Remove an element from the layer, and stop persisting the element. ! /// This operation may shrink the size of the layer, and causes an immediate update to the region where the element was placed. */ // ! void MaterialCollection::RemoveMaterial( Material * item ) { bool found = false; *************** *** 174,303 **** } SetModified(); POSTCONDITION(found); } - // --------------------------------------------------------------------------- - // void MaterialCollection::SetName( wchar_t * name ) - // --------------------------------------------------------------------------- - // - /* Set the name of the layer, which is used in order to present the list of layers to be enabled or disabled. */ ! void ! MaterialCollection::SetName( wchar_t * name ) { _name = name; SetModified(); } - // --------------------------------------------------------------------------- - // wchar_t* MaterialCollection::GetName() - // --------------------------------------------------------------------------- - // - /* Return the name of the layer as a wide character. */ ! const wchar_t* ! MaterialCollection::GetName() { return(_name.w_str()); } - // --------------------------------------------------------------------------- - // void MaterialCollection::GetNamePStr( Str255 nameBuf ) - // --------------------------------------------------------------------------- - // - /* Returns a representation of the name as a PStr into nameBuf. */ ! void ! MaterialCollection::GetNamePStr( Str255& nameBuf ) { _name.ToStr255(nameBuf); } - // --------------------------------------------------------------------------- - // Int32 MaterialCollection::GetNumMaterials() - // --------------------------------------------------------------------------- - // - /* Returns the number of elements in the layer. */ ! Int32 ! MaterialCollection::GetNumMaterials() { return(_items.Length()); } - // --------------------------------------------------------------------------- - // Material* MaterialCollection::GetIndexedMaterial( Int32 index ) - // --------------------------------------------------------------------------- - // - /* Returns the element given by the index. Elements are numbered from one to the number of elements, inclusive. */ ! Material* ! MaterialCollection::GetIndexedMaterial( Int32 index ) { Material *itemPtr; PRECONDITION(index >= 0); - ReloadCache(); - itemPtr = _items[index]; return(itemPtr); } - // --------------------------------------------------------------------------- - // bool MaterialCollection::IsModified() - // --------------------------------------------------------------------------- - // - /* Called externally to see if the layer needs to be saved. The save menu will only be enabled if some layer or preference needs to be saved. */ ! bool ! MaterialCollection::IsModified() { return _isModified; } - // --------------------------------------------------------------------------- - // void MaterialCollection::SetLayout( Layout* layout ) - // --------------------------------------------------------------------------- - // - /* Sets the layout class which owns this layer. */ ! void ! MaterialCollection::SetLayout( Layout* layout ) { _layout = layout; } - // --------------------------------------------------------------------------- - // void MaterialCollection::SetModified() - // --------------------------------------------------------------------------- - // - /* Called by elements to indicate that the layer has been modified, and should be persisted. */ ! void ! MaterialCollection::SetModified() { _layout->SetModified(); _isModified = true; } - // --------------------------------------------------------------------------- - // ClientDocument* MaterialCollection::GetClientDoc() - // --------------------------------------------------------------------------- - // ! ClientDocument* ! MaterialCollection::GetClientDoc() { return _layout->GetClientDoc(); } - // --------------------------------------------------------------------------- - // void MaterialCollection::InitMaterialCollectionFields() - // --------------------------------------------------------------------------- - // ! void ! MaterialCollection::InitMaterialCollectionFields() { ViewClass* vc3 = ViewClass::GetViewClass(kPaletteCID); --- 115,222 ---- } SetModified(); + _needsSort = true; POSTCONDITION(found); } ! // --------------------------------------------------------------------------- ! /// SetName ! /// Set the name of the layer, which is used in order to present the list of layers to be enabled or disabled. ! // ! void MaterialCollection::SetName( wchar_t * name ) { _name = name; SetModified(); } ! // --------------------------------------------------------------------------- ! /// GetName ! /// Return the name of the layer as a wide character. ! // ! String MaterialCollection::GetName() { return(_name.w_str()); } ! // --------------------------------------------------------------------------- ! /// GetNamePStr ! /// Returns a representation of the name as a PStr into nameBuf. ! // ! void MaterialCollection::GetNamePStr( Str255& nameBuf ) { _name.ToStr255(nameBuf); } ! // --------------------------------------------------------------------------- ! /// GetNumMaterials ! /// Returns the number of elements in the layer ! // ! Int32 MaterialCollection::GetNumMaterials() { return(_items.Length()); } ! // --------------------------------------------------------------------------- ! /// GetIndexedMaterial ! /// Returns the element given by the index. Elements are numbered from one to the number of elements, inclusive. ! // ! Material* MaterialCollection::GetIndexedMaterial( Int32 index ) { Material *itemPtr; PRECONDITION(index >= 0); itemPtr = _items[index]; return(itemPtr); } ! // --------------------------------------------------------------------------- ! /// IsModified() ! /// Called externally to see if the layer needs to be saved. The save menu will only be enabled if some layer or preference needs to be saved. ! // ! bool MaterialCollection::IsModified() { return _isModified; } ! // --------------------------------------------------------------------------- ! /// SetLayout ! /// Sets the layout class which owns this layer. ! // ! void MaterialCollection::SetLayout( Layout* layout ) { _layout = layout; } ! // --------------------------------------------------------------------------- ! /// SetModified ! // ! void MaterialCollection::SetModified() { _layout->SetModified(); _isModified = true; } ! // --------------------------------------------------------------------------- ! /// GetClientDoc() ! // ! ClientDocument* MaterialCollection::GetClientDoc() { return _layout->GetClientDoc(); } ! // --------------------------------------------------------------------------- ! /// InitMaterialCollectionFields ! // ! void MaterialCollection::InitMaterialCollectionFields() { ViewClass* vc3 = ViewClass::GetViewClass(kPaletteCID); *************** *** 305,364 **** vc3->AddProperty(kFieldMatCollectItems, "MatCollectItems", kIndexedField); } - // --------------------------------------------------------------------------- - // void MaterialCollection::FixCollection() - // --------------------------------------------------------------------------- - // - - - void - MaterialCollection::FixCollection() - { - #if 0 - UInt32 n, numMaterials, vindex, numVariants; - materialID_t testID; - Variant *var; - Material *mat; - string debug; - XGUUID nilID; - - return; - - // Look for nil variants, and see if we can make one of the variants fit uniquely - numMaterials = GetNumMaterials(); - for(n = 0; n < numMaterials; n++) - { - GetIndexedItemMaterialID(kFieldMatCollectItems, n, testID); - if(testID.variant == nilID) - { - mat = Material::LookupUID(GetFile(), testID.species); - numVariants = mat->NumVariants(); - for(vindex = 0; vindex < numVariants; vindex++) - { - var = mat->GetIndexedVariant(vindex); - var->GetVariantID(testID.variant); - var->GetName(debug); - if(!IsMaterialIDInSet(testID)) - { - RemoveIndexedItem(kFieldMatCollectItems, n); - AddItemMaterialID(kFieldMatCollectItems, testID); - SetModified(); - n--; // SInce we deleted a row, next item will be same index - break; - } - } - } - } - #endif - } - // --------------------------------------------------------------------------- - // bool MaterialCollection::IsMaterialIDInSet( materialID_t materialID ) // --------------------------------------------------------------------------- // ! ! ! bool ! MaterialCollection::IsMaterialIDInSet( materialID_t materialID ) { UInt32 n, numMaterials; --- 224,233 ---- vc3->AddProperty(kFieldMatCollectItems, "MatCollectItems", kIndexedField); } // --------------------------------------------------------------------------- + /// IsMaterialIDInSet // ! bool MaterialCollection::IsMaterialIDInSet( materialID_t materialID ) { UInt32 n, numMaterials; *************** *** 384,395 **** return result; } - // --------------------------------------------------------------------------- - // void MaterialCollection::ChangeMaterialID( materialID_t oldID, materialID_t newID ) - // --------------------------------------------------------------------------- - // ! void ! MaterialCollection::ChangeMaterialID( materialID_t oldID, materialID_t newID ) { #if FIX_XML --- 253,262 ---- return result; } ! // --------------------------------------------------------------------------- ! /// ChangeMaterialID ! // ! void MaterialCollection::ChangeMaterialID( materialID_t oldID, materialID_t newID ) { #if FIX_XML *************** *** 415,416 **** --- 282,383 ---- #endif } + + // --------------------------------------------------------------------------- + /// ParseXML + // + void MaterialCollection::ParseXML(XGXMLObject *obj) + { + XGXMLData *dataObj, *subData; + XGXMLObject *subObj, *itemObj; + XGXMLStringData *stringData; + Material *mat; + Variant *var; + SourceMaterialFile *sourceDB = SourceMaterialFile::GetSourceDatabase(); + const char *val; + bool found; + + PRECONDITION(this != NULL); + PRECONDITION(obj != NULL); + dataObj = dynamic_cast<XGXMLData*>(obj); + PRECONDITION(strcmp(dataObj->GetTag(), "Palette") == 0); + val = dataObj->GetArgValue("Name"); + + _name.SetCString(val); + + subObj = dataObj->GetChild(); + while(subObj != NULL) + { + subData = dynamic_cast<XGXMLData*>(subObj); + itemObj = subData->GetChild(); + stringData = dynamic_cast<XGXMLStringData*>(itemObj); + + if(stringData != NULL) + { + String full, species, variety; + const char *varietyPtr; + + full.SetCString(stringData->GetValue()); + Material::SplitSpeciesVariant(full, species, variety); + + varietyPtr = variety.empty() ? NULL : variety.c_str(); + found = sourceDB->LocateVariantByName(species.c_str(), kFieldCanonicalName, varietyPtr, &mat, &var); + if(!found) + found = sourceDB->LocateVariantByName(species.c_str(), kFieldCommonName, varietyPtr, &mat, &var); + if(found) + { + if(mat != NULL) + { + if(var != NULL) + mat->SetVariant(var); + AddMaterial(mat); + } + } + } + + subObj = subObj->GetSibling(); + } + _needsSort = true; + } + + //elem.name = material->GetDisplayName(kUsePreferencesSetting); + + // --------------------------------------------------------------------------- + /// SortByName + // + void MaterialCollection::SortByName(namePreference_t namePref) + { + UInt32 numItems; + Material *intermediate; + bool NoSwaps; + + if(_needsSort || _sortType != namePref) + { + // I know I know, but for a small number of items which should be already + // be sorted or nearly sorted, this should be enough. + numItems = _items.Length(); + for (unsigned int i = 0; i < (numItems - 1); ++i) + { + NoSwaps = true; // Checks to see if any swaps happened + + for (unsigned int j = 1; j < (numItems - i); ++j) + { + if (_items[j - 1]->GetDisplayName(namePref) > _items[j]->GetDisplayName(namePref)) + { + intermediate = _items[j-1]; + _items[j-1] = _items[j]; + _items[j] = intermediate; + + // There was a swap, so set the flag false + if (NoSwaps) + NoSwaps = false; + } + } + + // If the sort didn't do anything (i.e. if the array is + // sorted), then stop the algorithm. + if (NoSwaps) + break; + } + _needsSort = false; + } + } Index: MaterialCollection.h =================================================================== RCS file: /cvsroot/igarden/Garden/source/LayoutDB/MaterialCollection.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** MaterialCollection.h 13 Jan 2006 22:48:43 -0000 1.5 --- MaterialCollection.h 26 Nov 2006 01:22:52 -0000 1.5.2.1 *************** *** 19,23 **** #define __MaterialCollection ! #include "Persist.h" class Layout; --- 19,23 ---- #define __MaterialCollection ! #include "Material.h" class Layout; *************** *** 31,44 **** using yaaf::XGDynArray; - typedef struct - { - UInt32 dbIndex; - String name; - } MaterialElem_t; - class MaterialCollection { public: - void SortByName(); // methods MaterialCollection(DatabaseFile* file, Layout* layout, UInt32 nd = 0); --- 31,37 ---- *************** *** 52,56 **** void RemoveMaterial(Material * item); void SetName(wchar_t * name); ! const wchar_t* GetName(); void GetNamePStr(Str255& nameBuf); Int32 GetNumMaterials(); --- 45,49 ---- void RemoveMaterial(Material * item); void SetName(wchar_t * name); ! String GetName(); void GetNamePStr(Str255& nameBuf); Int32 GetNumMaterials(); *************** *** 60,66 **** ClientDocument* GetClientDoc(); static void InitMaterialCollectionFields(); - void FixCollection(); bool IsMaterialIDInSet(materialID_t materialID); void ChangeMaterialID(materialID_t oldID, materialID_t newID); protected: --- 53,61 ---- ClientDocument* GetClientDoc(); static void InitMaterialCollectionFields(); bool IsMaterialIDInSet(materialID_t materialID); void ChangeMaterialID(materialID_t oldID, materialID_t newID); + void SortByName(namePreference_t namePref); + + void ParseXML(XGXMLObject *obj); protected: *************** *** 70,80 **** private: - #pragma warn_hidevirtual off - bool _fixed; - XGDynArray<MaterialElem_t> _cache; - void ReloadCache(); // methods // attributes bool _isModified; Layout* _layout; --- 65,74 ---- private: // methods // attributes + bool _needsSort; + namePreference_t _sortType; + bool _isModified; Layout* _layout; |