tile3d

package module
v0.0.0-...-9f1acdb Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: AGPL-3.0, Apache-2.0 Imports: 10 Imported by: 0

README

# 3dtile For GO

Documentation

Index

Constants

View Source
const (
	B3DM_PROP_BATCH_LENGTH = "BATCH_LENGTH"
	B3DM_PROP_RTC_CENTER   = "RTC_CENTER"
)
View Source
const (
	BATCH_TABLE_HIERARCHY     = "3DTILES_batch_table_hierarchy"
	HIERARCHY_INSTANCE_LENGTH = "instancesLength"

	HIERARCHY_CLASSES           = "classes"
	HIERARCHY_CLASSIDS          = "classIds"
	HIERARCHY_CLASSE_NAME       = "name"
	HIERARCHY_CLASSINDEXES      = "classIndexes"
	HIERARCHY_CLASSES_INSTANCES = "instances"
	HIERARCHY_CLASSES_LENGTH    = "length"

	HIERARCHY_PARENT_COUNTS = "parentCounts"
	HIERARCHY_PARENTIDS     = "parentIds"
	HIERARCHY_PARENTINDEXES = "parentIndexes"
)
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 (
	CONTAINER_TYPE_SCALAR = "SCALAR"
	CONTAINER_TYPE_VEC2   = "VEC2"
	CONTAINER_TYPE_VEC3   = "VEC3"
	CONTAINER_TYPE_VEC4   = "VEC4"
)
View Source
const (
	REF_PROP_BYTE_OFFSET    = "byteOffset"
	REF_PROP_COMPONENT_TYPE = "componentType"
	REF_PROP_TYPE           = "type"
)
View Source
const (
	GEOM_PROP_BOXES               = "BOXES"
	GEOM_PROP_BOX_BATCH_IDS       = "BOX_BATCH_IDS"
	GEOM_PROP_CYLINDERS           = "CYLINDERS"
	GEOM_PROP_CYLINDER_BATCH_IDS  = "CYLINDER_BATCH_IDS"
	GEOM_PROP_ELLIPSOIDS          = "ELLIPSOIDS"
	GEOM_PROP_ELLIPSOID_BATCH_IDS = "ELLIPSOID_BATCH_IDS"
	GEOM_PROP_SPHERES             = "SPHERES"
	GEOM_PROP_SPHERE_BATCH_IDS    = "SPHERE_BATCH_IDS"
	GEOM_PROP_BOXES_LENGTH        = "BOXES_LENGTH"
	GEOM_PROP_CYLINDERS_LENGTH    = "CYLINDERS_LENGTH"
	GEOM_PROP_ELLIPSOIDS_LENGTH   = "ELLIPSOIDS_LENGTH"
	GEOM_PROP_SPHERES_LENGTH      = "SPHERES_LENGTH"
	GEOM_PROP_RTC_CENTER          = "RTC_CENTER"
)
View Source
const (
	I3DM_MAGIC         = "i3dm"
	I3DM_GLTF_URI      = 0
	I3DM_GLTF_EMBEDDED = 1
)
View Source
const (
	I3DM_PROP_POSITION                = "POSITION"
	I3DM_PROP_POSITION_QUANTIZED      = "POSITION_QUANTIZED"
	I3DM_PROP_QUANTIZED_VOLUME_OFFSET = "QUANTIZED_VOLUME_OFFSET"
	I3DM_PROP_QUANTIZED_VOLUME_SCALE  = "QUANTIZED_VOLUME_SCALE"
	I3DM_PROP_NORMAL_UP               = "NORMAL_UP"
	I3DM_PROP_NORMAL_RIGHT            = "NORMAL_RIGHT"
	I3DM_PROP_NORMAL_UP_OCT32P        = "NORMAL_UP_OCT32P"
	I3DM_PROP_NORMAL_RIGHT_OCT32P     = "NORMAL_RIGHT_OCT32P"
	I3DM_PROP_SCALE                   = "SCALE"
	I3DM_PROP_SCALE_NON_UNIFORM       = "SCALE_NON_UNIFORM"
	I3DM_PROP_BATCH_ID                = "BATCH_ID"
	I3DM_PROP_INSTANCES_LENGTH        = "INSTANCES_LENGTH"
	I3DM_PROP_RTC_CENTER              = "RTC_CENTER"
	I3DM_PROP_EAST_NORTH_UP           = "EAST_NORTH_UP"
)
View Source
const (
	PNTS_PROP_BATCH_LENGTH            = "BATCH_LENGTH"
	PNTS_PROP_RTC_CENTER              = "RTC_CENTER"
	PNTS_PROP_POSITION                = "POSITION"
	PNTS_PROP_POSITION_QUANTIZED      = "POSITION_QUANTIZED"
	PNTS_PROP_QUANTIZED_VOLUME_OFFSET = "QUANTIZED_VOLUME_OFFSET"
	PNTS_PROP_QUANTIZED_VOLUME_SCALE  = "QUANTIZED_VOLUME_SCALE"
	PNTS_PROP_NORMAL                  = "NORMAL"
	PNTS_PROP_NORMAL_OCT32P           = "NORMAL_OCT32P"
	PNTS_PROP_POINTS_LENGTH           = "POINTS_LENGTH"
	PNTS_PROP_CONSTANT_RGBA           = "CONSTANT_RGBA"
	PNTS_PROP_RGB                     = "RGB"
	PNTS_PROP_RGBA                    = "RGBA"
	PNTS_PROP_RGB565                  = "RGB565"
	PNTS_PROP_BATCH_ID                = "BATCH_ID"
)
View Source
const (
	PNTS_COLOR_FORMAT_RGB    = 0
	PNTS_COLOR_FORMAT_RGBA   = 1
	PNTS_COLOR_FORMAT_RGB565 = 2
	PNTS_COLOR_FORMAT_NONE   = 3
)
View Source
const (
	OP_NEGATIVE = "-"
	OP_POSITIVE = "+"
	OP_NOT      = "!"
)
View Source
const (
	OP_ADD        = "+"
	OP_SUB        = "-"
	OP_MUL        = "*"
	OP_DIV        = "/"
	OP_MOD        = "%"
	OP_EQ         = "==="
	OP_NEQ        = "!=="
	OP_GREATER    = ">"
	OP_GREATER_EQ = ">="
	OP_LESS       = "<"
	OP_LESS_EQ    = "<="
	OP_AND        = "&&"
	OP_OR         = "||"
	OP_REGEXP_NOT = "!~"
	OP_REGEXP     = "=~"
)
View Source
const (
	FUNC_IS_NAN             = "isNaN"
	FUNC_IS_FINITE          = "isFinite"
	FUNC_IS_EXACTCLASS      = "isExactClass"
	FUNC_IS_CLASS           = "isClass"
	FUNC_GET_EXACTCLASSNAME = "getExactClassName"
	FUNC_BOOLEAN            = "Boolean"
	FUNC_NUMBER             = "Number"
	FUNC_STRING             = "String"
	FUNC_ABS                = "abs"
	FUNC_SQRT               = "sqrt"
	FUNC_COS                = "cos"
	FUNC_SIN                = "sin"
	FUNC_TAN                = "tan"
	FUNC_ACOS               = "acos"
	FUNC_ASIN               = "asin"
	FUNC_ATAN               = "atan"
	FUNC_RADIANS            = "radians"
	FUNC_DEGREES            = "degrees"
	FUNC_SIGN               = "sign"
	FUNC_FLOOR              = "floor"
	FUNC_CEIL               = "ceil"
	FUNC_ROUND              = "round"
	FUNC_EXP                = "exp"
	FUNC_EXP2               = "exp2"
	FUNC_LOG                = "log"
	FUNC_LOG2               = "log2"
	FUNC_FRACT              = "fract"
	FUNC_LENGTH             = "length"
	FUNC_NORMALIZE          = "normalize"
)
View Source
const (
	FUNC_ATAN2    = "atan2"
	FUNC_POW      = "pow"
	FUNC_MIN      = "min"
	FUNC_MAX      = "max"
	FUNC_DISTANCE = "distance"
	FUNC_DOT      = "dot"
	FUNC_CROSS    = "cross"
)
View Source
const (
	FUNC_CLAMP = "clamp"
	FUNC_MIX   = "mix"
)
View Source
const (
	VAR_BOOLEAN   = ExpressionType(0)
	VAR_NULL      = ExpressionType(1)
	VAR_UNDEFINED = ExpressionType(2)
	VAR_NUMBER    = ExpressionType(3)
	VAR_STRING    = ExpressionType(4)
	VAR_ARRAY     = ExpressionType(5)
	VAR_VEC2      = ExpressionType(6)
	VAR_VEC3      = ExpressionType(7)
	VAR_VEC4      = ExpressionType(8)
	VAR_REGEXP    = ExpressionType(9)
)
View Source
const (
	EXP_VARIABLE           = ExpressionNodeType(0)
	EXP_UNARY              = ExpressionNodeType(1)
	EXP_BINARY             = ExpressionNodeType(2)
	EXP_TERNARY            = ExpressionNodeType(3)
	EXP_CONDITIONAL        = ExpressionNodeType(4)
	EXP_MEMBER             = ExpressionNodeType(5)
	EXP_FUNCTION_CALL      = ExpressionNodeType(6)
	EXP_ARRAY              = ExpressionNodeType(7)
	EXP_REGEX              = ExpressionNodeType(8)
	EXP_VARIABLE_IN_STRING = ExpressionNodeType(9)
	EXP_LITERAL_NULL       = ExpressionNodeType(10)
	EXP_LITERAL_BOOLEAN    = ExpressionNodeType(11)
	EXP_LITERAL_NUMBER     = ExpressionNodeType(12)
	EXP_LITERAL_STRING     = ExpressionNodeType(13)
	EXP_LITERAL_COLOR      = ExpressionNodeType(14)
	EXP_LITERAL_VECTOR     = ExpressionNodeType(15)
	EXP_LITERAL_REGEX      = ExpressionNodeType(16)
	EXP_LITERAL_UNDEFINED  = ExpressionNodeType(17)
	EXP_BUILTIN_VARIABLE   = ExpressionNodeType(18)
)
View Source
const (
	TILE_REFINE_ADD     = "ADD"
	TILE_REFINE_REPLACE = "REPLACE"
)
View Source
const (
	VCTR_PROP_POLYGONS_LENGTH  = "POLYGONS_LENGTH"
	VCTR_PROP_POLYLINES_LENGTH = "POLYLINES_LENGTH"
	VCTR_PROP_POINTS_LENGTH    = "POINTS_LENGTH"
	VCTR_PROP_REGION           = "REGION"
	VCTR_PROP_RTC_CENTER       = "RTC_CENTER"

	VCTR_PROP_POLYGON_COUNTS       = "POLYGON_COUNTS"
	VCTR_PROP_POLYGON_COUNT        = "POLYGON_COUNT"
	VCTR_PROP_POLYGON_INDEX_COUNTS = "POLYGON_INDEX_COUNTS"
	VCTR_PROP_POLYGON_INDEX_COUNT  = "POLYGON_INDEX_COUNT"
	VCTR_PROP_POLYLINE_COUNTS      = "POLYLINE_COUNTS"
	VCTR_PROP_POLYLINE_COUNT       = "POLYLINE_COUNT"

	VCTR_PROP_POLYGON_MINIMUM_HEIGHTS = "POLYGON_MINIMUM_HEIGHTS"
	VCTR_PROP_POLYGON_MAXIMUM_HEIGHTS = "POLYGON_MAXIMUM_HEIGHTS"
	VCTR_PROP_POLYGON_BATCH_IDS       = "POLYGON_BATCH_IDS"
	VCTR_PROP_POLYLINE_WIDTHS         = "POLYLINE_WIDTHS"
	VCTR_PROP_POLYLINE_BATCH_IDS      = "POLYLINE_BATCH_IDS"
	VCTR_PROP_POINT_BATCH_IDS         = "POINT_BATCH_IDS"
)
View Source
const (
	B3DM_MAGIC = "b3dm"
)
View Source
const (
	CMPT_MAGIC = "cmpt"
)
View Source
const (
	GEOM_MAGIC = "geom"
)
View Source
const MULTIPLE_CONTENTS = "3DTILES_multiple_contents"
View Source
const (
	PNTS_MAGIC = "pnts"
)
View Source
const (
	VCTR_MAGIC = "vctr"
)

