This commit is contained in:
Mikhalkovich Stanislav 2021-04-20 08:04:33 +03:00
parent 991a62b3f7
commit f8fcc025ea
8 changed files with 39 additions and 17 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "8";
public const string Build = "0";
public const string Revision = "2884";
public const string Revision = "2886";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=2884
%REVISION%=2886
%MINOR%=8
%MAJOR%=3

View file

@ -657,6 +657,8 @@ namespace PascalABCCompiler.NETGenerator {
public object GetConstantForExpression(IExpressionNode expr)
{
if (expr is PascalABCCompiler.TreeRealization.null_const_node) // SSM 20/04/21
return expr;
if (expr is IConstantNode)
return (expr as IConstantNode).value;
return null;

View file

@ -2639,7 +2639,9 @@ namespace PascalABCCompiler.NETGenerator
{
if (default_value.GetType() != param_types[i + num] && param_types[i + num].IsEnum && (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX))
default_value = Enum.ToObject(param_types[i + num], default_value);
pb.SetConstant(default_value);
if (default_value is TreeRealization.null_const_node) // SSM 20/04/21
pb.SetConstant(null);
else pb.SetConstant(default_value);
}
if (func.functions_nodes.Length > 0)
{
@ -6995,7 +6997,9 @@ namespace PascalABCCompiler.NETGenerator
pa |= ParameterAttributes.Optional;
pb = methb.DefineParameter(i + 1, pa, parameters[i].name);
if (default_value != null)
pb.SetConstant(default_value);
if (default_value is TreeRealization.null_const_node) // SSM 20/04/21
pb.SetConstant(null);
else pb.SetConstant(default_value);
helper.AddParameter(parameters[i], pb);
if (parameters[i].is_params)
pb.SetCustomAttribute(TypeFactory.ParamArrayAttributeConstructor, new byte[] { 0x1, 0x0, 0x0, 0x0 });
@ -7019,7 +7023,9 @@ namespace PascalABCCompiler.NETGenerator
pa |= ParameterAttributes.Optional;
pb = methb.DefineParameter(i + 1, pa, parameters[i].name);
if (default_value != null)
pb.SetConstant(default_value);
if (default_value is TreeRealization.null_const_node) // SSM 20/04/21
pb.SetConstant(null);
else pb.SetConstant(default_value);
helper.AddParameter(parameters[i], pb);
if (parameters[i].is_params)
pb.SetCustomAttribute(TypeFactory.ParamArrayAttributeConstructor, new byte[] { 0x1, 0x0, 0x0, 0x0 });

View file

@ -1 +1 @@
3.8.0.2884
3.8.0.2886

View file

@ -1 +1 @@
!define VERSION '3.8.0.2884'
!define VERSION '3.8.0.2886'

View file

@ -101,7 +101,7 @@ function P3D(x, y, z: real): Point3D;
/// Возвращает 3D-вектор с координатами (x,y,z)
function V3D(x, y, z: real): Vector3D;
/// Возвращает 3D-размер с координатами (x,y,z)
function Sz3D(x, y, z: real): Size3D;
function Sz3D(x, y, z: real): Size3D;
// -----------------------------------------------------
//>> Graph3D: функции для создания материалов Materials # Graph3D Materials functions
@ -118,6 +118,9 @@ function EmissiveMaterial(c: Color): Material;
function ImageMaterial(fname: string; M: real := 1; N: real := 1): Material;
/// Радужный материал
function RainbowMaterial: Material;
/// Возвращает материал по умолчанию
function DefaultMaterial: Material;
type
// -----------------------------------------------------
@ -901,6 +904,8 @@ type
procedure CreateBase(m: MeshElement3D; x, y, z: real; mat: GMaterial);
begin
CreateBase0(m, x, y, z);
if mat = nil then
mat := DefaultMaterial;
m.Material := mat;
//MaterialHelper.ChangeOpacity(mat,0.1);
//MaterialHelper.ChangeOpacity(BackMaterial,0.1);
@ -3187,8 +3192,6 @@ type
// -----------------------------------------------------
//>> Graph3D: сервисные функции # Graph3D service functions
// -----------------------------------------------------
/// Возвращает материал по умолчанию
function DefaultMaterial: Material;
/// Возвращает пустую группу объектов в точке (x, y, z)
function Group(x, y, z: integer): Group3D;
/// Возвращает пустую группу объектов в точке p
@ -3208,9 +3211,11 @@ procedure ShowObjects;
//>> Graph3D: функции для создания 3D-объектов # Graph3D functions for creation 3D-objects
// -----------------------------------------------------
/// Возвращает сферу с центром в точке (x, y, z) радиуса Radius
function Sphere(x, y, z, Radius: real; m: Material := DefaultMaterial): SphereT;
function Sphere(x, y, z, Radius: real; m: Material): SphereT;
/// Возвращает сферу с центром в точке (x, y, z) радиуса Radius
function Sphere(x, y, z, Radius: real): SphereT;
/// Возвращает сферу с центром в точке center радиуса Radius
function Sphere(center: Point3D; Radius: real; m: Material := DefaultMaterial): SphereT;
function Sphere(center: Point3D; Radius: real; m: Material := nil): SphereT;
/// Возвращает эллипсоид с центром в точке (x, y, z) и радиусами RadiusX, RadiusY, RadiusZ
function Ellipsoid(x, y, z, RadiusX, RadiusY, RadiusZ: real; m: Material := DefaultMaterial): EllipsoidT;
/// Возвращает эллипсоид с центром в точке center и радиусами RadiusX, RadiusY, RadiusZ
@ -4111,6 +4116,8 @@ function Group(en: sequence of Object3D): Group3D := Inv(()->Group3D.Create(0, 0
function Sphere(x, y, z, Radius: real; m: Material): SphereT := Inv(()->SphereT.Create(x, y, z, Radius, m));
function Sphere(x, y, z, Radius: real): SphereT := Sphere(x, y, z, Radius, DefaultMaterial);
function Sphere(center: Point3D; Radius: real; m: Material) := Sphere(center.x, center.y, center.z, Radius, m);
function Ellipsoid(x, y, z, RadiusX, RadiusY, RadiusZ: real; m: Material): EllipsoidT := Inv(()->EllipsoidT.Create(x, y, z, RadiusX, RadiusY, RadiusZ, m));

View file

@ -101,7 +101,7 @@ function P3D(x, y, z: real): Point3D;
/// Возвращает 3D-вектор с координатами (x,y,z)
function V3D(x, y, z: real): Vector3D;
/// Возвращает 3D-размер с координатами (x,y,z)
function Sz3D(x, y, z: real): Size3D;
function Sz3D(x, y, z: real): Size3D;
// -----------------------------------------------------
//>> Graph3D: функции для создания материалов Materials # Graph3D Materials functions
@ -118,6 +118,9 @@ function EmissiveMaterial(c: Color): Material;
function ImageMaterial(fname: string; M: real := 1; N: real := 1): Material;
/// Радужный материал
function RainbowMaterial: Material;
/// Возвращает материал по умолчанию
function DefaultMaterial: Material;
type
// -----------------------------------------------------
@ -901,6 +904,8 @@ type
procedure CreateBase(m: MeshElement3D; x, y, z: real; mat: GMaterial);
begin
CreateBase0(m, x, y, z);
if mat = nil then
mat := DefaultMaterial;
m.Material := mat;
//MaterialHelper.ChangeOpacity(mat,0.1);
//MaterialHelper.ChangeOpacity(BackMaterial,0.1);
@ -3187,8 +3192,6 @@ type
// -----------------------------------------------------
//>> Graph3D: сервисные функции # Graph3D service functions
// -----------------------------------------------------
/// Возвращает материал по умолчанию
function DefaultMaterial: Material;
/// Возвращает пустую группу объектов в точке (x, y, z)
function Group(x, y, z: integer): Group3D;
/// Возвращает пустую группу объектов в точке p
@ -3208,9 +3211,11 @@ procedure ShowObjects;
//>> Graph3D: функции для создания 3D-объектов # Graph3D functions for creation 3D-objects
// -----------------------------------------------------
/// Возвращает сферу с центром в точке (x, y, z) радиуса Radius
function Sphere(x, y, z, Radius: real; m: Material := DefaultMaterial): SphereT;
function Sphere(x, y, z, Radius: real; m: Material): SphereT;
/// Возвращает сферу с центром в точке (x, y, z) радиуса Radius
function Sphere(x, y, z, Radius: real): SphereT;
/// Возвращает сферу с центром в точке center радиуса Radius
function Sphere(center: Point3D; Radius: real; m: Material := DefaultMaterial): SphereT;
function Sphere(center: Point3D; Radius: real; m: Material := nil): SphereT;
/// Возвращает эллипсоид с центром в точке (x, y, z) и радиусами RadiusX, RadiusY, RadiusZ
function Ellipsoid(x, y, z, RadiusX, RadiusY, RadiusZ: real; m: Material := DefaultMaterial): EllipsoidT;
/// Возвращает эллипсоид с центром в точке center и радиусами RadiusX, RadiusY, RadiusZ
@ -4111,6 +4116,8 @@ function Group(en: sequence of Object3D): Group3D := Inv(()->Group3D.Create(0, 0
function Sphere(x, y, z, Radius: real; m: Material): SphereT := Inv(()->SphereT.Create(x, y, z, Radius, m));
function Sphere(x, y, z, Radius: real): SphereT := Sphere(x, y, z, Radius, DefaultMaterial);
function Sphere(center: Point3D; Radius: real; m: Material) := Sphere(center.x, center.y, center.z, Radius, m);
function Ellipsoid(x, y, z, RadiusX, RadiusY, RadiusZ: real; m: Material): EllipsoidT := Inv(()->EllipsoidT.Create(x, y, z, RadiusX, RadiusY, RadiusZ, m));