Rhino C++ API
8.14
|
#include <opennurbs_light.h>
Public Member Functions | |
ON_Light () | |
ON_Light (const ON_Light &)=default | |
~ON_Light () | |
ON_Color | Ambient () const |
ON_3dVector | Attenuation () const |
double | Attenuation (double) const |
ON::coordinate_system | CoordinateSystem () const |
determined by style More... | |
void | Default () |
make default light More... | |
ON_Color | Diffuse () const |
int | Dimension () const override |
ON_3dVector | Direction () const |
void | Dump (ON_TextLog &) const override |
for debugging More... | |
bool | Enable (bool=true) |
returns previous state More... | |
bool | GetBBox (double *boxmin, double *boxmax, bool bGrowBox=false) const override |
virtual ON_Geometry GetBBox override More... | |
bool | GetLightXform (const ON_Viewport &vp, ON::coordinate_system dest_cs, ON_Xform &xform) const |
bool | GetSpotLightRadii (double *inner_radius, double *outer_radius) const |
The spotlight radii are useful for display UI. More... | |
bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBoxAsInt, const ON_Xform *xform) const override |
virtual ON_Geometry GetTightBoundingBox override More... | |
double | HotSpot () const |
double | Intensity () const |
0.0 = 0% 1.0 = 100% Only clamped above zero - no maximum. More... | |
const bool | IsDirectionalLight () const |
bool | IsEnabled () const |
const bool | IsLinearLight () const |
const bool | IsPointLight () const |
const bool | IsRectangularLight () const |
const bool | IsSpotLight () const |
bool | IsValid (class ON_TextLog *text_log=nullptr) const override |
ON_3dVector | Length () const |
int | LightIndex () const |
const ON_wString & | LightName () const |
ON_3dPoint | Location () const |
ON_UUID | ModelObjectId () const override |
virtual More... | |
ON::object_type | ObjectType () const override |
ON_Light & | operator= (const ON_Light &)=default |
ON_3dVector | PerpindicularDirection () const |
double | PowerCandela () const |
double | PowerLumens () const |
double | PowerWatts () const |
bool | Read (ON_BinaryArchive &) override |
void | SetAmbient (ON_Color) |
void | SetAttenuation (const ON_3dVector &) |
void | SetAttenuation (double, double, double) |
void | SetDiffuse (ON_Color) |
void | SetDirection (const ON_3dVector &) |
void | SetHotSpot (double) |
void | SetIntensity (double) |
void | SetLength (const ON_3dVector &) |
void | SetLightIndex (int) |
void | SetLightName (const char *) |
void | SetLightName (const wchar_t *) |
void | SetLocation (const ON_3dPoint &) |
void | SetPowerCandela (double) |
void | SetPowerLumens (double) |
void | SetPowerWatts (double) |
void | SetShadowIntensity (double) |
void | SetSpecular (ON_Color) |
void | SetSpotAngleDegrees (double) |
void | SetSpotAngleRadians (double) |
void | SetSpotExponent (double) |
void | SetStyle (ON::light_style) |
void | SetWidth (const ON_3dVector &) |
double | ShadowIntensity () const |
ON_Color | Specular () const |
double | SpotAngleDegrees () const |
double | SpotAngleRadians () const |
double | SpotExponent () const |
ON::light_style | Style () const |
bool | Transform (const ON_Xform &) override |
ON_3dVector | Width () const |
bool | Write (ON_BinaryArchive &) const override |
Public Member Functions inherited from ON_Geometry | |
ON_Geometry ()=default | |
ON_Geometry (const ON_Geometry &)=default | |
~ON_Geometry ()=default | |
ON_BoundingBox | BoundingBox () const |
virtual class ON_Brep * | BrepForm (class ON_Brep *brep=nullptr) const |
virtual void | ClearBoundingBox () |
virtual ON_COMPONENT_INDEX | ComponentIndex () const |
virtual bool | EvaluatePoint (const class ON_ObjRef &objref, ON_3dPoint &P) const |
bool | GetBoundingBox (ON_3dPoint &bbox_min, ON_3dPoint &bbox_max, bool bGrowBox=false) const |
bool | GetBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false) const |
virtual bool | GetTightBoundingBox (class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const |
virtual bool | HasBrepForm () const |
virtual bool | IsDeformable () const |
virtual bool | IsMorphable () const |
virtual bool | MakeDeformable () |
virtual bool | Morph (const class ON_SpaceMorph &morph) |
ON_Geometry & | operator= (const ON_Geometry &)=default |
bool | Rotate (double rotation_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &rotation_axis, const ON_3dPoint &rotation_center) |
bool | Scale (double scale_factor) |
virtual bool | SwapCoordinates (int i, int j) |
const ON_BoundingBox | TightBoundingBox () const |
bool | Translate (const ON_3dVector &translation_vector) |
Public Member Functions inherited from ON_Object | |
ON_Object () ON_NOEXCEPT | |
ON_Object (const ON_Object &) | |
virtual | ~ON_Object () |
virtual ON_AggregateComponentStatus | AggregateComponentStatus () const |
bool | AttachUserData (class ON_UserData *pUserData) |
unsigned int | ClearAllComponentStates () const |
virtual unsigned int | ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const |
virtual unsigned int | ClearComponentStates (ON_ComponentStatus states_to_clear) const |
void | CopyUserData (const ON_Object &source_object) |
unsigned int | CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution) |
virtual ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const |
virtual bool | DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count) |
virtual void | DestroyRuntimeCache (bool bDelete=true) |
bool | DetachUserData (class ON_UserData *pUserData) |
void | EmergencyDestroy () |
class ON_UserData * | FirstUserData () const |
virtual unsigned int | GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const |
class ON_UserData * | GetUserData (const ON_UUID &userdata_uuid) const |
bool | GetUserString (const wchar_t *key, ON_wString &string_value) const |
int | GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const |
int | GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const |
bool | IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const |
bool | IsKindOf (const ON_ClassId *pClassId) const |
virtual void | MarkAggregateComponentStatusAsNotCurrent () const |
virtual void | MemoryRelocate () |
void | MoveUserData (ON_Object &source_object) |
unsigned int | MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems) |
ON_Object & | operator= (const ON_Object &) |
void | PurgeUserData () |
virtual unsigned int | SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const |
virtual unsigned int | SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const |
bool | SetUserString (const wchar_t *key, const wchar_t *string_value) |
int | SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace) |
virtual unsigned int | SizeOf () const |
bool | ThisIsNullptr (bool bSilentError) const |
void | TransformUserData (const class ON_Xform &xform) |
virtual bool | UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map) |
int | UserStringCount () const |
Public Attributes | |
ON_Color | m_ambient |
ON_3dVector | m_attenuation |
attenuation settings - ignored for "directional" and "ambient" lights More... | |
bool | m_bOn |
true if light is on More... | |
ON_Color | m_diffuse |
ON_3dVector | m_direction |
ignored for "point" and "ambient" lights More... | |
double | m_hotspot |
0.0 to 1.0 (See SetHotSpot() for details) More... | |
double | m_intensity |
ON_3dVector | m_length |
ON_UUID | m_light_id |
int | m_light_index |
ON_wString | m_light_name |
ON_3dPoint | m_location |
ignored for "directional" and "ambient" lights More... | |
double | m_shadow_intensity |
shawdow casting More... | |
ON_Color | m_specular |
double | m_spot_angle |
spot settings - ignored for non-spot lights More... | |
double | m_spot_exponent |
ON::light_style | m_style |
style of light More... | |
double | m_watts |
ON_3dVector | m_width |
Static Public Attributes | |
static const ON_Light | Unset |
Static Public Attributes inherited from ON_Geometry | |
const static ON_Geometry | Unset |
Additional Inherited Members | |
Public Types inherited from ON_Object | |
enum | UserDataConflictResolution : unsigned char { UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3, UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6 } |
Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
For complete openNURBS copyright information see http://www.opennurbs.org.
ON_Light::ON_Light | ( | ) |
ON_Light::~ON_Light | ( | ) |
|
default |
ON_Color ON_Light::Ambient | ( | ) | const |
ON_3dVector ON_Light::Attenuation | ( | ) | const |
double ON_Light::Attenuation | ( | double | ) | const |
computes 1/(a[0] + d*a[1] + d^2*a[2]) where d = argument returns 0 if a[0] + d*a[1] + d^2*a[2] <= 0
ON::coordinate_system ON_Light::CoordinateSystem | ( | ) | const |
determined by style
void ON_Light::Default | ( | ) |
make default light
Interface
ON_Color ON_Light::Diffuse | ( | ) | const |
|
overridevirtual |
ON_Geometry virtual functions
Reimplemented from ON_Geometry.
ON_3dVector ON_Light::Direction | ( | ) | const |
|
overridevirtual |
for debugging
Reimplemented from ON_Object.
bool ON_Light::Enable | ( | bool | = true | ) |
returns previous state
turn light on/off
|
overridevirtual |
virtual ON_Geometry GetBBox override
Reimplemented from ON_Geometry.
bool ON_Light::GetLightXform | ( | const ON_Viewport & | vp, |
ON::coordinate_system | dest_cs, | ||
ON_Xform & | xform | ||
) | const |
Description: A light's location and direction can be defined with respect to world, camera, or view coordinates. GetLightXform gets the transformation from the light's intrinsic coordinate system to the destination coordinate system specified by dest_cs. Parameters: vp - [in] viewport where light is being used dest_cs - [in] destination coordinate system xform - [out] transformation from the light's intrinsic coordinate system to cs. Returns: true if successful.
bool ON_Light::GetSpotLightRadii | ( | double * | inner_radius, |
double * | outer_radius | ||
) | const |
The spotlight radii are useful for display UI.
|
override |
virtual ON_Geometry GetTightBoundingBox override
double ON_Light::HotSpot | ( | ) | const |
double ON_Light::Intensity | ( | ) | const |
0.0 = 0% 1.0 = 100% Only clamped above zero - no maximum.
const bool ON_Light::IsDirectionalLight | ( | ) | const |
bool ON_Light::IsEnabled | ( | ) | const |
const bool ON_Light::IsLinearLight | ( | ) | const |
const bool ON_Light::IsPointLight | ( | ) | const |
const bool ON_Light::IsRectangularLight | ( | ) | const |
const bool ON_Light::IsSpotLight | ( | ) | const |
|
overridevirtual |
ON_Object virtual functions
Reimplemented from ON_Geometry.
ON_3dVector ON_Light::Length | ( | ) | const |
int ON_Light::LightIndex | ( | ) | const |
const ON_wString& ON_Light::LightName | ( | ) | const |
ON_3dPoint ON_Light::Location | ( | ) | const |
|
overridevirtual |
Description: Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
Returns: ON::object_type enum value.
Remarks: The default implementation of this virtual function returns ON::unknown_object_type
Reimplemented from ON_Object.
ON_3dVector ON_Light::PerpindicularDirection | ( | ) | const |
double ON_Light::PowerCandela | ( | ) | const |
double ON_Light::PowerLumens | ( | ) | const |
double ON_Light::PowerWatts | ( | ) | const |
|
overridevirtual |
Description: Low level archive writing tool used by ON_BinaryArchive::ReadObject(). Parameters: binary_archive - archive to read from Returns: Returns true if the read is successful. Remarks: Use ON_BinaryArchive::ReadObject() to read objects. This Read() function should read the objects definition back into its data members.
The default implementation of this virtual function returns false and does nothing.
Reimplemented from ON_Object.
void ON_Light::SetAmbient | ( | ON_Color | ) |
colors
void ON_Light::SetAttenuation | ( | const ON_3dVector & | ) |
void ON_Light::SetAttenuation | ( | double | , |
double | , | ||
double | |||
) |
attenuation settings (ignored for "directional" and "ambient" lights) attenuation = 1/(a[0] + d*a[1] + d^2*a[2]) where d = distance to light
void ON_Light::SetDiffuse | ( | ON_Color | ) |
void ON_Light::SetDirection | ( | const ON_3dVector & | ) |
void ON_Light::SetHotSpot | ( | double | ) |
The hot spot setting runs from 0.0 to 1.0 and is used to provides a linear interface for controlling the focus or concentration of a spotlight. A hot spot setting of 0.0 corresponds to a spot exponent of 128. A hot spot setting of 1.0 corresponds to a spot exponent of 0.0.
void ON_Light::SetIntensity | ( | double | ) |
void ON_Light::SetLength | ( | const ON_3dVector & | ) |
linear and rectangular light parameters (ignored for non-linear/rectangular lights)
void ON_Light::SetLightIndex | ( | int | ) |
light index
void ON_Light::SetLightName | ( | const char * | ) |
light name
void ON_Light::SetLightName | ( | const wchar_t * | ) |
void ON_Light::SetLocation | ( | const ON_3dPoint & | ) |
void ON_Light::SetPowerCandela | ( | double | ) |
void ON_Light::SetPowerLumens | ( | double | ) |
void ON_Light::SetPowerWatts | ( | double | ) |
void ON_Light::SetShadowIntensity | ( | double | ) |
shadow parameters (ignored for non-spot lights)
shadow intensity 0.0 = does not cast any shadows 1.0 = casts black shadows
void ON_Light::SetSpecular | ( | ON_Color | ) |
void ON_Light::SetSpotAngleDegrees | ( | double | ) |
spot light parameters (ignored for non-spot lights)
angle = 0 to 90 degrees exponent = 0 to 128 (0=uniform, 128=high focus)
void ON_Light::SetSpotAngleRadians | ( | double | ) |
void ON_Light::SetSpotExponent | ( | double | ) |
The spot exponent varies from 0.0 to 128.0 and provides an exponential interface for controlling the focus or concentration of a spotlight (like the OpenGL GL_SPOT_EXPONENT parameter). The spot exponent and hot spot parameters are linked; changing one will change the other. A hot spot setting of 0.0 corresponds to a spot exponent of 128. A hot spot setting of 1.0 corresponds to a spot exponent of 0.0.
void ON_Light::SetStyle | ( | ON::light_style | ) |
style, location, and direction direction is ignored for "point" and "ambient" lights location is ignored for "directional" and "ambient" lights
void ON_Light::SetWidth | ( | const ON_3dVector & | ) |
double ON_Light::ShadowIntensity | ( | ) | const |
ON_Color ON_Light::Specular | ( | ) | const |
double ON_Light::SpotAngleDegrees | ( | ) | const |
double ON_Light::SpotAngleRadians | ( | ) | const |
double ON_Light::SpotExponent | ( | ) | const |
ON::light_style ON_Light::Style | ( | ) | const |
|
overridevirtual |
Description: Transforms the object.
Parameters: xform - [in] transformation to apply to object. If xform.IsSimilarity() is zero, then you may want to call MakeSquishy() before calling Transform.
Remarks: When overriding this function, be sure to include a call to ON_Object::TransformUserData() which takes care of transforming any ON_UserData that may be attached to the object.
See Also: ON_Geometry::IsDeformable();
Remarks: Classes derived from ON_Geometry should call ON_Geometry::Transform() to handle user data transformations and then transform their definition.
Reimplemented from ON_Geometry.
ON_3dVector ON_Light::Width | ( | ) | const |
|
overridevirtual |
Use ON_BinaryArchive::WriteObject() and ON_BinaryArchive::ReadObject() for top level serialization. These Read()/Write() members should just write/read specific definitions. In particular, they should not write/ read any chunk typecode or length information. The default implementations return false and do nothing.
Reimplemented from ON_Object.
ON_Color ON_Light::m_ambient |
ON_3dVector ON_Light::m_attenuation |
attenuation settings - ignored for "directional" and "ambient" lights
each entry >= 0.0 att = 1/(a[0] + d*a[1] + d^2*a[2]) where d = distance to light
bool ON_Light::m_bOn |
true if light is on
ON_Color ON_Light::m_diffuse |
ON_3dVector ON_Light::m_direction |
ignored for "point" and "ambient" lights
double ON_Light::m_hotspot |
0.0 to 1.0 (See SetHotSpot() for details)
double ON_Light::m_intensity |
Linear dimming/brightening factor: 0.0 = off, 1.0 = 100%. Values < 0.0 and values > 1.0 are permitted but are not consistently interpreted by various renderers. Renderers should clamp the range to [0.0, 1.0] if their lighting model does not support more exotic interpretations of m_intensity.
ON_3dVector ON_Light::m_length |
only for linear and rectangular lights ends of linear lights are m_location and m_location+m_length
ON_UUID ON_Light::m_light_id |
int ON_Light::m_light_index |
ON_wString ON_Light::m_light_name |
ON_3dPoint ON_Light::m_location |
ignored for "directional" and "ambient" lights
double ON_Light::m_shadow_intensity |
shawdow casting
0.0 = no shadow casting, 1.0 = full shadow casting
ON_Color ON_Light::m_specular |
double ON_Light::m_spot_angle |
spot settings - ignored for non-spot lights
0.0 to 90.0
double ON_Light::m_spot_exponent |
0.0 to 128.0 0.0 = uniform 128.0 = high focus
ON::light_style ON_Light::m_style |
style of light
double ON_Light::m_watts |
Used by lighting models that reference lighting fixtures. Values < 0.0 are invalid. If m_watts is 0.0, the value is ignored.
ON_3dVector ON_Light::m_width |
only for rectangular lights corners of rectangular lights are m_location, m_location+m_length, m_location+m_width, m_location+m_width+m_length
|
static |