#include <sc_store.h>

Public Member Functions

void ComputeBounding (Point &min, Point &max)
 
void Delete (InclusionKey inclusion_key)
 
void Delete (InstanceKey instance_key)
 
void Delete (ViewKey view_key)
 
MaterialKey FindOrInsert (Color const &color)
 
MaterialKey FindOrInsert (Material const &material)
 
MatrixKey FindOrInsert (Matrix3d const &matrix)
 
MatrixKey FindOrInsert (DMatrix3d const &matrix)
 
MaterialMapKey FindOrInsert (MaterialKeys const &material_keys)
 
MaterialMapKey FindOrInsert (MaterialMapElements const &material_map_elements)
 
PolyPolygonKey FindOrInsert (uint32_t loop_count, uint32_t const *loop_counts, Point const *points)
 
ClipRegionKey FindOrInsert (ClipSubRegions const &clip_subregions)
 
const char * GenerateSCSFile (const char *utf8_scs_file_path=nullptr)
 
const char * GenerateSCZFile (const char *utf8_scz_file_path=nullptr, bool include_derived=true, bool include_editable=true, bool create_bundled=false)
 
void Get (DataKey key, std::vector< uint8_t > &byte_data) const
 
bool Get (Camera &camera, ViewKey view=ViewKey())
 
bool Get (MaterialProperties &material_properties, ViewKey view=ViewKey())
 
bool Get (ViewKey &view)
 
void GetClipRegionIds (ClipRegionIds &clip_region_ids) const
 
void GetClipRegionKeys (ClipRegionKeys &clip_region_keys) const
 
void GetDataIds (DataIds &data_ids) const
 
void GetDataKeys (DataKeys &data_keys) const
 
void GetGroupIds (GroupIds &group_ids) const
 
void GetGroupKeys (GroupKeys &group_keys) const
 
void GetImageIds (ImageIds &image_ids) const
 
void GetImageKeys (ImageKeys &image_keys) const
 
void GetInstanceIds (InstanceIds &instance_ids) const
 
void GetInstanceIncs (InstanceIncs &instance_incs) const
 
void GetInstanceKeys (InstanceKeys &instance_keys) const
 
ModelKey GetKey () const
 
void GetMaterialIds (MaterialIds &material_ids) const
 
void GetMaterialKeys (MaterialKeys &material_keys) const
 
void GetMaterialMapIds (MaterialMapIds &material_map_ids) const
 
void GetMaterialMapKeys (MaterialMapKeys &material_map_keys) const
 
void GetMatrixIds (MatrixIds &matrix_ids) const
 
void GetMatrixKeys (MatrixKeys &matrix_keys) const
 
void GetMeshIds (MeshIds &mesh_ids) const
 
void GetMeshKeys (MeshKeys &mesh_keys) const
 
const char * GetName () const
 
const char * GetPath () const
 
void GetPolyPolygonIds (PolyPolygonIds &polypolygon_ids) const
 
void GetPolyPolygonKeys (PolyPolygonKeys &polypolygon_keys) const
 
double GetRootMeasurementUnit ()
 
InclusionKey Include (Model const &model, MatrixKey matrix=MatrixKey())
 
MeshKey Insert (Mesh const &mesh)
 
MeshKey Insert (MeshKeys const &meshes)
 
MaterialKey Insert (Color const &color)
 
MaterialKey Insert (Material const &material)
 
LinePatternKey Insert (LinePattern const &line_pattern)
 
MatrixKey Insert (Matrix3d const &matrix)
 
MatrixKey Insert (DMatrix3d const &matrix)
 
ImageKey Insert (uint32_t byte_count, uint8_t const *byte_data, ImageFormat format)
 
ImageKey Insert (uint32_t width, uint32_t height, RGBA32 const *data)
 
ImageKey Insert (uint32_t width, uint32_t height, RGB24 const *data)
 
ImageKey Insert (uint32_t width, uint32_t height, Gray8 const *data)
 
ImageKey Insert (uint32_t width, uint32_t height, GrayAlpha16 const *data)
 
DataKey Insert (uint32_t byte_count, uint8_t const *byte_data, uint32_t priority=0)
 
GroupKey Insert (InstanceIncs const &instance_incs, GroupIncs const &group_incs)
 
MaterialMapKey Insert (MaterialKeys const &material_keys)
 
MaterialMapKey Insert (MaterialMapElements const &material_map_elements)
 
PolyPolygonKey Insert (uint32_t loop_count, uint32_t const *loop_counts, Point const *points)
 
ClipRegionKey Insert (ClipSubRegions const &clip_subregions)
 
