# Model

## Content

class | CacheImpl
class | ModelImpl

## Functions

| `~Model`
| `Model`
MeshKey | `Insert`
MeshKey | `Insert`
MaterialKey | `Insert`
MaterialKey | `Insert`
LinePatternKey | `Insert`
MatrixKey | `Insert`
MatrixKey | `Insert`
ImageKey | `Insert`
ImageKey | `Insert`
ImageKey | `Insert`
ImageKey | `Insert`
ImageKey | `Insert`
DataKey | `Insert`
GroupKey | `Insert`
MaterialMapKey | `Insert`
MaterialMapKey | `Insert`
PolyPolygonKey | `Insert`
ClipRegionKey | `Insert`
MaterialKey | `FindOrInsert`
MaterialKey | `FindOrInsert`
MatrixKey | `FindOrInsert`
MatrixKey | `FindOrInsert`
MaterialMapKey | `FindOrInsert`
MaterialMapKey | `FindOrInsert`
PolyPolygonKey | `FindOrInsert`
ClipRegionKey | `FindOrInsert`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
InstanceKey | `Instance`
InclusionKey | `Include`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Set`
void | `Delete`
void | `Delete`
void | `Delete`
ModelKey | `GetKey`
const char * | `GetName`
const char * | `GetPath`
void | `GetInstanceIncs`
void | `GetMeshIds`
void | `GetMaterialIds`
void | `GetMatrixIds`
void | `GetInstanceIds`
void | `GetImageIds`
void | `GetDataIds`
void | `GetGroupIds`
void | `GetMaterialMapIds`
void | `GetPolyPolygonIds`
void | `GetClipRegionIds`
void | `GetMeshKeys`
void | `GetMaterialKeys`
void | `GetMatrixKeys`
void | `GetInstanceKeys`
void | `GetImageKeys`
void | `GetDataKeys`
void | `GetGroupKeys`
void | `GetMaterialMapKeys`
void | `GetPolyPolygonKeys`
void | `GetClipRegionKeys`
void | `Get`
void | `Set`
bool | `Get`
void | `Set`
bool | `Get`
void | `Set`
bool | `Get`
ViewKey | `View`
void | `PrepareStream`
void | `ComputeBounding`
double | `GetRootMeasurementUnit`
const char * | `GenerateSCSFile`
const char * | `GenerateSCZFile`

## Detailed Description

class Model

  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.

  Public Functions

  ~Model()
  Model(Model &&that)
  MeshKey Insert(Mesh const &mesh)

    Insert a new definition into the model.

    Parameters

      mesh – The Mesh.

    Returns

      A MeshKey.

  MeshKey Insert(MeshKeys const &meshes)

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

    Parameters

      meshes – The MeshKeys. The index 0 is the highest representation and the Nth index is the lowest representation.

    Returns

      A MeshKey.

  MaterialKey Insert(Color const &color)

    Insert a new definition into the model.

    Parameters

      color – The Color.

    Returns

      A MaterialKey.

  MaterialKey Insert(Material const &material)

    Insert a new definition into the model.

    Parameters

      material – The Material.

    Returns

      A MaterialKey.

  LinePatternKey Insert(LinePattern const &line_pattern)

    Insert a new definition into the model.

    Parameters

      line_pattern – The Line Pattern.

    Returns

      A LinePatternKey.

  MatrixKey Insert(Matrix3d const &matrix)

    Insert a new definition into the model.

    Parameters

      matrix – The Matrix3d.

    Returns

      A MatrixKey.

  MatrixKey Insert(DMatrix3d const &matrix)

    Insert a new definition into the model.

    Parameters

      matrix – The DMatrix3d.

    Returns

      A MatrixKey.

  ImageKey Insert(uint32_t byte_count, uint8_t const *byte_data, ImageFormat format)

    Insert a new definition into the model.

    Parameters

      - byte_count – The byte count.

      - byte_data – The image data of length byte_count.

      - format – The ImageFormat of the byte_data.

    Returns

      An ImageKey.

  ImageKey Insert(uint32_t width, uint32_t height, RGBA32 const *data)

    Insert a new definition into the model.

    Parameters

      - width – The image width.

      - width – The image height.

      - data – The RGBA32 image data of length width * height.

    Returns

      An ImageKey.

  ImageKey Insert(uint32_t width, uint32_t height, RGB24 const *data)

    Insert a new definition into the model.

    Parameters

      - width – The image width.

      - width – The image height.

      - data – The RGB24 image data of length width * height.

    Returns

      An ImageKey.

  ImageKey Insert(uint32_t width, uint32_t height, Gray8 const *data)

    Insert a new definition into the model.

    Parameters

      - width – The image width.

      - width – The image height.

      - data – The Gray8 image data of length width * height.

    Returns

      An ImageKey.

  ImageKey Insert(uint32_t width, uint32_t height, GrayAlpha16 const *data)

    Insert a new definition into the model.

    Parameters

      - width – The image width.

      - width – The image height.

      - data – The GrayAlpha16 image data of length width * height.

    Returns

      An ImageKey.

  DataKey Insert(uint32_t byte_count, uint8_t const *byte_data, uint32_t priority = 0)

    Insert a new definition into the model.

    Parameters

      - byte_count – The byte count.

      - byte_data – The bytes of length byte_count.

      - priority – The priority. Controls streaming order: 0 not sent by default - ~0 sent by request only and excluded from .scs; otherwise, highest first.

    Returns

      A DataKey.

  GroupKey Insert(InstanceIncs const &instance_incs, GroupIncs const &group_incs)

    Insert a new definition into the model.

    Parameters

      - instance_incs – The InstanceIncs to insert.

      - group_incs – The GroupIncs to insert.

    Returns

      A GroupKey.

  MaterialMapKey Insert(MaterialKeys const &material_keys)

    Insert a new definition into the model.

    Parameters

      material_keys – The MaterialKeys to insert. These define a fully enumerated material map.

    Returns

      A MaterialMapKey.

  MaterialMapKey Insert(MaterialMapElements const &material_map_elements)

    Insert a new definition into the model.

    Parameters

      material_map_elements – The MaterialMapElements to insert. These define a sparse material map.

    Returns

      A MaterialMapKey.

  PolyPolygonKey Insert(uint32_t loop_count, uint32_t const *loop_counts, Point const *points)

    Insert a new definition into the model.

    Parameters

      - loop_count – The loop count.

      - loop_counts – The counts for loop_count loops.

      - points – The points.

    Returns

      A PolyPolygonKey.

  ClipRegionKey Insert(ClipSubRegions const &clip_subregions)

    Insert a new definition into the model.

    Parameters

      key – clip_subregions ClipSubRegions to insert.

    Returns

      A ClipRegionKey.

  MaterialKey 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

      color – The Color to match or insert.

    Returns

      A MaterialKey.

  MaterialKey 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

      material – The Material to match or insert.

    Returns

      A MaterialKey.

  MatrixKey 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

      matrix – The Matrix3d to match or insert.

    Returns

      A MatrixKey.

  MatrixKey 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

      matrix – The DMatrix3d to match or insert.

    Returns

      A MatrixKey.

  MaterialMapKey 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_keys – The MaterialKeys to match or insert. These define a fully enumerated material map.

    Returns

      A MaterialMapKey.

  MaterialMapKey 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_elements – The MaterialMapElements to match or insert. These define a sparse material map.

    Returns

      A MaterialMapKey.

  PolyPolygonKey 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_count – The loop count.

      - loop_counts – The counts for loop_count loops.

      - points – The points.

    Returns

      A PolyPolygonKey.

  ClipRegionKey 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

      key – clip_subregions ClipSubRegions to match or insert.

    Returns

      A ClipRegionKey.

  void Set(MeshKey key, Mesh const &mesh)

    Replace the underlying definition for key.

    Parameters

      - key – The MeshKey to modify.

      - meshes – The replacement Mesh.

  void Set(MeshKey key, MeshKeys const &meshes)

    Replace the underlying definition for key.

    Parameters

      - key – The MeshKey to modify.

      - meshes – The replacement MeshKeys. The index 0 is the highest representation and the Nth index is the lowest representation.

  void Set(MaterialKey key, Color const &color)

    Replace the underlying definition for key.

    Parameters

      - key – The MaterialKey to modify.

      - color – The replacement Color.

  void Set(MaterialKey key, Material const &material)

    Replace the underlying definition for key.

    Parameters

      - key – The MaterialKey to modify.

      - material – The replacement Material.

  void Set(MatrixKey key, Matrix3d const &matrix)

    Replace the underlying definition for key.

    Parameters

      - key – The MatrixKey to modify.

      - matrix – The replacement Matrix3d.

  void Set(MatrixKey key, DMatrix3d const &matrix)

    Replace the underlying definition for key.

    Parameters

      - key – The MatrixKey to modify.

      - matrix – The replacement DMatrix3d.

  void Set(ImageKey key, uint32_t byte_count, uint8_t const *byte_data, ImageFormat format)

    Replace the underlying definition for key.

    Parameters

      - key – The ImageKey to modify.

      - byte_count – The replacement byte count.

      - byte_data – The replacement image data of length byte_count.

      - format – The replacement ImageFormat of the byte_data.

  void Set(ImageKey key, uint32_t width, uint32_t height, RGBA32 const *data)

    Replace the underlying definition for key.

    Parameters

      - key – The ImageKey to modify.

      - width – The replacement image width.

      - width – The replacement image height.

      - data – The replacement RGBA32 image data of length width * height.

  void Set(ImageKey key, uint32_t width, uint32_t height, RGB24 const *data)

    Replace the underlying definition for key.

    Parameters

      - key – The ImageKey to modify.

      - width – The replacement image width.

      - width – The replacement image height.

      - data – The replacement RGB24 image data of length width * height.

  void Set(ImageKey key, uint32_t width, uint32_t height, Gray8 const *data)

    Replace the underlying definition for key.

    Parameters

      - key – The ImageKey to modify.

      - width – The replacement image width.

      - width – The replacement image height.

      - data – The replacement Gray8 image data of length width * height.

  void Set(ImageKey key, uint32_t width, uint32_t height, GrayAlpha16 const *data)

    Replace the underlying definition for key.

    Parameters

      - key – The ImageKey to modify.

      - width – The replacement image width.

      - width – The replacement image height.

      - data – The replacement GrayAlpha16 image data of length width * height.

  void Set(DataKey key, uint32_t byte_count, uint8_t const *byte_data)

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

    Parameters

      - key – The DataKey to modify.

      - byte_count – The replacement byte count.

      - byte_data – The replacement bytes of length byte_count.

  void Set(DataKey key, uint32_t byte_count, uint8_t const *byte_data, uint32_t priority)

    Replace the underlying definition for key.

    Parameters

      - key – The DataKey to modify.

      - byte_count – The replacement byte count.

      - byte_data – The replacement bytes of length byte_count.

      - priority – The replacement priority. Controls streaming order: 0 not sent by default - ~0 sent by request only and excluded from .scs; otherwise, highest first.

  void Set(GroupKey key, InstanceIncs const &instance_incs, GroupIncs const &group_incs)

    Replace the underlying definition for key.

    Parameters

      - key – The GroupKey to modify.

      - instance_incs – The replacement InstanceIncs.

      - group_incs – The replacement GroupIncs.

  void Set(MaterialMapKey key, MaterialKeys const &material_keys)

    Replace the underlying definition for key.

    Parameters

      - key – The MaterialMapKey to modify.

      - material_keys – The replacement MaterialKeys. These define a fully enumerated material map.

  void Set(MaterialMapKey key, MaterialMapElements const &material_map_elements)

    Replace the underlying definition for key.

    Parameters

      - key – The MaterialMapKey to modify.

      - material_map_elements – The replacement MaterialMapElements. These define a sparse material map.

  void Set(PolyPolygonKey key, uint32_t loop_count, uint32_t const *loop_counts, Point const *points)

    Replace the underlying definition for key.

    Parameters

      - key – The PolyPolygonKey to modify.

      - loop_count – The replacement loop count.

      - loop_counts – The replacement counts for loop_count loops.

      - points – The replacement points.

  void Set(ClipRegionKey key, ClipSubRegions const &clip_subregions)

    Replace the underlying definition for key.

    Parameters

      - key – The ClipRegionKey to modify.

      - clip_subregions – The replacement ClipSubRegions.

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

    Creates an Instance of a mesh.

    Parameters

      - mesh – The MeshKey to instance.

      - matrix – The transform matrix for the instance. The default constructed MatrixKey is an identity matrix.

      - face_material – The MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - line_material – The MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - point_material – The MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - face_material_map – The MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - line_material_map – The MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - point_material_map – The MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - visibility – The Visibility. The default constructed Visibility is all on.

      - modifiers – The Modifiers. The default constructed Modifiers is none.

      - clip_region – The ClipRegionKey. The default constructed ClipRegionKey is none.

      - vector_culling – The VectorCulling setting. The default constructed VectorCulling is none.

    Returns

      An InstanceKey.

  InclusionKey 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

      - model – The Model to include.

      - matrix – The transform matrix for the inclusion the default constructed MatrixKey is an identity matrix.

    Returns

      An InclusionKey.

  void Set(InstanceKey key, MeshKey mesh)

    Replace the mesh for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - mesh – The replacement MeshKey.

  void Set(InstanceKey key, MatrixKey matrix)

    Replace the matrix for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - matrix – The replacement MatrixKey.

  void Set(InstanceKey key, VectorCulling const &vector_culling)

    Replace the vector culling settings for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - vector_culling – The replacement VectorCulling setting.

  void Set(InstanceKey key, MaterialKey face_material, MaterialKey line_material, MaterialKey point_material)

    Replace the materials for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - face_material – The MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - line_material – The MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - point_material – The MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

  void Set(InstanceKey key, MaterialMapKey face_material_map, MaterialMapKey line_material_map, MaterialMapKey point_material_map)

    Replace the material maps for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - face_material_map – The MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - line_material_map – The MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - point_material_map – The MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

  void Set(InstanceKey key, Visibility visibility)

    Replace the visibility for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - visibility – The replacement Visibility.

  void Set(InstanceKey key, Modifiers modifiers)

    Replace the modifiers for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - modifiers – The replacement Modifiers.

  void Set(InstanceKey key, ClipRegionKey clip_region)

    Replace the clip region for an Instance.

    Parameters

      - key – The InstanceKey to modify.

      - clip_region – The replacement ClipRegionKey.

  void Set(InstanceInc const &inc, MaterialKey face_material, MaterialKey line_material, MaterialKey point_material)

    Override the materials for a specific InstanceInc.

    Parameters

      - inc – The InstanceInc to override.

      - face_material – The MaterialKey for faces. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - line_material – The MaterialKey for lines. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

      - point_material – The MaterialKey for points. If MaterialKey::Unspecified() is used then the mesh’s setting will be used.

  void 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

      - inc – The InstanceInc to override.

      - face_material_map – The MaterialMapKey for faces. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - line_material_map – The MaterialMapKey for lines. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

      - point_material_map – The MaterialMapKey for points. If the default constructed MaterialMapKey is used the mesh’s setting will be used.

  void Set(InstanceInc const &inc, Visibility visibility)

    Override the visibility for a specific InstanceInc.

    Parameters

      - inc – The InstanceInc to override.

      - visibility – The override Visibility.

  void Set(InstanceInc const &inc, Modifiers modifiers_to_add)

    Add modifiers for a specific InstanceInc.

    Parameters

      - inc – The InstanceInc to add modifiers to.

      - modifiers_to_add – The additional Modifiers.

  void Set(InstanceInc const &inc, ClipRegionKey clip_region)

    Override clip region for a specific InstanceInc.

    Parameters

      - inc – The InstanceInc to override.

      - clip_region – The override ClipRegionKey.

  void Delete(InclusionKey inclusion_key)

    Remove an existing Inclusion from a model.

    Parameters

      inclusion_key – The InclusionKey to remove.

  void Delete(InstanceKey instance_key)

    Remove an existing Instance from a model.

    Parameters

      instance_key – The InstanceKey to remove.

  void Delete(ViewKey view_key)

    Remove an existing View from a model.

    Parameters

      view_key – The ViewKey to remove.

  ModelKey GetKey() const

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

    Returns

      A ModelKey.

  const char *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.

  const char *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.

  void GetInstanceIncs(InstanceIncs &instance_incs) const

    Query the InstanceIncs defined in a model.

    Parameters

      instance_incs – A write back vector to return defined InstanceIncs.

  void GetMeshIds(MeshIds &mesh_ids) const

    Query the MeshIds defined in a model.

    Parameters

      mesh_ids – A write back vector to return defined MeshIds.

  void 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_ids – A write back vector to return defined MaterialIds.

  void 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_ids – A write back vector to return defined MatrixIds.

  void 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_ids – A write back vector to return defined InstanceIds.

  void 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_ids – A write back vector to return defined ImageIds.

  void GetDataIds(DataIds &data_ids) const

    Query the DataIds defined in a model.

    Parameters

      data_ids – A write back vector to return defined DataIds.

  void 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_ids – A write back vector to return defined GroupIds.

  void 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_ids – A write back vector to return defined MaterialMapIds.

  void 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_ids – A write back vector to return defined PolyPolygonIds.

  void 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_ids – A write back vector to return defined ClipRegionIds.

  void GetMeshKeys(MeshKeys &mesh_keys) const

    Query the MeshKeys defined in a model.

    Parameters

      mesh_keys – A write back vector to return defined MeshKeys.

  void GetMaterialKeys(MaterialKeys &material_keys) const

    Query the MaterialKeys defined in a model.

    Parameters

      material_keys – A write back vector to return defined MaterialKeys.

  void GetMatrixKeys(MatrixKeys &matrix_keys) const

    Query the MatrixKeys defined in a model.

    Parameters

      matrix_keys – A write back vector to return defined MatrixKeys.

  void GetInstanceKeys(InstanceKeys &instance_keys) const

    Query the InstanceKeys defined in a model.

    Parameters

      instance_keys – A write back vector to return defined InstanceKeys.

  void GetImageKeys(ImageKeys &image_keys) const

    Query the ImageKeys defined in a model.

    Parameters

      image_keys – A write back vector to return defined ImageKeys.

  void GetDataKeys(DataKeys &data_keys) const

    Query the DataKeys defined in a model.

    Parameters

      data_keys – A write back vector to return defined DataKeys.

  void GetGroupKeys(GroupKeys &group_keys) const

    Query the GroupKeys defined in a model.

    Parameters

      group_keys – A write back vector to return defined GroupKeys.

  void GetMaterialMapKeys(MaterialMapKeys &material_map_keys) const

    Query the MaterialMapKeys defined in a model.

    Parameters

      material_map_keys – A write back vector to return defined MaterialMapKeys.

  void GetPolyPolygonKeys(PolyPolygonKeys &polypolygon_keys) const

    Query the PolyPolygonKeys defined in a model.

    Parameters

      polypolygon_keys – A write back vector to return defined PolyPolygonKeys.

  void GetClipRegionKeys(ClipRegionKeys &clip_region_keys) const

    Query the ClipRegionKeys defined in a model.

    Parameters

      clip_region_keys – A write back vector to return defined ClipRegionKeys.

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

    Query the data associated with a DataKey.

    Parameters

      - key – The data to read

      - byte_data – The write back vector to return the associated data.

  void Set(Camera const &camera, ViewKey view = ViewKey())

    Set a views camera.

    Parameters

      - camera – The camera for the view.

      - view – The view to set the properties on. If unspecified the default view is used.

  bool Get(Camera &camera, ViewKey view = ViewKey())

    Query a views camera.

    Parameters

      - camera – A write back value to return the Camera. Only valid if true is returned.

      - view – The view to query the properties on. If unspecified the default view is used.

    Returns

      True if Camera has been set.

  void 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_properties – The default properties for the view.

      - view – The view to set the properties on. If unspecified the default view is used.

  bool Get(MaterialProperties &material_properties, ViewKey view = ViewKey())

    Query a views default material properties.

    Parameters

      - material_properties – A write back value to return the MaterialProperties. Only valid if true is returned.

      - view – The view to query the properties on. If unspecified the default view is used.

    Returns

      True if MaterialProperties have been set.

  void Set(ViewKey view)

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

    Parameters

      view – The initial ViewKey.

  bool Get(ViewKey &view)

    Query an optional initial View. *

    Parameters

      view – A write back value containing the initial ViewKey. Only valid if true is returned. *

    Returns

      True if an optional View has been set.

  ViewKey View()

    Create a new View.

    Returns

      A new ViewKey.

  void PrepareStream(CompressionStrategy compression_strategy = CompressionStrategy::Default)

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

    Parameters

      compression_strategy – The strategy use to compress large meshes and images. Affects speed and output size

  void 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.

  double 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.

  const char *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_path – Specifies 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.

  const char *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_path – Specifies 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_derived – If true the .scz file will include the files needed from streaming.

      - include_editable – If true the .scz file will include the files needed for future editing.

      - create_bundled – If 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.

  Friends

  friend class TC::Store::CacheImpl
  friend class TC::Store::ModelImpl