0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
[occt.git] / src / V3d / V3d_PositionalLight.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-01-22
2// Created by: GG
3// Copyright (c) 1992-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _V3d_PositionalLight_HeaderFile
18#define _V3d_PositionalLight_HeaderFile
19
c357e426 20#include <V3d_PositionLight.hxx>
42cf5bc1 21
22class V3d_PositionalLight;
23DEFINE_STANDARD_HANDLE(V3d_PositionalLight, V3d_PositionLight)
24
25//! Creation and modification of an isolated
26//! (positional) light source.
27class V3d_PositionalLight : public V3d_PositionLight
28{
42cf5bc1 29public:
30
c357e426 31 //! Creates an isolated light source theX, theY, theZ in the viewer.
32 //! It is also defined by the color theColor and
33 //! two attenuation factors theConstAttentuation, theLinearAttentuation.
42cf5bc1 34 //! The resulting attenuation factor determining the
35 //! illumination of a surface depends on the following
36 //! formula :
c357e426 37 //! F = 1/(ConstAttenuation + LinearAttenuation*Length)
42cf5bc1 38 //! Length is the distance of the isolated source
c357e426 39 //! from the surface. //! Warning! raises BadValue from V3d
40 //! if one of the attenuation coefficients is not in range [0, 1].
41 Standard_EXPORT V3d_PositionalLight (const Handle(V3d_Viewer)& theViewer,
ee2be2a8 42 const Standard_Real theX,
43 const Standard_Real theY,
44 const Standard_Real theZ,
87432b82 45 const Quantity_Color& theColor = Quantity_NOC_WHITE,
ee2be2a8 46 const Standard_Real theConstAttenuation = 1.0,
47 const Standard_Real theLinearAttenuation = 0.0);
c357e426 48
49 //! Creates a light source of the Positional type in the viewer.
50 //! theXt, theYt, theZt : Coordinate of Target light source.
51 //! theXp, theYp, theZp : Coordinate of Position light source.
42cf5bc1 52 //! The light source is also defined by the color Color
c357e426 53 //! and two attenuation factors theConstAttentuation,
54 //! theLinearAttentuation that determine the illumination of a
42cf5bc1 55 //! surface using the following formula :
c357e426 56 //! F = 1/(ConstAttenuation + LinearAttenuation*Length)
57 //! Length is the distance of the isolated source
58 //! from the surface. //! Warning! raises BadValue from V3d
42cf5bc1 59 //! if one of the attenuation coefficients is not between 0 et 1.
c357e426 60 Standard_EXPORT V3d_PositionalLight (const Handle(V3d_Viewer)& theViewer,
ee2be2a8 61 const Standard_Real theXt,
62 const Standard_Real theYt,
63 const Standard_Real theZt,
64 const Standard_Real theXp,
65 const Standard_Real theYp,
66 const Standard_Real theZp,
87432b82 67 const Quantity_Color& theColor = Quantity_NOC_WHITE,
ee2be2a8 68 const Standard_Real theConstAttenuation = 1.0,
69 const Standard_Real theLinearAttenuation = 0.0);
c357e426 70
42cf5bc1 71 //! Defines the position of the light source.
ee2be2a8 72 Standard_EXPORT virtual void SetPosition (const Standard_Real theX,
73 const Standard_Real theY,
74 const Standard_Real theZ) Standard_OVERRIDE;
c357e426 75
42cf5bc1 76 //! Defines the attenuation factors.
77 //! Warning: raises BadValue from V3d
78 //! if one of the attenuation coefficients is not between 0 et 1.
ee2be2a8 79 Standard_EXPORT void SetAttenuation (const Standard_Real theConstAttenuation,
80 const Standard_Real theLinearAttenuation);
c357e426 81
42cf5bc1 82 //! Modifies the smoothing radius
83 Standard_EXPORT void SetSmoothRadius (const Standard_Real theValue);
c357e426 84
42cf5bc1 85 //! Display the graphic structure of light source
c357e426 86 //! in the chosen view. We have three type of representation
42cf5bc1 87 //! - SIMPLE : Only the light source is displayed.
88 //! - PARTIAL : The light source and the light space are
89 //! displayed.
90 //! - COMPLETE : The light source, the light space and the
91 //! radius of light space are displayed.
92 //! We can choose the "SAMELAST" as parameter of representation
93 //! In this case the graphic structure representation will be
94 //! the last displayed.
c357e426 95 Standard_EXPORT void Display (const Handle(V3d_View)& theView,
96 const V3d_TypeOfRepresentation theRepresentation) Standard_OVERRIDE;
42cf5bc1 97
c357e426 98 //! Returns the position of the light source.
ee2be2a8 99 Standard_EXPORT void Position (Standard_Real& theX,
100 Standard_Real& theY,
101 Standard_Real& theZ) const Standard_OVERRIDE;
42cf5bc1 102
c357e426 103 //! Returns the attenuation factors.
ee2be2a8 104 Standard_EXPORT void Attenuation (Standard_Real& theConstAttenuation,
105 Standard_Real& theLinearAttenuation) const;
42cf5bc1 106
92efcf78 107 DEFINE_STANDARD_RTTIEXT(V3d_PositionalLight,V3d_PositionLight)
42cf5bc1 108
42cf5bc1 109private:
110
42cf5bc1 111 //! Defined the representation of the positional light source.
c357e426 112 Standard_EXPORT void Symbol (const Handle(Graphic3d_Group)& theSymbol,
113 const Handle(V3d_View)& theView) const Standard_OVERRIDE;
42cf5bc1 114};
115
42cf5bc1 116#endif // _V3d_PositionalLight_HeaderFile