InstanceKey Instance (MeshKey mesh, MatrixKey matrix=MatrixKey(), MaterialKey face_material=MaterialKey::Unspecified(), MaterialKey line_material=MaterialKey::Unspecified(), MaterialKey point_material=MaterialKey::Unspecified(), MaterialMapKey face_material_map=MaterialMapKey(), MaterialMapKey line_material_map=MaterialMapKey(), MaterialMapKey point_material_map=MaterialMapKey(), Visibility visibility=Visibility(), Modifiers modifiers=Modifiers(), ClipRegionKey clip_region=ClipRegionKey(), VectorCulling const &vector_culling=VectorCulling())
 
 Model (Model &&that)
 
void PrepareStream (CompressionStrategy compression_strategy=CompressionStrategy::Default)
 
void Set (MeshKey key, Mesh const &mesh)
 
void Set (MeshKey key, MeshKeys const &meshes)
 
void Set (MaterialKey key, Color const &color)
 
void Set (MaterialKey key, Material const &material)
 
void Set (MatrixKey key, Matrix3d const &matrix)
 
void Set (MatrixKey key, DMatrix3d const &matrix)
 
void Set (ImageKey key, uint32_t byte_count, uint8_t const *byte_data, ImageFormat format)
 
void Set (ImageKey key, uint32_t width, uint32_t height, RGBA32 const *data)
 
void Set (ImageKey key, uint32_t width, uint32_t height, RGB24 const *data)
 
void Set (ImageKey key, uint32_t width, uint32_t height, Gray8 const *data)
 
void Set (ImageKey key, uint32_t width, uint32_t height, GrayAlpha16 const *data)
 
void Set (DataKey key, uint32_t byte_count, uint8_t const *byte_data)
 
void Set (DataKey key, uint32_t byte_count, uint8_t const *byte_data, uint32_t priority)
 
void Set (GroupKey key, InstanceIncs const &instance_incs, GroupIncs const &group_incs)
 
void Set (MaterialMapKey key, MaterialKeys const &material_keys)
 
void Set (MaterialMapKey key, MaterialMapElements const &material_map_elements)
 
void Set (PolyPolygonKey key, uint32_t loop_count, uint32_t const *loop_counts, Point const *points)
 
void Set (ClipRegionKey key, ClipSubRegions const &clip_subregions)
 
void Set (InstanceKey key, MeshKey mesh)
 
void Set (InstanceKey key, MatrixKey matrix)
 
void Set (InstanceKey key, VectorCulling const &vector_culling)
 
void Set (InstanceKey key, MaterialKey face_material, MaterialKey line_material, MaterialKey point_material)
 
void Set (InstanceKey key, MaterialMapKey face_material_map, MaterialMapKey line_material_map, MaterialMapKey point_material_map)
 
void Set (InstanceKey key, Visibility visibility)
 
void Set (InstanceKey key, Modifiers modifiers)
 
void Set (InstanceKey key, ClipRegionKey clip_region)
 
void Set (InstanceInc const &inc, MaterialKey face_material, MaterialKey line_material, MaterialKey point_material)
 
void Set (InstanceInc const &inc, MaterialMapKey face_material_map, MaterialMapKey line_material_map, MaterialMapKey point_material_map)
 
void Set (InstanceInc const &inc, Visibility visibility)
 
void Set (InstanceInc const &inc, Modifiers modifiers_to_add)
 
void Set (InstanceInc const &inc, ClipRegionKey clip_region)
 
void Set (Camera const &camera, ViewKey view=ViewKey())
 
void Set (MaterialProperties const &material_properties, ViewKey view=ViewKey())
 
void Set (ViewKey view)
 
ViewKey View ()
 
 ~Model ()
 

Detailed Description

The interface into a model. This class allows the definition of meshes, colors, matrices, instances, and other model data. It also provides means of modifying existing definitions. Querying of its name, model key, default camera, keys and many other aspects.

A model is closed when its destructor or cache.Close(model) is called.

In general operations on invalid keys or otherwise invalid usage will throw exceptions. Using try catch blocks around your code is advised.

A model has a default View, but unless a self include is created nothing will be visible when it is streamed. A model without a self include can be seen as an pure container for data, but unless it is included in some other model it is not directly viewable.

Consider a model containing a single instance of a sphere. If it was self included 4 times with different matrices then 4 spheres would be visible when the model is streamed and viewed. If it was included in a second model once, a single sphere would be visible in the second model.

Constructor & Destructor Documentation

◆ ~Model()

SC::Store::Model::~Model ( )

◆ Model()

SC::Store::Model::Model ( Model &&  that)

Member Function Documentation

◆ ComputeBounding()

void SC::Store::Model::ComputeBounding ( Point min,
Point max 
)

Compute the bounding for this model. This requires PrepareStream() has been called. If the stream has not been prepared an exception may be thrown.

◆ Delete() [1/3]

void SC::Store::Model::Delete ( InclusionKey  inclusion_key)

Remove an existing Inclusion from a model.

Parameters
inclusion_keyThe InclusionKey to remove.

◆ Delete() [2/3]

void SC::Store::Model::Delete ( InstanceKey  instance_key)

Remove an existing Instance from a model.

