inc
Model
-
class Model
High-level wrapper around SBML model, geometry, and simulation data.
Public Functions
-
bool getIsValid() const
Returns
trueif model loaded/constructed successfully.- Returns:
trueif model state is valid.
-
const QString &getErrorMessage() const
Error message from last load/parse failure.
- Returns:
Error message string.
-
bool getHasUnsavedChanges() const
Returns
trueif any contained model data is unsaved.- Returns:
trueif model has unsaved changes.
-
const QString &getCurrentFilename() const
Current file path associated with model.
- Returns:
Current filename/path.
-
void setName(const QString &name)
Set model name.
- Parameters:
name – New model name.
-
ModelCompartments &getCompartments()
Mutable access to compartment manager.
-
const ModelCompartments &getCompartments() const
Immutable access to compartment manager.
-
ModelGeometry &getGeometry()
Mutable access to geometry manager.
-
const ModelGeometry &getGeometry() const
Immutable access to geometry manager.
-
ModelMembranes &getMembranes()
Mutable access to membrane manager.
-
const ModelMembranes &getMembranes() const
Immutable access to membrane manager.
-
ModelSpecies &getSpecies()
Mutable access to species manager.
-
const ModelSpecies &getSpecies() const
Immutable access to species manager.
-
ModelReactions &getReactions()
Mutable access to reaction manager.
-
const ModelReactions &getReactions() const
Immutable access to reaction manager.
-
ModelFunctions &getFunctions()
Mutable access to function-definition manager.
-
const ModelFunctions &getFunctions() const
Immutable access to function-definition manager.
-
ModelParameters &getParameters()
Mutable access to parameter manager.
-
const ModelParameters &getParameters() const
Immutable access to parameter manager.
-
ModelEvents &getEvents()
Mutable access to event manager.
-
const ModelEvents &getEvents() const
Immutable access to event manager.
-
ModelUnits &getUnits()
Mutable access to units manager.
-
const ModelUnits &getUnits() const
Immutable access to units manager.
-
simulate::SimulationData &getSimulationData()
Mutable simulation results storage.
-
const simulate::SimulationData &getSimulationData() const
Immutable simulation results storage.
-
SimulationSettings &getSimulationSettings()
Mutable simulation settings.
-
const SimulationSettings &getSimulationSettings() const
Immutable simulation settings.
-
MeshParameters &getMeshParameters()
Mutable mesh settings.
-
const MeshParameters &getMeshParameters() const
Immutable mesh settings.
-
simulate::OptimizeOptions &getOptimizeOptions()
Mutable optimization settings.
-
const simulate::OptimizeOptions &getOptimizeOptions() const
Immutable optimization settings.
-
const std::vector<QRgb> &getSampledFieldColors() const
Imported sampled-field colors.
- Returns:
Vector of sampled-field colors.
-
ModelFeatures &getFeatures()
Mutable access to feature manager.
-
const ModelFeatures &getFeatures() const
Immutable access to feature manager.
-
explicit Model()
Construct empty model wrapper.
-
~Model()
Destructor.
-
void createSBMLFile(const std::string &name)
Create a new spatial SBML model.
- Parameters:
name – Model name.
-
void importSBMLFile(const std::string &filename)
Import SBML from file.
- Parameters:
filename – Path to SBML file.
-
void importSBMLString(const std::string &xml, const std::string &filename = {})
Import SBML from XML string.
- Parameters:
xml – SBML XML text.
filename – Optional source filename.
-
void exportSBMLFile(const std::string &filename)
Export SBML to file.
- Parameters:
filename – Output SBML filename.
-
void importFile(const std::string &filename)
Import SBML/SME file by extension/probing.
- Parameters:
filename – Input filename.
-
void exportSMEFile(const std::string &filename)
Export SME project file.
- Parameters:
filename – Output SME filename.
-
QString getXml()
Serialize current SBML XML.
- Returns:
SBML XML as text.
-
void clear()
Clear model state.
-
SpeciesGeometry getSpeciesGeometry(const QString &speciesID) const
Geometry context for given species id.
- Parameters:
speciesID – Species id.
- Returns:
Geometry context for species.
-
std::string inlineExpr(const std::string &mathExpression) const
Inline functions/assignments in a math expression.
- Parameters:
mathExpression – Expression to inline.
- Returns:
Inlined expression string.
-
DisplayOptions getDisplayOptions() const
Current display options.
- Returns:
Display options.
-
void setDisplayOptions(const DisplayOptions &displayOptions)
Set display options.
- Parameters:
displayOptions – New display options.
-
bool getIsValid() const
ModelCompartments
-
class ModelCompartments
SBML compartment manager plus geometry-backed compartment objects.
Public Functions
-
ModelCompartments()
Construct empty compartment model.
-
ModelCompartments(libsbml::Model *model, ModelMembranes *membranes, const ModelUnits *units, simulate::SimulationData *data)
Construct compartment model from SBML model.
-
void setGeometryPtr(ModelGeometry *geometry)
Set geometry dependency pointer.
-
void setSpeciesPtr(ModelSpecies *species)
Set species dependency pointer.
-
void setReactionsPtr(ModelReactions *reactions)
Set reactions dependency pointer.
-
void setSimulationDataPtr(simulate::SimulationData *data)
Set simulation-data dependency pointer.
-
const QStringList &getIds() const
Compartment ids.
-
const QStringList &getNames() const
Compartment names.
-
const QVector<QRgb> &getColors() const
Compartment display colors.
-
QString add(const QString &name)
Add compartment.
-
bool remove(const QString &id)
Remove compartment.
-
QString getName(const QString &id) const
Get compartment name.
-
QString setName(const QString &id, const QString &name)
Set compartment name.
-
std::optional<std::vector<QPointF>> getInteriorPoints(const QString &id) const
Get interior points used for meshing.
-
void setInteriorPoints(const QString &id, const std::vector<QPointF> &points)
Set interior points used for meshing.
-
void setColor(const QString &id, QRgb color)
Set compartment display color.
-
QRgb getColor(const QString &id) const
Get compartment display color.
-
QString getIdFromColor(QRgb color) const
Find compartment id from display color.
-
const std::vector<std::unique_ptr<geometry::Compartment>> &getCompartments() const
Geometry-backed compartment objects.
-
geometry::Compartment *getCompartment(const QString &id)
Mutable geometry-backed compartment object.
-
const geometry::Compartment *getCompartment(const QString &id) const
Immutable geometry-backed compartment object.
-
double getSize(const QString &id) const
Compartment size in model units.
-
const std::map<std::string, double, std::less<>> &getInitialCompartmentSizes() const
Initial compartment sizes captured on import.
-
void clear()
Clear all compartments.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
ModelCompartments()
ModelEvents
-
class ModelEvents
Public Functions
-
ModelEvents()
Construct empty event model.
-
explicit ModelEvents(libsbml::Model *model, ModelParameters *parameters = nullptr, ModelSpecies *species = nullptr)
Construct event model from SBML model.
-
const QStringList &getIds() const
Event ids.
-
const QStringList &getNames() const
Event names.
-
QString setName(const QString &id, const QString &name)
Set display name.
-
QString getName(const QString &id) const
Get display name.
-
void setVariable(const QString &id, const QString &variable)
Set target variable id modified by event.
-
QString getVariable(const QString &id) const
Get target variable id.
-
void setTime(const QString &id, double time)
Set trigger time for event.
-
double getTime(const QString &id) const
Get trigger time for event.
-
void setExpression(const QString &id, const QString &expr)
Set assignment expression.
-
QString getExpression(const QString &id) const
Get assignment expression.
-
QString add(const QString &name, const QString &variable)
Add new event.
-
bool isParameter(const QString &id) const
Returns
trueif id refers to a parameter.
-
double getValue(const QString &id) const
Get current value of event target variable.
-
void remove(const QString &id)
Remove event.
-
void removeAnyUsingVariable(const QString &variable)
Remove events targeting the supplied variable.
-
void applyEvent(const QString &id)
Apply event assignment immediately.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
ModelEvents()
ModelFunctions
-
class ModelFunctions
SBML function-definition manager.
Public Functions
-
ModelFunctions()
Construct empty function model.
-
explicit ModelFunctions(libsbml::Model *model)
Construct function model from SBML model.
-
const QStringList &getIds() const
Function ids.
-
const QStringList &getNames() const
Function names.
-
QString setName(const QString &id, const QString &name)
Set function display name.
-
QString getName(const QString &id) const
Get function display name.
-
void setExpression(const QString &id, const QString &expression)
Set function expression/body.
-
QString getExpression(const QString &id) const
Get function expression/body.
-
QStringList getArguments(const QString &id) const
Get function argument ids.
-
QString addArgument(const QString &functionId, const QString &argumentId)
Add argument to function.
-
void removeArgument(const QString &functionId, const QString &argumentId)
Remove argument from function.
-
QString add(const QString &name)
Add new function with default expression.
-
void remove(const QString &id)
Remove function.
-
std::vector<common::SymbolicFunction> getSymbolicFunctions() const
Convert to symbolic-function objects for expression processing.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
ModelFunctions()
ModelGeometry
-
class ModelGeometry
SBML geometry manager and mesh owner.
Public Functions
-
ModelGeometry()
Construct empty geometry model.
-
explicit ModelGeometry(libsbml::Model *model, ModelCompartments *compartments, ModelMembranes *membranes, const ModelUnits *units, Settings *annotation)
Construct geometry model from SBML model and dependencies.
- Parameters:
model – SBML model pointer.
compartments – Compartment manager.
membranes – Membrane manager.
units – Units manager.
annotation – Settings annotation.
-
void importSampledFieldGeometry(const libsbml::Model *model, const std::optional<common::Volume> &analyticImageSize = std::nullopt)
Import sampled-field geometry from SBML model.
- Parameters:
model – Source SBML model.
analyticImageSize – Optional raster size for analytic fallback.
-
void importSampledFieldGeometry(const QString &filename, const std::optional<common::Volume> &analyticImageSize = std::nullopt)
Import sampled-field/analytic geometry from file.
- Parameters:
filename – Source filename.
analyticImageSize – Optional raster size for analytic fallback.
-
void importGeometryFromImages(const common::ImageStack &imgs, bool keepColorAssignments)
Replace geometry from image stack.
- Parameters:
imgs – Geometry images.
keepColorAssignments – Keep previous compartment-color mapping.
-
void importGeometryFromGmsh(const common::ImageStack &imgs, const mesh::GMSHMesh &gmshMesh, bool importAsFixedTopology)
Import geometry rasterized from a Gmsh mesh and align physical coordinates with the mesh bounds.
- Parameters:
imgs – Voxelized geometry image stack.
gmshMesh – Source Gmsh mesh used for voxelization.
importAsFixedTopology – Store mesh as fixed topology if
true.
-
void setImportedGmshMesh(const mesh::GMSHMesh &gmshMesh, const std::optional<std::vector<std::pair<QRgb, int>>> &colorTagPairs = std::nullopt)
Store imported Gmsh mesh for fixed-topology meshing.
- Parameters:
gmshMesh – Imported Gmsh mesh (tetrahedra for 3D or triangles for 2D).
colorTagPairs – Optional explicit mapping from compartment color to Gmsh physical tag.
-
void setImportedMesh2d(const mesh::FixedTopology2d &fixedMesh2d)
Store imported fixed 2d mesh topology for fixed-topology meshing.
- Parameters:
fixedMesh2d – Imported 2d fixed mesh.
-
void captureCurrentMeshAsFixedTopology()
Capture current active mesh as fixed-topology mesh.
Captures current 2D or 3D mesh (if valid) and stores it as the fixed mesh topology source for subsequent remeshing.
-
void clearImportedMesh()
Clear any stored imported mesh topology.
-
bool hasImportedMesh() const
Returns
trueif imported mesh topology is available.- Returns:
trueif imported mesh exists.
-
const QString &getFixedMeshImportDiagnostic() const
Diagnostic message from ParametricGeometry fixed-mesh import.
- Returns:
Empty string if no import diagnostic is available.
-
const QString &getFixedMeshExportDiagnostic() const
Diagnostic message from ParametricGeometry fixed-mesh export.
- Returns:
Empty string if no export diagnostic is available.
-
void updateMesh()
Rebuild mesh objects from current geometry.
-
void clear()
Clear geometry and mesh state.
-
int getNumDimensions() const
Number of spatial dimensions.
- Returns:
Number of spatial dimensions.
-
void setVoxelSize(const common::VolumeF &newVoxelSize, bool updateSBML = true)
Set physical voxel size and optionally write to SBML.
- Parameters:
newVoxelSize – New voxel size.
updateSBML – If
true, write updates back to SBML.
-
void setPhysicalOrigin(const common::VoxelF &newPhysicalOrigin, bool updateSBML = true)
Set physical origin and optionally write to SBML.
- Parameters:
newPhysicalOrigin – New physical origin.
updateSBML – If
true, write updates back to SBML.
-
const common::VoxelF &getPhysicalOrigin() const
Physical origin of voxel
(0,0,0).- Returns:
Physical origin.
-
const common::VolumeF &getPhysicalSize() const
Physical total geometry size.
- Returns:
Physical geometry size.
-
common::VoxelF getPhysicalPoint(const common::Voxel &voxel) const
Convert voxel index to physical coordinate.
- Parameters:
voxel – Voxel index.
- Returns:
Physical coordinate of voxel center.
-
QString getPhysicalPointAsString(const common::Voxel &voxel) const
Convert voxel index to formatted physical coordinate string.
- Parameters:
voxel – Voxel index.
- Returns:
Formatted coordinate string.
-
bool getIsValid() const
Returns
trueif geometry is valid.- Returns:
Geometry validity.
-
bool getIsMeshValid() const
Returns
trueif mesh is valid.- Returns:
Mesh validity.
-
bool getHasImage() const
Returns
trueif geometry image data is available.- Returns:
trueif geometry images exist.
-
void updateGeometryImageColor(QRgb oldColor, QRgb newColor)
Replace one geometry color with another.
- Parameters:
oldColor – Existing color.
newColor – Replacement color.
-
void writeGeometryToSBML() const
Write current geometry representation to SBML.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
- Returns:
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
- Parameters:
unsavedChanges – New unsaved state.
Public Static Functions
-
static std::optional<int> getAnalyticGeometryNumDimensions(const QString &filename)
Number of spatial dimensions in analytic geometry file.
- Parameters:
filename – Analytic-geometry file.
- Returns:
Number of dimensions if file contains analytic geometry.
-
ModelGeometry()
ModelMath
-
class ModelMath
Parser/evaluator for SBML math expressions.
Public Functions
-
ModelMath()
Construct invalid empty math object.
-
explicit ModelMath(const libsbml::Model *model)
Construct math parser bound to an SBML model.
-
void parse(const std::string &expr)
Parse expression and update validity state.
-
double eval(const std::map<const std::string, std::pair<double, bool>> &vars = {}) const
Evaluate parsed expression.
-
bool isValid() const
Returns
trueif parsed expression is valid.
-
const std::string &getErrorMessage() const
Parse/evaluation error message.
-
ModelMath()
ModelMembranes
-
class ModelMembranes
SBML membrane manager.
Public Functions
-
const QStringList &getIds() const
Membrane ids.
-
const QStringList &getNames() const
Membrane names.
-
QString setName(const QString &id, const QString &name)
Set membrane display name.
-
QString getName(const QString &id) const
Get membrane display name.
-
const std::vector<geometry::Membrane> &getMembranes() const
Geometry membrane objects.
-
const geometry::Membrane *getMembrane(const QString &id) const
Get membrane by id.
-
const std::vector<std::pair<std::string, std::pair<QRgb, QRgb>>> &getIdColorPairs() const
Membrane id and adjacent compartment color pairs.
-
double getSize(const QString &id) const
Membrane size in model units.
-
void updateCompartmentNames(const QStringList &compartmentNames)
Update cached compartment-name text.
-
void updateCompartments(const std::vector<std::unique_ptr<geometry::Compartment>> &compartments)
Recompute membranes from compartment geometry.
-
void updateCompartmentImages(const common::ImageStack &imgs)
Recompute membrane pixels from geometry images.
-
void updateGeometryImageColor(QRgb oldColor, QRgb newColor)
Replace a compartment color in membrane definitions.
-
void importMembraneIdsAndNames()
Import membrane ids/names from SBML annotations.
-
explicit ModelMembranes(libsbml::Model *model = nullptr)
Construct membrane model.
-
~ModelMembranes()
Destructor.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
const QStringList &getIds() const
ModelParameters
-
class ModelParameters
SBML parameter manager.
Public Functions
-
ModelParameters()
Construct empty parameter model.
-
explicit ModelParameters(libsbml::Model *model)
Construct parameter model from SBML model.
-
void setEventsPtr(ModelEvents *events)
Set events dependency pointer.
-
void setSpeciesPtr(ModelSpecies *species)
Set species dependency pointer.
-
const QStringList &getIds() const
Parameter ids.
-
const QStringList &getNames() const
Parameter names.
-
QString setName(const QString &id, const QString &name)
Set display name.
-
QString getName(const QString &id) const
Get display name.
-
void setExpression(const QString &id, const QString &expr)
Set parameter expression/value.
-
QString getExpression(const QString &id) const
Get parameter expression/value.
-
QString add(const QString &name)
Add new parameter.
-
void remove(const QString &id)
Remove parameter.
-
const SpatialCoordinates &getSpatialCoordinates() const
Spatial coordinate parameters.
-
void setSpatialCoordinates(SpatialCoordinates coords)
Set spatial coordinate parameter ids.
-
std::vector<IdName> getSymbols(const QStringList &compartments = {}) const
Symbols available for expression substitution.
-
std::vector<IdNameValue> getGlobalConstants() const
Constant parameters.
-
std::vector<IdNameExpr> getNonConstantParameters() const
Non-constant parameters.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
ModelParameters()
ModelReactions
-
class ModelReactions
SBML reaction manager.
Public Functions
-
ModelReactions()
Construct empty reaction model.
-
explicit ModelReactions(libsbml::Model *model, const ModelCompartments *compartments, const ModelMembranes *membranes, bool isNonSpatialModel)
Construct reaction model from SBML model.
-
void makeReactionLocationsValid()
Ensure all reactions reference valid locations.
-
void applySpatialReactionRescalings(const std::vector<ReactionRescaling> &reactionRescalings)
Apply precomputed reaction expression rescalings.
-
std::vector<ReactionRescaling> getSpatialReactionRescalings() const
Compute expression rescalings for spatial unit consistency.
-
bool getIsIncompleteODEImport() const
Returns
trueif imported ODE reactions were incomplete.
-
QStringList getIds(const QString &locationId) const
Reaction ids for a location id.
-
QStringList getIds(const ReactionLocation &reactionLocation) const
Reaction ids for a location descriptor.
-
std::vector<ReactionLocation> getReactionLocations() const
All available reaction locations.
-
QString add(const QString &name, const QString &locationId, const QString &rateExpression = "1")
Add reaction.
-
void remove(const QString &id)
Remove reaction.
-
void removeAllInvolvingSpecies(const QString &speciesId)
Remove all reactions involving species.
-
QString setName(const QString &id, const QString &name)
Set reaction name.
-
QString getName(const QString &id) const
Get reaction name.
-
QString getScheme(const QString &id) const
Get stoichiometric scheme string.
-
void setLocation(const QString &id, const QString &locationId)
Set reaction location id.
-
QString getLocation(const QString &id) const
Get reaction location id.
-
double getSpeciesStoichiometry(const QString &id, const QString &speciesId) const
Stoichiometry of a species in a reaction.
-
void setSpeciesStoichiometry(const QString &id, const QString &speciesId, double stoichiometry)
Set stoichiometry for species in reaction.
-
QString getRateExpression(const QString &id) const
Get kinetic rate expression.
-
void setRateExpression(const QString &id, const QString &expression)
Set kinetic rate expression.
-
QStringList getParameterIds(const QString &id) const
Local parameter ids for reaction.
-
QString setParameterName(const QString &reactionId, const QString ¶meterId, const QString &name)
Set local parameter name.
-
QString getParameterName(const QString &reactionId, const QString ¶meterId) const
Get local parameter name.
-
void setParameterValue(const QString &reactionId, const QString ¶meterId, double value)
Set local parameter value.
-
double getParameterValue(const QString &reactionId, const QString ¶meterId) const
Get local parameter value.
-
QString addParameter(const QString &reactionId, const QString &name, double value)
Add local parameter to reaction.
-
void removeParameter(const QString &reactionId, const QString &id)
Remove local parameter from reaction.
-
bool dependOnVariable(const QString &variableId) const
Returns
trueif any reaction depends on variable id.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
ModelReactions()
ModelSpecies
-
class ModelSpecies
SBML species manager with spatial field data.
Public Functions
-
ModelSpecies()
Construct empty species model.
-
ModelSpecies(libsbml::Model *model, const ModelCompartments *compartments, const ModelGeometry *geometry, const ModelParameters *parameters, const ModelFunctions *functions, simulate::SimulationData *data, Settings *annotation)
Construct species model from SBML model and dependencies.
- Parameters:
model – SBML model pointer.
compartments – Compartment manager.
geometry – Geometry manager.
parameters – Parameter manager.
functions – Function manager.
data – Simulation data storage.
annotation – Settings annotation.
-
void setReactionsPtr(ModelReactions *reactions)
Set reactions dependency pointer.
- Parameters:
reactions – Reaction manager.
-
void setSimulationDataPtr(simulate::SimulationData *data)
Set simulation-data dependency pointer.
- Parameters:
data – Simulation data storage.
-
bool containsNonSpatialReactiveSpecies() const
Returns
trueif any reactive species is non-spatial.- Returns:
trueif non-spatial reactive species exist.
-
QString add(const QString &name, const QString &compartmentId)
Add species to compartment.
- Parameters:
name – Species display name.
compartmentId – Target compartment id.
- Returns:
New species id.
-
void remove(const QString &id)
Remove species.
- Parameters:
id – Species id.
-
QString setName(const QString &id, const QString &name)
Set species name.
- Parameters:
id – Species id.
name – New species name.
- Returns:
Final (possibly uniquified) name.
-
QString getName(const QString &id) const
Get species name.
- Parameters:
id – Species id.
- Returns:
Species name.
-
void updateCompartmentGeometry(const QString &compartmentId)
Rebuild field geometry after compartment geometry changes.
- Parameters:
compartmentId – Compartment id.
-
void setCompartment(const QString &id, const QString &compartmentId)
Move species to another compartment.
- Parameters:
id – Species id.
compartmentId – Target compartment id.
-
QString getCompartment(const QString &id) const
Get species compartment id.
- Parameters:
id – Species id.
- Returns:
Compartment id.
-
QStringList getIds(const QString &compartmentId) const
Species ids in a compartment.
- Parameters:
compartmentId – Compartment id.
- Returns:
Species ids in compartment.
-
QStringList getNames(const QString &compartmentId) const
Species names in a compartment.
- Parameters:
compartmentId – Compartment id.
- Returns:
Species names in compartment.
-
void setIsSpatial(const QString &id, bool isSpatial)
Set whether species is spatial.
- Parameters:
id – Species id.
isSpatial – Spatial flag.
-
bool getIsSpatial(const QString &id) const
Returns whether species is spatial.
- Parameters:
id – Species id.
- Returns:
Spatial flag.
-
void setDiffusionConstant(const QString &id, double diffusionConstant)
Set uniform diffusion constant.
- Parameters:
id – Species id.
diffusionConstant – Diffusion constant value.
-
double getDiffusionConstant(const QString &id) const
Get uniform diffusion constant.
- Parameters:
id – Species id.
- Returns:
Diffusion constant.
-
void setStorage(const QString &id, double storageValue)
Set species storage coefficient.
- Parameters:
id – Species id.
storageValue – Storage value.
-
double getStorage(const QString &id) const
Get species storage coefficient.
- Parameters:
id – Species id.
- Returns:
Storage value.
-
SpatialDataType getDiffusionConstantType(const QString &id) const
Representation type of diffusion constant data.
- Parameters:
id – Species id.
- Returns:
Diffusion data representation type.
-
SpatialDataType getInitialConcentrationType(const QString &id) const
Representation type of initial concentration data.
- Parameters:
id – Species id.
- Returns:
Initial concentration representation type.
-
void setInitialConcentration(const QString &id, double concentration)
Set uniform initial concentration.
- Parameters:
id – Species id.
concentration – Initial concentration value.
-
double getInitialConcentration(const QString &id) const
Get uniform initial concentration.
- Parameters:
id – Species id.
- Returns:
Initial concentration value.
-
void setAnalyticConcentration(const QString &id, const QString &analyticExpression)
Set analytic initial concentration expression.
- Parameters:
id – Species id.
analyticExpression – Analytic concentration expression.
-
void setFieldConcAnalytic(geometry::Field &field, const std::string &expr, const std::map<std::string, double, std::less<>> &substitutions = {})
Apply analytic concentration expression to a field.
- Parameters:
field – Field to update.
expr – Analytic expression.
substitutions – Constant substitutions.
-
QString getAnalyticConcentration(const QString &id) const
Get analytic concentration expression.
- Parameters:
id – Species id.
- Returns:
Analytic concentration expression.
-
void updateAllAnalyticConcentrations()
Recompute all analytic concentrations.
-
void setSampledFieldConcentration(const QString &id, const std::vector<double> &concentrationArray)
Set sampled-field concentration array.
- Parameters:
id – Species id.
concentrationArray – Concentration values in image order.
-
std::vector<double> getSampledFieldConcentration(const QString &id, bool maskAndInvertY = false) const
Get sampled-field concentration array.
- Parameters:
id – Species id.
maskAndInvertY – If
true, apply mask and Y inversion.
- Returns:
Concentration values in image order.
-
void setSampledFieldDiffusionConstant(const QString &id, const std::vector<double> &diffusionConstantArray)
Set sampled-field diffusion constant array.
- Parameters:
id – Species id.
diffusionConstantArray – Diffusion values in image order.
-
std::vector<double> getSampledFieldDiffusionConstant(const QString &id, bool maskAndInvertY = false) const
Get sampled-field diffusion constant array.
- Parameters:
id – Species id.
maskAndInvertY – If
true, apply mask and Y inversion.
- Returns:
Diffusion values in image order.
-
bool isValidAnalyticDiffusionExpression(const QString &analyticExpression) const
Validate analytic diffusion expression.
- Parameters:
analyticExpression – Expression to validate.
- Returns:
trueif expression is valid.
-
void setAnalyticDiffusionConstant(const QString &id, const QString &analyticExpression)
Set analytic diffusion constant expression.
- Parameters:
id – Species id.
analyticExpression – Analytic diffusion expression.
-
QString getAnalyticDiffusionConstant(const QString &id) const
Get analytic diffusion constant expression.
- Parameters:
id – Species id.
- Returns:
Analytic diffusion expression.
-
bool isValidCrossDiffusionExpression(const QString &id, const QString &expression) const
Validate cross-diffusion expression for species pair.
- Parameters:
id – Primary species id.
expression – Cross-diffusion expression.
- Returns:
trueif expression is valid.
-
void setCrossDiffusionConstant(const QString &id, const QString &otherId, const QString &expression)
Set cross-diffusion expression for species pair.
- Parameters:
id – Primary species id.
otherId – Coupled species id.
expression – Cross-diffusion expression.
-
void removeCrossDiffusionConstant(const QString &id, const QString &otherId)
Remove cross-diffusion expression for species pair.
- Parameters:
id – Primary species id.
otherId – Coupled species id.
-
QString getCrossDiffusionConstant(const QString &id, const QString &otherId) const
Get cross-diffusion expression for species pair.
- Parameters:
id – Primary species id.
otherId – Coupled species id.
- Returns:
Cross-diffusion expression.
-
std::map<std::string, std::string> getCrossDiffusionConstants(const QString &id) const
Get all cross-diffusion expressions for a species.
- Parameters:
id – Species id.
- Returns:
Mapping from coupled species id to expression.
-
common::ImageStack getConcentrationImages(const QString &id) const
Concentration images for species.
- Parameters:
id – Species id.
- Returns:
Concentration image stack.
-
void setColor(const QString &id, QRgb color)
Set species display color.
- Parameters:
id – Species id.
color – New display color.
-
QRgb getColor(const QString &id) const
Get species display color.
- Parameters:
id – Species id.
- Returns:
Species display color.
-
void setIsConstant(const QString &id, bool constant)
Set constant/non-constant species flag.
- Parameters:
id – Species id.
constant – Constant flag.
-
bool getIsConstant(const QString &id) const
Get constant/non-constant species flag.
- Parameters:
id – Species id.
- Returns:
Constant flag.
-
bool isScalarConstantSpecies(const QString &id) const
Returns whether species is a scalar constant.
- Parameters:
id – Species id.
- Returns:
trueif species is constant and non-spatial.
-
bool isSimulatedSpecies(const QString &id) const
Returns whether species should be present in simulation fields.
- Parameters:
id – Species id.
- Returns:
trueif species should appear in simulation state/results.
-
bool isReactive(const QString &id) const
Returns whether species participates in any reaction.
- Parameters:
id – Species id.
- Returns:
trueif species is reactive.
-
void removeInitialAssignments()
Remove all species initial assignments.
-
QString getSampledFieldInitialAssignment(const QString &id) const
Get sampled-field initial-assignment expression.
- Parameters:
id – Species id.
- Returns:
Initial-assignment expression.
-
geometry::Field *getField(const QString &id)
Mutable field object for species id.
- Parameters:
id – Species id.
- Returns:
Mutable field pointer or
nullptr.
-
const geometry::Field *getField(const QString &id) const
Immutable field object for species id.
- Parameters:
id – Species id.
- Returns:
Immutable field pointer or
nullptr.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
- Returns:
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
- Parameters:
unsavedChanges – New unsaved state.
-
ModelSpecies()
ModelUnits
-
class ModelUnits
Model unit system and derived display strings.
Public Functions
-
explicit ModelUnits(libsbml::Model *model = nullptr)
Construct units manager from SBML model.
-
const Unit &getTime() const
Selected time unit.
-
int getTimeIndex() const
Selected time unit index.
-
const QVector<Unit> &getTimeUnits() const
Available time units.
-
QVector<Unit> &getTimeUnits()
Mutable time unit list.
-
void setTimeIndex(int index)
Set selected time unit index.
-
const Unit &getLength() const
Selected length unit.
-
int getLengthIndex() const
Selected length unit index.
-
const QVector<Unit> &getLengthUnits() const
Available length units.
-
QVector<Unit> &getLengthUnits()
Mutable length unit list.
-
void setLengthIndex(int index)
Set selected length unit index.
-
const Unit &getVolume() const
Selected volume unit.
-
int getVolumeIndex() const
Selected volume unit index.
-
const QVector<Unit> &getVolumeUnits() const
Available volume units.
-
QVector<Unit> &getVolumeUnits()
Mutable volume unit list.
-
void setVolumeIndex(int index)
Set selected volume unit index.
-
const Unit &getAmount() const
Selected amount unit.
-
int getAmountIndex() const
Selected amount unit index.
-
const QVector<Unit> &getAmountUnits() const
Available amount units.
-
QVector<Unit> &getAmountUnits()
Mutable amount unit list.
-
void setAmountIndex(int index)
Set selected amount unit index.
-
const QString &getConcentration() const
Derived concentration unit string.
-
const QString &getDiffusion() const
Derived diffusion unit string.
-
const QString &getCompartmentReaction() const
Derived compartment reaction-rate unit string.
-
const QString &getMembraneReaction() const
Derived membrane reaction-rate unit string.
-
bool getHasUnsavedChanges() const
Unsaved state flag.
-
void setHasUnsavedChanges(bool unsavedChanges)
Set unsaved state flag.
-
explicit ModelUnits(libsbml::Model *model = nullptr)
Settings
-
struct Settings
Complete SME model annotation payload.
Public Functions
Public Members
-
SimulationSettings simulationSettings = {}
Simulation settings.
-
DisplayOptions displayOptions = {}
Display settings.
-
MeshParameters meshParameters = {}
Mesh settings.
-
std::map<std::string, QRgb> speciesColors = {}
Species id to display color mapping.
-
sme::simulate::OptimizeOptions optimizeOptions = {}
Parameter optimization settings.
-
std::vector<QRgb> sampledFieldColors = {}
Imported sampled-field compartment colors.
-
std::map<std::string, std::vector<double>> speciesDiffusionConstantArrays = {}
Species diffusion constants for image-based definitions.
-
std::map<std::string, std::string> speciesAnalyticDiffusionConstants = {}
Species diffusion constants as analytic expressions.
-
std::map<std::string, std::map<std::string, std::string>> speciesCrossDiffusionConstants = {}
Cross-diffusion expressions by species pair.
-
std::map<std::string, double> speciesStorageValues = {}
Optional species storage coefficients.
-
std::vector<simulate::FeatureDefinition> features = {}
Feature definitions for extracting scalar time-series from ROIs.
-
SimulationSettings simulationSettings = {}
-
struct SimulationSettings
Simulation settings persisted with model annotation.
Public Functions
-
struct DisplayOptions
UI display preferences persisted with the model.
Public Functions
Public Members
-
std::vector<bool> showSpecies = {}
Per-species visibility flags.
-
bool showMinMax = {true}
Display min/max concentration overlays.
-
bool normaliseOverAllTimepoints = {true}
Normalize colormap over all simulated timepoints.
-
bool normaliseOverAllSpecies = {true}
Normalize colormap over all species.
-
bool showGeometryGrid = {false}
Show geometry grid overlay.
-
bool showGeometryScale = {false}
Show geometry scale annotation.
-
bool invertYAxis = {false}
Invert vertical image axis in views/export.
-
std::vector<bool> showFeatures = {}
Per-feature visibility flags.
-
std::vector<bool> showSpecies = {}
-
struct MeshParameters
Mesh generation options stored in model annotation.
Public Functions
Public Members
-
std::vector<std::size_t> maxPoints = {}
Maximum boundary points per boundary or global total (mode dependent).
-
std::vector<std::size_t> maxAreas = {}
Maximum triangle area per compartment.
-
std::size_t boundarySimplifierType = {0}
Boundary simplification algorithm selection.
-
std::vector<std::size_t> maxCellVolumes = {}
Maximum tetrahedron cell volume per compartment (3D voxel mesh).
-
MeshSourceType meshSourceType = {MeshSourceType::VoxelGeometry}
Mesh source mode.
-
std::vector<std::size_t> maxPoints = {}