/////////////////////////////////////////////////////////////////////////////// // 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. /////////////////////////////////////////////////////////////////////////////// #ifndef __TNW_DATABASE_WRITE_TRANSACTION_H__ #define __TNW_DATABASE_WRITE_TRANSACTION_H__ #include "SharedPtr.h" #include "NwExport.h" #include "OdResult.h" #include "RxObject.h" #include "SmartPtr.h" #include "NwSavedItemsElementType.h" class OdNwObjectId; class OdNwGridSystemElement; /** \details This template class is a specialization of the OdSmartPtr class for OdNwGridSystemElement object pointers. */ typedef OdSmartPtr OdNwGridSystemElementPtr; /** \details This class implements the interface for interaction with a database write transaction. The class is deprecated since relaese/26.10. It is unsafe due to an auto-commit pattern that hides errors. */ class NWDBEXPORT OdNwDatabaseWriteTransaction { public: /** \details Adds a new model to the model collection of the database by its source path. \param sourcePath [in] String with the path to the source model to be added to the collection. \param pResCode [out] Receives eOk if the model is added successfully, or an appropriate error code otherwise. \returns ID of the new OdNwModel object in the database if successful, or null pointer otherwise. \remarks This method is applicable for a composite database (NWF) only. The new model is added to the active sheet. The method is deprecated since relaese/26.10. It is unsafe due to an auto-commit pattern that hides errors. */ virtual OdNwObjectId addModel(const OdString& sourcePath, OdResult* pResCode = NULL) = 0; /** \details Virtual destructor. Frees allocated resources. \remarks The database resolving process runs when destructor is called. */ virtual ~OdNwDatabaseWriteTransaction(); /** \details Creates a grid system element. \returns Smart pointer to an OdNwGridSystemElement object. \remarks The method returns a value that corresponds to the sheet selected as active for the database. The method is deprecated since relaese/26.10. It is unsafe due to an auto-commit pattern that hides errors. */ virtual OdNwGridSystemElementPtr createGridSystemElement() = 0; /** \details Creates Selection Sets element. \returns dNwObjectId with an OdNwSelectionSetsElement object. \remarks The method returns a value that corresponds to the sheet, selected as active for the database. The method is deprecated since release 25.0. Use the createSavedItemsElement method with 'NwSavedItemsElementType::kSelectionSets' instead. */ virtual OdNwObjectId createSelectionSetsElement() = 0; /** \details Creates an object ID with the saved items element of the database by selected type. \param siElementType [in] Saved item element type. \param pResCode [out] Receives eOk if the element creating is successfully, or an appropriate error code otherwise. \returns Object ID of the database's object with the OdNwSavedItemsElement derrived class. If creation of new element was not applicaple it will return empty object id. \remarks The method returns a value that corresponds to the sheet, selected as active for the database. If the database does already have a required element it will be replaced by new element. siElementType can be one of the following: Name Value Description NwSavedItemsElementType::kSavedViews 0x00 OdNwSavedViewsElement class object. NwSavedItemsElementType::kClash 0x01 OdNwClashElement class object. NwSavedItemsElementType::kLights 0x02 OdNwLightsElement class object. NwSavedItemsElementType::kSelectionSets 0x03 OdNwSelectionSetsElement class object. NwSavedItemsElementType::kSavedAnimation 0x04 OdNwSavedAnimElement class object. NwSavedItemsElementType::kTimeLiner 0x05 OdNwTimeLinerElement class object.
This method is not applicable for composite databases (NWF files) if type is 'NwSavedItemsElementType::kSavedViews' or 'NwSavedItemsElementType::kSavedAnimation'. The method is deprecated since relaese/26.10. It is unsafe due to an auto-commit pattern that hides errors. */ virtual OdNwObjectId createSavedItemsElement(NwSavedItemsElementType::Enum siElementType, OdResult* pResCode = NULL) = 0; }; /** \details This template class is a specialization of the OdSharedPtr class for OdNwDatabaseWriteTransaction object pointers. */ typedef OdSharedPtr OdNwDatabaseWriteTransactionPtr; #endif