b3dm

package
v0.0.0-...-a6d07c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	B3DM_PROP_BATCH_LENGTH = "BATCH_LENGTH"
	B3DM_PROP_RTC_CENTER   = "RTC_CENTER"
)
View Source
const (
	COMPONENT_TYPE_BYTE           = "BYTE"
	COMPONENT_TYPE_UNSIGNED_BYTE  = "UNSIGNED_BYTE"
	COMPONENT_TYPE_SHORT          = "SHORT"
	COMPONENT_TYPE_UNSIGNED_SHORT = "UNSIGNED_SHORT"
	COMPONENT_TYPE_INT            = "INT"
	COMPONENT_TYPE_UNSIGNED_INT   = "UNSIGNED_INT"
	COMPONENT_TYPE_FLOAT          = "FLOAT"
	COMPONENT_TYPE_DOUBLE         = "DOUBLE"
)
View Source
const (
	REF_PROP_BYTE_OFFSET    = "byteOffset"
	REF_PROP_COMPONENT_TYPE = "componentType"
	REF_PROP_TYPE           = "type"
)
View Source
const (
	CONTAINER_TYPE_SCALAR = "SCALAR"
	CONTAINER_TYPE_VEC2   = "VEC2"
	CONTAINER_TYPE_VEC3   = "VEC3"
	CONTAINER_TYPE_VEC4   = "VEC4"
)

Variables

This section is empty.

Functions

func B3dmFeatureTableDecode

func B3dmFeatureTableDecode(header map[string]interface{}, buff []byte) map[string]interface{}

func B3dmFeatureTableEncode

func B3dmFeatureTableEncode(header map[string]interface{}, data map[string]interface{}) []byte

func ComponentTypeSize

func ComponentTypeSize(tp string) int

func ContainerTypeSize

func ContainerTypeSize(tp string) int

func GetGltfAttribute

func GetGltfAttribute(primitive *gltf.Primitive, doc *gltf.Document, name string) ([]interface{}, error)

func ReadGltfValueAt

func ReadGltfValueAt(gltf *gltf.Document, accesorId, n uint32) []interface{}

Types

type B3dm

type B3dm struct {
	Header       B3dmHeader
	FeatureTable FeatureTable
	BatchTable   BatchTable
	Model        *gltf.Document
}

func Open

func Open(fileName string) (*B3dm, error)

Open will open a b3dm file specified by name and return the B3dm.

func (*B3dm) GetBatchTable

func (m *B3dm) GetBatchTable() *BatchTable

func (*B3dm) GetFeatureTable

func (m *B3dm) GetFeatureTable() *FeatureTable

func (*B3dm) GetFeatureTableView

func (m *B3dm) GetFeatureTableView() *B3dmFeatureTable

func (*B3dm) GetHeader

func (m *B3dm) GetHeader() Header

func (*B3dm) GetModel

func (m *B3dm) GetModel() *gltf.Document

type B3dmFeatureTable

type B3dmFeatureTable struct {
	BatchLength int
	RtcCenter   [3]float64
}

type B3dmHeader

type B3dmHeader struct {
	Magic                        [4]byte
	Version                      uint32
	ByteLength                   uint32
	FeatureTableJSONByteLength   uint32
	FeatureTableBinaryByteLength uint32
	BatchTableJSONByteLength     uint32
	BatchTableBinaryByteLength   uint32
}

func (*B3dmHeader) GetBatchTableBinaryByteLength

func (h *B3dmHeader) GetBatchTableBinaryByteLength() uint32

func (*B3dmHeader) GetBatchTableJSONByteLength

func (h *B3dmHeader) GetBatchTableJSONByteLength() uint32

func (*B3dmHeader) GetByteLength

func (h *B3dmHeader) GetByteLength() uint32

func (*B3dmHeader) GetFeatureTableBinaryByteLength

func (h *B3dmHeader) GetFeatureTableBinaryByteLength() uint32

func (*B3dmHeader) GetFeatureTableJSONByteLength

func (h *B3dmHeader) GetFeatureTableJSONByteLength() uint32

func (*B3dmHeader) GetSize

func (h *B3dmHeader) GetSize() int64

type B3dmReader

type B3dmReader struct {
	// contains filtered or unexported fields
}

func NewB3dmReader

func NewB3dmReader(r io.Reader) *B3dmReader

func (*B3dmReader) Decode

func (r *B3dmReader) Decode(m *B3dm) error

func (*B3dmReader) DecodeHeader

func (r *B3dmReader) DecodeHeader(d *B3dmHeader) error

type BatchTable

type BatchTable struct {
	Header map[string]interface{}
	Data   map[string][]interface{}
}

func (*BatchTable) Read

func (h *BatchTable) Read(reader io.Reader, header Header, batchLength int) error

type BatchTableValuesEntry

type BatchTableValuesEntry []interface{}

type BinaryBodyReference

type BinaryBodyReference struct {
	ByteOffset    uint32 `json:"byteOffset"`
	ComponentType string `json:"componentType,omitempty"`
	ContainerType string `json:"type,omitempty"`
}

func (*BinaryBodyReference) FromMap

func (r *BinaryBodyReference) FromMap(d map[string]interface{})

type FeatureTable

type FeatureTable struct {
	Header map[string]interface{}
	Data   map[string]interface{}
	// contains filtered or unexported fields
}

func (*FeatureTable) GetBatchLength

func (h *FeatureTable) GetBatchLength() int

func (*FeatureTable) Read

func (h *FeatureTable) Read(reader io.Reader, header Header) error
type Header interface {
	GetSize() int64

	GetByteLength() uint32

	GetFeatureTableJSONByteLength() uint32
	GetFeatureTableBinaryByteLength() uint32

	GetBatchTableJSONByteLength() uint32
	GetBatchTableBinaryByteLength() uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL