Class TElevationGridNode

Unit

Declaration

type TElevationGridNode = class(TAbstractGeometryNode)

Description

Uniform rectangular grid of varying height above the Y=0 plane, aka "height map".

Hierarchy

Overview

Methods

Public constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override;
Public function IsNotEmpty: boolean;
Public function ColorField: TSFNode; override;
Public function InternalFogCoord: TMFFloat; override;
Public function AttribField: TMFNode; override;
Public function SolidField: TSFBool; override;
Public function FieldSetByEvent(const Event: TX3DEvent): TX3DField; override;
Public function Proxy(var State: TX3DGraphTraverseState): TAbstractGeometryNode; override;
Public function LocalBoundingBox(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): TBox3D; override;
Public function VerticesCount(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): Cardinal; override;
Public function TrianglesCount(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): Cardinal; override;
Public class function InternalCreateTriangles( const AXDimension, AZDimension: Integer; const AXSpacing, AZSpacing: Single; const AHeight: TSingleList; const ATexCoord: TAbstractTextureCoordinateNode; const TriangulationIgnoreHeights: Boolean): TIndexedTriangleSetNode;
Public procedure CreateNode; override;
Public class function ClassX3DType: String; override;
Public procedure SetAttrib(const Value: array of TAbstractVertexAttributeNode);
Public procedure SetHeight(const Value: array of Single); overload;
Public procedure SetHeight(const Value: TSingleList); overload;

Properties

Public property EventSet_height: TMFFloatEvent read FEventSet_height;
Public property FdAttrib: TMFNode read FFdAttrib;
Public property FdColor: TSFNode read FFdColor;
Public property Color: TAbstractColorNode read GetColor write SetColor;
Public property FdFogCoord: TSFNode read FFdFogCoord;
Public property FogCoord: TFogCoordinateNode read GetFogCoord write SetFogCoord;
Public property FdNormal: TSFNode read FFdNormal;
Public property Normal: TAbstractNormalNode read GetNormal write SetNormal;
Public property FdTexCoord: TSFNode read FFdTexCoord;
Public property TexCoord: TAbstractTextureCoordinateNode read GetTexCoord write SetTexCoord;
Public property FdCcw: TSFBool read FFdCcw;
Public property Ccw: Boolean read GetCcw write SetCcw;
Public property FdColorPerVertex: TSFBool read FFdColorPerVertex;
Public property ColorPerVertex: Boolean read GetColorPerVertex write SetColorPerVertex;
Public property FdCreaseAngle: TSFFloat read FFdCreaseAngle;
Public property CreaseAngle: Single read GetCreaseAngle write SetCreaseAngle;
Public property FdHeight: TMFFloat read FFdHeight;
Public property FdNormalPerVertex: TSFBool read FFdNormalPerVertex;
Public property NormalPerVertex: Boolean read GetNormalPerVertex write SetNormalPerVertex;
Public property FdSolid: TSFBool read FFdSolid;
Public property FdXDimension: TSFInt32 read FFdXDimension;
Public property XDimension: Integer read GetXDimension write SetXDimension;
Public property FdXSpacing: TSFFloat read FFdXSpacing;
Public property XSpacing: Single read GetXSpacing write SetXSpacing;
Public property FdZDimension: TSFInt32 read FFdZDimension;
Public property ZDimension: Integer read GetZDimension write SetZDimension;
Public property FdZSpacing: TSFFloat read FFdZSpacing;
Public property ZSpacing: Single read GetZSpacing write SetZSpacing;

Description

Methods

Public constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override;

This item has no description. Showing description inherited from TX3DNode.Create.

Constructor. Initializes various properties:

  • Name, BaseUrl are initialized from given parameters.

  • The Fields, Events lists are filled in every descendant, to have all the fields/events defined by the specification.

  • DefaultContainerField, and other node-specific stuff, is filled in descendants. This is actually implemented in CreateNode, that is called at the end of this constructor.

Public function IsNotEmpty: boolean;

Do we have (correct) data to render.

Checks whether - xDimension and zDimension are >= 2, - xSpacing and zSpacing are > 0 - height list has at least the required number of values.

Public function ColorField: TSFNode; override;

