-
Notifications
You must be signed in to change notification settings - Fork 7
/
MolHero.MoleculeModel.pas
executable file
·75 lines (60 loc) · 1.28 KB
/
MolHero.MoleculeModel.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
unit MolHero.MoleculeModel;
interface
uses
System.Types,
System.Math.Vectors,
System.Generics.Collections;
type
TAtomData = record
AtomKind: integer;
Pos: TPoint3D;
Symbol: string;
end;
TAtoms = TList<TAtomData>;
TBondKind = record
const b1 = 1;
const b2 = 2;
const b3 = 3;
end;
TBondData = record
BondKind: integer;
IdStart, IdEnd: integer;
end;
TBonds = TList<TBondData>;
TMolecule = class
private
FAtoms: TAtoms;
FBonds: TBonds;
FDisplayName: string;
procedure SetDisplayName(const Value: string);
public
constructor Create;
destructor Destroy; override;
procedure Clear;
property Atoms: TAtoms read FAtoms;
property Bonds: TBonds read FBonds;
property DisplayName: string read FDisplayName write SetDisplayName;
end;
implementation
{ TMolecule }
constructor TMolecule.Create;
begin
FAtoms := TList<TAtomData>.Create;
FBonds := TList<TBondData>.Create;
end;
destructor TMolecule.Destroy;
begin
FAtoms.Free;
FBonds.Free;
inherited;
end;
procedure TMolecule.SetDisplayName(const Value: string);
begin
FDisplayName := Value;
end;
procedure TMolecule.Clear;
begin
FAtoms.Clear;
FBonds.Clear;
end;
end.