NX Open C++ Reference Guide
Public Types | Public Member Functions
NXOpen::Light Class Reference

Represents a light source. More...

Inheritance diagram for NXOpen::Light:
NXOpen::NXObject NXOpen::TaggedObject NXOpen::INXObject

List of all members.

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.

Detailed Description

Represents a light source.


Creation of lights is not supported yet.

Created in NX4.0.0.


Member Enumeration Documentation

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.

Enumerator:
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.


Member Function Documentation

Whether a light is enabled in a given view.

true means the light is on, false means the light is off.

Returns:
true: the light is on, false: off
Created in NX4.0.0.

License requirements : None
Parameters:
viewThe 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

Parameters:
lightTypethe type of light
sceneLightTypeis light_type is ...scene, this is the specific type of scene light

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

Parameters:
viewThe view to turn the light on or off in
onOrOfftrue 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

Parameters:
intensityintensity

The documentation for this class was generated from the following file:
Copyright 2011 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.