This item has no description.

Public function InternalFogCoord: TMFFloat; override;

This item has no description.

Public function AttribField: TMFNode; override;

This item has no description.

Public function SolidField: TSFBool; override;

This item has no description. Showing description inherited from TAbstractGeometryNode.SolidField.

Is backface culling used. Nil if given geometry node doesn't have a field to control it.

Public function FieldSetByEvent(const Event: TX3DEvent): TX3DField; override;

This item has no description. Showing description inherited from TX3DNode.FieldSetByEvent.

Find field set by given event of this node. Nil if not found (including when this Event doesn't actually belong to this node).

Public function Proxy(var State: TX3DGraphTraverseState): TAbstractGeometryNode; override;

This item has no description. Showing description inherited from TAbstractGeometryNode.Proxy.

Converts this node to another node class that may be better supported.

Typically, converts some complex geometry node (like Extrusion or Teapot) into more common node like IndexedFaceSet or IndexedTriangleSet. TShape class wraps this method into a more comfortable interface, that is TShape methods simply automatically convert geometry nodes to their proxy versions if needed.

In the base TAbstractGeometryNode class, returns Nil indicating that no conversion is known.

The resulting node's Name (if the result is not Nil) must be equal to our Name.

Some Proxy implementations (especially for VRML 1.0) will have to create new State (TX3DGraphTraverseState) instance along with a new geometry node. You should do this by copying the State into a new TX3DGraphTraverseState instance, and modyfying the State reference. Simply speaking, do

State := TX3DGraphTraverseState.CreateCopy(State);

You should not just modify the fields of the provided State instance. (Reasoning: some proxy methods rely on getting the original State, e.g. with original MaterialBinding, not the transformed state, to work correctly.)

You can modify State variable only when returning non-nil geometry.

Public function LocalBoundingBox(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): TBox3D; override;

This item has no description.

Public function VerticesCount(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): Cardinal; override;

This item has no description. Showing description inherited from TAbstractGeometryNode.VerticesCount.

Calculate vertex and triangles count of this node.

They require State of this node during VRML traverse state — this is mainly for VRML 1.0 nodes, that depend on such state.

Vertices count calculates number of different vertexes in this node. That is, it doesn't eliminate doubles in cases like Coordinate node with multiple points the same. But if some face is known to use twice the same vertex index, then this counts like a single vertex. The idea is that this indicates rendering speed.

For triangles count, the returned value may be different then actual if some faces were non-convex. Things like TriangulateFace may remove degenerate triangles, so actual number of triangles may be slightly less. So don't depend on TrianglesCount as a precise measure — but it's a good fast measure of complexity of given node, how fast it will be rendered, used with collision detection etc.

Notes for descendants implementors:

For coordinate-based nodes (when InternalCoord returns True), VerticesCount is already implemented in this class. Using Coord method, no other information is needed.

For other nodes, the default implementation of both VerticesCount and TrianglesCount in this TAbstractGeometryNode class will use ProxyGeometry and ProxyState to do the work. You should override these methods if Proxy is not available (so caller will always pass ProxyGeometry = Nil) or some faster approach is possible.

Public function TrianglesCount(State: TX3DGraphTraverseState; ProxyGeometry: TAbstractGeometryNode; ProxyState: TX3DGraphTraverseState): Cardinal; override;

This item has no description.

Public class function InternalCreateTriangles( const AXDimension, AZDimension: Integer; const AXSpacing, AZSpacing: Single; const AHeight: TSingleList; const ATexCoord: TAbstractTextureCoordinateNode; const TriangulationIgnoreHeights: Boolean): TIndexedTriangleSetNode;

Create triangle set to render the elevation grid. Useful for - Proxy in this class - TCastleTerrain which wants direct TIndexedTriangleSetNode (faster to later update than to maintain TElevationGridNode).

Public procedure CreateNode; override;

Create node fields and events.

Public class function ClassX3DType: String; override;

This item has no description. Showing description inherited from TX3DNode.ClassX3DType.

Node type name in VRML/X3D, for this class. Normal VRML/X3D node classes should override this to return something non-empty, and then X3DType automatically will return the same value.

Empty for classes that don't have a hardcoded VRML/X3D node name, like a special TX3DUnknownNode. Such special classes should override then X3DType to return actual non-empty name there.

You usually should call X3DType. The only use of this method is that it works on classes (it's "class function"), without needing at actual instance.

Public procedure SetAttrib(const Value: array of TAbstractVertexAttributeNode);

This item has no description.

Public procedure SetHeight(const Value: array of Single); overload;

This item has no description.

Public procedure SetHeight(const Value: TSingleList); overload;

This item has no description.

Properties

Public property EventSet_height: TMFFloatEvent read FEventSet_height;

This item has no description.

Public property FdAttrib: TMFNode read FFdAttrib;

Internal wrapper for property Attrib. This wrapper API may change, we advise to access simpler Attrib instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FdColor: TSFNode read FFdColor;

Internal wrapper for property Color. This wrapper API may change, we advise to access simpler Color instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Color: TAbstractColorNode read GetColor write SetColor;

This item has no description.

Public property FdFogCoord: TSFNode read FFdFogCoord;

Internal wrapper for property FogCoord. This wrapper API may change, we advise to access simpler FogCoord instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FogCoord: TFogCoordinateNode read GetFogCoord write SetFogCoord;

This item has no description.

Public property FdNormal: TSFNode read FFdNormal;

Internal wrapper for property Normal. This wrapper API may change, we advise to access simpler Normal instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Normal: TAbstractNormalNode read GetNormal write SetNormal;

This item has no description.

Public property FdTexCoord: TSFNode read FFdTexCoord;

Internal wrapper for property TexCoord. This wrapper API may change, we advise to access simpler TexCoord instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property TexCoord: TAbstractTextureCoordinateNode read GetTexCoord write SetTexCoord;

This item has no description.

Public property FdCcw: TSFBool read FFdCcw;

Internal wrapper for property Ccw. This wrapper API may change, we advise to access simpler Ccw instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Ccw: Boolean read GetCcw write SetCcw;

This item has no description.

Public property FdColorPerVertex: TSFBool read FFdColorPerVertex;

Internal wrapper for property ColorPerVertex. This wrapper API may change, we advise to access simpler ColorPerVertex instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property ColorPerVertex: Boolean read GetColorPerVertex write SetColorPerVertex;

This item has no description.

Public property FdCreaseAngle: TSFFloat read FFdCreaseAngle;

Internal wrapper for property CreaseAngle. This wrapper API may change, we advise to access simpler CreaseAngle instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property CreaseAngle: Single read GetCreaseAngle write SetCreaseAngle;

This item has no description.

Public property FdHeight: TMFFloat read FFdHeight;

Internal wrapper for property Height. This wrapper API may change, we advise to access simpler Height instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FdNormalPerVertex: TSFBool read FFdNormalPerVertex;

Internal wrapper for property NormalPerVertex. This wrapper API may change, we advise to access simpler NormalPerVertex instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property NormalPerVertex: Boolean read GetNormalPerVertex write SetNormalPerVertex;

This item has no description.

Public property FdSolid: TSFBool read FFdSolid;

Internal wrapper for property Solid. This wrapper API may change, we advise to access simpler Solid instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FdXDimension: TSFInt32 read FFdXDimension;

Internal wrapper for property XDimension. This wrapper API may change, we advise to access simpler XDimension instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property XDimension: Integer read GetXDimension write SetXDimension;

This item has no description.

Public property FdXSpacing: TSFFloat read FFdXSpacing;

Internal wrapper for property XSpacing. This wrapper API may change, we advise to access simpler XSpacing instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property XSpacing: Single read GetXSpacing write SetXSpacing;

This item has no description.

Public property FdZDimension: TSFInt32 read FFdZDimension;

Internal wrapper for property ZDimension. This wrapper API may change, we advise to access simpler ZDimension instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property ZDimension: Integer read GetZDimension write SetZDimension;

This item has no description.

Public property FdZSpacing: TSFFloat read FFdZSpacing;

Internal wrapper for property ZSpacing. This wrapper API may change, we advise to access simpler ZSpacing instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property ZSpacing: Single read GetZSpacing write SetZSpacing;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.