/////////////////////////////////////////////////////////////////////////////// // 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_MATERIAL_UTILS_H_ #define TNW_MATERIAL_UTILS_H_ #include "NwExport.h" #include "RxObject.h" #include "OdResult.h" #include "SmartPtr.h" #include "NwModelUnits.h" class OdString; class OdGeMatrix3d; class OdGiRasterImage; class OdNwGraphicJsonBundle; /** \details This template class is a specialization of the OdSmartPtr class for OdNwGraphicJsonBundle object pointers. */ typedef OdSmartPtr OdNwGraphicJsonBundlePtr; /** \details This template class is a specialization of the OdSmartPtr class for OdGiRasterImage object pointers. */ typedef OdSmartPtr OdGiRasterImagePtr; /** \details Material utils used for creation of texture and work with BimNv materials. */ namespace NwMaterialUtils { /** \details Gets graphic JSON bundle object with generic bundle schema by the external texture data. \param txtPath [in] A string value with the texture path. \param pMappingTransform [in] A pointer to the OdGeMatrix3d object with the texture mapping transformation. \param modelUnits [in] A database model units. \param resCode [out] A result error code. \returns Smart pointer to graphic JSON bundle object. \remarks The texture mapping transformation can contain: x scale value in the [0][0] element, y scale value in the [1][1] element, x offset value in the [0][3] element, y offset value in the [1][3] element. Units must be one of the following: Name Value Description NwModelUnits::UNITS_METERS 0x00 SI meter. Length of the path travelled by light in a vacuum in 1 299,792,458th of second. NwModelUnits::UNITS_CENTIMETERS 0x01 1/100th of an SI meter. NwModelUnits::UNITS_MILLIMETERS 0x02 1/1000th of an SI meter. NwModelUnits::UNITS_FEET 0x03 1/3rd of a yard. NwModelUnits::UNITS_INCHES 0x04 1/12th of a foot, 2.54 SI centimeters. NwModelUnits::UNITS_YARDS 0x05 Imperial yard, 0.9144 SI meters. NwModelUnits::UNITS_KILOMETERS 0x06 1000 SI meters. NwModelUnits::UNITS_MILES 0x07 1760 yards. NwModelUnits::UNITS_MICROMETERS 0x08 1/1,000,000th of an SI meter, micron. NwModelUnits::UNITS_MILS 0x09 1/1,000th of an inch. NwModelUnits::UNITS_MICROINCHES 0x0A 1/1,000,000th of an inch.
*/ NWDBEXPORT OdNwGraphicJsonBundlePtr getDefaultGenericSchemaBundleByExternalTexture(const OdString& txtPath, const OdGeMatrix3d* pMaterialMapping, NwModelUnits::Enum modelUnits, OdResult& resCode); /** \details Gets graphic JSON bundle object with generic bundle schema by the the internal texture data. \param txtPath [in] A string value with the texture path. \param pTxtImage [in] A smart pointer to the OdGiRasterImage object with the texture. \param pMappingTransform [in] A pointer to the OdGeMatrix3d object with the texture mapping transformation. \param modelUnits [in] A database model units. \param resCode [out] A result error code. \returns Smart pointer to graphic JSON bundle object. \remarks The texture mapping transformation can contain: x scale value in the [0][0] element, y scale value in the [1][1] element, x offset value in the [0][3] element, y offset value in the [1][3] element. Units must be one of the following: Name Value Description NwModelUnits::UNITS_METERS 0x00 SI meter. Length of the path travelled by light in a vacuum in 1 299,792,458th of second. NwModelUnits::UNITS_CENTIMETERS 0x01 1/100th of an SI meter. NwModelUnits::UNITS_MILLIMETERS 0x02 1/1000th of an SI meter. NwModelUnits::UNITS_FEET 0x03 1/3rd of a yard. NwModelUnits::UNITS_INCHES 0x04 1/12th of a foot, 2.54 SI centimeters. NwModelUnits::UNITS_YARDS 0x05 Imperial yard, 0.9144 SI meters. NwModelUnits::UNITS_KILOMETERS 0x06 1000 SI meters. NwModelUnits::UNITS_MILES 0x07 1760 yards. NwModelUnits::UNITS_MICROMETERS 0x08 1/1,000,000th of an SI meter, micron. NwModelUnits::UNITS_MILS 0x09 1/1,000th of an inch. NwModelUnits::UNITS_MICROINCHES 0x0A 1/1,000,000th of an inch.
*/ NWDBEXPORT OdNwGraphicJsonBundlePtr getDefaultGenericSchemaBundleByInternalTexture(const OdString& txtPath, OdGiRasterImagePtr pTxtData, const OdGeMatrix3d* pMaterialMapping, NwModelUnits::Enum modelUnits, OdResult& resCode); } #endif // TNW_MATERIAL_UTILS_H_