![]() |
CNiLight | ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Class |
Declared in: NiLight.h |
Overview
CNiLight encapsulates the interface to a single light on a 3D graph object, which allows you to modify its appearance and behavior.
Lights are positioned within the world coordinates of the graph using the following properties:
- Longitude
- Latitude
- Distance
You get individual lights using the Lights property on a CNiGraph3D object.
Note: To specify a date/time value, you must convert your date or time value to a double. A date is implemented as a floating-point value with the integer part of the number measuring days from midnight, 30 December 1899, and the fractional part representing the time of day. The absolute value of the fractional part of the number represents the time as a fraction of a day. Thus, 1 second equals 1 / 24 hours / 60 minutes, which is 1/86400 or approximately 1.157407e-5. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25.
Base Classes
Data Items
![]() |
LightAttenuationStyles | Attenuation | Specifies the attenuation style of the light source. |
![]() |
CNiColor | Color | Specifies the color of the light source. |
![]() |
double | Distance | Specifies the distance of the light source from the origin of the graph. |
![]() |
bool | Enabled | Enables lighting when set to true. |
![]() |
double | Latitude | Specifies the latitudinal position of the light source. |
![]() |
double | Longitude | Specifies the longitudinal position of the light source. |
Constructors
![]() |
CNiLight() |
Default constructor. | |
![]() |
CNiLight( CWLight_CI* pCustom, CNiInterface::ThreadAccess option ) |
Constructor that attaches to the specified CWLight_CI pointer. | |
![]() |
CNiLight( const CNiLight& source ) |
Copy constructor. |
Destructors
Functions
![]() |
static const IID & | GetIid() |
Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects. |
![]() |
const CNiLight & | Assignment operator. |
Example
// Set the attenuation mode of the third light in a 3D graph. CNiGraph3D graph; CNiLight light = graph.Lights.Item(3); light.Attenuation = CNiLight::Quadratic;