Class TAbstractTexture2DNode

Unit

Declaration

type TAbstractTexture2DNode = class(TAbstractSingleTextureNode)

Description

2D texture.

Hierarchy

Overview

Methods

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: string = ''); override;
Public destructor Destroy; override;
Public function TextureImage: TEncodedImage;
Public function IsTextureImage: boolean;
Public function TextureComposite: TCompositeImage;
Public function TextureVideo: TVideo;
Public function IsTextureVideo: boolean;
Public procedure CreateNode; override;
Public class function ClassX3DType: string; override;

Properties

Public property IsTextureLoaded: boolean read FIsTextureLoaded write SetIsTextureLoaded;
Public property TextureUsedFullUrl: string read FTextureUsedFullUrl;
Public property FdRepeatS: TSFBool read FFdRepeatS;
Public property RepeatS: Boolean read GetRepeatS write SetRepeatS;
Public property FdRepeatT: TSFBool read FFdRepeatT;
Public property RepeatT: Boolean read GetRepeatT write SetRepeatT;
Public property FdTextureProperties: TSFNode read FFdTextureProperties;
Public property TextureProperties: TTexturePropertiesNode read GetTextureProperties write SetTextureProperties;

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 destructor Destroy; override;

This item has no description.

Public function TextureImage: TEncodedImage;

TextureImage, TextureComposite and TextureVideo contain actual texture data. TextureImage may come from inline VRML texture or could be loaded from file (including from some URL), this doesn't concern you here.

Calls to TextureImage, TextureVideo, IsTextureImage, IsTextureVideo, TextureComposite will automatically load the data, so in simple situations you really don't need to do anything. Just check and use them when you want, and things will just work. See IsTextureLoaded for more control about loading / unloading.

Note that either one of TextureImage or TextureVideo may be Nil, if the other one is loaded. Or when loading failed (warning will be reported by WritelnWarning). IsTextureImage checks that TextureImage is non-nil (so it's successfully loaded) and additionally that texture size is not zero. Similar for IsTextureVideo.

Note that when image failed to load, or URL was just empty, we can have IsTextureLoaded = True but both IsTextureImage = False and IsTextureVideo = False.

TextureImage may have any class allowed by LoadTextureImage.

Public function IsTextureImage: boolean;

This item has no description.

Public function TextureComposite: TCompositeImage;

This item has no description.

Public function TextureVideo: TVideo;

This item has no description.

Public function IsTextureVideo: boolean;

This item has no description.

Public procedure CreateNode; override;

This item has no description. Showing description inherited from TAbstractTextureNode.CreateNode.

Automatically generated node properties.

Do not edit this file manually! To add new properties: - add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ , - and regenerate include files by running x3d-nodes-to-pascal

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.

Properties

Public property IsTextureLoaded: boolean read FIsTextureLoaded write SetIsTextureLoaded;

Is the texture data already loaded. Since the texture will be loaded automatically, you're usually not interested in this property. You can read it to e.g. predict if next TextureImage / TextureVideo call may take a long time. (You know that if IsTextureLoaded = True then TextureImage just returns ready image instantly).

You can also set IsTextureLoaded. Setting to True means that you request the texture to be loaded now, if it's not loaded already. Setting to False may be useful if you want to release resources (e.g. when you want to keep TTextureNode instance loaded but you know that you will not need TextureImage / TextureComposite / TextureVideo anymore). You can also set it to False and then back to True if you want to request reloading the texture from URL (e.g. if you suspect that the URL contents changed).

Note that IsTextureLoaded is set to True, even if actual loading failed. You still have to check afterwards IsTextureImage and IsTextureVideo to know if loading was actually successful. This is deliberate — it means that each call to TextureImage etc. will not unnecessarily read the disk (or even connect to internet) when the file does not exist. Also, the loading errors reported by WritelnWarning will not be repeated — they will occur only once, when IsTextureLoaded changes from False to True.

Public property TextureUsedFullUrl: string read FTextureUsedFullUrl;

Once the texture data (image or video) is loaded, this is set to the URL that was used to load, or '' if no URL was used. "No URL was used" may mean that no URL was valid, or inlined image was used.

This is always a full, expanded (i.e. not relative) URL.

In case of data: URLs, this doesn't contain actual data (it would be too long then, and TextureUsedFullUrl is mainly for showing to the user), it's cutted.

Public property FdRepeatS: TSFBool read FFdRepeatS;

Internal wrapper for property RepeatS. This wrapper API may change, we advise to access simpler RepeatS instead.

Public property RepeatS: Boolean read GetRepeatS write SetRepeatS;

This item has no description.

Public property FdRepeatT: TSFBool read FFdRepeatT;

Internal wrapper for property RepeatT. This wrapper API may change, we advise to access simpler RepeatT instead.

Public property RepeatT: Boolean read GetRepeatT write SetRepeatT;

This item has no description.

Public property FdTextureProperties: TSFNode read FFdTextureProperties;

Internal wrapper for property TextureProperties. This wrapper API may change, we advise to access simpler TextureProperties instead.

Public property TextureProperties: TTexturePropertiesNode read GetTextureProperties write SetTextureProperties;

This item has no description.


Generated by PasDoc 0.16.0.