Parameters
instance_keyThe InstanceKey to remove.

◆ Delete() [3/3]

void SC::Store::Model::Delete ( ViewKey  view_key)

Remove an existing View from a model.

Parameters
view_keyThe ViewKey to remove.

◆ FindOrInsert() [1/8]

MaterialKey SC::Store::Model::FindOrInsert ( Color const &  color)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
colorThe Color to match or insert.
Returns
A MaterialKey.

◆ FindOrInsert() [2/8]

MaterialKey SC::Store::Model::FindOrInsert ( Material const &  material)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
materialThe Material to match or insert.
Returns
A MaterialKey.

◆ FindOrInsert() [3/8]

MatrixKey SC::Store::Model::FindOrInsert ( Matrix3d const &  matrix)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
matrixThe Matrix3d to match or insert.
Returns
A MatrixKey.

◆ FindOrInsert() [4/8]

MatrixKey SC::Store::Model::FindOrInsert ( DMatrix3d const &  matrix)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
matrixThe DMatrix3d to match or insert.
Returns
A MatrixKey.

◆ FindOrInsert() [5/8]

MaterialMapKey SC::Store::Model::FindOrInsert ( MaterialKeys const &  material_keys)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
material_keysThe MaterialKeys to match or insert. These define a fully enumerated material map.
Returns
A MaterialMapKey.

◆ FindOrInsert() [6/8]

MaterialMapKey SC::Store::Model::FindOrInsert ( MaterialMapElements const &  material_map_elements)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
material_map_elementsThe MaterialMapElements to match or insert. These define a sparse material map.
Returns
A MaterialMapKey.

◆ FindOrInsert() [7/8]

PolyPolygonKey SC::Store::Model::FindOrInsert ( uint32_t  loop_count,
uint32_t const *  loop_counts,
Point const *  points 
)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
loop_countThe loop count.
loop_countsThe counts for loop_count loops.
pointsThe points.
Returns
A PolyPolygonKey.

◆ FindOrInsert() [8/8]

ClipRegionKey SC::Store::Model::FindOrInsert ( ClipSubRegions const &  clip_subregions)

Look up matching definition or insert if not found. Only definitions created using FindOrInsert are matchable. Helps create a more compact model if unique keying is not needed.

Parameters
keyclip_subregions ClipSubRegions to match or insert.
Returns
A ClipRegionKey.

◆ GenerateSCSFile()

const char* SC::Store::Model::GenerateSCSFile ( const char *  utf8_scs_file_path = nullptr)

Generates an .scs file. Returned pointer is only valid until the next call.

Parameters
utf8_scs_file_pathSpecifies the full path and file name of the .scs file to generate include the .scs extension. If the utf8_scs_file_path is nullptr or empty a .scs file will be generated in the model directory with a default name.
Returns
A pointer to a 'C' string UTF8 file system path of the generated .scs file.

◆ GenerateSCZFile()

const char* SC::Store::Model::GenerateSCZFile ( const char *  utf8_scz_file_path = nullptr,
bool  include_derived = true,
bool  include_editable = true,
bool  create_bundled = false 
)

Generates an .scz file. Returned pointer is only valid until the next call. Using "include_derived = false" is not compatible with "include_editable = false" the resulting file is unusable and the call will throw. A bundled .scz can be streamed without decompression but will create a larger file and may only be opened read-only. A file created with "include_editable = false" can only be opened read-only.

Parameters
utf8_scz_file_pathSpecifies the full path and file name of the .scz file to generate include the .scz extension. If the utf8_scz_file_path is nullptr or empty a .scz file will be generated in the model directory with a default name.
include_derivedIf true the .scz file will include the files needed from streaming.
include_editableIf true the .scz file will include the files needed for future editing.
create_bundledIf true the .scz file will be bundled rather than compressed.
Returns
A pointer to a 'C' string UTF8 file system path of the generated .scz file.

◆ Get() [1/4]

void SC::Store::Model::Get ( DataKey  key,
std::vector< uint8_t > &  byte_data 
) const

Query the data associated with a DataKey.

Parameters
keyThe data to read
byte_dataThe write back vector to return the associated data.

◆ Get() [2/4]

bool SC::Store::Model::Get ( Camera camera,
ViewKey  view = ViewKey() 
)

Query a views camera.

Parameters
cameraA write back value to return the Camera. Only valid if true is returned.
viewThe view to query the properties on. If unspecified the default view is used.
Returns
True if Camera has been set.

◆ Get() [3/4]

bool SC::Store::Model::Get ( MaterialProperties material_properties,
ViewKey  view = ViewKey() 
)

Query a views default material properties.

Parameters
material_propertiesA write back value to return the MaterialProperties. Only valid if true is returned.
viewThe view to query the properties on. If unspecified the default view is used.
Returns
True if MaterialProperties have been set.

◆ Get() [4/4]

bool SC::Store::Model::Get ( ViewKey view)

Query an optional initial View. *

Parameters
viewA write back value containing the initial ViewKey. Only valid if true is returned. *
Returns
True if an optional View has been set.

◆ GetClipRegionIds()

void SC::Store::Model::GetClipRegionIds ( ClipRegionIds clip_region_ids) const

Query the ClipRegionIds defined in a model. Ids are not stable values from one open model to another.

Parameters
clip_region_idsA write back vector to return defined ClipRegionIds.

◆ GetClipRegionKeys()

void SC::Store::Model::GetClipRegionKeys ( ClipRegionKeys clip_region_keys) const

Query the ClipRegionKeys defined in a model.

Parameters
clip_region_keysA write back vector to return defined ClipRegionKeys.

◆ GetDataIds()

void SC::Store::Model::GetDataIds ( DataIds data_ids) const

Query the DataIds defined in a model.

Parameters
data_idsA write back vector to return defined DataIds.

◆ GetDataKeys()

void SC::Store::Model::GetDataKeys ( DataKeys data_keys) const

Query the DataKeys defined in a model.

Parameters
data_keysA write back vector to return defined DataKeys.

◆ GetGroupIds()

void SC::Store::Model::GetGroupIds ( GroupIds group_ids) const

Query the GroupIds defined in a model. Ids are not stable values from one open model to another.

Parameters
group_idsA write back vector to return defined GroupIds.

◆ GetGroupKeys()

void SC::Store::Model::GetGroupKeys ( GroupKeys group_keys) const

Query the GroupKeys defined in a model.

Parameters
group_keysA write back vector to return defined GroupKeys.

◆ GetImageIds()

void SC::Store::Model::GetImageIds ( ImageIds image_ids) const

Query the ImageIds defined in a model. Ids are not stable values from one open model to another.

Parameters
image_idsA write back vector to return defined ImageIds.

◆ GetImageKeys()

void SC::Store::Model::GetImageKeys ( ImageKeys image_keys) const

Query the ImageKeys defined in a model.

Parameters
image_keysA write back vector to return defined ImageKeys.

◆ GetInstanceIds()

void SC::Store::Model::GetInstanceIds ( InstanceIds instance_ids) const

Query the InstanceIds defined in a model. Ids are not stable values from one open model to another.

Parameters
instance_idsA write back vector to return defined InstanceIds.

◆ GetInstanceIncs()

void SC::Store::Model::GetInstanceIncs ( InstanceIncs instance_incs) const

Query the InstanceIncs defined in a model.

Parameters
instance_incsA write back vector to return defined InstanceIncs.

◆ GetInstanceKeys()

void SC::Store::Model::GetInstanceKeys ( InstanceKeys instance_keys) const

Query the InstanceKeys defined in a model.

Parameters
instance_keysA write back vector to return defined InstanceKeys.

◆ GetKey()

ModelKey SC::Store::Model::GetKey ( ) const

Query the current ModelKey. ModelKeys are not stable values from one open model to another.

Returns
A ModelKey.

◆ GetMaterialIds()

void SC::Store::Model::GetMaterialIds ( MaterialIds material_ids) const

Query the MaterialIds defined in a model. Ids are not stable values from one open model to another.

Parameters
material_idsA write back vector to return defined MaterialIds.

◆ GetMaterialKeys()

void SC::Store::Model::GetMaterialKeys ( MaterialKeys material_keys) const

Query the MaterialKeys defined in a model.

Parameters
material_keysA write back vector to return defined MaterialKeys.

◆ GetMaterialMapIds()

void SC::Store::Model::GetMaterialMapIds ( MaterialMapIds material_map_ids) const

Query the MaterialMapIds defined in a model. Ids are not stable values from one open model to another.

Parameters
material_map_idsA write back vector to return defined MaterialMapIds.

◆ GetMaterialMapKeys()

void SC::Store::Model::GetMaterialMapKeys ( MaterialMapKeys material_map_keys) const

Query the MaterialMapKeys defined in a model.

Parameters
material_map_keysA write back vector to return defined MaterialMapKeys.

◆ GetMatrixIds()

void SC::Store::Model::GetMatrixIds ( MatrixIds matrix_ids) const

Query the MatrixIds defined in a model. Ids are not stable values from one open model to another.

Parameters
matrix_idsA write back vector to return defined MatrixIds.

◆ GetMatrixKeys()

void SC::Store::Model::GetMatrixKeys ( MatrixKeys matrix_keys) const

Query the MatrixKeys defined in a model.

Parameters
matrix_keysA write back vector to return defined MatrixKeys.

◆ GetMeshIds()

void SC::Store::Model::GetMeshIds ( MeshIds mesh_ids) const

Query the MeshIds defined in a model.

Parameters
mesh_idsA write back vector to return defined MeshIds.

◆ GetMeshKeys()

void SC::Store::Model::GetMeshKeys ( MeshKeys mesh_keys) const

Query the MeshKeys defined in a model.

Parameters
mesh_keysA write back vector to return defined MeshKeys.

◆ GetName()

const char* SC::Store::Model::GetName ( ) const

Query the name used by a model. The name is not sufficient to uniquely identify a model; use a path instead. Returned pointer is only valid until the next call.

Returns
A pointer to a 'C' string with the UTF8 model name.

◆ GetPath()

const char* SC::Store::Model::GetPath ( ) const

Query the file system path used by a model. Returned pointer is only valid until the next call.

Returns
A pointer to a 'C' string with the UTF8 file system path.

◆ GetPolyPolygonIds()

void SC::Store::Model::GetPolyPolygonIds ( PolyPolygonIds polypolygon_ids) const

Query the PolyPolygonIds defined in a model. Ids are not stable values from one open model to another.

Parameters
polypolygon_idsA write back vector to return defined PolyPolygonIds.

◆ GetPolyPolygonKeys()

void SC::Store::Model::GetPolyPolygonKeys ( PolyPolygonKeys polypolygon_keys) const

Query the PolyPolygonKeys defined in a model.

Parameters
polypolygon_keysA write back vector to return defined PolyPolygonKeys.

◆ GetRootMeasurementUnit()

double SC::Store::Model::GetRootMeasurementUnit ( )

Returns the measurement unit of the root node in the model if any. Returns 0 if no measurement unit is set.

Returns
The measurement unit of the root node.

◆ Include()

InclusionKey SC::Store::Model::Include ( Model const &  model,
MatrixKey  matrix = MatrixKey() 
)

Include a model in this model's views. May be a self inclusion. Inclusions present in the included model are not included, just the included model's data.

Parameters
modelThe Model to include.
matrixThe transform matrix for the inclusion the default constructed MatrixKey is an identity matrix.
Returns
An InclusionKey.

◆ Insert() [1/18]

MeshKey SC::Store::Model::Insert ( Mesh const &  mesh)

Insert a new definition into the model.

Parameters
meshThe Mesh.
Returns
A MeshKey.

◆ Insert() [2/18]

MeshKey SC::Store::Model::Insert ( MeshKeys const &  meshes)

Insert a new definition into the model. This is a mesh selector with different mesh levels.

Parameters
meshesThe MeshKeys. The index 0 is the highest representation and the Nth index is the lowest representation.
Returns
A MeshKey.

◆ Insert() [3/18]

MaterialKey SC::Store::Model::Insert ( Color const &  color)

Insert a new definition into the model.

Parameters
colorThe Color.
Returns
A MaterialKey.

◆ Insert() [4/18]

MaterialKey SC::Store::Model::Insert ( Material const &  material)

Insert a new definition into the model.

Parameters
materialThe Material.
Returns
A MaterialKey.

◆ Insert() [5/18]

LinePatternKey SC::Store::Model::Insert ( LinePattern const &  line_pattern)

Insert a new definition into the model.

Parameters
line_patternThe Line Pattern.
Returns
A LinePatternKey.

◆ Insert() [6/18]

MatrixKey SC::Store::Model::Insert ( Matrix3d const &  matrix)

Insert a new definition into the model.

Parameters
matrixThe Matrix3d.
Returns
A MatrixKey.

◆ Insert() [7/18]

MatrixKey SC::Store::Model::Insert ( DMatrix3d const &  matrix)

Insert a new definition into the model.

Parameters
matrixThe DMatrix3d.
Returns
A MatrixKey.

◆ Insert() [8/18]

ImageKey SC::Store::Model::Insert ( uint32_t  byte_count,
uint8_t const *  byte_data,
ImageFormat  format 
)

Insert a new definition into the model.

Parameters
byte_countThe byte count.
byte_dataThe image data of length byte_count.
formatThe ImageFormat of the byte_data.
Returns
An ImageKey.

◆ Insert() [9/18]

ImageKey SC::Store::Model::Insert ( uint32_t  width,
uint32_t  height,
RGBA32 const *  data 
)

Insert a new definition into the model.

Parameters
widthThe image width.
widthThe image height.
dataThe RGBA32 image data of length width * height.
Returns
An ImageKey.

◆ Insert() [10/18]

ImageKey SC::Store::Model::Insert ( uint32_t  width,
uint32_t  height,
RGB24 const *  data 
)

Insert a new definition into the model.

Parameters
widthThe image width.
widthThe image height.
dataThe RGB24 image data of length width * height.
Returns
An ImageKey.

◆ Insert() [11/18]

ImageKey SC::Store::Model::Insert ( uint32_t  width,
uint32_t  height,
Gray8 const *  data 
)

Insert a new definition into the model.

Parameters
widthThe image width.
widthThe image height.
dataThe Gray8 image data of length width * height.
Returns
An ImageKey.

◆ Insert() [12/18]

ImageKey SC::Store::Model::Insert ( uint32_t  width,
uint32_t  height,
GrayAlpha16 const *  data 
)

