Правки в Controls и примерах

Исправления ошибок в параметрах Pyramid Prism в Graph3D
This commit is contained in:
Mikhalkovich Stanislav 2020-08-03 21:26:25 +03:00
parent ec918d645d
commit c0906732a5
19 changed files with 256 additions and 90 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "6";
public const string Build = "3";
public const string Revision = "2608";
public const string Revision = "2613";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=3
%REVISION%=2608
%MINOR%=6
%REVISION%=2613
%COREVERSION%=3
%MAJOR%=3

View file

@ -17,22 +17,16 @@ begin
lb.AddRange('1 2 3 4 5'.ToWords);
var cb := new ComboBoxWPF('ComboBox');
cb.AddRange('1 2 3 4 5'.ToWords);
var sl := new SliderWPF('Slider:');
b.Click := procedure -> begin
if b.Text = 'Заголовки включены' then
b.Text := 'Заголовки выключены'
else b.Text := 'Заголовки включены';
if tb.Title = '' then
tb.Title := 'Заголовок'
else tb.Title := '';
if ib.Title = '' then
ib.Title := 'Заголовок'
else ib.Title := '';
if lb.Title = '' then
lb.Title := 'Заголовок'
else lb.Title := '';
if cb.Title = '' then
cb.Title := 'Заголовок'
else cb.Title := '';
tb.TitleVisible := not tb.TitleVisible;
ib.TitleVisible := not ib.TitleVisible;
lb.TitleVisible := not lb.TitleVisible;
cb.TitleVisible := not cb.TitleVisible;
sl.TitleVisible := not sl.TitleVisible;
end;
end.

View file

@ -2,10 +2,7 @@
uses Controls,GraphWPF;
type My = auto class
i,j: integer;
public
property Поле1: integer read i;
property Поле2: integer read j;
Поле1,Поле2: integer;
end;
begin

View file

@ -0,0 +1,20 @@
uses GraphWPF, Controls, ABCDatabases;
begin
Window.Title := 'Столицы стран';
LeftPanel(220, Colors.LightGoldenrodYellow);
var страны := ЗаполнитьМассивСтран;
var a := ListBox('Страны',550);
a.AddRange(страны.ConvertAll(страна -> страна.Название));
var d := DictStr;
foreach var страна in страны do
d[страна.Название] := страна.Столица;
Font.Size := 70;
a.SelectionChanged := procedure -> begin
Window.Clear;
DrawText(GraphWindow.ClientRect,d[a.SelectedText])
end;
end.

View file

@ -23,8 +23,7 @@ begin
var cb := ComboBox('Выпадающий список');
cb.AddRange('Россия','США','Китай','Германия','Франция');
TextBlock('Слайдер');
Slider(0,10);
Slider('Слайдер:',0,10);
TextBlock('Блок текста');
IntegerBlock('Блок целого:',64);
RealBlock('Блок вещественного:',3.5);

View file

@ -6,24 +6,16 @@ begin
Font.Size := 40;
LeftPanel(150);
var rb := IntegerBlock('Красный:');
rb.Margin := 3;
var r := Slider(0,255,255,16);
var gb := IntegerBlock('Зеленый:');
gb.Margin := 3;
var g := Slider(0,255,255,16);
var bb := IntegerBlock('Синий:');
bb.Margin := 3;
var b := Slider(0,255,255,16);
var r := Slider('Красный: ',0,255,255,16);
var g := Slider('Зеленый: ',0,255,255,16);
var b := Slider('Синий: ',0,255,255,16);
Button('Выход').Click := procedure -> Window.Close;
Button('Выход').Click := procedure → Window.Close;
var p: procedure := ()-> begin
Window.Clear(RGB(r.Value.Round,g.Value.Round,b.Value.Round));
rb.Value := r.Value.Round;
gb.Value := g.Value.Round;
bb.Value := b.Value.Round;
DrawText(GraphWindow.ClientRect,$'R={rb.Value}, G={gb.Value}, B={bb.Value}');
var p: procedure := () → begin
var c := RGB(r.Value,g.Value,b.Value);
Window.Clear(c);
DrawText(GraphWindow.ClientRect,$'R={c.R}, G={c.G}, B={c.B}');
end;
r.ValueChanged := p;
g.ValueChanged := p;

View file