Variables

View Source
var (
	TileDefaultTransform = [16]float64{1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}
)

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 GeomFeatureTableDecode

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

func GeomFeatureTableEncode

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

func I3dmFeatureTableDecode

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

func I3dmFeatureTableEncode

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

func IsQuantizable

func IsQuantizable(pos float64, origin float32, scale float32, rangeScale uint16) bool

func IsQuantized

func IsQuantized(qpos uint16) bool

func PntsFeatureTableDecode

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

func PntsFeatureTableEncode

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

func Quantize

func Quantize(pos float64, origin float32, scale float32, rangeScale uint16) uint16

func QuantizePoint3d

func QuantizePoint3d(pos [3]float64, params *QParams3d) [3]uint16

func UnQuantize

func UnQuantize(qpos uint16, origin float32, scale float32, rangeScale uint16) float64

func UnQuantizePoint3d

func UnQuantizePoint3d(qpos [3]uint16, params *QParams3d) [3]float64

func VctrFeatureTableDecode

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

func VctrFeatureTableEncode

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

Types

type Asset

type Asset struct {
	Version        string `json:"version"`
	TilesetVersion string `json:"tilesetVersion,omitempty"`
	GltfUpAxis     string `json:"gltfUpAxis,omitempty"`
}

type B3dm

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

