/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "OdaCommon.h" #include "DbDatabase.h" #include "TraceStorage/OdTraceRuntime.h" #include "DwgViewer.h" #include "MaterialsEditor.h" #ifndef MECHANICAL_MODE struct OdTracesUsersEx { struct OdUserData { OdUserData() = default; OdUserData(const OdTraceCollaborator& collab) { m_firstName = collab.getFirstName(); m_lastName = collab.getLastName(); m_userName = collab.getUserName(); m_oxygenId = collab.getOxygenId(); } OdString m_firstName; OdString m_lastName; OdString m_userName; OdString m_oxygenId; }; OdTracesUsersEx() = default; void add(const OdArray& traces) { for (const auto& i : traces) { OdUserData user(i); if (!m_users.contains(user)) m_users.append(user); } } void add(const OdUserData& user) { if (!m_users.contains(user)) m_users.append(user); } OdArray m_users; int m_currentUser = -1; }; bool operator==(const OdTracesUsersEx::OdUserData& lhs, const OdTracesUsersEx::OdUserData& rhs); class CTraceTabCollab : public CDialog { DECLARE_DYNAMIC(CTraceTabCollab) public: CTraceTabCollab(CWnd* pParent = nullptr); // standard constructor virtual ~CTraceTabCollab(); // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_TRACE_TAB_COLLAB }; #endif CListCtrl m_listCollaborators; CTracesViewDlg* m_owner; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: afx_msg void OnNMDblclkListTraceCollaborators(NMHDR* pNMHDR, LRESULT* pResult); }; class CTraceTabUsers : public CDialog { DECLARE_DYNAMIC(CTraceTabUsers) public: CTraceTabUsers(CWnd* pParent = nullptr); // standard constructor virtual ~CTraceTabUsers(); // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_TRACE_TAB_USERS }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: void fillUsers(); void setSelectedUser(); OdTracesUsersEx m_tracesUsers; CListCtrl m_listTraceUsers; afx_msg void OnNMDblclkListTraceUsers(NMHDR* pNMHDR, LRESULT* pResult); OdDbDatabase* m_pDb; afx_msg void OnNMClickListTraceUsers(NMHDR* pNMHDR, LRESULT* pResult); }; /* * * * // TracesView dialog * * */ class CTracesViewDlg : public CDialog { DECLARE_DYNAMIC(CTracesViewDlg) public: CTracesViewDlg(CWnd* pParent = nullptr); // standard constructor virtual ~CTracesViewDlg(); void resetData(); // Dialog Data #ifdef AFX_DESIGN_TIME enum { IDD = IDD_TRACES_VIEW }; #endif OdDbDatabase* m_pDb = nullptr; CDwgViewer* m_pDwgViewer = nullptr; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support BOOL OnInitDialog(); void addOdaDefaultUser(); void forceRegenView(); void updateTraceListView(); void fillCollaboratorsList(); void changeButtonStateOnOpenTrace(const bool updateCollaboratos = true); void changeButtonStateOnCloseTrace(const OdResult eRes, const int selectedRow = 0); CTabCtrl m_tabCtrl; CTraceTabCollab m_tabCollab; CTraceTabUsers m_tabUsers; CListCtrl m_listTraces; CButton m_openButton; CButton m_closeButton; CButton m_newTraceButton; CButton m_radioTraceFront; CButton m_radioTraceBack; OdArray m_traceInfoArr; int m_openedTraceRowIndex; DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedOpen(); afx_msg void OnBnClickedClose(); afx_msg void OnNMClickListTrace(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); afx_msg void OnBnClickedRadioTraceFront(); afx_msg void OnBnClickedRadioTraceBack(); afx_msg void OnBnClickedNewTrace(); afx_msg void OnTcnSelchangeTraceTab(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnBnClickedRenameTrace(); afx_msg void OnBnClickedRemoveTarce(); friend class CTraceTabCollab; }; #endif