| 1 |
{ -*- buffer-read-only: t -*- |
| 2 |
|
| 3 |
Copyright 2015-2024 Michalis Kamburelis. |
| 4 |
|
| 5 |
This file is part of "Castle Game Engine". |
| 6 |
|
| 7 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 8 |
included in this distribution, for details about the copyright. |
| 9 |
|
| 10 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
---------------------------------------------------------------------------- |
| 15 |
} |
| 16 |
|
| 17 |
{ Automatically generated node properties. |
| 18 |
|
| 19 |
Do not edit this file manually! |
| 20 |
To add new properties: |
| 21 |
- add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ , |
| 22 |
- and regenerate include files by running x3d-nodes-to-pascal } |
| 23 |
|
| 24 |
{$ifdef read_interface} |
| 25 |
|
| 26 |
strict private |
| 27 |
function GetStatus: Boolean; |
| 28 |
procedure SetStatus(const Value: Boolean); |
| 29 |
function GetNotStatus: Boolean; |
| 30 |
procedure SetNotStatus(const Value: Boolean); |
| 31 |
function GetEnabled: Boolean; |
| 32 |
procedure SetEnabled(const Value: Boolean); |
| 33 |
public |
| 34 |
{ Create node fields and events. } |
| 35 |
procedure CreateNode; override; |
| 36 |
class function ClassX3DType: String; override; |
| 37 |
|
| 38 |
strict private FFdStatus: TSFBool; |
| 39 |
{ Internal wrapper for property @code(Status). This wrapper API may change, we advise to access simpler @code(Status) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 40 |
public property FdStatus: TSFBool read FFdStatus; |
| 41 |
{ Stored Boolean value. } |
| 42 |
property Status: Boolean read GetStatus write SetStatus; |
| 43 |
|
| 44 |
strict private FFdNotStatus: TSFBool; |
| 45 |
{ Internal wrapper for property @code(NotStatus). This wrapper API may change, we advise to access simpler @code(NotStatus) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 46 |
public property FdNotStatus: TSFBool read FFdNotStatus; |
| 47 |
{ Always the negated value of @link(Status). You can set either @link(Status) or @link(NotStatus), changing one changes also the other to keep them being negated values of each other. Also events (like @link(EventToggle)) change both properties. } |
| 48 |
property NotStatus: Boolean read GetNotStatus write SetNotStatus; |
| 49 |
|
| 50 |
strict private FEventToggle: TXFAnyEvent; |
| 51 |
{ Send any value to this event (the value is ignored) to toggle @link(Status) between @true and @false. } |
| 52 |
public property EventToggle: TXFAnyEvent read FEventToggle; |
| 53 |
|
| 54 |
strict private FEventSet: TXFAnyEvent; |
| 55 |
{ Send any value to this event (the value is ignored) to set @link(Status) to @true. } |
| 56 |
public property EventSet: TXFAnyEvent read FEventSet; |
| 57 |
|
| 58 |
strict private FEventReset: TXFAnyEvent; |
| 59 |
{ Send any value to this event (the value is ignored) to set @link(Status) to @false. } |
| 60 |
public property EventReset: TXFAnyEvent read FEventReset; |
| 61 |
|
| 62 |
strict private FEventChanged: TSFBoolEvent; |
| 63 |
{ Outputs a @true value whenever the @link(Status) changed. } |
| 64 |
public property EventChanged: TSFBoolEvent read FEventChanged; |
| 65 |
|
| 66 |
strict private FEventOn: TSFBoolEvent; |
| 67 |
{ Outputs a @true value whenever the @link(Status) changed to @true. } |
| 68 |
public property EventOn: TSFBoolEvent read FEventOn; |
| 69 |
|
| 70 |
strict private FEventOff: TSFBoolEvent; |
| 71 |
{ Outputs a @true value whenever the @link(Status) changed to @false. } |
| 72 |
public property EventOff: TSFBoolEvent read FEventOff; |
| 73 |
|
| 74 |
strict private FFdEnabled: TSFBool; |
| 75 |
{ Internal wrapper for property @code(Enabled). This wrapper API may change, we advise to access simpler @code(Enabled) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 76 |
public property FdEnabled: TSFBool read FFdEnabled; |
| 77 |
{ When the node is disabled, input events are ignored (this includes @link(EventToggle), @link(EventSet), @link(EventReset) but also sending new values to @link(Status) and @link(NotStatus)) and output events (@link(EventOn), @link(EventOff), @link(EventChanged)) are never generated. } |
| 78 |
property Enabled: Boolean read GetEnabled write SetEnabled; |
| 79 |
|
| 80 |
{$endif read_interface} |
| 81 |
|
| 82 |
{$ifdef read_implementation} |
| 83 |
|
| 84 |
{ TTogglerNode ----------------------------------------------- } |
| 85 |
|
| 86 |
function TTogglerNode.GetStatus: Boolean; |
| 87 |
begin |
| 88 |
Result := FdStatus.Value; |
| 89 |
end; |
| 90 |
|
| 91 |
procedure TTogglerNode.SetStatus(const Value: Boolean); |
| 92 |
begin |
| 93 |
FdStatus.Send(Value); |
| 94 |
end; |
| 95 |
|
| 96 |
function TTogglerNode.GetNotStatus: Boolean; |
| 97 |
begin |
| 98 |
Result := FdNotStatus.Value; |
| 99 |
end; |
| 100 |
|
| 101 |
procedure TTogglerNode.SetNotStatus(const Value: Boolean); |
| 102 |
begin |
| 103 |
FdNotStatus.Send(Value); |
| 104 |
end; |
| 105 |
|
| 106 |
function TTogglerNode.GetEnabled: Boolean; |
| 107 |
begin |
| 108 |
Result := FdEnabled.Value; |
| 109 |
end; |
| 110 |
|
| 111 |
procedure TTogglerNode.SetEnabled(const Value: Boolean); |
| 112 |
begin |
| 113 |
FdEnabled.Send(Value); |
| 114 |
end; |
| 115 |
|
| 116 |
class function TTogglerNode.ClassX3DType: String; |
| 117 |
begin |
| 118 |
Result := 'Toggler'; |
| 119 |
end; |
| 120 |
|
| 121 |
procedure TTogglerNode.CreateNode; |
| 122 |
begin |
| 123 |
inherited; |
| 124 |
|
| 125 |
FFdStatus := TSFBool.Create(Self, True, 'status', false); |
| 126 |
FdStatus.ChangeAlways := chNone; |
| 127 |
AddField(FFdStatus); |
| 128 |
|
| 129 |
FFdNotStatus := TSFBool.Create(Self, True, 'notStatus', true); |
| 130 |
FdNotStatus.ChangeAlways := chNone; |
| 131 |
AddField(FFdNotStatus); |
| 132 |
|
| 133 |
FEventToggle := TXFAnyEvent.Create(Self, 'toggle', true); |
| 134 |
AddEvent(FEventToggle); |
| 135 |
|
| 136 |
FEventSet := TXFAnyEvent.Create(Self, 'set', true); |
| 137 |
AddEvent(FEventSet); |
| 138 |
|
| 139 |
FEventReset := TXFAnyEvent.Create(Self, 'reset', true); |
| 140 |
AddEvent(FEventReset); |
| 141 |
|
| 142 |
FEventChanged := TSFBoolEvent.Create(Self, 'changed', false); |
| 143 |
AddEvent(FEventChanged); |
| 144 |
|
| 145 |
FEventOn := TSFBoolEvent.Create(Self, 'on', false); |
| 146 |
AddEvent(FEventOn); |
| 147 |
|
| 148 |
FEventOff := TSFBoolEvent.Create(Self, 'off', false); |
| 149 |
AddEvent(FEventOff); |
| 150 |
|
| 151 |
FFdEnabled := TSFBool.Create(Self, True, 'enabled', true); |
| 152 |
FdEnabled.ChangeAlways := chNone; |
| 153 |
AddField(FFdEnabled); |
| 154 |
end; |
| 155 |
|
| 156 |
{$endif read_implementation} |