Insert a new definition into the model.

Parameters
widthThe image width.
widthThe image height.
dataThe GrayAlpha16 image data of length width * height.
Returns
An ImageKey.

◆ Insert() [13/18]

DataKey SC::Store::Model::Insert ( uint32_t  byte_count,
uint8_t const *  byte_data,
uint32_t  priority = 0 
)

Insert a new definition into the model.

Parameters
byte_countThe byte count.
byte_dataThe bytes of length byte_count.
priorityThe priority. Controls streaming order: 0 not sent by default - ~0 sent by request only and excluded from .scs; otherwise, highest first.
Returns
A DataKey.

◆ Insert() [14/18]

GroupKey SC::Store::Model::Insert ( InstanceIncs const &  instance_incs,
GroupIncs const &  group_incs 
)

Insert a new definition into the model.

Parameters
instance_incsThe InstanceIncs to insert.
group_incsThe GroupIncs to insert.
Returns
A GroupKey.

◆ Insert() [15/18]

MaterialMapKey SC::Store::Model::Insert ( MaterialKeys const &  material_keys)

Insert a new definition into the model.

Parameters
material_keysThe MaterialKeys to insert. These define a fully enumerated material map.
Returns
A MaterialMapKey.

◆ Insert() [16/18]

MaterialMapKey SC::Store::Model::Insert ( MaterialMapElements const &  material_map_elements)

Insert a new definition into the model.

Parameters
material_map_elementsThe MaterialMapElements to insert. These define a sparse material map.
Returns
A MaterialMapKey.

◆ Insert() [17/18]

PolyPolygonKey SC::Store::Model::Insert ( uint32_t  loop_count,
uint32_t const *  loop_counts,
Point const *  points 
)

Insert a new definition into the model.

Parameters
loop_countThe loop count.
loop_countsThe counts for loop_count loops.
pointsThe points.
Returns
A PolyPolygonKey.

◆ Insert() [18/18]

ClipRegionKey SC::Store::Model::Insert ( ClipSubRegions const &  clip_subregions)

Insert a new definition into the model.

Parameters
keyclip_subregions ClipSubRegions to insert.
Returns
A ClipRegionKey.

◆ Instance()

InstanceKey SC::Store::Model::Instance ( MeshKey  mesh,
MatrixKey  matrix = MatrixKey(),
MaterialKey  face_material = MaterialKey::Unspecified(),
MaterialKey  line_material = MaterialKey::Unspecified(),
MaterialKey  point_material = MaterialKey::Unspecified(),
MaterialMapKey  face_material_map = MaterialMapKey(),
MaterialMapKey  line_material_map = MaterialMapKey(),
MaterialMapKey  point_material_map = MaterialMapKey(),
Visibility  visibility = Visibility(),
Modifiers  modifiers = Modifiers(),
ClipRegionKey  clip_region = ClipRegionKey(),
VectorCulling const &  vector_culling = VectorCulling() 
)

Creates an Instance of a mesh.

Parameters
meshThe MeshKey to instance.
matrixThe transform matrix for the instance. The default constructed MatrixKey is an identity matrix.
face_materialThe MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
line_materialThe MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
point_materialThe MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
face_material_mapThe MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh's setting will be used.
line_material_mapThe MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh's setting will be used.
point_material_mapThe MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh's setting will be used.
visibilityThe Visibility. The default constructed Visibility is all on.
modifiersThe Modifiers. The default constructed Modifiers is none.
clip_regionThe ClipRegionKey. The default constructed ClipRegionKey is none.
vector_cullingThe VectorCulling setting. The default constructed VectorCulling is none.
Returns
An InstanceKey.

◆ PrepareStream()

void SC::Store::Model::PrepareStream ( CompressionStrategy  compression_strategy = CompressionStrategy::Default)

Prepares this model for streaming. This should be done last when all data has been authored. *

Parameters
compression_strategyThe strategy use to compress large meshes and images. Affects speed and output size

◆ Set() [1/34]

void SC::Store::Model::Set ( MeshKey  key,
Mesh const &  mesh 
)

Replace the underlying definition for key.

Parameters
keyThe MeshKey to modify.
meshesThe replacement Mesh.

◆ Set() [2/34]

void SC::Store::Model::Set ( MeshKey  key,
MeshKeys const &  meshes 
)

Replace the underlying definition for key.

Parameters
keyThe MeshKey to modify.
meshesThe replacement MeshKeys. The index 0 is the highest representation and the Nth index is the lowest representation.

◆ Set() [3/34]

void SC::Store::Model::Set ( MaterialKey  key,
Color const &  color 
)

Replace the underlying definition for key.

Parameters
keyThe MaterialKey to modify.
colorThe replacement Color.

◆ Set() [4/34]

void SC::Store::Model::Set ( MaterialKey  key,
Material const &  material 
)

Replace the underlying definition for key.

