# Callbacks from Core to View

# configurator callbacks

# request_material_properties

void request_material_properties(const std::string& aMaterialId)

requests the properties for the given material id from the view. Expects the view to call ConfiguratorKernel::setMaterialProperties with the according properties.

struct MaterialProperties {
    std::string id;
    std::map<std::string, std::string> properties;
};

ConfiguratorKernel::setMaterialProperties(
    const std::vector<MaterialProperties> &propertiesOfMaterials)

# geometry callbacks

# planobject_begin_construction

void planobject_begin_construction(int_id_t aPlanObjectId);

called after construction for non free-flyin object or merged constructions for any planobject is requested, before any construction for this object is sent.

parameters:

  • planObjectId

emscripten: Editor3dPlanObjectBeginConstruction

# planobject_add_baked_mesh

void planobject_add_baked_mesh(
    int_id_t aPlanObjectId,
    std::string materialId,
    std::vector<roomle::Vector3f> vertices,
    std::vector<indices_t> indices,
    std::vector<roomle::Vector2f> uvs,
    std::vector<roomle::Vector3f> normals);

sends a baked mesh (not named) for the given planObject

parameters:

  • planObjectId
  • materialId
  • vertices
  • indices
  • uvs
  • normals

emscripten: Editor3dPlanObjectAddBakedMesh

# planobject_add_named_mesh

void planobject_add_named_mesh(
     int_id_t aPlanObjectId,
     std::string meshId,
     std::string materialId,
     const Matrix4f & transform,
     std::vector<roomle::Vector3f> vertices,
     std::vector<indices_t> indices,
     std::vector<roomle::Vector2f> uvs,
     std::vector<roomle::Vector3f> normals);

sends a named mesh for the given planObject. if the view already knows the geometry for this mesh id, it should reuse it and discard the provided data. To be able to reuse it, the mesh is not baked into the current space but the necessary transform matrix is provided.

parameters:

  • planObjectId
  • meshId
  • materialId
  • transform
  • vertices
  • indices
  • uvs
  • normals

emscripten: Editor3dPlanObjectAddNamedMesh

# planobject_construction_done

void planobject_construction_done(int_id_t aPlanObjectId);

called after all construction calls for a requested planobject are sent (only sent if the construction was requested on planobjectlevel).

parameters:

  • planObjectId

emscripten: Editor3dPlanObjectConstructionDone

# component_configuration_updated

void component_configuration_updated(const int_id_t& aComponentRuntimeId,const bool& geometryChanged);

Called when the configuration has changed. Indicates whether the configuration changes cause geometry changes.

emscripten: componentConfigurationUpdated

# component_meta_updated

void component_meta_updated(const int_id_t& aComponentRuntimeId);

Called when the component's position or orientation has changed.

emscripten: componentMetaUpdated