/////////////////////////////////////////////////////////////////////////////// // 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_LIGHTITEM_H__ #define __TNW_LIGHTITEM_H__ #include "NwSavedItem.h" #include "NwLightIntensityUnits.h" #include "NwLightDistribution.h" class OdNwColor; /** \details This struct represents a light's lamp intensity value with specified units. */ struct NWDBEXPORT OdNwLampIntensity { /** Lamp intensity double value. */ double m_value; /** Lamp intensity unit. */ NwLightIntensityUnits::Enum m_units; /** Distance from the light source to the surface if lamp intensity unit in lux. */ double m_illuminanceAt; /** Double value of electrical efficiency(lm/W) produced by a light source. */ double m_electricalEfficiency;// }; /** \details This class represents a base class for light saved items. */ class NWDBEXPORT OdNwLightItem : public OdNwSavedItem { //DOM-IGNORE-BEGIN ODRX_DECLARE_MEMBERS(OdNwLightItem); //DOM-IGNORE-END public: /** \details Default constructor. Creates an object of the OdNwLightItem class. */ OdNwLightItem(); /** \details Constructor for objects of the OdNwLightItem class. Creates an OdNwLightItem object for the specified item. \param pImpl [in] Item to create a OdNwLightItem object for. */ explicit OdNwLightItem(OdNwObjectImpl* pImpl); public: /** \details Virtual destructor. Frees allocated resources. */ virtual ~OdNwLightItem(); public: /** \details Checks whether light is on or off in the scene. \returns The true value if the light is on, or false otherwise. */ bool isLightOn() const; /** \details Checks whether the light's glyph is displayed. \returns The true value if the light's glyph is displayed, or false otherwise. */ bool isGlyphDisplay() const; /** \details Gets the emitted light color. \returns An OdNwColor object with the filter color of the light. */ OdNwColor getFilterClr() const; /** \details Gets the inherent brightness of the light with specified units. \returns The struct with double intensity value, intesity unit and additional parameters for lux and watt intensity. \remarks The intensity units must be one of the following: Name Value Description NwLightIntensityUnits::kCandella 0 Light intensity in candella NwLightIntensityUnits::kLumen 1 Light flux in lumen NwLightIntensityUnits::kLux 2 Light illuminance in lux NwLightIntensityUnits::kWatt 3 Light wattage in watt
*/ OdNwLampIntensity getLampIntensity() const; /** \details Gets the lamp color of this light. \returns An OdNwColor object with the lamp color of this light. */ OdNwColor getLampClr() const; /** \details Gets the result color of this light which is the product of the lamp color and the filter color as RGB component values. \returns An OdNwColor object with the result color of this light. */ OdNwColor getResultClr() const; /** \details Gets the light source distirbution type. \returns The light source distirbution type. \remarks The returned value must be one of the following: Name Value Description NwLightDistribution::kIsotropic 0 A light's source which emits light in all directions uniformly. NwLightDistribution::kSpot 1 A focused beam of light like a flashlight, a follow spot in a theater, or a headlight. NwLightDistribution::kDiffuse 2 A light distribution integrates the characteristics of direct lighting and those of indirect lighting. NwLightDistribution::kIes 3 Light distibution is set by light profile from .ies file.
*/ NwLightDistribution::Enum getDistribution() const; public: /** \details Sets the enabled light status. \param isOn [in] boolean value for light's enabling status. \returns eOk if the light's enabling status is successfully changed, or an appropriate error code otherwise. */ OdResult setLightOn(bool isOn); /** \details Sets the emitted light color. \param clr [in] right value reference to the emitted light color. \returns eOk if the light's color sets is successfully, or an appropriate error code otherwise. */ OdResult setFilterClr(OdNwColor&& clr); /** \details Sets the lamp color of this light. \param lampTemp [in] lamp color temperature in Kelvin. The lamp temperature is must be in range from 1000K to 20000K. \returns eOk if the light's color sets is successfully, or an appropriate error code otherwise. */ OdResult setLampClr(OdUInt32 lampTemp); /** \details Sets the inherent brightness of the light with specified units. \param lampIntensity [in] The struct with double intensity value, intesity unit and additional parameters for lux and watt intensity. \returns eOk if the light's intensity sets is successfully, or an appropriate error code otherwise. For distant light type intensity units must always be in candella. */ OdResult setLampIntensity(const OdNwLampIntensity& lampIntensity); }; /** \details This template class is a specialization of the OdSmartPtr class for OdNwLightItem object pointers. */ typedef OdSmartPtr OdNwLightItemPtr; #endif //__TNW_SAVEDVIEWPOINT_H__