func NewB3dm

func NewB3dm() *B3dm

func (*B3dm) CalcSize

func (m *B3dm) CalcSize() int64

func (*B3dm) GetBatchTable

func (m *B3dm) GetBatchTable() *BatchTable

func (*B3dm) GetFeatureTable

func (m *B3dm) GetFeatureTable() *FeatureTable

func (*B3dm) GetFeatureTableView

func (m *B3dm) GetFeatureTableView() B3dmFeatureTableView

func (*B3dm) GetHeader

func (m *B3dm) GetHeader() Header

func (*B3dm) Read

func (m *B3dm) Read(reader io.ReadSeeker) error

func (*B3dm) SetFeatureTable

func (m *B3dm) SetFeatureTable(view B3dmFeatureTableView)

func (*B3dm) Write

func (m *B3dm) Write(writer io.Writer) error

type B3dmFeatureTableView

type B3dmFeatureTableView struct {
	BatchLength int
	RtcCenter   []float64
}

type B3dmHeader

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

func (*B3dmHeader) CalcSize

func (h *B3dmHeader) CalcSize() int64

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) SetBatchTableBinaryByteLength

func (h *B3dmHeader) SetBatchTableBinaryByteLength(n uint32)

func (*B3dmHeader) SetBatchTableJSONByteLength

