ANSYS::Nexus::GLTFWriter::Primitive Class Reference
Last update: 17.04.2023Primitives are the renderable parts of meshes. More...
#include <GLTFWriter.h>
Inheritance diagram for ANSYS::Nexus::GLTFWriter::Primitive:
Public Types | |
enum | PrimitiveType { PT_POINTS = 0 , PT_LINES = 1 , PT_LINE_LOOP = 2 , PT_LINE_STRIP = 3 , PT_TRIANGLES = 4 , PT_TRIANGLE_STRIP = 5 , PT_TRIANGLE_FAN = 6 } |
enum | PrimitiveXAttachment { PXA_NONE , PXA_LEFT , PXA_CENTER , PXA_RIGHT } |
enum | PrimitiveYAttachment { PYA_NONE , PYA_BOTTOM , PYA_CENTER , PYA_TOP } |
Public Member Functions | |
virtual Primitive * | Mirror ()=0 |
virtual bool | AppendAttribute (Attribute *attribute)=0 |
Static Public Member Functions | |
static Primitive * | Create (GLTF *gltf, PrimitiveType type, Material *material, Index *indices=0, bool isPickable=true) |
static Primitive * | Create2DTexture (GLTF *gltf, Texture *texture, float width, float height, PrimitiveXAttachment xAttach=PXA_LEFT, PrimitiveYAttachment yAttach=PYA_CENTER) |
static Primitive * | Create2DTexture (GLTF *gltf, Texture *texture, float width, float height, float x=0, float y=0) |
Detailed Description
Primitives are the renderable parts of meshes.
Definition at line 29 of file GLTFMesh.h.
Member Enumeration Documentation
◆ PrimitiveType
Type of primitive
Definition at line 33 of file GLTFMesh.h.
◆ PrimitiveXAttachment
Type of X Attachment
Enumerator | |
---|---|
PXA_NONE | Use X location. |
PXA_LEFT | Anchor at left edge. |
PXA_CENTER | Center in horizontal direction. |
PXA_RIGHT | Anchor at right edge. |
Definition at line 44 of file GLTFMesh.h.
◆ PrimitiveYAttachment
Type of Y Attachment
Enumerator | |
---|---|
PYA_NONE | Use Y location. |
PYA_BOTTOM | Anchor at bottom edge. |
PYA_CENTER | Center in vertical direction. |
PYA_TOP | Anchor at top edge. |
Definition at line 52 of file GLTFMesh.h.
Member Function Documentation
◆ AppendAttribute()
|
pure virtual |
Adds an attribute to a primitive. Multiple attributes can be appended to a primitive.
- Returns
- Status of AppendAttribute.
- Parameters
-
[in] attribute Attribute object.
◆ Create()
|
static |
Creates a primitive.
- Returns
- Primitive object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] type Primitive::PrimitiveType defining type of primitive to create. [in] material Material used to render primitive. [in] indices Optional, indices used to render type. indices are index into appended attributes. If no indices are specified, vertices are grouped as appropriate for primitive type. [in] isPickable Optional, primitive can participate in probing, hit-detection, and pivot point selection. A 2D overlay is an example of something this is not pickable.
- Examples
- Test002.cpp, Test005.cpp, Test008.cpp, Test009.cpp, Test010.cpp, Test013.cpp, and Test014.cpp.
◆ Create2DTexture() [1/2]
|
static |
Creates a 2D billboard from a texture.
- Returns
- Primitive object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] texture Texture object used to texture billboard. [in] width Width of billboard. Ranges from 0 to 1 as fraction of minimum screen dimension. [in] height Height of billboard. Ranges from 0 to 1 as fraction of minimum screen dimension. [in] x X screen location. Ranges from 0 to 1. [in] y Y screen location. Ranges from 0 to 1.
◆ Create2DTexture() [2/2]
|
static |
Creates a 2D billboard from a texture.
- Returns
- Primitive object. Do not delete this pointer.
- Parameters
-
[in] gltf GLTF object. [in] texture Texture object used to texture billboard. [in] width Width of billboard. Ranges from 0 to 1 as fraction of minimum screen dimension. [in] height Height of billboard. Ranges from 0 to 1 as fraction of minimum screen dimension. [in] xAttach X location attachment. [in] yAttach Y location attachment.
- Examples
- Test005.cpp.
◆ Mirror()
|
pure virtual |
The documentation for this class was generated from the following file:
- D:/ANSYSDev/NoBackup/branches/EnSight-Second-Coming/webgl_viewer/gltfwriterlib/include/GLTFMesh.h