Skip to content

Commit

Permalink
Update StatesDocument.cpp
Browse files Browse the repository at this point in the history
Now settings for `note` and `precision` are updated in the body of the constructor instead of in the initializer list.
  • Loading branch information
fcanderson committed Oct 12, 2024
1 parent bd764f6 commit a09c2b3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions OpenSim/Simulation/StatesDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,20 @@ struct SDocUtil {
//_____________________________________________________________________________
StatesDocument::
StatesDocument(const Model& model, const Array_<State>& trajectory,
const String& note, int p) :
note(note), precision(clamp(1, p, SimTK::LosslessNumDigitsReal))
const String& note, int p)
{
this->note = note;
this->precision = clamp(1, p, SimTK::LosslessNumDigitsReal);
formDoc(model, trajectory);
}
//_____________________________________________________________________________
StatesDocument::
StatesDocument(const Model& model, const vector<State>& trajectory,
const String& note, int p) :
note(note), precision(clamp(1, p, SimTK::LosslessNumDigitsReal))
const String& note, int p)
{
this->note = note;
this->precision = clamp(1, p, SimTK::LosslessNumDigitsReal);

// Repackage the trajectory of states as a SimTK::Array_<>, which is
// the container type used by this class and also by the underlying
// trajectory-related methods in OpenSim::Component.
Expand Down

0 comments on commit a09c2b3

Please sign in to comment.