-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3535 from opensim-org/wrapping_abstract_path
Implement `AbstractPath` and related API changes to support multiple path types
- Loading branch information
Showing
28 changed files
with
555 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* -------------------------------------------------------------------------- * | ||
* OpenSim: AbstractPath.cpp * | ||
* -------------------------------------------------------------------------- * | ||
* The OpenSim API is a toolkit for musculoskeletal modeling and simulation. * | ||
* See http://opensim.stanford.edu and the NOTICE file for more information. * | ||
* OpenSim is developed at Stanford University and supported by the US * | ||
* National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA * | ||
* through the Warrior Web program. * | ||
* * | ||
* Copyright (c) 2005-2023 Stanford University and the Authors * | ||
* Author(s): Nicholas Bianco, Joris Verhagen, Adam Kewley * | ||
* * | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may * | ||
* not use this file except in compliance with the License. You may obtain a * | ||
* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * | ||
* * | ||
* Unless required by applicable law or agreed to in writing, software * | ||
* distributed under the License is distributed on an "AS IS" BASIS, * | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * | ||
* See the License for the specific language governing permissions and * | ||
* limitations under the License. * | ||
* -------------------------------------------------------------------------- */ | ||
|
||
#include "AbstractPath.h" | ||
#include "Appearance.h" | ||
|
||
using namespace OpenSim; | ||
|
||
AbstractPath::AbstractPath() : ModelComponent() { | ||
setAuthors("Nicholas Bianco, Joris Verhagen, Adam Kewley"); | ||
|
||
Appearance appearance; | ||
appearance.set_color(SimTK::Gray); | ||
constructProperty_Appearance(appearance); | ||
} | ||
|
||
AbstractPath::AbstractPath(AbstractPath const&) = default; | ||
|
||
AbstractPath::~AbstractPath() noexcept = default; | ||
|
||
AbstractPath& AbstractPath::operator=(const AbstractPath&) = default; | ||
|
||
AbstractPath::AbstractPath(AbstractPath&& other) = default; | ||
|
||
AbstractPath& AbstractPath::operator=(AbstractPath&& other) = default; | ||
|
||
// DEFAULTED METHODS | ||
const SimTK::Vec3& AbstractPath::getDefaultColor() const | ||
{ | ||
return get_Appearance().get_color(); | ||
} | ||
|
||
void AbstractPath::setDefaultColor(const SimTK::Vec3& color) | ||
{ | ||
updProperty_Appearance().setValueIsDefault(false); | ||
upd_Appearance().set_color(color); | ||
} | ||
|
||
double AbstractPath::getPreScaleLength(const SimTK::State&) const | ||
{ | ||
return _preScaleLength; | ||
} | ||
|
||
void AbstractPath::setPreScaleLength(const SimTK::State&, | ||
double preScaleLength) | ||
{ | ||
_preScaleLength = preScaleLength; | ||
} |
Oops, something went wrong.