Changeset 702

Show
Ignore:
Timestamp:
08/10/07 17:25:04 (16 months ago)
Author:
leo
Message:

Fixed used pieces dialog.

Location:
trunk
Files:
16 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/lc_flexpiece.cpp

    r700 r702  
    77#include "lc_colors.h" 
    88#include "pieceinf.h" 
     9#include "typedefs.h" 
    910 
    1011lcFlexiblePiece::lcFlexiblePiece(PieceInfo* Info) 
     
    7879    if (m_PieceInfo) 
    7980        m_PieceInfo->DeRef(); 
     81} 
     82 
     83void lcFlexiblePiece::GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const 
     84{ 
     85    LC_PIECELIST_ENTRY Entry; 
     86 
     87    Entry.Info = m_PieceInfo; 
     88    Entry.Color = (m_Color == LC_COLOR_DEFAULT) ? Color : m_Color; 
     89 
     90    Pieces.Add(Entry); 
    8091} 
    8192 
  • trunk/common/lc_flexpiece.h

    r693 r702  
    1414 
    1515    // Base class implementation. 
     16    virtual void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const; 
    1617    virtual void ClosestRayIntersect(LC_CLICK_RAY* Ray) const; 
    1718    virtual bool IntersectsVolume(const Vector4* Planes, int NumPlanes) const; 
  • trunk/common/lc_model.cpp

    r688 r702  
    6060 
    6161    return false; 
     62} 
     63 
     64void lcModel::GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const 
     65{ 
     66    for (lcPieceObject* Piece = m_Pieces; Piece; Piece = (lcPieceObject*)Piece->m_Next) 
     67        Piece->GetPieceList(Pieces, Color); 
    6268} 
    6369 
  • trunk/common/lc_model.h

    r688 r702  
    55#include "config.h" 
    66#include "algebra.h" 
     7#include "array.h" 
    78 
    89class lcObject; 
     
    2122    // Check if a given model is referenced by this model. 
    2223    bool IsSubModel(const lcModel* Model) const; 
     24 
     25    // Get a list of all actual pieces used by this model. 
     26    void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const; 
    2327 
    2428    // Tell this model it's now the active model or no longer active. 
  • trunk/common/lc_modelref.cpp

    r700 r702  
    2525lcModelRef::~lcModelRef() 
    2626{ 
     27} 
     28 
     29void lcModelRef::GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const 
     30{ 
     31    m_Model->GetPieceList(Pieces, Color); 
    2732} 
    2833 
  • trunk/common/lc_modelref.h

    r700 r702  
    1414 
    1515    // Base class implementation. 
     16    virtual void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const; 
    1617    virtual void ClosestRayIntersect(LC_CLICK_RAY* Ray) const; 
    1718    virtual bool IntersectsVolume(const Vector4* Planes, int NumPlanes) const; 
  • trunk/common/lc_piece.cpp

    r700 r702  
    88#include "texture.h" 
    99#include "lc_colors.h" 
     10#include "typedefs.h" 
    1011 
    1112lcPiece::lcPiece(PieceInfo* Info) 
     
    4546        BuildMesh(); 
    4647    } 
     48} 
     49 
     50void lcPiece::GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const 
     51{ 
     52    LC_PIECELIST_ENTRY Entry; 
     53 
     54    Entry.Info = m_PieceInfo; 
     55    Entry.Color = (m_Color == LC_COLOR_DEFAULT) ? Color : m_Color; 
     56 
     57    Pieces.Add(Entry); 
    4758} 
    4859 
  • trunk/common/lc_piece.h

    r700 r702  
    1919 
    2020    // Base class implementation. 
     21    virtual void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const; 
    2122    virtual void ClosestRayIntersect(LC_CLICK_RAY* Ray) const; 
    2223    virtual bool IntersectsVolume(const Vector4* Planes, int NumPlanes) const; 
  • trunk/common/lc_pieceobj.h

    r691 r702  
    2626    // Merges this object's bounding box with another box. 
    2727    void MergeBoundingBox(BoundingBox* Box); 
     28 
     29    // Get a list of all actual pieces used by this piece. 
     30    virtual void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const = 0; 
    2831 
    2932    // Export this object to an LDraw file. 
  • trunk/common/lc_pivot.cpp

    r700 r702  
    1515 
    1616lcPivot::~lcPivot() 
     17{ 
     18    // fixme: lcPivot 
     19} 
     20 
     21void lcPivot::GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const 
    1722{ 
    1823    // fixme: lcPivot 
  • trunk/common/lc_pivot.h

    r681 r702  
    1111 
    1212    // Base class implementation. 
     13    virtual void GetPieceList(ObjArray<struct LC_PIECELIST_ENTRY>& Pieces, int Color) const; 
    1314    virtual void ClosestRayIntersect(LC_CLICK_RAY* Ray) const; 
    1415    virtual bool IntersectsVolume(const Vector4* Planes, int NumPlanes) const; 
  • trunk/common/project.cpp

    r700 r702  
    42594259            opts.Name = Name; 
    42604260            opts.Author = Sys_ProfileLoadString("Default", "User", ""); 
    4261             opts.lines = 0; 
    4262             opts.count = NULL; 
    4263             opts.names = NULL; 
     4261            opts.PiecesUsed = NULL; 
    42644262 
    42654263            if (SystemDoDialog(LC_DLG_PROPERTIES, &opts)) 
     
    43374335        case LC_MODEL_PROPERTIES: 
    43384336        { 
    4339 /* FIXME: model properties 
    43404337            LC_PROPERTIESDLG_OPTS opts; 
    43414338 
     
    43464343            opts.Comments = m_ActiveModel->m_Comments; 
    43474344 
    4348             // Piece list. 
    4349             opts.lines = lcGetPiecesLibrary()->GetPieceCount(); 
    4350             opts.count = (unsigned short*)malloc(lcGetPiecesLibrary()->GetPieceCount()*LC_MAXCOLORS*sizeof(unsigned short)); 
    4351             memset (opts.count, 0, lcGetPiecesLibrary()->GetPieceCount()*LC_MAXCOLORS*sizeof(unsigned short)); 
    4352             opts.names = (char**)malloc(lcGetPiecesLibrary()->GetPieceCount()*sizeof(char*)); 
    4353             for (int i = 0; i < lcGetPiecesLibrary()->GetPieceCount(); i++) 
    4354                 opts.names[i] = lcGetPiecesLibrary()->GetPieceInfo (i)->m_strDescription; 
    4355  
    4356             for (Piece* pPiece = m_ActiveModel->m_Pieces; pPiece; pPiece = (Piece*)pPiece->m_Next) 
    4357             { 
    4358                 int idx = lcGetPiecesLibrary()->GetPieceIndex (pPiece->GetPieceInfo ()); 
    4359                 opts.count[idx*LC_MAXCOLORS+pPiece->GetColor()]++; 
     4345            // Pieces list. 
     4346            PiecesLibrary* Lib = lcGetPiecesLibrary(); 
     4347            int NumPieces = Lib->GetPieceCount() * lcNumUserColors; 
     4348            opts.PiecesUsed = new int[NumPieces]; 
     4349            memset(opts.PiecesUsed, 0, NumPieces * sizeof(int)); 
     4350 
     4351            ObjArray<LC_PIECELIST_ENTRY> Pieces; 
     4352            m_ActiveModel->GetPieceList(Pieces, LC_COLOR_DEFAULT); 
     4353 
     4354            for (int i = 0; i < Pieces.GetSize(); i++) 
     4355            { 
     4356                int Index = Lib->GetPieceIndex(Pieces[i].Info) * lcNumUserColors + Pieces[i].Color; 
     4357                opts.PiecesUsed[Index]++; 
    43604358            } 
    43614359 
     
    43744372            } 
    43754373 
    4376             free(opts.count); 
    4377             free(opts.names); 
    4378 */ 
     4374            delete[] opts.PiecesUsed; 
    43794375        } break; 
    43804376 
  • trunk/common/typedefs.h

    r680 r702  
    202202} LC_CURSOR_TYPE; 
    203203 
    204 // Piece connections (complicated and wastes memory but fast). 
    205  
     204struct LC_PIECELIST_ENTRY 
     205{ 
     206    PieceInfo* Info; 
     207    int Color; 
     208}; 
     209 
     210// Piece connections. 
    206211struct CONNECTION 
    207212{ 
     
    227232 
    228233// Select by Name dialog data 
    229  
    230234typedef enum 
    231235{ 
     
    418422    String Description; 
    419423    String Comments; 
    420     char** names; 
    421     unsigned short* count; 
    422     int lines; 
     424    int* PiecesUsed; 
    423425}; 
    424426 
  • trunk/win/Propspgs.cpp

    r700 r702  
    66#include "PropsPgs.h" 
    77#include "defines.h" 
     8#include "lc_colors.h" 
     9#include "library.h" 
     10#include "lc_application.h" 
     11#include "pieceinf.h" 
    812 
    913#ifdef _DEBUG 
     
    6468        // NOTE: the ClassWizard will add member initialization here 
    6569    //}}AFX_DATA_INIT 
     70 
     71    m_ColorColumn = new int[lcNumUserColors]; 
    6672} 
    6773 
    6874CPropertiesPieces::~CPropertiesPieces() 
    6975{ 
     76    delete[] m_ColorColumn; 
    7077} 
    7178 
     
    7784    //}}AFX_DATA_MAP 
    7885} 
    79  
    8086 
    8187BEGIN_MESSAGE_MAP(CPropertiesPieces, CPropertyPage) 
     
    8591END_MESSAGE_MAP() 
    8692 
    87  
    88 BOOL CPropertiesPieces::OnInitDialog()  
    89 { 
    90     CPropertyPage::OnInitDialog(); 
    91 /* FIXME: model pieces 
    92     char tmp[64]; 
    93     int i, j; 
    94     memset (&totalcount, 0, sizeof (totalcount)); 
    95     for (i = 0; i < lines; i++) 
    96         for (j = 0; j < LC_MAXCOLORS; j++) 
    97             totalcount[j] += count[i*LC_MAXCOLORS+j]; 
    98  
    99     int ID = 0; 
    100     m_List.InsertColumn(0, "Piece", LVCFMT_LEFT, 130, 0); 
    101     for (i = 0; i < LC_MAXCOLORS; i++) 
    102         if (totalcount[i]) 
     93static int CALLBACK ListViewCompareProc(LPARAM lP1, LPARAM lP2, LPARAM lParamData) 
     94{ 
     95    CPropertiesPieces* Dlg = (CPropertiesPieces*)lParamData; 
     96    int* Line1 = (int*)lP1; 
     97    int* Line2 = (int*)lP2; 
     98 
     99    // Keep the total row at the bottom of the list. 
     100    if (lP1 == -1) 
     101        return 1; 
     102    else if (lP2 == -1) 
     103        return -1; 
     104 
     105    if (Dlg->m_SortColumn != 0) 
     106    { 
     107        int Num1, Num2; 
     108 
     109        if (Dlg->m_SortColumn == Dlg->m_List.GetHeaderCtrl()->GetItemCount() - 1) 
    103110        { 
    104             col[i] = ID; 
    105             ID++; 
    106  
    107             CString str; 
    108             str.LoadString(IDS_COLOR01 + i); 
    109             m_List.InsertColumn(ID, (LPCSTR)str, LVCFMT_LEFT, 80, 0); 
     111            Num1 = 0; 
     112            Num2 = 0; 
     113 
     114            for (int i = 0; i < lcNumUserColors; i++) 
     115            { 
     116                Num1 += Line1[i]; 
     117                Num2 += Line2[i]; 
     118            } 
    110119        } 
    111120        else 
    112             col[i] = -1; 
    113     ID++; 
    114     m_List.InsertColumn(ID, "Total", LVCFMT_LEFT, 60, 0); 
    115  
    116     for (i = 0; i < lines; i++) 
    117     { 
    118         int total = 0; 
    119  
    120         for (j = 0; j < LC_MAXCOLORS; j++) 
    121             total += count[i*LC_MAXCOLORS+j]; 
    122  
    123         if (total == 0) 
     121        { 
     122            int i; 
     123 
     124            for (i = 0; i < lcNumUserColors; i++) 
     125                if (Dlg->m_ColorColumn[i] == Dlg->m_SortColumn) 
     126                    break; 
     127 
     128            Num1 = Line1[i]; 
     129            Num2 = Line2[i]; 
     130        } 
     131 
     132        if (Num1 < Num2) 
     133            return Dlg->m_SortAscending ? 1 : -1; 
     134        else if (Num1 > Num2) 
     135            return Dlg->m_SortAscending ? -1 : 1; 
     136        else 
     137            return 0; 
     138    } 
     139 
     140    int Index1 = (Line1 - Dlg->m_PiecesUsed) / lcNumUserColors; 
     141    int Index2 = (Line2 - Dlg->m_PiecesUsed) / lcNumUserColors; 
     142 
     143    PiecesLibrary* Lib = lcGetPiecesLibrary(); 
     144    PieceInfo* Info1 = Lib->GetPieceInfo(Index1); 
     145    PieceInfo* Info2 = Lib->GetPieceInfo(Index2); 
     146 
     147    if (Dlg->m_SortAscending) 
     148        return _strcmpi(Info1->m_strDescription, Info2->m_strDescription); 
     149    else 
     150        return - _strcmpi(Info1->m_strDescription, Info2->m_strDescription); 
     151} 
     152 
     153BOOL CPropertiesPieces::OnInitDialog()  
     154{ 
     155    CPropertyPage::OnInitDialog(); 
     156 
     157    int* ColorTotal = new int[lcNumUserColors]; 
     158    memset(ColorTotal, 0, lcNumUserColors * sizeof(int)); 
     159    memset(m_ColorColumn, 0, lcNumUserColors * sizeof(int)); 
     160    int i, j; 
     161 
     162    PiecesLibrary* Lib = lcGetPiecesLibrary(); 
     163 
     164    // Count the number of pieces used for each color. 
     165    for (i = 0; i < Lib->GetPieceCount(); i++) 
     166        for (j = 0; j < lcNumUserColors; j++) 
     167            ColorTotal[j] += m_PiecesUsed[j + i * lcNumUserColors]; 
     168 
     169    // Add columns to the list header. 
     170    m_List.InsertColumn(0, "Piece", LVCFMT_LEFT, 130, 0); 
     171 
     172    int Column = 1; 
     173 
     174    for (i = 0; i < lcNumUserColors; i++) 
     175    { 
     176        if (!ColorTotal[i]) 
    124177            continue; 
    125178 
    126         char name[65]; 
     179        m_ColorColumn[i] = Column; 
     180        m_List.InsertColumn(Column, lcColorList[i].Name, LVCFMT_LEFT, 80, 0); 
     181        Column++; 
     182    } 
     183 
     184    m_List.InsertColumn(Column, "Total", LVCFMT_LEFT, 60, 0); 
     185 
     186    m_List.SetRedraw(FALSE); 
     187 
     188    // Add pieces to the list. 
     189    for (i = 0; i < Lib->GetPieceCount(); i++) 
     190    { 
     191        int* Line = m_PiecesUsed + i * lcNumUserColors; 
     192        int LineTotal = 0; 
     193 
     194        for (j = 0; j < lcNumUserColors; j++) 
     195            LineTotal += Line[j]; 
     196 
     197        if (!LineTotal) 
     198            continue; 
     199 
     200        char name[256], tmp[256]; 
    127201        LV_ITEM lvi; 
    128202        lvi.mask = LVIF_TEXT|LVIF_PARAM; 
     
    130204        lvi.iSubItem = 0; 
    131205        lvi.pszText = name; 
    132         lvi.lParam = i; 
    133         strcpy (name, names[i]); 
     206        lvi.lParam = (LPARAM)Line; 
     207        strcpy(name, Lib->GetPieceInfo(i)->m_strDescription); 
     208 
    134209        int idx = m_List.InsertItem(&lvi); 
    135210 
    136         for (j = 0; j < LC_MAXCOLORS; j++) 
    137 //          if (totalcount[j]) 
    138             if (count[i*LC_MAXCOLORS+j]) 
    139             { 
    140                 sprintf (tmp, "%d", count[i*LC_MAXCOLORS+j]); 
    141                 lvi.iItem = idx; 
    142                 lvi.pszText = tmp; 
    143                 m_List.SetItemText(idx, col[j] + 1, tmp); 
    144             } 
    145  
    146         sprintf (tmp, "%d", total); 
    147         lvi.iItem = idx; 
    148         lvi.pszText = tmp; 
    149         m_List.SetItemText(idx, ID, tmp); 
    150     } 
    151  
    152     m_List.ModifyStyle(LVS_SORTASCENDING | LVS_SORTDESCENDING, 0L); 
    153  
    154     char name[65]; 
     211        for (j = 0; j < lcNumUserColors; j++) 
     212        { 
     213            if (!Line[j]) 
     214                continue; 
     215 
     216            sprintf(tmp, "%d", Line[j]); 
     217            m_List.SetItemText(idx, m_ColorColumn[j], tmp); 
     218        } 
     219 
     220        sprintf (tmp, "%d", LineTotal); 
     221        m_List.SetItemText(idx, Column, tmp); 
     222    } 
     223 
     224    // Add totals. 
     225    char name[256], tmp[256]; 
    155226    strcpy (name, "Total"); 
    156227    LV_ITEM lvi; 
     
    160231    lvi.pszText = name; 
    161232    lvi.lParam = -1; 
     233 
    162234    int idx = m_List.InsertItem(&lvi), total = 0; 
    163  
    164     for (i = 0; i < LC_MAXCOLORS; i++) 
    165         if (totalcount[i]) 
    166         { 
    167             sprintf (tmp, "%d", totalcount[i]); 
    168             lvi.iItem = idx; 
    169             lvi.pszText = tmp; 
    170             m_List.SetItemText(idx, col[i] + 1, tmp); 
    171             total += totalcount[i]; 
    172         } 
    173  
    174     sprintf (tmp, "%d", total); 
    175     lvi.iItem = idx; 
    176     lvi.pszText = tmp; 
    177     m_List.SetItemText(idx, ID, tmp); 
    178 */ 
     235    int Total = 0; 
     236 
     237    for (i = 0; i < lcNumUserColors; i++) 
     238    { 
     239        if (!ColorTotal[i]) 
     240            continue; 
     241 
     242        Total += ColorTotal[i]; 
     243 
     244        sprintf (tmp, "%d", ColorTotal[i]); 
     245        m_List.SetItemText(idx, m_ColorColumn[i], tmp); 
     246    } 
     247 
     248    sprintf (tmp, "%d", Total); 
     249    m_List.SetItemText(idx, Column, tmp); 
     250 
     251    delete[] ColorTotal; 
     252 
     253    m_SortColumn = 0; 
     254    m_SortAscending = true; 
     255 
     256    m_List.SortItems((PFNLVCOMPARE)ListViewCompareProc, (LPARAM)this); 
     257 
     258    m_List.SetRedraw(TRUE); 
     259    m_List.Invalidate(); 
     260 
    179261    return TRUE; 
    180262} 
    181263 
    182 struct COMPARE_DATA 
    183 { 
    184     CPropertiesPieces* page; 
    185     int color; 
    186 }; 
    187  
    188 static int CALLBACK ListViewCompareProc(LPARAM lP1, LPARAM lP2, LPARAM lParamData) 
    189 { 
    190     /* FIXME: model pieces 
    191     int i, a, b; 
    192     COMPARE_DATA* data = (COMPARE_DATA*)lParamData; 
    193  
    194     if (data->color == -1) 
    195     { 
    196         // check if we're comparing the "total" row 
    197         if (lP1 == -1) 
    198             return 1; 
    199         else if (lP2 == -1) 
    200             return -1; 
    201  
    202         return _strcmpi(data->page->names[lP1], data->page->names[lP2]); 
    203     } 
    204  
    205     // last column 
    206     if (data->color == LC_MAXCOLORS) 
    207     { 
    208         a = b = 0; 
    209         for (i = 0; i < LC_MAXCOLORS; i++) 
    210         { 
    211             a += data->page->count[lP1*LC_MAXCOLORS+i]; 
    212             b += data->page->count[lP2*LC_MAXCOLORS+i]; 
    213         } 
    214     } 
     264void CPropertiesPieces::OnColumnclickPropPiecesList(NMHDR* pNMHDR, LRESULT* pResult)  
     265{ 
     266    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; 
     267 
     268    if (m_SortColumn == pNMListView->iSubItem) 
     269        m_SortAscending = !m_SortAscending; 
    215270    else 
    216     { 
    217         if (lP1 == -1) 
    218             a = data->page->totalcount[data->color]; 
    219         else 
    220             a = data->page->count[lP1*LC_MAXCOLORS+data->color]; 
    221          
    222         if (lP2 == -1) 
    223             b = data->page->totalcount[data->color]; 
    224         else 
    225             b = data->page->count[lP2*LC_MAXCOLORS+data->color]; 
    226     } 
    227  
    228     if (a == b) 
    229         return 0; 
    230  
    231     if (a < b) 
    232         return -1; 
    233     else 
    234         return 1; 
    235 */ 
    236 } 
    237  
    238 void CPropertiesPieces::OnColumnclickPropPiecesList(NMHDR* pNMHDR, LRESULT* pResult)  
    239 { 
    240     /* FIXME: model pieces 
    241     int i; 
    242     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; 
    243     COMPARE_DATA data; 
    244  
    245     data.page = this; 
    246  
    247     if (pNMListView->iSubItem == 0) 
    248         data.color = -1; 
    249     else 
    250     { 
    251         for (i = 0; i < LC_MAXCOLORS; i++) 
    252             if (col[i] == pNMListView->iSubItem-1) 
    253                 break; 
    254  
    255         data.color = i; 
    256     } 
    257  
    258     m_List.SortItems((PFNLVCOMPARE)ListViewCompareProc, (LPARAM)&data); 
     271        m_SortColumn = pNMListView->iSubItem; 
     272 
     273    m_List.SetRedraw(FALSE); 
     274 
     275    m_List.SortItems((PFNLVCOMPARE)ListViewCompareProc, (LPARAM)this); 
     276 
     277    m_List.SetRedraw(TRUE); 
     278    m_List.Invalidate(); 
    259279 
    260280    *pResult = 0; 
    261     */ 
    262 } 
     281} 
  • trunk/win/Propspgs.h

    r700 r702  
    1 // PropsPgs.h : header file 
    2 // 
    3  
    4 #ifndef __PROPSPGS_H__ 
    5 #define __PROPSPGS_H__ 
     1#ifndef _PROPSPGS_H_ 
     2#define _PROPSPGS_H_ 
    63 
    74#include "defines.h" 
     
    4542}; 
    4643 
    47  
    4844///////////////////////////////////////////////////////////////////////////// 
    4945// CPropertiesPieces dialog 
     
    5753    CPropertiesPieces(); 
    5854    ~CPropertiesPieces(); 
    59     char** names; 
    60     unsigned short* count; 
    61     int lines; 
    62 //  int col[LC_MAXCOLORS]; 
    63 //  int totalcount[LC_MAXCOLORS]; 
    6455 
    6556// Dialog Data 
     
    6960    //}}AFX_DATA 
    7061 
     62    int* m_PiecesUsed; 
     63    int* m_ColorColumn; 
     64    int m_SortColumn; 
     65    bool m_SortAscending; 
    7166 
    7267// Overrides 
     
    8580    //}}AFX_MSG 
    8681    DECLARE_MESSAGE_MAP() 
    87  
    8882}; 
    8983 
    90  
    91  
    92 #endif // __PROPSPGS_H__ 
     84#endif // _PROPSPGS_H_ 
  • trunk/win/System.cpp

    r680 r702  
    16021602        { 
    16031603            LC_PROPERTIESDLG_OPTS* opts = (LC_PROPERTIESDLG_OPTS*)param; 
    1604             CPropertiesSheet ps(opts->names && opts->count); 
     1604            CPropertiesSheet ps(opts->PiecesUsed != NULL); 
    16051605 
    16061606            ps.SetTitle("Model Properties", 0);