This commit performs a comprehensive documentation pass on the MedicalLib library, implementing a full documentation generation pipeline using Doxygen, Sphinx, and Breathe for Read the Docs.
Key changes include: - **Added Comprehensive Doxygen Comments:** - Reviewed all header files in `include/MedicalLib/`. - Added Doxygen comments for public methods, structs, and their member variables to ensure full API coverage as per the project's coding standards. - Addressed all Doxygen warnings related to undocumented public members. - **Restructured Sphinx Documentation:** - Created a new `docs/api/` directory to house detailed documentation for each component. - Replaced the single `api.rst` file with a well-organized structure using a `toctree`. - Created individual `.rst` pages for each organ, class, and major component. - **Enabled Graph Generation:** - Configured Doxygen to generate class hierarchy and collaboration graphs. - Ensured the build process includes these graphs in the final documentation, providing visual context for the library's structure. - **Verified Build Process:** - Installed all necessary dependencies (`doxygen`, `graphviz`, python packages). - Successfully ran the Doxygen and Sphinx build process to generate the final HTML documentation, ensuring all changes are correctly integrated. This work results in a professional, navigable, and maintainable documentation site for the MedicalLib library.
This commit is contained in:
+30
-5
@@ -1,10 +1,35 @@
|
||||
API Reference
|
||||
=============
|
||||
|
||||
This page contains the auto-generated API reference for the MedicalLib C++ library.
|
||||
This section provides a detailed, auto-generated reference for every class, struct, and function in the MedicalLib library.
|
||||
|
||||
.. doxygenfile:: MedicalLib/MedicalLib.h
|
||||
:project: MedicalLib
|
||||
.. toctree::
|
||||
:caption: Core
|
||||
:maxdepth: 1
|
||||
|
||||
.. doxygenfile:: MedicalLib/Patient.h
|
||||
:project: MedicalLib
|
||||
api/patient
|
||||
api/organ
|
||||
|
||||
.. toctree::
|
||||
:caption: Organs
|
||||
:maxdepth: 1
|
||||
|
||||
api/heart
|
||||
api/lungs
|
||||
api/brain
|
||||
api/liver
|
||||
api/kidneys
|
||||
api/stomach
|
||||
api/intestines
|
||||
api/pancreas
|
||||
api/spleen
|
||||
api/gallbladder
|
||||
api/bladder
|
||||
api/esophagus
|
||||
api/spinalcord
|
||||
|
||||
.. toctree::
|
||||
:caption: General
|
||||
:maxdepth: 1
|
||||
|
||||
api/general
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Bladder
|
||||
=======
|
||||
|
||||
.. doxygenclass:: Bladder
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: MicturitionState
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,14 @@
|
||||
Brain
|
||||
=====
|
||||
|
||||
.. doxygenclass:: Brain
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: BrainRegion
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,20 @@
|
||||
Esophagus
|
||||
=========
|
||||
|
||||
.. doxygenclass:: Esophagus
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: Bolus
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: PeristalsisState
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,13 @@
|
||||
Gallbladder
|
||||
===========
|
||||
|
||||
.. doxygenclass:: Gallbladder
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: GallbladderState
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,7 @@
|
||||
General Functions
|
||||
=================
|
||||
|
||||
This page documents general utility functions provided by the library.
|
||||
|
||||
.. doxygenfile:: MedicalLib/MedicalLib.h
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,28 @@
|
||||
Heart
|
||||
=====
|
||||
|
||||
.. doxygenclass:: Heart
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:protected-members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: Valve
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: Chamber
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: ValveStatus
|
||||
:project: MedicalLib
|
||||
|
||||
.. doxygenenum:: ChamberState
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,14 @@
|
||||
Intestines
|
||||
==========
|
||||
|
||||
.. doxygenclass:: Intestines
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: IntestinalSegment
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,14 @@
|
||||
Kidneys
|
||||
=======
|
||||
|
||||
.. doxygenclass:: Kidneys
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: Nephron
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,14 @@
|
||||
Liver
|
||||
=====
|
||||
|
||||
.. doxygenclass:: Liver
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: HepaticLobule
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,24 @@
|
||||
Lungs
|
||||
=====
|
||||
|
||||
.. doxygenclass:: Lungs
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: Lobe
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: Bronchus
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: RespiratoryState
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,9 @@
|
||||
Organ (Base Class)
|
||||
==================
|
||||
|
||||
This page documents the abstract base class for all organs in the simulation.
|
||||
|
||||
.. doxygenclass:: Organ
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
@@ -0,0 +1,14 @@
|
||||
Pancreas
|
||||
========
|
||||
|
||||
.. doxygenclass:: Pancreas
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: DigestiveEnzymes
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,26 @@
|
||||
Patient
|
||||
=======
|
||||
|
||||
This page documents the main `Patient` struct and related functions that manage the overall simulation state.
|
||||
|
||||
.. doxygenstruct:: Patient
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: BloodPressure
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: Blood
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Helper Functions
|
||||
----------------
|
||||
|
||||
.. doxygenfile:: MedicalLib/Patient.h
|
||||
:project: MedicalLib
|
||||
:sections: func
|
||||
@@ -0,0 +1,20 @@
|
||||
Spinal Cord
|
||||
===========
|
||||
|
||||
.. doxygenclass:: SpinalCord
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: SpinalTract
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: SignalStatus
|
||||
:project: MedicalLib
|
||||
@@ -0,0 +1,18 @@
|
||||
Spleen
|
||||
======
|
||||
|
||||
.. doxygenclass:: Spleen
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: RedPulp
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: WhitePulp
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
@@ -0,0 +1,20 @@
|
||||
Stomach
|
||||
=======
|
||||
|
||||
.. doxygenclass:: Stomach
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
:undoc-members:
|
||||
|
||||
Related Structures
|
||||
------------------
|
||||
|
||||
.. doxygenstruct:: Chyme
|
||||
:project: MedicalLib
|
||||
:members:
|
||||
|
||||
Related Enums
|
||||
-------------
|
||||
|
||||
.. doxygenenum:: GastricState
|
||||
:project: MedicalLib
|
||||
@@ -10,9 +10,9 @@
|
||||
* @brief Represents a specific region of the brain.
|
||||
*/
|
||||
struct BrainRegion {
|
||||
std::string name;
|
||||
double activityLevel; // 0.0 to 1.0
|
||||
double bloodFlow_ml_100g_min;
|
||||
std::string name; ///< The name of the brain region.
|
||||
double activityLevel; ///< Metabolic activity level, normalized [0.0, 1.0].
|
||||
double bloodFlow_ml_100g_min; ///< Blood flow in mL per 100g of tissue per minute.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ enum class PeristalsisState {
|
||||
* @brief Represents a small mass of chewed food.
|
||||
*/
|
||||
struct Bolus {
|
||||
double volume_mL;
|
||||
double position_cm; // Position from the top of the esophagus
|
||||
double volume_mL; ///< The volume of the bolus in mL.
|
||||
double position_cm; ///< Position from the top of the esophagus in cm.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
+33
-10
@@ -15,10 +15,10 @@ enum class ValveStatus { OPEN, CLOSED };
|
||||
* @brief Represents a single heart valve and its potential pathologies.
|
||||
*/
|
||||
struct Valve {
|
||||
std::string name;
|
||||
ValveStatus status = ValveStatus::CLOSED;
|
||||
double stenosis = 0.0; // Degree of narrowing [0, 1]
|
||||
double regurgitation = 0.0; // Degree of leakage [0, 1]
|
||||
std::string name; ///< The name of the valve (e.g., "Mitral").
|
||||
ValveStatus status = ValveStatus::CLOSED; ///< The current status of the valve (OPEN or CLOSED).
|
||||
double stenosis = 0.0; ///< Degree of narrowing, normalized [0, 1].
|
||||
double regurgitation = 0.0; ///< Degree of leakage, normalized [0, 1].
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -30,12 +30,12 @@ enum class ChamberState { SYSTOLE, DIASTOLE };
|
||||
* @brief Represents a single chamber of the heart.
|
||||
*/
|
||||
struct Chamber {
|
||||
std::string name;
|
||||
ChamberState state = ChamberState::DIASTOLE;
|
||||
double volume_mL = 0.0;
|
||||
double pressure_mmHg = 0.0;
|
||||
double endDiastolicVolume_mL = 120.0;
|
||||
double endSystolicVolume_mL = 50.0;
|
||||
std::string name; ///< The name of the chamber (e.g., "Left Ventricle").
|
||||
ChamberState state = ChamberState::DIASTOLE;///< The current state of the chamber (SYSTOLE or DIASTOLE).
|
||||
double volume_mL = 0.0; ///< The current volume of blood in the chamber in mL.
|
||||
double pressure_mmHg = 0.0; ///< The current pressure in the chamber in mmHg.
|
||||
double endDiastolicVolume_mL = 120.0; ///< The volume of blood at the end of diastole (filling).
|
||||
double endSystolicVolume_mL = 50.0; ///< The volume of blood at the end of systole (contraction).
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -64,12 +64,35 @@ public:
|
||||
std::string getSummary() const override;
|
||||
|
||||
// --- Electrical Properties ---
|
||||
/**
|
||||
* @brief Sets the baseline heart rate.
|
||||
* @param newRate_bpm The new heart rate in beats per minute.
|
||||
*/
|
||||
void setHeartRate(double newRate_bpm);
|
||||
|
||||
/**
|
||||
* @brief Gets the current measured heart rate.
|
||||
* @return The heart rate in beats per minute.
|
||||
*/
|
||||
double getHeartRate() const;
|
||||
|
||||
/**
|
||||
* @brief Gets the simulated EKG data for all leads.
|
||||
* @return A constant reference to the map of EKG data.
|
||||
*/
|
||||
const std::map<std::string, std::deque<double>>& getEkgData() const;
|
||||
|
||||
// --- Mechanical Properties ---
|
||||
/**
|
||||
* @brief Calculates and returns the left ventricular ejection fraction.
|
||||
* @return The ejection fraction as a percentage [0, 100].
|
||||
*/
|
||||
double getEjectionFraction() const;
|
||||
|
||||
/**
|
||||
* @brief Gets the simulated aortic pressure, representing systemic blood pressure.
|
||||
* @return The aortic pressure in mmHg.
|
||||
*/
|
||||
double getAorticPressure() const; // Represents systemic blood pressure
|
||||
|
||||
private:
|
||||
|
||||
@@ -11,11 +11,11 @@ struct DigestiveEnzymes;
|
||||
* @brief Represents a segment of the intestines.
|
||||
*/
|
||||
struct IntestinalSegment {
|
||||
std::string name;
|
||||
double length_m;
|
||||
double motility; // Rate of chyme movement
|
||||
double nutrientAbsorptionRate;
|
||||
double waterAbsorptionRate;
|
||||
std::string name; ///< The name of the segment (e.g., "Duodenum").
|
||||
double length_m; ///< The length of the segment in meters.
|
||||
double motility; ///< The rate of chyme movement.
|
||||
double nutrientAbsorptionRate; ///< The rate at which nutrients are absorbed.
|
||||
double waterAbsorptionRate; ///< The rate at which water is absorbed.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* @brief Represents a functional unit of the kidney.
|
||||
*/
|
||||
struct Nephron {
|
||||
std::string id;
|
||||
double filtrationEfficiency; // 0.0 to 1.0
|
||||
bool isDamaged;
|
||||
std::string id; ///< The unique ID of the nephron.
|
||||
double filtrationEfficiency; ///< The filtration efficiency, normalized [0.0, 1.0].
|
||||
bool isDamaged; ///< True if the nephron has sustained damage.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* @brief Represents a functional unit of the liver.
|
||||
*/
|
||||
struct HepaticLobule {
|
||||
std::string id;
|
||||
double metabolicActivity; // A factor from 0.0 to 1.0+
|
||||
bool isDamaged;
|
||||
std::string id; ///< The unique ID of the lobule.
|
||||
double metabolicActivity; ///< A factor representing the metabolic activity [0.0, 1.0+].
|
||||
bool isDamaged; ///< True if the lobule has sustained damage.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,17 +18,17 @@ enum class RespiratoryState {
|
||||
* @brief Represents a single lobe of the lung.
|
||||
*/
|
||||
struct Lobe {
|
||||
std::string name;
|
||||
double volume_mL;
|
||||
double compliance; // How easily it inflates
|
||||
std::string name; ///< The name of the lobe.
|
||||
double volume_mL; ///< The current volume of air in the lobe in mL.
|
||||
double compliance; ///< The measure of the lung's ability to stretch and expand.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents a major airway.
|
||||
*/
|
||||
struct Bronchus {
|
||||
std::string name;
|
||||
double resistance; // Airflow resistance
|
||||
std::string name; ///< The name of the bronchus.
|
||||
double resistance; ///< The resistance to airflow.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
* @brief Represents the mix of enzymes released by the pancreas for digestion.
|
||||
*/
|
||||
struct DigestiveEnzymes {
|
||||
double volume_mL = 0.0;
|
||||
double amylase_U_per_L = 0.0;
|
||||
double lipase_U_per_L = 0.0;
|
||||
double volume_mL = 0.0; ///< The volume of the secreted fluid in mL.
|
||||
double amylase_U_per_L = 0.0; ///< The concentration of amylase in Units/Liter.
|
||||
double lipase_U_per_L = 0.0; ///< The concentration of lipase in Units/Liter.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,29 +11,29 @@ class Organ;
|
||||
* @brief Represents blood pressure values.
|
||||
*/
|
||||
struct BloodPressure {
|
||||
double systolic_mmHg = 120.0;
|
||||
double diastolic_mmHg = 80.0;
|
||||
double systolic_mmHg = 120.0; ///< Systolic pressure in mmHg.
|
||||
double diastolic_mmHg = 80.0; ///< Diastolic pressure in mmHg.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents the composition of the patient's blood.
|
||||
*/
|
||||
struct Blood {
|
||||
BloodPressure bloodPressure;
|
||||
double oxygenSaturation = 98.0; // Normal SpO2
|
||||
double co2PartialPressure_mmHg = 40.0; // Normal PaCO2
|
||||
double glucose_mg_per_dL = 100.0; // Normal fasting glucose
|
||||
double angiotensin_au = 0.0; // Hormone for BP control
|
||||
double toxins_au = 0.0; // Arbitrary units, 0 is clean
|
||||
BloodPressure bloodPressure; ///< The patient's blood pressure.
|
||||
double oxygenSaturation = 98.0; ///< Peripheral oxygen saturation (SpO2) as a percentage.
|
||||
double co2PartialPressure_mmHg = 40.0; ///< Partial pressure of CO2 in arterial blood (PaCO2).
|
||||
double glucose_mg_per_dL = 100.0; ///< Blood glucose level in mg/dL.
|
||||
double angiotensin_au = 0.0; ///< Concentration of angiotensin, a hormone for BP control, in arbitrary units.
|
||||
double toxins_au = 0.0; ///< Concentration of toxins in the blood, in arbitrary units.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Holds all the vital signs and other medical information for a patient.
|
||||
*/
|
||||
struct Patient {
|
||||
int patientId;
|
||||
Blood blood;
|
||||
std::vector<std::unique_ptr<Organ>> organs;
|
||||
int patientId; ///< The unique ID for the patient.
|
||||
Blood blood; ///< The patient's blood composition and vitals.
|
||||
std::vector<std::unique_ptr<Organ>> organs; ///< A collection of all the patient's simulated organs.
|
||||
};
|
||||
|
||||
// Define MEDICAL_LIB_EXPORT for exporting symbols from the DLL
|
||||
|
||||
@@ -17,9 +17,9 @@ enum class SignalStatus {
|
||||
* @brief Represents a major bundle of nerve fibers in the spinal cord.
|
||||
*/
|
||||
struct SpinalTract {
|
||||
std::string name;
|
||||
SignalStatus status;
|
||||
double conductionVelocity_m_per_s;
|
||||
std::string name; ///< The name of the tract (e.g., "Corticospinal").
|
||||
SignalStatus status; ///< The functional status of the neural pathway.
|
||||
double conductionVelocity_m_per_s; ///< The speed of signal travel in meters/sec.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
* @brief Represents the red pulp, responsible for filtering blood.
|
||||
*/
|
||||
struct RedPulp {
|
||||
double filtrationRate; // Arbitrary units
|
||||
double rbcBreakdownRate; // Rate of old red blood cell removal
|
||||
double filtrationRate; ///< The rate of blood filtration, in arbitrary units.
|
||||
double rbcBreakdownRate; ///< The rate of old red blood cell removal.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents the white pulp, part of the immune system.
|
||||
*/
|
||||
struct WhitePulp {
|
||||
double lymphocyteCount; // in millions
|
||||
double macrophageCount; // in millions
|
||||
double lymphocyteCount; ///< The number of lymphocytes, in millions.
|
||||
double macrophageCount; ///< The number of macrophages, in millions.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,8 +18,8 @@ enum class GastricState {
|
||||
* @brief Represents the mixture of partially digested food and gastric juices.
|
||||
*/
|
||||
struct Chyme {
|
||||
double volume_mL;
|
||||
double acidity_pH;
|
||||
double volume_mL; ///< The volume of chyme in mL.
|
||||
double acidity_pH; ///< The pH of the chyme.
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user