| 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 GetTessellationScale: Single; |
| 28 |
procedure SetTessellationScale(const Value: Single); |
| 29 |
function GetBBox: TBox3D; |
| 30 |
procedure SetBBox(const Value: TBox3D); |
| 31 |
public |
| 32 |
{ Create node fields and events. } |
| 33 |
procedure CreateNode; override; |
| 34 |
class function ClassX3DType: String; override; |
| 35 |
|
| 36 |
strict private FEventAddGeometry: TMFNodeEvent; |
| 37 |
{ } |
| 38 |
public property EventAddGeometry: TMFNodeEvent read FEventAddGeometry; |
| 39 |
|
| 40 |
strict private FEventRemoveGeometry: TMFNodeEvent; |
| 41 |
{ } |
| 42 |
public property EventRemoveGeometry: TMFNodeEvent read FEventRemoveGeometry; |
| 43 |
|
| 44 |
strict private FFdGeometry: TMFNode; |
| 45 |
{ Internal wrapper for property @code(Geometry). This wrapper API may change, we advise to access simpler @code(Geometry) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 46 |
public property FdGeometry: TMFNode read FFdGeometry; |
| 47 |
{ } |
| 48 |
procedure SetGeometry(const Value: array of TAbstractNurbsSurfaceGeometryNode); |
| 49 |
|
| 50 |
strict private FFdTessellationScale: TSFFloat; |
| 51 |
{ Internal wrapper for property @code(TessellationScale). This wrapper API may change, we advise to access simpler @code(TessellationScale) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 52 |
public property FdTessellationScale: TSFFloat read FFdTessellationScale; |
| 53 |
{ } |
| 54 |
property TessellationScale: Single read GetTessellationScale write SetTessellationScale; |
| 55 |
|
| 56 |
strict private FFdBboxCenter: TSFVec3f; |
| 57 |
{ Internal wrapper for property @code(BboxCenter). This wrapper API may change, we advise to access simpler @code(BboxCenter) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 58 |
public property FdBboxCenter: TSFVec3f read FFdBboxCenter; |
| 59 |
{ } |
| 60 |
property BBox: TBox3D read GetBBox write SetBBox; |
| 61 |
|
| 62 |
strict private FFdBboxSize: TSFVec3f; |
| 63 |
{ Internal wrapper for property @code(BboxSize). This wrapper API may change, we advise to access simpler @code(BboxSize) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). } |
| 64 |
public property FdBboxSize: TSFVec3f read FFdBboxSize; |
| 65 |
|
| 66 |
{$endif read_interface} |
| 67 |
|
| 68 |
{$ifdef read_implementation} |
| 69 |
|
| 70 |
{ TNurbsSetNode ----------------------------------------------- } |
| 71 |
|
| 72 |
procedure TNurbsSetNode.SetGeometry(const Value: array of TAbstractNurbsSurfaceGeometryNode); |
| 73 |
var |
| 74 |
L: Integer; |
| 75 |
A: array of TX3DNode; |
| 76 |
begin |
| 77 |
L := High(Value) + 1; |
| 78 |
SetLength(A, L); |
| 79 |
if L > 0 then |
| 80 |
Move(Value[0], A[0], L * SizeOf(TAbstractNurbsSurfaceGeometryNode)); |
| 81 |
FdGeometry.Send(A); |
| 82 |
end; |
| 83 |
|
| 84 |
function TNurbsSetNode.GetTessellationScale: Single; |
| 85 |
begin |
| 86 |
Result := FdTessellationScale.Value; |
| 87 |
end; |
| 88 |
|
| 89 |
procedure TNurbsSetNode.SetTessellationScale(const Value: Single); |
| 90 |
begin |
| 91 |
FdTessellationScale.Send(Value); |
| 92 |
end; |
| 93 |
|
| 94 |
function TNurbsSetNode.GetBBox: TBox3D; |
| 95 |
begin |
| 96 |
Result := TBox3D.FromCenterSize(FdBBoxCenter.Value, FdBBoxSize.Value); |
| 97 |
end; |
| 98 |
|
| 99 |
procedure TNurbsSetNode.SetBBox(const Value: TBox3D); |
| 100 |
var |
| 101 |
ValueCenter, ValueSize: TVector3; |
| 102 |
begin |
| 103 |
Value.ToCenterSize(ValueCenter, ValueSize); |
| 104 |
FdBBoxCenter.Send(ValueCenter); |
| 105 |
FdBBoxSize.Send(ValueSize); |
| 106 |
end; |
| 107 |
|
| 108 |
class function TNurbsSetNode.ClassX3DType: String; |
| 109 |
begin |
| 110 |
Result := 'NurbsSet'; |
| 111 |
end; |
| 112 |
|
| 113 |
procedure TNurbsSetNode.CreateNode; |
| 114 |
begin |
| 115 |
inherited; |
| 116 |
|
| 117 |
FEventAddGeometry := TMFNodeEvent.Create(Self, 'addGeometry', true); |
| 118 |
AddEvent(FEventAddGeometry); |
| 119 |
|
| 120 |
FEventRemoveGeometry := TMFNodeEvent.Create(Self, 'removeGeometry', true); |
| 121 |
AddEvent(FEventRemoveGeometry); |
| 122 |
|
| 123 |
FFdGeometry := TMFNode.Create(Self, True, 'geometry', [TAbstractNurbsSurfaceGeometryNode]); |
| 124 |
FdGeometry.ChangeAlways := chVisibleNonGeometry; |
| 125 |
AddField(FFdGeometry); |
| 126 |
|
| 127 |
FFdTessellationScale := TSFFloat.Create(Self, True, 'tessellationScale', 1.0); |
| 128 |
FdTessellationScale.ChangeAlways := chVisibleNonGeometry; |
| 129 |
FdTessellationScale.MustBeNonnegative := true; |
| 130 |
AddField(FFdTessellationScale); |
| 131 |
|
| 132 |
FFdBboxCenter := TSFVec3f.Create(Self, False, 'bboxCenter', Vector3(0, 0, 0)); |
| 133 |
FdBboxCenter.ChangeAlways := chVisibleNonGeometry; |
| 134 |
AddField(FFdBboxCenter); |
| 135 |
|
| 136 |
FFdBboxSize := TSFVec3f.Create(Self, False, 'bboxSize', Vector3(-1, -1, -1)); |
| 137 |
FdBboxSize.ChangeAlways := chVisibleNonGeometry; |
| 138 |
AddField(FFdBboxSize); |
| 139 |
end; |
| 140 |
|
| 141 |
{$endif read_implementation} |