@ -0,0 +1,28 @@
// Модуль Controls
uses Graph3D, Controls;
begin
var l := LeftPanel(200, Colors.LightGoldenrodYellow);
var height := IntegerBox('Высота:', 1, 15);
height.Value := 5;
height.Tooltip := 'Покрутите колёсико мыши';
var radius := IntegerBox('Радиус:', 1, 6);
radius.Value := 2;
radius.Tooltip := 'Покрутите колёсико мыши';
var sides := Slider('Количество сторон: ', 3, 20);
sides.Frequency := 1;
sides.Value := 5;
var p := Pyramid(Origin, sides.Value, height.Value, radius.Value, Colors.Green);
height.ValueChanged := procedure -> begin
p.Height := height.Value;
end;
radius.ValueChanged := procedure -> begin
p.Radius := radius.Value;
end;
sides.ValueChanged := procedure -> begin
p.Sides := sides.Value;
end;
end.

View file

@ -23,11 +23,10 @@ begin
var cb0 := ComboBox(x,362,'Выпадающий список',w);
cb0.AddRange('Россия','США','Китай','Германия','Франция');
TextBlock(x,414,'Слайдер');
Slider(x,434,0,10,w);
Slider(x,414,'Слайдер:',0,10,w);
TextBlock(x,469,'Блок текста',w);
IntegerBlock(x,488,'Блок целого:',w,64);
RealBlock(x,507,'Блок вещественного:',w,3.5);
IntegerBlock(x,497,'Блок целого:',w,64);
RealBlock(x,526,'Блок вещественного:',w,3.5);
LeftPanel(160,Colors.Orange);
@ -48,8 +47,7 @@ begin
var cb := ComboBox('Выпадающий список');
cb.AddRange('Россия','США','Китай','Германия','Франция');
TextBlock('Слайдер');
Slider(0,10);
Slider('Слайдер:',0,10);
TextBlock('Блок текста');
IntegerBlock('Блок целого:',64);
RealBlock('Блок вещественного:',3.5);

View file

@ -23,8 +23,7 @@ begin
var cb := new ComboBoxWPF('Выпадающий список');
cb.AddRange('Россия','США','Китай','Германия','Франция');
new TextBlockWPF('Слайдер');
new SliderWPF(0,10);
new SliderWPF('Слайдер:',0,10);
new TextBlockWPF('Блок текста');
new IntegerBlockWPF('Блок целого:',64);
new RealBlockWPF('Блок вещественного:',3.5);

Binary file not shown.

View file

@ -1 +1 @@
3.6.3.2608
3.6.3.2613

View file

@ -1 +1 @@
!define VERSION '3.6.3.2608'
!define VERSION '3.6.3.2613'

View file