func (h *B3dmHeader) SetBatchTableJSONByteLength(n uint32)

func (*B3dmHeader) SetFeatureTableBinaryByteLength

func (h *B3dmHeader) SetFeatureTableBinaryByteLength(n uint32)

func (*B3dmHeader) SetFeatureTableJSONByteLength

func (h *B3dmHeader) SetFeatureTableJSONByteLength(n uint32)

type BatchTable

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

func (*BatchTable) CalcSize

func (h *BatchTable) CalcSize(header Header) int64

func (*BatchTable) GetProperty

func (h *BatchTable) GetProperty(property string, batchId int) interface{}

func (*BatchTable) Read

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

func (*BatchTable) Write

func (h *BatchTable) Write(writer io.Writer, header Header) error

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{})

func (*BinaryBodyReference) GetMap

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

type BinaryBodySizeHelper

type BinaryBodySizeHelper struct {
	Header *map[string]interface{}
	Size   uint32
}

type BoundingVolume

type BoundingVolume struct {
	Region *[]float64 `json:"region,omitempty"`
	Box    *[]float64 `json:"box,omitempty"`
	Sphere *[]float64 `json:"sphere,omitempty"`
}

func (*BoundingVolume) GetBox

func (b *BoundingVolume) GetBox() []float64

func (*BoundingVolume) GetData

func (b *BoundingVolume) GetData() []float64

func (*BoundingVolume) GetRegion

func (b *BoundingVolume) GetRegion() []float64

func (*BoundingVolume) GetSphere

func (b *BoundingVolume) GetSphere() []float64

func (*BoundingVolume) SetBox

func (b *BoundingVolume) SetBox(box []float64) error

func (*BoundingVolume) SetRegion

func (b *BoundingVolume) SetRegion(region []float64) error

func (*BoundingVolume) SetSphere

func (b *BoundingVolume) SetSphere(sphere []float64) error

type Cmpt

type Cmpt struct {
	Header CmptHeader
	Tiles  []TileModel
}

func NewCmpt

func NewCmpt() *Cmpt

func (*Cmpt) CalcSize

func (m *Cmpt) CalcSize() int64

func (*Cmpt) GetHeader

func (m *Cmpt) GetHeader() Header

func (*Cmpt) Read

func (m *Cmpt) Read(reader io.ReadSeeker) error

func (*Cmpt) Write

func (m *Cmpt) Write(writer io.Writer) error

type CmptHeader

type CmptHeader struct {
	Magic       [4]byte
	Version     uint32
	ByteLength  uint32
	TilesLength uint32
}

func (*CmptHeader) CalcSize

func (h *CmptHeader) CalcSize() int64

func (*CmptHeader) GetBatchTableBinaryByteLength

func (*CmptHeader) GetBatchTableBinaryByteLength() uint32

func (*CmptHeader) GetBatchTableJSONByteLength

func (*CmptHeader) GetBatchTableJSONByteLength() uint32

func (*CmptHeader) GetByteLength

func (h *CmptHeader) GetByteLength() uint32

func (*CmptHeader) GetFeatureTableBinaryByteLength

func (*CmptHeader) GetFeatureTableBinaryByteLength() uint32

func (*CmptHeader) GetFeatureTableJSONByteLength

func (*CmptHeader) GetFeatureTableJSONByteLength() uint32

func (*CmptHeader) GetTilesLength

func (h *CmptHeader) GetTilesLength() uint32

func (*CmptHeader) SetBatchTableBinaryByteLength

func (*CmptHeader) SetBatchTableBinaryByteLength(uint32)

func (*CmptHeader) SetBatchTableJSONByteLength

func (*CmptHeader) SetBatchTableJSONByteLength(uint32)

func (*CmptHeader) SetFeatureTableBinaryByteLength

func (*CmptHeader) SetFeatureTableBinaryByteLength(uint32)

func (*CmptHeader) SetFeatureTableJSONByteLength

func (*CmptHeader) SetFeatureTableJSONByteLength(uint32)

func (*CmptHeader) SetTilesLength

func (h *CmptHeader) SetTilesLength(n uint32)

type Content

type Content struct {
	Url string `json:"uri"`
}

type Expression

type Expression string

type ExpressionNodeType

type ExpressionNodeType int32

type ExpressionType

type ExpressionType int32

type FeatureTable

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

func (*FeatureTable) CalcSize

func (h *FeatureTable) CalcSize(header Header) int64

func (*FeatureTable) GetBatchLength

func (h *FeatureTable) GetBatchLength() int

func (*FeatureTable) Read

func (h *FeatureTable) Read(reader io.ReadSeeker, header Header) error

func (*FeatureTable) Write

func (h *FeatureTable) Write(writer io.Writer, header Header) error

type Geom

type Geom struct {
	Header       GeomHeader
	FeatureTable FeatureTable
	BatchTable   BatchTable
}

func (*Geom) CalcSize

