Click or drag to resize
AB4D logo

TubeLineVisual3D Class

TubeLineVisual3D class is used to create Visual3D that represents a 3D line from StartPosition to EndPosition created with 3D tube.
Inheritance Hierarchy

Namespace: Ab3d.Visuals
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
public class TubeLineVisual3D : BaseModelVisual3D

The TubeLineVisual3D type exposes the following members.

Constructors
 NameDescription
Public methodTubeLineVisual3D Constructor
Public methodTubeLineVisual3D(String) Constructor
Top
Properties
 NameDescription
Public propertyEndPosition Gets or sets the line's end position
Public propertyGenerateTextureCoordinates Gets or sets a Boolean that specifies if texture coordinates are generated (created mesh is more complicated in this case). Default value is true.
Public propertyIsEndPositionClosed Gets or sets a Boolean that specifies if the tube is closed at its end position. Default value is true.
Public propertyIsStartPositionClosed Gets or sets a Boolean that specifies if the tube is closed at its start position. Default value is true.
Public propertyRadius Gets or sets the radius of the Tube.
Public propertySegments Gets or sets the number of segments that are used to create the circular area of the Tube. Default value is 10.
Public propertyStartPosition Gets or sets line's start position
Top
Methods
 NameDescription
Protected methodRefreshGeometry Recreates the Visual3D geometry
(Overrides BaseModelVisual3DRefreshGeometry)
Top
Fields
 NameDescription
Public fieldStatic memberEndPositionProperty EndPositionProperty
Public fieldStatic memberGenerateTextureCoordinatesProperty GenerateTextureCoordinatesProperty
Public fieldStatic memberIsEndPositionClosedProperty IsEndPositionClosedProperty
Public fieldStatic memberIsStartPositionClosedProperty IsStartPositionClosedProperty
Public fieldStatic memberRadiusProperty RadiusProperty
Public fieldStatic memberSegmentsProperty SegmentsProperty
Public fieldStatic memberStartPositionProperty StartPositionProperty
Top
Extension Methods
 NameDescription
Public Extension MethodDumpHierarchy Display details about the hierarchy of Visual3D children to Debug console (for example to Visual Studio's Immediate window).
(Defined by Extensions)
Public Extension MethodForEachGeometryModel3D Performs the specified action on each GeometryModel3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodForEachVisual3D Performs the specified action on each ModelVisual3D inside the rootModelVisual3D.
(Defined by Extensions)
Public Extension MethodGetName Gets name of the Visual3D that was previously set by SetName extension method.
(Defined by Extensions)
Public Extension MethodSetName Sets Name property to Visual3D. Note that if name is not correct for WPF, it can be corrected (name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores). In this case the SetName method will set the corrected name to the object and return false (in this case you can call GetName to get the corrected name). True is returned when the original name is set to the object.
(Defined by Extensions)
Top
Remarks

TubeLineVisual3D class is used to create Visual3D that represents a 3D line from StartPosition to EndPosition created with 3D tube.

3D lines that are created from 3D tubes are significantly different from the standard 3D lines (LineVisual3D and other 3D lines that are derived from BaseLineVisual3D class) because their 3D geometry is defined at creation time. The geometry also does not need to change when camera and view size is changed. On the other hand, standard lines need to change their geometry so that they always face the camera and so that their thickness is correct.

Another difference between 3D tube lines and standard 3D lines is that the line thickness in TubeLineVisual3D is defined as radius of the tube and is specified in 3D world coordinates, but the line thickness for standard 3D lines is defined in screen coordinates.

To prevent shading the TubeLineVisual3D (making parts of the object darker based on the angle to the light), you can use EmissiveMaterial (usually it is used in such a way that you create a Material3DGroup and then first add a black DiffuseMaterial and then an EmissiveMaterial).

See Also