/////////////////////////////////////////////////////////////////////////////// // 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_TEXTURE_MAPPER_H__ #define __TNW_TEXTURE_MAPPER_H__ #include "NwExport.h" #define STL_USING_MEMORY #include "OdaSTL.h" #include "NwModelUnits.h" #include "OdResult.h" #include "RxObject.h" #include "SmartPtr.h" class OdGeMatrix3d; class OdGiRasterImage; class OdNwTextureMapperImpl; class OdString; class OdGePoint2d; /** \details This struct represents a uv repeat mode of mapper. */ struct NwMapperUVRepeat { /** Vertical tiling. */ bool m_uRepeat = true; /** Horizontal tiling. */ bool m_vRepeat = true; }; /** \details This template class is a specialization of the OdSmartPtr class for OdGiRasterImage object pointers. */ typedef OdSmartPtr OdGiRasterImagePtr; /** \details This class represents a texture mapper. */ class NWDBEXPORT OdNwTextureMapper { public: /** \details Default constructor. */ OdNwTextureMapper(); /** \details Copy constructor. Creates a color from the given OdNwTextureMapper object. */ OdNwTextureMapper(const OdNwTextureMapper&); /** \details Copy assignment operator. \returns A reference to a OdNwTextureMapper object that is the result of the operation. */ OdNwTextureMapper& operator=(const OdNwTextureMapper&); /** \details Move constructor. Creates a color from the given OdNwTextureMapper object. */ OdNwTextureMapper(OdNwTextureMapper&&); /** \details Move assignment operator. \returns A reference to a OdNwTextureMapper object that is the result of the operation. */ OdNwTextureMapper& operator=(OdNwTextureMapper&&); /** \details Destructor. Frees allocated resources. */ ~OdNwTextureMapper(); public: /** \details Gets a string parameter with texture original path. \param pResult [out] Pointer to the OdResult object with an error code. \returns An OdString value with path. */ OdString getPath(OdResult* pRes = NULL) const; /** \details Gets a raster image parameter value with embedding texture data. \param pResult [out] Pointer to the OdResult object with an error code. \returns An OdGiRasterImagePtr value with embedding texture. */ OdGiRasterImagePtr getRasterImage(OdResult* pRes = NULL) const; /** \details Gets a OdGeMatrix3d parameter value with texture mapping transformation. \param desiredUnits [in] Parameter type specified by the NwModelUnits::Enum with model units in which mapping transformation need to calculate. \param pResult [out] Pointer to the OdResult object with the error code. \returns Returns an OdGeMatrix3d value with mapping transformation. \remarks The desiredUnits 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
*/ OdGeMatrix3d getTransform(NwModelUnits::Enum dbUnits, OdResult* pRes = NULL) const; /** \details Gets an offset position for texture mapping. \param offset [out] Mapping position offset by X and Y coords. \param units [out] Mapping position offset units. \param isLinked [out] Is offsets are linked for changing. \returns The eOk value if successful, or an appropriate error code overwise. \remarks The 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
*/ OdResult getOffset(OdGePoint2d& offset, std::pair& units, bool& isLinked) const; /** \details Gets a double value of mapping rotation. \param pResult [out] Pointer to the OdResult object with an error code. \returns A double value with rotation angle in degree units. */ double getRotation(OdResult* pRes = NULL) const; /** \details Gets an scale for texture mapping. \param scale [out] mapping scale by X and Y coords. \param units [out] mapping scale units. \param isLinked [out] is scaling are linked for changing. \returns The eOk value if successful, or an appropriate error code overwise. \remarks The 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
*/ OdResult getScale(OdGePoint2d& scale, std::pair& units, bool& isLinked) const; /** \details Gets a uv-repeat mapping status. \param pResult [out] Pointer to the OdResult object with an error code. \returns A pair of boolean values if there is tiling repeat by uv or not. */ NwMapperUVRepeat getUVRepeat(OdResult* pRes = NULL) const; private: //DOM-IGNORE-BEGIN friend class OdNwTextureMapperImpl; std::unique_ptr m_pImpl; //DOM-IGNORE-END }; #endif // __TNW_TEXTURE_MAPPER_H__