Parameters
keyThe MaterialKey to modify.
materialThe replacement Material.

◆ Set() [5/34]

void SC::Store::Model::Set ( MatrixKey  key,
Matrix3d const &  matrix 
)

Replace the underlying definition for key.

Parameters
keyThe MatrixKey to modify.
matrixThe replacement Matrix3d.

◆ Set() [6/34]

void SC::Store::Model::Set ( MatrixKey  key,
DMatrix3d const &  matrix 
)

Replace the underlying definition for key.

Parameters
keyThe MatrixKey to modify.
matrixThe replacement DMatrix3d.

◆ Set() [7/34]

void SC::Store::Model::Set ( ImageKey  key,
uint32_t  byte_count,
uint8_t const *  byte_data,
ImageFormat  format 
)

Replace the underlying definition for key.

Parameters
keyThe ImageKey to modify.
byte_countThe replacement byte count.
byte_dataThe replacement image data of length byte_count.
formatThe replacement ImageFormat of the byte_data.

◆ Set() [8/34]

void SC::Store::Model::Set ( ImageKey  key,
uint32_t  width,
uint32_t  height,
RGBA32 const *  data 
)

Replace the underlying definition for key.

Parameters
keyThe ImageKey to modify.
widthThe replacement image width.
widthThe replacement image height.
dataThe replacement RGBA32 image data of length width * height.

◆ Set() [9/34]

void SC::Store::Model::Set ( ImageKey  key,
uint32_t  width,
uint32_t  height,
RGB24 const *  data 
)

Replace the underlying definition for key.

Parameters
keyThe ImageKey to modify.
widthThe replacement image width.
widthThe replacement image height.
dataThe replacement RGB24 image data of length width * height.

◆ Set() [10/34]

void SC::Store::Model::Set ( ImageKey  key,
uint32_t  width,
uint32_t  height,
Gray8 const *  data 
)

Replace the underlying definition for key.

Parameters
keyThe ImageKey to modify.
widthThe replacement image width.
widthThe replacement image height.
dataThe replacement Gray8 image data of length width * height.

◆ Set() [11/34]

void SC::Store::Model::Set ( ImageKey  key,
uint32_t  width,
uint32_t  height,
GrayAlpha16 const *  data 
)

Replace the underlying definition for key.

Parameters
keyThe ImageKey to modify.
widthThe replacement image width.
widthThe replacement image height.
dataThe replacement GrayAlpha16 image data of length width * height.

◆ Set() [12/34]

void SC::Store::Model::Set ( DataKey  key,
uint32_t  byte_count,
uint8_t const *  byte_data 
)

Replace the underlying definition for key. The original priority is retained.

Parameters
keyThe DataKey to modify.
byte_countThe replacement byte count.
byte_dataThe replacement bytes of length byte_count.

◆ Set() [13/34]

void SC::Store::Model::Set ( DataKey  key,
uint32_t  byte_count,
uint8_t const *  byte_data,
uint32_t  priority 
)

Replace the underlying definition for key.

Parameters
keyThe DataKey to modify.
byte_countThe replacement byte count.
byte_dataThe replacement bytes of length byte_count.
priorityThe replacement priority. Controls streaming order: 0 not sent by default - ~0 sent by request only and excluded from .scs; otherwise, highest first.

◆ Set() [14/34]

void SC::Store::Model::Set ( GroupKey  key,
InstanceIncs const &  instance_incs,
GroupIncs const &  group_incs 
)

Replace the underlying definition for key.

Parameters
keyThe GroupKey to modify.
instance_incsThe replacement InstanceIncs.
group_incsThe replacement GroupIncs.

◆ Set() [15/34]

void SC::Store::Model::Set ( MaterialMapKey  key,
MaterialKeys const &  material_keys 
)

Replace the underlying definition for key.

Parameters
keyThe MaterialMapKey to modify.
material_keysThe replacement MaterialKeys. These define a fully enumerated material map.

◆ Set() [16/34]

void SC::Store::Model::Set ( MaterialMapKey  key,
MaterialMapElements const &  material_map_elements 
)

Replace the underlying definition for key.

Parameters
keyThe MaterialMapKey to modify.
material_map_elementsThe replacement MaterialMapElements. These define a sparse material map.

◆ Set() [17/34]

void SC::Store::Model::Set ( PolyPolygonKey  key,
uint32_t  loop_count,
uint32_t const *  loop_counts,
Point const *  points 
)

Replace the underlying definition for key.

Parameters
keyThe PolyPolygonKey to modify.
loop_countThe replacement loop count.
loop_countsThe replacement counts for loop_count loops.
pointsThe replacement points.

◆ Set() [18/34]

void SC::Store::Model::Set ( ClipRegionKey  key,
ClipSubRegions const &  clip_subregions 
)

Replace the underlying definition for key.

Parameters
keyThe ClipRegionKey to modify.
clip_subregionsThe replacement ClipSubRegions.