@ -215,6 +215,20 @@ namespace PascalABCCompiler.SyntaxTree
}
}
// добавление свойств - временно убрал т.к. свойства нельзя передавать как var-параметры
// По идее если это делать, то поля переименовывать везде в классе!!!
/*for (var i=0; i<names.Count; i++)
{
if (names[i].name.StartsWith("#"))
continue;
var propName = names[i].TypedClone();
names[i].name = "!" + names[i].name;
var simpleProp = BuildSimpleReadWriteProperty(propName, names[i].name, types[i]);
var cm = BuildOneMemberSection(simpleProp);
cb.Add(cm);
}*/
if (!HasConstructor)
{
var fnames = names.Select(x => new ident("f" + x.name.ToLower(), x.source_context)).ToList();

View file

@ -16387,7 +16387,9 @@ namespace PascalABCCompiler.TreeConverter
{
tn = convert_strong(_var_def_statement.vars_type);
if (tn.type_special_kind != SemanticTree.type_special_kind.array_kind &&
if (tn.type_special_kind != SemanticTree.type_special_kind.array_kind &&
tn.type_special_kind != SemanticTree.type_special_kind.array_wrapper &&
!tn.BaseFullName.StartsWith("System.Tuple") &&
_var_def_statement.inital_value is SyntaxTree.array_const ac)
{
AddError(get_location(_var_def_statement), "IMPOSSIBLE_TO_CONVERT_ARRAY_CONST_TO_{0}", tn);

View file

@ -24,6 +24,7 @@ type
GPanel = System.Windows.Controls.Panel;
GControl = System.Windows.Controls.Control;
GStatusBar = System.Windows.Controls.Primitives.StatusBar;
Orientation = System.Windows.Controls.Orientation;
MessageBox = System.Windows.MessageBox;
MessageBoxButton = System.Windows.MessageBoxButton;
MessageBoxResult = System.Windows.MessageBoxResult;
@ -181,6 +182,35 @@ type
/// Событие нажатия на элемент управления
Click: procedure;
end;
StackPanelWPF = class(CommonControlWPF)
private
property sp: StackPanel read element as StackPanel;
procedure CreateP(Orient: Orientation; width,height: real);
begin
element := new StackPanel;
element.Focusable := False;
if width>0 then
element.Width := width;
if height>0 then
element.Height := height;
sp.Orientation := Orient;
__ActivePanelInternal.Children.Add(sp);
_ActivePanel := sp;
end;
procedure SetColorP(c: GColor);
begin
sp.Background := GetBrush(c);
end;
function GetColorP := (sp.Background as SolidColorBrush).Color;
procedure SetTTP(s: string);
begin
sp.ToolTip := s;
end;
public
constructor (Orient: Orientation; width: real := 0; height: real := 0) := Invoke(CreateP,Orient,width,height);
property Color: GColor read Invoke&<GColor>(GetColorP) write Invoke(SetColorP, value);
end;
/// Элемент управления "Изображение"
ImageWPF = class(CommonControlWPF)
@ -200,7 +230,6 @@ type
MainDockPanel.children.RemoveAt(MainDockPanel.children.Count-1);
MainDockPanel.children.Add(im);
end;
private
function GetNameP: string;
begin
Result := (im.Source as BitmapImage).UriSource.AbsolutePath
@ -386,6 +415,12 @@ type
else tb.Visibility := System.Windows.Visibility.Visible;
tb.Text := t;
end;
procedure SetTitleVisibilityP(v: boolean);
begin
if v then
tb.Visibility := System.Windows.Visibility.Visible
else tb.Visibility := System.Windows.Visibility.Collapsed;
end;
procedure SetHP(h: real) := MainElement.Height := h;
function CreateStackPanel(el: FrameworkElement; title: string): StackPanel;
@ -418,7 +453,10 @@ type
end;
public
/// Заголовок
property Title: string read InvokeString(()->tb.Text) write Invoke(SetTitleP, value);
property Title: string read InvokeString(()->tb.Text) write Invoke(SetTitleP, value); virtual;
/// Видим ли заголовок
property TitleVisible: boolean read InvokeBoolean(()->tb.Visibility <> System.Windows.Visibility.Collapsed)
write Invoke(SetTitleVisibilityP, value); virtual;
/// Высота элемента управления
property Height: real read InvokeReal(()->MainElement.ActualHeight) write Invoke(SetHP, value); override;
/// Размер шрифта
@ -605,10 +643,10 @@ type
property Items[i: integer]: string read InvokeString(()->cb.Items[i] as string); default;
end;
/// Элемент управления "Слайдер"
SliderWPF = class(CommonControlWPF)
SliderBase = class(ControlWithTitleWPF)
private
function sl: Slider := element as Slider;
titl: string; // часть заголовка без числа
function sl: Slider := MainElement as Slider;
function GetMinimum: real := InvokeReal(()->sl.Minimum);
procedure SetMinimumP(r: real) := sl.Minimum := r;
procedure SetMinimum(r: real) := Invoke(SetMinimumP, r);
@ -621,11 +659,18 @@ type
function GetFrequency: real := InvokeReal(()->sl.TickFrequency);
procedure SetFrequencyP(r: real) := sl.TickFrequency := r;
procedure SetFrequency(r: real) := Invoke(SetFrequencyP, r);
protected
procedure CreatePXY(x,y: real; min, max, val, freq: real; width: real);
private
procedure CreatePXY(x,y: real; title: string; min, max, val, freq: real; width: real);
begin
Init0(new Slider,width,x,y);
sl.ValueChanged += procedure(o, e) -> ValueChangedP;
Init1(new Slider,title,width,x,y);
Remainder(title,min, max, val, freq);
end;
procedure Remainder(tit: string; min, max, val, freq: real);
begin
titl := tit;
sl.ValueChanged += procedure(o, e) -> if ValueChanged <> nil then ValueChanged;
sl.ValueChanged += procedure(o, e) -> if title <> '' then tb.Text := Title + ' ' + sl.Value;
if titl <> '' then tb.Text := Title + ' ' + sl.Value;
sl.TickPlacement := System.Windows.Controls.Primitives.TickPlacement.BottomRight;
sl.Minimum := min;
sl.Maximum := max;
@ -634,15 +679,62 @@ type
sl.TickFrequency := (max-min)/10
else sl.TickFrequency := freq;
sl.Foreground := Brushes.Black;
sl.IsSnapToTickEnabled := True;
end;
procedure CreateP(title: string; min, max, val, freq: real) := CreatePXY(-1, -1, title, min, max, val, freq, 0);
procedure SetTitleP1(tit: string);
begin
titl := tit;
SetTitleP(tit +' ' + sl.Value);
end;
procedure CreateP(min, max, val, freq: real) := CreatePXY(-1,-1,min, max, val, freq, 0);
procedure ValueChangedP := if ValueChanged <> nil then ValueChanged;
public
/// Событие, возникающее при изменении значения
ValueChanged: procedure;
constructor Create(min, max: real; val: real := real.MinValue; freq: real := 0) := Invoke(CreateP, min, max, val, freq);
constructor Create(x,y: real; min, max: real; width: real; val: real := real.MinValue; freq: real := 0) := Invoke(CreatePXY, x,y,min, max, val, freq, width);
/// Заголовок
property Title: string read InvokeString(()->titl) write Invoke(SetTitleP1, value); override;
end;
/// Элемент управления "Слайдер" с целыми значениями
SliderWPF = class(SliderBase)
private
procedure CreatePXYI(x,y: real; title: string; min, max, val, freq: integer; width: integer);
begin
Init1(new Slider,title,width,x,y);
if freq<=0 then
freq := (max-min) div 10;
if freq = 0 then
freq := 1;
Remainder(title,min, max, val, freq);
end;
procedure CreatePI(title: string; min, max, val, freq: integer) := CreatePXYI(-1, -1, title, min, max, val, freq, 0);
public
constructor Create(min, max: integer; val: integer := integer.MinValue; freq: integer := 0)
:= Invoke(CreatePI, '', min, max, val, freq);
constructor Create(title: string := '');
begin
Create(title, 0, 10, 0);
end;
constructor Create(title: string; min, max: integer; val: integer := integer.MinValue; freq: integer := 0)
:= Invoke(CreatePI, title, min, max, val, freq);
constructor Create(x,y: real; title: string; min, max: integer; width: integer; val: integer := integer.MinValue; freq: integer := 0)
:= Invoke(CreatePXYI, x,y,title,min, max, val, freq, width);
/// Минимальное значение
property Minimum: integer read GetMinimum.Round write SetMinimum(value);
/// Максимальное значение
property Maximum: integer read GetMaximum.Round write SetMaximum(value);
/// Текущее значение
property Value: integer read GetValue.Round write SetValue(value);
/// Интервал между делениями
property Frequency: integer read GetFrequency.Round write SetFrequency(value);
end;
/// Элемент управления "Слайдер" с вещественными значениями
SliderRealWPF = class(SliderBase)
public
constructor Create(min, max: real; val: real := real.MinValue; freq: real := 0) := Invoke(CreateP, '', min, max, val, freq);
constructor Create(title: string := '') := Create(title, 0, 10, 0);
constructor Create(title: string; min, max: real; val: real := real.MinValue; freq: real := 0) := Invoke(CreateP, title, min, max, val, freq);
constructor Create(x,y: real; title: string; min, max: real; width: real; val: real := real.MinValue; freq: real := 0) := Invoke(CreatePXY, x,y,title,min, max, val, freq, width);
/// Минимальное значение
property Minimum: real read GetMinimum write SetMinimum;
/// Максимальное значение
@ -1029,12 +1121,23 @@ function ListBox(title: string := ''; height: real := 150): ListBoxWPF;
/// Элемент управления "Список" с заданными координатами
function ListBox(x,y: real; title: string := ''; width: real := 150; height: real := 150): ListBoxWPF;
/// Элемент управления "Слайдер с вещественными значениями"
function SliderReal(title: string := ''): SliderRealWPF;
/// Элемент управления "Слайдер с вещественными значениями" с заданным диапазоном значений и заголовком
function SliderReal(title: string; min,max: real; val: real := real.MinValue; freq: real := 0): SliderRealWPF;
/// Элемент управления "Слайдер с вещественными значениями" с заданным диапазоном значений
function SliderReal(min, max: real; val: real := real.MaxValue; freq: real := 0): SliderRealWPF;
/// Элемент управления "Слайдер с вещественными значениями" с заданными координатами
function SliderReal(x,y: real; title: string; min,max: real; width: real; val: real := real.MinValue; freq: real := 0): SliderRealWPF;
/// Элемент управления "Слайдер"
function Slider(): SliderWPF;
function Slider(title: string := ''): SliderWPF;
/// Элемент управления "Слайдер" с заданным диапазоном значений и заголовком
function Slider(title: string; min,max: integer; val: integer := integer.MinValue; freq: integer := 0): SliderWPF;
/// Элемент управления "Слайдер" с заданным диапазоном значений
function Slider(min,max: real; val: real := real.MinValue; freq: real := 0): SliderWPF;
function Slider(min, max: integer; val: integer := integer.MinValue; freq: integer := 0): SliderWPF;
/// Элемент управления "Слайдер" с заданными координатами
function Slider(x,y: real; min,max: real; width: real; val: real := real.MinValue; freq: real := 0): SliderWPF;
function Slider(x,y: real; title: string; min,max: integer; width: integer; val: integer := integer.MinValue; freq: integer := 0): SliderWPF;
/// Элемент управления "Изображение"
function Image(name: string): ImageWPF;
@ -1111,18 +1214,34 @@ function IntegerBox(x, y: real; title: string; min,max: integer; width: real) :=
function ListBox(title: string; height: real): ListBoxWPF := ListBoxWPF.Create(title,height);
function ListBox(x,y: real; title: string; width: real; height: real): ListBoxWPF := ListBoxWPF.Create(x,y,title,width,height);
function Slider: SliderWPF := SliderWPF.Create(0, 10, 0, 0);
function Slider(min, max, val, freq: real): SliderWPF;
function SliderReal(title: string): SliderRealWPF := SliderRealWPF.Create(title,0, 10, 0, 0);
function SliderReal(title: string; min, max, val, freq: real): SliderRealWPF;
begin
if val = real.MinValue then
val := min;
Result := SliderWPF.Create(min, max, val, freq);
Result := SliderRealWPF.Create(title, min, max, val, freq);
end;
function SliderReal(min, max, val, freq: real): SliderRealWPF := SliderReal('',min, max, val, freq);
function SliderReal(x,y: real; title: string; min,max,width,val,freq: real): SliderRealWPF;
begin
if val = real.MinValue then
val := min;
Result := SliderRealWPF.Create(x, y, title, min, max, width, val, freq);
end;
function Slider(x,y,min,max,width,val,freq: real): SliderWPF;
function Slider(title: string): SliderWPF := SliderWPF.Create(title);
function Slider(title: string; min, max, val, freq: integer): SliderWPF;
begin
if val = real.MinValue then
val := min;
Result := SliderWPF.Create(x, y, min, max, width, val, freq);
Result := SliderWPF.Create(title, min, max, val, freq);
end;
function Slider(min, max, val, freq: integer): SliderWPF := Slider('',min, max, val, freq);
function Slider(x,y: real; title: string; min,max,width,val,freq: integer): SliderWPF;
begin
if val = real.MinValue then
val := min;
Result := SliderWPF.Create(x, y, title, min, max, width, val, freq);
end;
function Image(name: string): ImageWPF := new ImageWPF(name);

View file

@ -2206,15 +2206,15 @@ type
procedure SetN(n: integer);
function GetN: integer;
protected
function CreateObject: Object3D; override := new PrismT(X, Y, Z, N, Radius, Height, Material.Clone);
function CreateObject: Object3D; override := new PrismT(X, Y, Z, Sides, Radius, Height, Material.Clone);
public
constructor(x, y, z: real; N: integer; r, h: real; m: Gmaterial);
/// Радиус правильной призмы
property Radius: real read GetR write SetR;
/// Высота правильной призмы
property Height: real read GetH write SetH;
/// Количество углов правильной призмы
property N: integer read GetN write SetN;
/// Количество боковых граней правильной призмы
property Sides: integer read GetN write SetN;
/// Возвращает клон правильной призмы
function Clone := (inherited Clone) as PrismT;
end;
@ -2226,15 +2226,15 @@ type
PyramidT = class(PrismT)
private
protected
function CreateObject: Object3D; override := new PyramidT(X, Y, Z, N, Radius, Height, Material.Clone);
function CreateObject: Object3D; override := new PyramidT(X, Y, Z, Sides, Radius, Height, Material.Clone);
public
constructor(x, y, z: real; N: integer; r, h: real; m: GMaterial);
/// Радиус правильной пирамиды
property Radius: real read GetR write SetR;
/// Высота правильной пирамиды
property Height: real read GetH write SetH;
/// Количество углов правильной пирамиды
property N: integer read GetN write SetN;
/// Количество боковых граней правильной пирамиды
property Sides: integer read GetN write SetN;
/// Возвращает клон правильной пирамиды
function Clone := (inherited Clone) as PyramidT;
end;
@ -2288,8 +2288,8 @@ type
begin
var pc := new Point3DCollection;
var a := PartitionPoints(0, 2 * Pi, N).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).ToArray;
var b := PartitionPoints(0, 2 * Pi, N).Select(x -> P3D(fr * cos(x), fr * sin(x), fh)).ToArray;
var a := PartitionPoints(0, 2 * Pi, Sides).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).ToArray;
var b := PartitionPoints(0, 2 * Pi, Sides).Select(x -> P3D(fr * cos(x), fr * sin(x), fh)).ToArray;
for var i := 0 to a.High - 1 do
begin
pc.Add(a[i]);
@ -2320,12 +2320,12 @@ type
end;
protected
function CreateObject: Object3D; override := new PrismTWireframe(X, Y, Z, N, Radius, Height, (model as LinesVisual3D).Thickness, (model as LinesVisual3D).Color);
function CreateObject: Object3D; override := new PrismTWireframe(X, Y, Z, Sides, Radius, Height, (model as LinesVisual3D).Thickness, (model as LinesVisual3D).Color);
public
function Points: Point3DCollection; virtual;
begin
var a := PartitionPoints(0, 2 * Pi, N).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).SkipLast;
var b := PartitionPoints(0, 2 * Pi, N).Select(x -> P3D(fr * cos(x), fr * sin(x), fh)).SkipLast;
var a := PartitionPoints(0, 2 * Pi, Sides).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).SkipLast;
var b := PartitionPoints(0, 2 * Pi, Sides).Select(x -> P3D(fr * cos(x), fr * sin(x), fh)).SkipLast;
var pc := new Point3DCollection(a + b);
Result := pc;
@ -2338,8 +2338,8 @@ type
property Radius: real read fr write SetR;
/// Высота проволочной правильной призмы
property Height: real read fh write SetH;
/// Количество углов проволочной правильной призмы
property N: integer read fn write SetN;
/// Количество боковых граней проволочной правильной призмы
property Sides: integer read fn write SetN;
/// Цвет проволоки правильной призмы
property Color: GColor read GetC write SetC; override;
/// Толщина проволоки правильной призмы
@ -2352,13 +2352,13 @@ type
/// Класс проволочной правильной пирамиды
PyramidTWireframe = class(PrismTWireframe)
protected
function CreateObject: Object3D; override := new PyramidTWireframe(X, Y, Z, N, Radius, Height, (model as LinesVisual3D).Thickness, (model as LinesVisual3D).Color);
function CreateObject: Object3D; override := new PyramidTWireframe(X, Y, Z, Sides, Radius, Height, (model as LinesVisual3D).Thickness, (model as LinesVisual3D).Color);
private
function CreatePoints: Point3DCollection; override;
begin
var pc := new Point3DCollection;
var a := PartitionPoints(0, 2 * Pi, N).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).ToArray;
var a := PartitionPoints(0, 2 * Pi, Sides).Select(x -> P3D(fr * cos(x), fr * sin(x), 0)).ToArray;
var b := P3D(0, 0, fh);
for var i := 0 to a.High - 1 do
begin
@ -2377,8 +2377,8 @@ type
property Radius: real read fr write SetR;
/// Высота проволочной правильной пирамиды
property Height: real read fh write SetH;
/// Количество углов проволочной правильной пирамиды
property N: integer read fn write SetN;
/// Количество боковых граней проволочной правильной пирамиды
property Sides: integer read fn write SetN;
/// Цвет проволоки правильной пирамиды
property Color: GColor read GetC write SetC; override;
/// Толщина проволоки правильной пирамиды
@ -3373,15 +3373,15 @@ function FileModel3D(p: Point3D; fname: string; m: Material): FileModelT := File
function Prism(x, y, z: real; Sides: integer; Height, Radius: real; m: Material): PrismT := Inv(()->PrismT.Create(x, y, z, Sides, Radius, Height, m));
function Prism(p: Point3D; Sides: integer; Height, Radius: real; m: Material): PrismT := Prism(p.X, p.Y, p.Z, Sides, Radius, Height, m);
function Prism(p: Point3D; Sides: integer; Height, Radius: real; m: Material): PrismT := Prism(p.X, p.Y, p.Z, Sides, Height, Radius, m);
function PrismWireFrame(x, y, z: real; Sides: integer; Height, Radius: real; Thickness: real; c: Color): PrismTWireFrame := Inv(()->PrismTWireFrame.Create(x, y, z, Sides, Radius, Height, thickness, c));
function PrismWireFrame(p: Point3D; Sides: integer; Height, Radius: real; Thickness: real; c: Color): PrismTWireFrame := PrismWireFrame(p.x, p.y, p.z, Sides, Radius, Height, thickness, c);
function PrismWireFrame(p: Point3D; Sides: integer; Height, Radius: real; Thickness: real; c: Color): PrismTWireFrame := PrismWireFrame(p.x, p.y, p.z, Sides, Height, Radius, thickness, c);
function Pyramid(x, y, z: real; Sides: integer; Height, Radius: real; m: Material): PyramidT := Inv(()->PyramidT.Create(x, y, z, Sides, Radius, Height, m));
function Pyramid(p: Point3D; Sides: integer; Height, Radius: real; m: Material): PyramidT := Pyramid(p.X, p.Y, p.Z, Sides, Radius, Height, m);
function Pyramid(p: Point3D; Sides: integer; Height, Radius: real; m: Material): PyramidT := Pyramid(p.X, p.Y, p.Z, Sides, Height, Radius, m);
function PyramidWireFrame(x, y, z: real; Sides: integer; Height, Radius: real; Thickness: real; c: Color): PyramidTWireFrame := Inv(()->PyramidTWireFrame.Create(x, y, z, Sides, Radius, Height, thickness, c));

