NX Open C++ Reference Guide
|
Represents a light source. More...
Public Types | |
enum | SceneType { SceneTypeNotASceneLight = -1, SceneTypeAmbient, SceneTypeLeftTop, SceneTypeTop, SceneTypeRightTop, SceneTypeFront, SceneTypeLeftBottom, SceneTypeBottom, SceneTypeRightBottom } |
The predefined scene lights used in Basic Lights. More... | |
Public Member Functions | |
bool | GetEnabledInView (NXOpen::View *view) |
Whether a light is enabled in a given view. | |
void | GetLightType (NXOpen::LightType *lightType, NXOpen::Light::SceneType *sceneLightType) |
Get the type of a light. | |
double | Intensity () |
Returns the intensity of a light. | |
void | SetEnabledInView (NXOpen::View *view, bool onOrOff) |
Whether a light is to be enabled in a given view. | |
void | SetIntensity (double intensity) |
Sets the intensity of a light. |
Represents a light source.
Creation of lights is not supported yet.
Created in NX4.0.0.
The predefined scene lights used in Basic Lights.
These are subtypes of LightTypeScene . Except for ambient light, all of the other lights are on the same side of the model as the observer.
SceneTypeAmbient |
Light from all around the model. |
SceneTypeLeftTop |
Light from the top left of the view. |
SceneTypeTop |
Light from the top center of the view. |
SceneTypeRightTop |
Light from the top right of the view. |
SceneTypeFront |
Light from the front of the view (at the observer's location. |
SceneTypeLeftBottom |
Light from the bottom left of the view. |
SceneTypeBottom |
Light from the bottom center of the view. |
SceneTypeRightBottom |
Light from the bottom right of the view. |
bool NXOpen::Light::GetEnabledInView | ( | NXOpen::View * | view | ) |
Whether a light is enabled in a given view.
true means the light is on, false means the light is off.
view | The view to check |
void NXOpen::Light::GetLightType | ( | NXOpen::LightType * | lightType, |
NXOpen::Light::SceneType * | sceneLightType | ||
) |
Get the type of a light.
If the light is a scene light, the specific type of scene light is also returned. It the light is not a scene light, the scene_light_type output is undefined.
Created in NX4.0.0.
License requirements : None
lightType | the type of light |
sceneLightType | is light_type is ...scene, this is the specific type of scene light |
double NXOpen::Light::Intensity | ( | ) |
Returns the intensity of a light.
Intensity is normally in the range of 0.0 (fully off) to 1.0 (fully on), except that for lights other than scene lights, the intensity may be greater than 1.0.
Note that even if the light is not displayed in any view, the intensity may still be greater than 0.0, as this intensity will be used the next time the light is turned on.
For now, setting Light::SetIntensity may only be used for a scene light.
Created in NX4.0.0.
License requirements : None
void NXOpen::Light::SetEnabledInView | ( | NXOpen::View * | view, |
bool | onOrOff | ||
) |
Whether a light is to be enabled in a given view.
true means to turn the light on, false is to turn it off. For now, the light must be of type LightTypeScene .
Created in NX4.0.0.
License requirements : None
view | The view to turn the light on or off in |
onOrOff | true for on, false for off |
void NXOpen::Light::SetIntensity | ( | double | intensity | ) |
Sets the intensity of a light.
Intensity is normally in the range of 0.0 (fully off) to 1.0 (fully on), except that for lights other than scene lights, the intensity may be greater than 1.0.
Note that even if the light is not displayed in any view, the intensity may still be greater than 0.0, as this intensity will be used the next time the light is turned on.
For now, setting Light::SetIntensity may only be used for a scene light.
Created in NX4.0.0.
License requirements : None
intensity | intensity |