func (m *Geom) CalcSize() int64

func (*Geom) GetBatchTable

func (m *Geom) GetBatchTable() *BatchTable

func (*Geom) GetFeatureTable

func (m *Geom) GetFeatureTable() *FeatureTable

func (*Geom) GetFeatureTableView

func (m *Geom) GetFeatureTableView() GeomFeatureTableView

func (*Geom) GetHeader

func (m *Geom) GetHeader() Header

func (*Geom) Read

func (m *Geom) Read(reader io.ReadSeeker) error

func (*Geom) SetFeatureTable

func (m *Geom) SetFeatureTable(view GeomFeatureTableView)

func (*Geom) Write

func (m *Geom) Write(writer io.Writer) error

type GeomBox

type GeomBox [16]float32

type GeomCylinder

type GeomCylinder [16]float32

type GeomEllipsoid

type GeomEllipsoid [16]float32

type GeomFeatureTableView

type GeomFeatureTableView struct {
	Boxs             []GeomBox
	BoxBatchId       interface{}
	Cylinders        []GeomCylinder
	CylinderBatchId  interface{}
	Ellipsoids       []GeomEllipsoid
	EllipsoidBatchId interface{}
	Spheres          []GeomSphere
	SphereBatchId    interface{}
	RtcCenter        [3]float64
}

type GeomHeader

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

func (*GeomHeader) CalcSize

func (h *GeomHeader) CalcSize() int64

func (*GeomHeader) GetBatchTableBinaryByteLength

func (h *GeomHeader) GetBatchTableBinaryByteLength() uint32

func (*GeomHeader) GetBatchTableJSONByteLength

func (h *GeomHeader) GetBatchTableJSONByteLength() uint32

func (*GeomHeader) GetByteLength

func (h *GeomHeader) GetByteLength() uint32

func (*GeomHeader) GetFeatureTableBinaryByteLength

func (h *GeomHeader) GetFeatureTableBinaryByteLength() uint32

func (*GeomHeader) GetFeatureTableJSONByteLength

func (h *GeomHeader) GetFeatureTableJSONByteLength() uint32

func (*GeomHeader) SetBatchTableBinaryByteLength

func (h *GeomHeader) SetBatchTableBinaryByteLength(n uint32)

func (*GeomHeader) SetBatchTableJSONByteLength

func (h *GeomHeader) SetBatchTableJSONByteLength(n uint32)

func (*GeomHeader) SetFeatureTableBinaryByteLength

func (h *GeomHeader) SetFeatureTableBinaryByteLength(n uint32)

func (*GeomHeader) SetFeatureTableJSONByteLength

func (h *GeomHeader) SetFeatureTableJSONByteLength(n uint32)

type GeomSphere

type GeomSphere [4]float32
type Header interface {
	CalcSize() int64

	GetByteLength() uint32

	GetFeatureTableJSONByteLength() uint32
	GetFeatureTableBinaryByteLength() uint32

	GetBatchTableJSONByteLength() uint32
	GetBatchTableBinaryByteLength() uint32

	SetFeatureTableJSONByteLength(uint32)
	SetFeatureTableBinaryByteLength(uint32)

	SetBatchTableJSONByteLength(uint32)
	SetBatchTableBinaryByteLength(uint32)
}

type I3dm

type I3dm struct {
	Header       I3dmHeader
	FeatureTable FeatureTable
	BatchTable   BatchTable
	GltfUri      string
	Model        *gltf.Document
}

func (*I3dm) CalcSize

func (m *I3dm) CalcSize() int64

func (*I3dm) GetBatchTable

func (m *I3dm) GetBatchTable() *BatchTable

func (*I3dm) GetFeatureTable

func (m *I3dm) GetFeatureTable() *FeatureTable

func (*I3dm) GetFeatureTableView

func (m *I3dm) GetFeatureTableView() I3dmFeatureTableView

func (*I3dm) GetHeader

func (m *I3dm) GetHeader() Header

func (*I3dm) Read

func (m *I3dm) Read(reader io.ReadSeeker) error

func (*I3dm) SetFeatureTable

func (m *I3dm) SetFeatureTable(view I3dmFeatureTableView)

func (*I3dm) Write

func (m *I3dm) Write(writer io.Writer) error

type I3dmFeatureTableView

type I3dmFeatureTableView struct {
	Position              [][3]float32
	PositionQuantized     [][3]uint16
	NormalRight           [][3]float32
	NormalUp              [][3]float32
	NormalRightOCT16P     [][2]uint16
	NormalUpOCT16P        [][2]uint16
	Scale                 []float32
	ScaleNONUniform       [][3]float32
	BatchId               interface{}
	InstanceLength        int
	RtcCenter             []float64
	QuantizedVolumeOffset []float32
	QuantizedVolumeScale  []float32
	EastNorthUp           *bool
}

type I3dmHeader

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

func (*I3dmHeader) CalcSize

func (h *I3dmHeader) CalcSize() int64

func (*I3dmHeader) GetBatchTableBinaryByteLength