View file

@ -3,6 +3,9 @@
NAME_CANNOT_HAVE_GENERIC_PARAMETERS_{0}=Name {0} can not have generic parameters
AUTO_CLASS_MUST_NOT_HAVE_POINTERS=Auto class can not have fields of pointer type
AUTO_CLASS_MUST_NOT_HAVE_PARENTS=Auto class can not have parents
AUTO_CLASS_MUST_NOT_HAVE_UNNAMED_ENUMS=Auto class can not have fields with unnamed enums type
AUTO_CLASS_MUST_NOT_HAVE_EVENTS=Auto class can not have events
AUTO_CLASS_MUST_NOT_HAVE_PROPERTIES=Auto class can not have properties
UNDEFINED_NAME_REFERENCE_{0}=Undefined name reference '{0}'
TWO_TYPE_CONVERTIONS_POSSIBLE_FIRST_TYPE_{0}_SECOND_TYE_{1}=Two type of convertions are possible: to type '{0}' and to type '{1}'
CAN_NOT_CONVERT_TYPES_FROM_{0}_TO_{1}=Incompatible types: '{0}' and '{1}'

View file

@ -5,6 +5,7 @@ AUTO_CLASS_MUST_NOT_HAVE_POINTERS=Авто класс не может иметь
AUTO_CLASS_MUST_NOT_HAVE_PARENTS=Авто класс не может иметь предков
AUTO_CLASS_MUST_NOT_HAVE_UNNAMED_ENUMS=Авто класс не может иметь полей с неименованными перечислимыми типами
AUTO_CLASS_MUST_NOT_HAVE_EVENTS=Авто класс не может иметь поля, являющиеся событиями
AUTO_CLASS_MUST_NOT_HAVE_PROPERTIES=Авто класс не может иметь свойства
UNDEFINED_NAME_REFERENCE_{0}=Неизвестное имя '{0}'
TWO_TYPE_CONVERTIONS_POSSIBLE_FIRST_TYPE_{0}_SECOND_TYE_{1}=Возможны два преобразования типа: к типу {0} и к типу {1}
CAN_NOT_CONVERT_TYPES_FROM_{0}_TO_{1}=Нельзя преобразовать тип {0} к {1}