|
| 1 | +/* |
| 2 | + * Copyright (C) 2022 Open Source Robotics Foundation |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + * |
| 16 | +*/ |
| 17 | + |
| 18 | +#ifndef SDF_USD_SDF_PARSER_JOINT_HH_ |
| 19 | +#define SDF_USD_SDF_PARSER_JOINT_HH_ |
| 20 | + |
| 21 | +#include <unordered_map> |
| 22 | +#include <string> |
| 23 | + |
| 24 | +// TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings |
| 25 | +// are reported using #pragma message so normal diagnostic flags cannot remove |
| 26 | +// them. This workaround requires this block to be used whenever usd is |
| 27 | +// included. |
| 28 | +#pragma push_macro ("__DEPRECATED") |
| 29 | +#undef __DEPRECATED |
| 30 | +#include <pxr/usd/sdf/path.h> |
| 31 | +#include <pxr/usd/usd/stage.h> |
| 32 | +#pragma pop_macro ("__DEPRECATED") |
| 33 | + |
| 34 | +#include "sdf/Joint.hh" |
| 35 | +#include "sdf/Model.hh" |
| 36 | +#include "sdf/config.hh" |
| 37 | +#include "sdf/usd/Export.hh" |
| 38 | +#include "sdf/usd/UsdError.hh" |
| 39 | + |
| 40 | +namespace sdf |
| 41 | +{ |
| 42 | + // Inline bracke to help doxygen filtering. |
| 43 | + inline namespace SDF_VERSION_NAMESPACE { |
| 44 | + // |
| 45 | + namespace usd |
| 46 | + { |
| 47 | + /// \brief Parse a SDF joint into a USD stage. |
| 48 | + /// \param[in] _joint The SDF joint to parse. |
| 49 | + /// \param[in] _stage The stage that should contain the USD representation |
| 50 | + /// of _joint. This must be a valid, initialized stage. |
| 51 | + /// \param[in] _path The USD path of the parsed joint in _stage, which must |
| 52 | + /// be a valid USD path. |
| 53 | + /// \param[in] _parentModel The model that is the parent of _joint |
| 54 | + /// \param[in] _linkToUsdPath a map of a link's SDF name to the link's USD |
| 55 | + /// path. This is used to determine which USD prims should be assigned as |
| 56 | + /// the USD joint's relative links. |
| 57 | + /// \param[in] _worldPath The USD path of the world prim. This is needed if |
| 58 | + /// _joint's parent is the world. |
| 59 | + /// \return UsdErrors, which is a vector of UsdError objects. Each UsdError |
| 60 | + /// includes an error code and message. An empty vector indicates no errors |
| 61 | + /// occurred when parsing _joint to its USD representation. |
| 62 | + UsdErrors IGNITION_SDFORMAT_USD_VISIBLE ParseSdfJoint( |
| 63 | + const sdf::Joint &_joint, |
| 64 | + pxr::UsdStageRefPtr &_stage, const std::string &_path, |
| 65 | + const sdf::Model &_parentModel, |
| 66 | + const std::unordered_map<std::string, pxr::SdfPath> &_linkToUsdPath, |
| 67 | + const pxr::SdfPath &_worldPath); |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +#endif |
0 commit comments