func (h *I3dmHeader) GetBatchTableBinaryByteLength() uint32

func (*I3dmHeader) GetBatchTableJSONByteLength

func (h *I3dmHeader) GetBatchTableJSONByteLength() uint32

func (*I3dmHeader) GetByteLength

func (h *I3dmHeader) GetByteLength() uint32

func (*I3dmHeader) GetFeatureTableBinaryByteLength

func (h *I3dmHeader) GetFeatureTableBinaryByteLength() uint32

func (*I3dmHeader) GetFeatureTableJSONByteLength

func (h *I3dmHeader) GetFeatureTableJSONByteLength() uint32

func (*I3dmHeader) SetBatchTableBinaryByteLength

func (h *I3dmHeader) SetBatchTableBinaryByteLength(n uint32)

func (*I3dmHeader) SetBatchTableJSONByteLength

func (h *I3dmHeader) SetBatchTableJSONByteLength(n uint32)

func (*I3dmHeader) SetFeatureTableBinaryByteLength

func (h *I3dmHeader) SetFeatureTableBinaryByteLength(n uint32)

func (*I3dmHeader) SetFeatureTableJSONByteLength

func (h *I3dmHeader) SetFeatureTableJSONByteLength(n uint32)

type MultipeContent

type MultipeContent []*Content

type OctEncodedNormal

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

func NewOctEncodedNormal

func NewOctEncodedNormal(v [3]float32) *OctEncodedNormal

func (*OctEncodedNormal) Decode

func (n *OctEncodedNormal) Decode() [3]float32

type Pnts

type Pnts struct {
	Header       PntsHeader
	FeatureTable FeatureTable
	BatchTable   BatchTable
}

func NewPnts

func NewPnts() *Pnts

func (*Pnts) CalcSize

func (m *Pnts) CalcSize() int64

func (*Pnts) GetBatchTable

func (m *Pnts) GetBatchTable() *BatchTable

func (*Pnts) GetFeatureTable

func (m *Pnts) GetFeatureTable() *FeatureTable

func (*Pnts) GetFeatureTableView

func (m *Pnts) GetFeatureTableView() PntsFeatureTableView

func (*Pnts) GetHeader

func (m *Pnts) GetHeader() Header

func (*Pnts) Read

func (m *Pnts) Read(reader io.ReadSeeker) error

func (*Pnts) SetFeatureTable

func (m *Pnts) SetFeatureTable(view PntsFeatureTableView)

func (*Pnts) Write

func (m *Pnts) Write(writer io.Writer) error

type PntsFeatureTableView

type PntsFeatureTableView struct {
	Position              [][3]float32
	PositionQuantized     [][3]uint16
	RGBA                  [][4]uint8
	RGB                   [][3]uint8
	RGB565                []uint16
	Normal                [][3]float32
	NormalOCT16P          [][2]uint8
	BatchId               interface{}
	PointsLength          uint32
	RtcCenter             []float64
	QuantizedVolumeOffset []float32
	QuantizedVolumeScale  []float32
	ConstantRGBA          []uint8
	BatchLength           *uint32
}

type PntsHeader

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

func (*PntsHeader) CalcSize

func (h *PntsHeader) CalcSize() int64

func (*PntsHeader) GetBatchTableBinaryByteLength

func (h *PntsHeader) GetBatchTableBinaryByteLength() uint32

func (*PntsHeader) GetBatchTableJSONByteLength

func (h *PntsHeader) GetBatchTableJSONByteLength() uint32

func (*PntsHeader) GetByteLength

func (h *PntsHeader) GetByteLength() uint32

func (*PntsHeader) GetFeatureTableBinaryByteLength

func (h *PntsHeader) GetFeatureTableBinaryByteLength() uint32

func (*PntsHeader) GetFeatureTableJSONByteLength

func (h *PntsHeader) GetFeatureTableJSONByteLength() uint32

func (*PntsHeader) SetBatchTableBinaryByteLength

func (h *PntsHeader) SetBatchTableBinaryByteLength(n uint32)

func (*PntsHeader) SetBatchTableJSONByteLength

func (h *PntsHeader) SetBatchTableJSONByteLength(n uint32)

func (*PntsHeader) SetFeatureTableBinaryByteLength

func (h *PntsHeader) SetFeatureTableBinaryByteLength(n uint32)

func (*PntsHeader) SetFeatureTableJSONByteLength

func (h *PntsHeader) SetFeatureTableJSONByteLength(n uint32)

type QParams3d

type QParams3d struct {
	Origin [3]float32
	Scale  [3]float32
}

func (*QParams3d) SetFromRange

func (p *QParams3d) SetFromRange(range_ *vec3.Box, rangeScale uint16)

type Schema

type Schema struct {
	Maximum float64 `json:"maximum,omitempty"`
	Minimum float64 `json:"minimum,omitempty"`
}

type Styling

