| 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 GetPickingGeometry: TAbstractGeometryNode; |
| 28 |
procedure SetPickingGeometry(const Value: TAbstractGeometryNode); |
| 29 |
function GetIntersectionType: TPickSensorIntersectionType; |
| 30 |
procedure SetIntersectionType(const Value: TPickSensorIntersectionType); |
| 31 |
function GetSortOrder: TPickSensorRange; |
| 32 |
procedure SetSortOrder(const Value: TPickSensorRange); |
| 33 |
public |
| 34 |
{ Create node fields and events. } |
| 35 |
procedure CreateNode; override; |
| 36 |
class function ClassX3DType: String; override; |
| 37 |
|
| 38 |
strict private FFdObjectType: TMFString; |
| 39 |
{ Internal wrapper for property @code(ObjectType). This wrapper API may change, we advise to access simpler @code(ObjectType) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 40 |
public property FdObjectType: TMFString read FFdObjectType; |
| 41 |
{ } |
| 42 |
procedure SetObjectType(const Value: array of string); overload; |
| 43 |
{ } |
| 44 |
procedure SetObjectType(const Value: TCastleStringList); overload; |
| 45 |
|
| 46 |
strict private FFdPickingGeometry: TSFNode; |
| 47 |
{ Internal wrapper for property @code(PickingGeometry). This wrapper API may change, we advise to access simpler @code(PickingGeometry) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 48 |
public property FdPickingGeometry: TSFNode read FFdPickingGeometry; |
| 49 |
{ } |
| 50 |
property PickingGeometry: TAbstractGeometryNode read GetPickingGeometry write SetPickingGeometry; |
| 51 |
|
| 52 |
strict private FFdPickTarget: TMFNode; |
| 53 |
{ Internal wrapper for property @code(PickTarget). This wrapper API may change, we advise to access simpler @code(PickTarget) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 54 |
public property FdPickTarget: TMFNode read FFdPickTarget; |
| 55 |
{ } |
| 56 |
procedure SetPickTarget(const Value: array of TX3DNode); |
| 57 |
|
| 58 |
strict private FEventPickedGeometry: TMFNodeEvent; |
| 59 |
{ } |
| 60 |
public property EventPickedGeometry: TMFNodeEvent read FEventPickedGeometry; |
| 61 |
|
| 62 |
strict private FFdIntersectionType: TSFStringEnum; |
| 63 |
{ Internal wrapper for property @code(IntersectionType). This wrapper API may change, we advise to access simpler @code(IntersectionType) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 64 |
public property FdIntersectionType: TSFStringEnum read FFdIntersectionType; |
| 65 |
{ } |
| 66 |
property IntersectionType: TPickSensorIntersectionType read GetIntersectionType write SetIntersectionType; |
| 67 |
|
| 68 |
strict private FFdSortOrder: TSFStringEnum; |
| 69 |
{ Internal wrapper for property @code(SortOrder). This wrapper API may change, we advise to access simpler @code(SortOrder) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 70 |
public property FdSortOrder: TSFStringEnum read FFdSortOrder; |
| 71 |
{ } |
| 72 |
property SortOrder: TPickSensorRange read GetSortOrder write SetSortOrder; |
| 73 |
|
| 74 |
{$endif read_interface} |
| 75 |
|
| 76 |
{$ifdef read_implementation} |
| 77 |
|
| 78 |
{ TAbstractPickSensorNode ----------------------------------------------- } |
| 79 |
|
| 80 |
procedure TAbstractPickSensorNode.SetObjectType(const Value: array of string); |
| 81 |
begin |
| 82 |
FdObjectType.Send(Value); |
| 83 |
end; |
| 84 |
|
| 85 |
procedure TAbstractPickSensorNode.SetObjectType(const Value: TCastleStringList); |
| 86 |
begin |
| 87 |
FdObjectType.Send(Value); |
| 88 |
end; |
| 89 |
|
| 90 |
function TAbstractPickSensorNode.GetPickingGeometry: TAbstractGeometryNode; |
| 91 |
begin |
| 92 |
if FdPickingGeometry.Value is TAbstractGeometryNode then |
| 93 |
Result := TAbstractGeometryNode(FdPickingGeometry.Value) |
| 94 |
else |
| 95 |
Result := nil; |
| 96 |
end; |
| 97 |
|
| 98 |
procedure TAbstractPickSensorNode.SetPickingGeometry(const Value: TAbstractGeometryNode); |
| 99 |
begin |
| 100 |
FdPickingGeometry.Send(Value); |
| 101 |
end; |
| 102 |
|
| 103 |
procedure TAbstractPickSensorNode.SetPickTarget(const Value: array of TX3DNode); |
| 104 |
var |
| 105 |
L: Integer; |
| 106 |
A: array of TX3DNode; |
| 107 |
begin |
| 108 |
L := High(Value) + 1; |
| 109 |
SetLength(A, L); |
| 110 |
if L > 0 then |
| 111 |
Move(Value[0], A[0], L * SizeOf(TX3DNode)); |
| 112 |
FdPickTarget.Send(A); |
| 113 |
end; |
| 114 |
|
| 115 |
function TAbstractPickSensorNode.GetIntersectionType: TPickSensorIntersectionType; |
| 116 |
begin |
| 117 |
Result := TPickSensorIntersectionType(FdIntersectionType.EnumValue); |
| 118 |
end; |
| 119 |
|
| 120 |
procedure TAbstractPickSensorNode.SetIntersectionType(const Value: TPickSensorIntersectionType); |
| 121 |
begin |
| 122 |
FdIntersectionType.SendEnumValue(Ord(Value)); |
| 123 |
end; |
| 124 |
|
| 125 |
function TAbstractPickSensorNode.GetSortOrder: TPickSensorRange; |
| 126 |
begin |
| 127 |
Result := TPickSensorRange(FdSortOrder.EnumValue); |
| 128 |
end; |
| 129 |
|
| 130 |
procedure TAbstractPickSensorNode.SetSortOrder(const Value: TPickSensorRange); |
| 131 |
begin |
| 132 |
FdSortOrder.SendEnumValue(Ord(Value)); |
| 133 |
end; |
| 134 |
|
| 135 |
class function TAbstractPickSensorNode.ClassX3DType: String; |
| 136 |
begin |
| 137 |
Result := 'X3DPickSensorNode'; |
| 138 |
end; |
| 139 |
|
| 140 |
procedure TAbstractPickSensorNode.CreateNode; |
| 141 |
begin |
| 142 |
inherited; |
| 143 |
|
| 144 |
FFdObjectType := TMFString.Create(Self, True, 'objectType', ['ALL']); |
| 145 |
FdObjectType.ChangeAlways := chVisibleNonGeometry; |
| 146 |
AddField(FFdObjectType); |
| 147 |
|
| 148 |
FFdPickingGeometry := TSFNode.Create(Self, True, 'pickingGeometry', [TAbstractGeometryNode]); |
| 149 |
FdPickingGeometry.ChangeAlways := chVisibleNonGeometry; |
| 150 |
AddField(FFdPickingGeometry); |
| 151 |
|
| 152 |
FFdPickTarget := TMFNode.Create(Self, True, 'pickTarget', [TAbstractGroupingNode, TAbstractShapeNode, TInlineNode]); |
| 153 |
FdPickTarget.ChangeAlways := chVisibleNonGeometry; |
| 154 |
AddField(FFdPickTarget); |
| 155 |
|
| 156 |
FEventPickedGeometry := TMFNodeEvent.Create(Self, 'pickedGeometry', false); |
| 157 |
AddEvent(FEventPickedGeometry); |
| 158 |
|
| 159 |
FFdIntersectionType := TSFStringEnum.Create(Self, False, 'intersectionType', @PickSensorIntersectionTypeNames, Ord(High(PickSensorIntersectionTypeNames)) + 1, Ord(piBounds)); |
| 160 |
FdIntersectionType.ChangeAlways := chVisibleNonGeometry; |
| 161 |
AddField(FFdIntersectionType); |
| 162 |
|
| 163 |
FFdSortOrder := TSFStringEnum.Create(Self, False, 'sortOrder', @PickSensorRangeNames, Ord(High(PickSensorRangeNames)) + 1, Ord(prClosest)); |
| 164 |
FdSortOrder.ChangeAlways := chVisibleNonGeometry; |
| 165 |
AddField(FFdSortOrder); |
| 166 |
end; |
| 167 |
|
| 168 |
{$endif read_implementation} |