From 7c2b595433519c0f0c1597c48a92661091c655cc Mon Sep 17 00:00:00 2001 From: Clay Anderson Date: Wed, 4 Sep 2024 13:54:03 -0500 Subject: [PATCH] Update StatesTrajectory.h - Improved documentation comments. --- OpenSim/Simulation/StatesTrajectory.h | 33 ++++++++++++--------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/OpenSim/Simulation/StatesTrajectory.h b/OpenSim/Simulation/StatesTrajectory.h index 0945f90580..7c781cf105 100644 --- a/OpenSim/Simulation/StatesTrajectory.h +++ b/OpenSim/Simulation/StatesTrajectory.h @@ -294,25 +294,22 @@ class OSIMSIMULATION_API StatesTrajectory { * all continuous, discrete, and modeling states) to an * OpenSim::StatesDocument. That StatesDocument instance can then be * used to serialize the states to an OSTATES file or document string by - * calling the following: - * - * StatesDocument::serializeToFile() - * StatesDocument::serializeToSring() + * calling `StatesDocument::serialize()`. * * Once the states have been serialized, they can be deserialized by - * constructing a new StatesDocument from a file or document string: - * - * StatesDocument(const SimTK::String& filename) - * StatesDocument(const char* xmlDocument) - * - * and then calling the following: - * + * constructing a new StatesDocument by calling + * ``` + * StatesDocument(const SimTK::String& filename) + * ``` + * and then calling: + * ``` * StatesDocument::deserialize(const OpenSim::Model& model, * SimTK::Array_& trajectory) - * * - * The OSTATES format is plain-text XML (see SimTK::Xml) with precision - * sufficient to restore a time-history of SimTK::State%s with virtually - * no trunction or rounding error. + * ``` + * + * The .ostates format is plain-text XML (see SimTK::Xml) with a + * specifiable precision between 1 and 20 significant figures. A precision + * of 20 digits results in losselss de/serialization. * * A note of CAUTION: * Using either @@ -323,11 +320,11 @@ class OSIMSIMULATION_API StatesTrajectory { * to construct a StatesTrajectory instance will likely leave discrete * states (i.e., OpenSim::DiscreteVariable%s) and modeling states * (i.e., OpenSim::ModelingOptions%s) uninitialized. The reason is that - * Storage and TimeSeriesTable objects generally include only the - * continuous states (i.e., OpenSim::StateVariable%s). + * Storage and TimeSeriesTable objects include only the continuous states + * (i.e., OpenSim::StateVariable%s). * * Thus, when relying on serialization and deserialization to reproduce a - * complete StatesTrajectory, a StatesDocument is the preferred source as + * complete StatesTrajectory, a StatesDocument is the preferred means as * it will include continuous, discrete, and modeling states. */ OpenSim::StatesDocument