type Styling struct {
	Defines                  Expression `json:"defines"`
	Show                     Expression `json:"show"`
	Color                    Expression `json:"color"`
	PointSize                Expression `json:"pointSize,omitempty"`
	PointOutlineColor        Expression `json:"pointOutlineColor,omitempty"`
	PointOutlineWidth        Expression `json:"pointOutlineWidth,omitempty"`
	LabelColor               Expression `json:"labelColor,omitempty"`
	LabelOutlineColor        Expression `json:"labelOutlineColor,omitempty"`
	LabelOutlineWidth        Expression `json:"labelOutlineWidth,omitempty"`
	Font                     Expression `json:"font,omitempty"`
	LabelStyle               Expression `json:"labelStyle,omitempty"`
	BackgroundColor          Expression `json:"backgroundColor,omitempty"`
	BackgroundPadding        Expression `json:"backgroundPadding,omitempty"`
	BackgroundEnabled        Expression `json:"backgroundEnabled,omitempty"`
	ScaleByDistance          Expression `json:"scaleByDistance,omitempty"`
	TranslucencyByDistance   Expression `json:"translucencyByDistance,omitempty"`
	DistanceDisplayCondition Expression `json:"distanceDisplayCondition,omitempty"`
	HeightOffset             Expression `json:"heightOffset,omitempty"`
	AnchorLineEnabled        Expression `json:"anchorLineEnabled,omitempty"`
	AnchorLineColor          Expression `json:"anchorLineColor,omitempty"`
	Image                    Expression `json:"image,omitempty"`
	DisableDepthTestDistance Expression `json:"disableDepthTestDistance,omitempty"`
	HorizontalOrigin         Expression `json:"horizontalOrigin,omitempty"`
	VerticalOrigin           Expression `json:"verticalOrigin,omitempty"`
	LabelHorizontalOrigin    Expression `json:"labelHorizontalOrigin,omitempty"`
	LabelVerticalOrigin      Expression `json:"labelVerticalOrigin,omitempty"`
}

type Tile

type Tile struct {
	Content             *Content               `json:"content,omitempty"`
	BoundingVolume      BoundingVolume         `json:"boundingVolume,omitempty"`
	ViewerRequestVolume *BoundingVolume        `json:"viewerRequestVolume,omitempty"`
	GeometricError      float64                `json:"geometricError"`
	Refine              string                 `json:"refine"`
	Transform           *[16]float64           `json:"transform,omitempty"`
	Children            []Tile                 `json:"children,omitempty"`
	Extensions          map[string]interface{} `json:"extensions,omitempty"`
}

type TileModel

type TileModel interface {
	GetHeader() Header
	GetFeatureTable() *FeatureTable
	GetBatchTable() *BatchTable
	CalcSize() int64
	Read(reader io.ReadSeeker) error
	Write(writer io.Writer) error
}

type Tileset

type Tileset struct {
	Asset              Asset              `json:"asset"`
	GeometricError     float64            `json:"geometricError"`
	Root               Tile               `json:"root"`
	Properties         *map[string]Schema `json:"properties,omitempty"`
	ExtensionsUsed     []string           `json:"extensionsUsed,omitempty"`
	ExtensionsRequired []string           `json:"extensionsRequired,omitempty"`
}

func TilesetFromJson

func TilesetFromJson(data io.Reader) *Tileset

func (*Tileset) ToJson

func (ts *Tileset) ToJson() (string, error)

type Vctr

type Vctr struct {
	Header       VctrHeader
	FeatureTable FeatureTable
	BatchTable   BatchTable
	Indices      VctrIndices
	Polygons     VctrPolygons
	Polylines    VctrPolylines
	Points       VctrPoints
}

func (*Vctr) CalcSize

func (m *Vctr) CalcSize() uint32

func (*Vctr) GetBatchTable

func (m *Vctr) GetBatchTable() *BatchTable

func (*Vctr) GetFeatureTable

func (m *Vctr) GetFeatureTable() *FeatureTable

func (*Vctr) GetFeatureTableView

func (m *Vctr) GetFeatureTableView() VctrFeatureTableView

func (*Vctr) GetHeader

func (m *Vctr) GetHeader() Header

func (*Vctr) GetIndices

func (m *Vctr) GetIndices() VctrIndices

func (*Vctr) GetPoints

func (m *Vctr) GetPoints() VctrPoints

func (*Vctr) GetPolygons

func (m *Vctr) GetPolygons() VctrPolygons

func (*Vctr) GetPolylines

func (m *Vctr) GetPolylines() VctrPolylines

func (*Vctr) Read

func (m *Vctr) Read(reader io.ReadSeeker) error

func (*Vctr) SetFeatureTable

func (m *Vctr) SetFeatureTable(view VctrFeatureTableView)

func (*Vctr) Write

func (m *Vctr) Write(writer io.Writer) error

type VctrFeatureTableView

type VctrFeatureTableView struct {
	Region               *[6]float32
	RtcCenter            [3]float64
	PointsLength         uint32
	PointBatchId         interface{}
	PolygonsLength       uint32
	PolylinesLength      uint32
	PolylineBatchId      interface{}
	PolylineWidths       []uint16
	PolylineCounts       []uint32
	PolygonBatchId       interface{}
	PolygonMinimumHeight []float32
	PolygonMaximumHeight []float32
	PolygonIndexCounts   []uint32
	PolygonCounts        []uint32
}