◆ Set() [19/34]

void SC::Store::Model::Set ( InstanceKey  key,
MeshKey  mesh 
)

Replace the mesh for an Instance.

Parameters
keyThe InstanceKey to modify.
meshThe replacement MeshKey.

◆ Set() [20/34]

void SC::Store::Model::Set ( InstanceKey  key,
MatrixKey  matrix 
)

Replace the matrix for an Instance.

Parameters
keyThe InstanceKey to modify.
matrixThe replacement MatrixKey.

◆ Set() [21/34]

void SC::Store::Model::Set ( InstanceKey  key,
VectorCulling const &  vector_culling 
)

Replace the vector culling settings for an Instance.

Parameters
keyThe InstanceKey to modify.
vector_cullingThe replacement VectorCulling setting.

◆ Set() [22/34]

void SC::Store::Model::Set ( InstanceKey  key,
MaterialKey  face_material,
MaterialKey  line_material,
MaterialKey  point_material 
)

Replace the materials for an Instance.

Parameters
keyThe InstanceKey to modify.
face_materialThe MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
line_materialThe MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
point_materialThe MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh's setting will be used.

◆ Set() [23/34]

void SC::Store::Model::Set ( InstanceKey  key,
MaterialMapKey  face_material_map,
MaterialMapKey  line_material_map,
MaterialMapKey  point_material_map 
)

Replace the material maps for an Instance.

Parameters
keyThe InstanceKey to modify.
face_material_mapThe MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh's setting will be used.
line_material_mapThe MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh's setting will be used.
point_material_mapThe MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh's setting will be used.

◆ Set() [24/34]

void SC::Store::Model::Set ( InstanceKey  key,
Visibility  visibility 
)

Replace the visibility for an Instance.

Parameters
keyThe InstanceKey to modify.
visibilityThe replacement Visibility.

◆ Set() [25/34]

void SC::Store::Model::Set ( InstanceKey  key,
Modifiers  modifiers 
)

Replace the modifiers for an Instance.

Parameters
keyThe InstanceKey to modify.
modifiersThe replacement Modifiers.

◆ Set() [26/34]

void SC::Store::Model::Set ( InstanceKey  key,
ClipRegionKey  clip_region 
)

Replace the clip region for an Instance.

Parameters
keyThe InstanceKey to modify.
clip_regionThe replacement ClipRegionKey.

◆ Set() [27/34]

void SC::Store::Model::Set ( InstanceInc const &  inc,
MaterialKey  face_material,
MaterialKey  line_material,
MaterialKey  point_material 
)

Override the materials for a specific InstanceInc.

Parameters
incThe InstanceInc to override.
face_materialThe MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
line_materialThe MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh's setting will be used.
point_materialThe MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh's setting will be used.

◆ Set() [28/34]

void SC::Store::Model::Set ( InstanceInc const &  inc,
MaterialMapKey  face_material_map,
MaterialMapKey  line_material_map,
MaterialMapKey  point_material_map 
)

Override the material maps for a specific InstanceInc.

Parameters
incThe InstanceInc to override.
face_material_mapThe MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh's setting will be used.
line_material_mapThe MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh's setting will be used.
point_material_mapThe MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh's setting will be used.

◆ Set() [29/34]

void SC::Store::Model::Set ( InstanceInc const &  inc,
Visibility  visibility 
)

Override the visibility for a specific InstanceInc.

Parameters
incThe InstanceInc to override.
visibilityThe override Visibility.

◆ Set() [30/34]

void SC::Store::Model::Set ( InstanceInc const &  inc,
Modifiers  modifiers_to_add 
)

Add modifiers for a specific InstanceInc.

Parameters
incThe InstanceInc to add modifiers to.
modifiers_to_addThe additional Modifiers.

◆ Set() [31/34]

void SC::Store::Model::Set ( InstanceInc const &  inc,
ClipRegionKey  clip_region 
)

Override clip region for a specific InstanceInc.

Parameters
incThe InstanceInc to override.
clip_regionThe override ClipRegionKey.

◆ Set() [32/34]

void SC::Store::Model::Set ( Camera const &  camera,
ViewKey  view = ViewKey() 
)

Set a views camera.

Parameters
cameraThe camera for the view.
viewThe view to set the properties on. If unspecified the default view is used.

◆ Set() [33/34]

void SC::Store::Model::Set ( MaterialProperties const &  material_properties,
ViewKey  view = ViewKey() 
)

Set a views default material properties - these apply to all materials that do not have their own properties.

Parameters
material_propertiesThe default properties for the view.
viewThe view to set the properties on. If unspecified the default view is used.

◆ Set() [34/34]

void SC::Store::Model::Set ( ViewKey  view)

Set a new initial View. Only needed if more than one View exists.

Parameters
viewThe initial ViewKey.

◆ View()

ViewKey SC::Store::Model::View ( )

Create a new View.

Returns
A new ViewKey.