type VctrHeader

type VctrHeader struct {
	Magic                        [4]byte
	Version                      uint32
	ByteLength                   uint32
	FeatureTableJSONByteLength   uint32
	FeatureTableBinaryByteLength uint32
	BatchTableJSONByteLength     uint32
	BatchTableBinaryByteLength   uint32
	PolygonIndicesByteLength     uint32
	PolygonPositionsByteLength   uint32
	PolylinePositionsByteLength  uint32
	PointPositionsByteLength     uint32
}

func (*VctrHeader) CalcSize

func (h *VctrHeader) CalcSize() int64

func (*VctrHeader) GetBatchTableBinaryByteLength

func (h *VctrHeader) GetBatchTableBinaryByteLength() uint32

func (*VctrHeader) GetBatchTableJSONByteLength

func (h *VctrHeader) GetBatchTableJSONByteLength() uint32

func (*VctrHeader) GetByteLength

func (h *VctrHeader) GetByteLength() uint32

func (*VctrHeader) GetFeatureTableBinaryByteLength

func (h *VctrHeader) GetFeatureTableBinaryByteLength() uint32

func (*VctrHeader) GetFeatureTableJSONByteLength

func (h *VctrHeader) GetFeatureTableJSONByteLength() uint32

func (*VctrHeader) GetPointPositionsByteLength

func (h *VctrHeader) GetPointPositionsByteLength() uint32

func (*VctrHeader) GetPolygonIndicesByteLength

func (h *VctrHeader) GetPolygonIndicesByteLength() uint32

func (*VctrHeader) GetPolygonPositionsByteLength

func (h *VctrHeader) GetPolygonPositionsByteLength() uint32

func (*VctrHeader) GetPolylinePositionsByteLength

func (h *VctrHeader) GetPolylinePositionsByteLength() uint32

func (*VctrHeader) SetBatchTableBinaryByteLength

func (h *VctrHeader) SetBatchTableBinaryByteLength(n uint32)

func (*VctrHeader) SetBatchTableJSONByteLength

func (h *VctrHeader) SetBatchTableJSONByteLength(n uint32)

func (*VctrHeader) SetFeatureTableBinaryByteLength

func (h *VctrHeader) SetFeatureTableBinaryByteLength(n uint32)

func (*VctrHeader) SetFeatureTableJSONByteLength

func (h *VctrHeader) SetFeatureTableJSONByteLength(n uint32)

func (*VctrHeader) SetPointPositionsByteLength

func (h *VctrHeader) SetPointPositionsByteLength(n uint32)

func (*VctrHeader) SetPolygonIndicesByteLength

func (h *VctrHeader) SetPolygonIndicesByteLength(n uint32)

func (*VctrHeader) SetPolygonPositionsByteLength

func (h *VctrHeader) SetPolygonPositionsByteLength(n uint32)

func (*VctrHeader) SetPolylinePositionsByteLength

func (h *VctrHeader) SetPolylinePositionsByteLength(n uint32)

type VctrIndices

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

func (*VctrIndices) Add

func (m *VctrIndices) Add(pt [3]uint32)

func (VctrIndices) CalcSize

func (m VctrIndices) CalcSize(header Header) uint32

func (*VctrIndices) Read

func (m *VctrIndices) Read(reader io.ReadSeeker, header Header) error

func (*VctrIndices) Write

func (m *VctrIndices) Write(writer io.Writer, header Header) error

type VctrPoints

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

func (*VctrPoints) Add

func (m *VctrPoints) Add(pt [3]int)

func (*VctrPoints) CalcSize

func (m *VctrPoints) CalcSize(header Header) uint32

func (*VctrPoints) Read

func (m *VctrPoints) Read(reader io.ReadSeeker, header Header) error

func (*VctrPoints) Write

func (m *VctrPoints) Write(writer io.Writer, header Header) error

type VctrPolygons

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

func (*VctrPolygons) Add

func (m *VctrPolygons) Add(pt [2]int)

func (*VctrPolygons) CalcSize

func (m *VctrPolygons) CalcSize(header Header) uint32

func (*VctrPolygons) Read

func (m *VctrPolygons) Read(reader io.ReadSeeker, header Header) error

func (*VctrPolygons) Write

func (m *VctrPolygons) Write(writer io.Writer, header Header) error

type VctrPolylines

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

func (*VctrPolylines) Add

func (m *VctrPolylines) Add(pt [3]int)

func (*VctrPolylines) CalcSize

func (m *VctrPolylines) CalcSize(header Header) uint32

func (*VctrPolylines) Read

func (m *VctrPolylines) Read(reader io.ReadSeeker, header Header) error

func (*VctrPolylines) Write

func (m *VctrPolylines) Write(writer io.Writer, header Header) error

Jump to

Keyboard shortcuts

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