Skip to content

Commit 332c430

Browse files
committed
Merge remote-tracking branch 'upstream/sdf13' into embeddedsdf_refactoring
2 parents f7ffbfa + 707cb30 commit 332c430

32 files changed

+998
-31
lines changed

include/sdf/Collision.hh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace sdf
3434
//
3535
// Forward declaration.
3636
class Geometry;
37+
class ParserConfig;
3738
class Surface;
3839
struct PoseRelativeToGraph;
3940
template <typename T> class ScopedGraph;
@@ -55,6 +56,15 @@ namespace sdf
5556
/// an error code and message. An empty vector indicates no error.
5657
public: Errors Load(ElementPtr _sdf);
5758

59+
/// \brief Load the collision based on a element pointer. This is *not* the
60+
/// usual entry point. Typical usage of the SDF DOM is through the Root
61+
/// object.
62+
/// \param[in] _sdf The SDF Element pointer
63+
/// \param[in] _config Parser configuration
64+
/// \return Errors, which is a vector of Error objects. Each Error includes
65+
/// an error code and message. An empty vector indicates no error.
66+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
67+
5868
/// \brief Get the name of the collision.
5969
/// The name of the collision must be unique within the scope of a Link.
6070
/// \return Name of the collision.

include/sdf/Geometry.hh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace sdf
3737
class Ellipsoid;
3838
class Heightmap;
3939
class Mesh;
40+
class ParserConfig;
4041
class Plane;
4142
class Polyline;
4243
class Sphere;
@@ -93,6 +94,15 @@ namespace sdf
9394
/// an error code and message. An empty vector indicates no error.
9495
public: Errors Load(ElementPtr _sdf);
9596

97+
/// \brief Load the geometry based on a element pointer. This is *not* the
98+
/// usual entry point. Typical usage of the SDF DOM is through the Root
99+
/// object.
100+
/// \param[in] _sdf The SDF Element pointer
101+
/// \param[in] _config Parser configuration
102+
/// \return Errors, which is a vector of Error objects. Each Error includes
103+
/// an error code and message. An empty vector indicates no error.
104+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
105+
96106
/// \brief Get the type of geometry.
97107
/// \return The geometry type.
98108
public: GeometryType Type() const;

include/sdf/Heightmap.hh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ namespace sdf
2828
{
2929
// Inline bracket to help doxygen filtering.
3030
inline namespace SDF_VERSION_NAMESPACE {
31+
//
32+
33+
// Forward declarations.
34+
class ParserConfig;
35+
3136
/// \brief Texture to be used on heightmaps.
3237
class SDFORMAT_VISIBLE HeightmapTexture
3338
{
@@ -42,6 +47,15 @@ namespace sdf
4247
/// an error code and message. An empty vector indicates no error.
4348
public: Errors Load(ElementPtr _sdf);
4449

50+
/// \brief Load the heightmap texture geometry based on a element pointer.
51+
/// This is *not* the usual entry point. Typical usage of the SDF DOM is
52+
/// through the Root object.
53+
/// \param[in] _sdf The SDF Element pointer
54+
/// \param[in] _config Parser configuration
55+
/// \return Errors, which is a vector of Error objects. Each Error includes
56+
/// an error code and message. An empty vector indicates no error.
57+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
58+
4559
/// \brief Get the heightmap texture's size.
4660
/// \return The size of the heightmap texture in meters.
4761
public: double Size() const;
@@ -129,6 +143,15 @@ namespace sdf
129143
/// an error code and message. An empty vector indicates no error.
130144
public: Errors Load(ElementPtr _sdf);
131145

146+
/// \brief Load the heightmap geometry based on a element pointer.
147+
/// This is *not* the usual entry point. Typical usage of the SDF DOM is
148+
/// through the Root object.
149+
/// \param[in] _sdf The SDF Element pointer
150+
/// \param[in] _config Parser configuration
151+
/// \return Errors, which is a vector of Error objects. Each Error includes
152+
/// an error code and message. An empty vector indicates no error.
153+
public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
154+
132155
/// \brief Get the heightmap's URI.
133156
/// \return The URI of the heightmap data.
134157
public: std::string Uri() const;

include/sdf/Link.hh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace sdf
3737
// Forward declarations.
3838
class Collision;
3939
class Light;
40+
class ParserConfig;
4041
class ParticleEmitter;
4142
class Sensor;
4243
class Visual;
@@ -56,6 +57,15 @@ namespace sdf
5657
/// an error code and message. An empty vector indicates no error.
5758
public: Errors Load(ElementPtr _sdf);
5859

60+
/// \brief Load the link based on a element pointer. This is *not* the
61+
/// usual entry point. Typical usage of the SDF DOM is through the Root
62+
/// object.
63+
/// \param[in] _sdf The SDF Element pointer
64+
/// \param[in] _config Parser configuration
65+
/// \return Errors, which is a vector of Error objects. Each Error includes
66+
/// an error code and message. An empty vector indicates no error.
67+
public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
68+
5969
/// \brief Get the name of the link.
6070
/// The name of a link must be unique within the scope of a Model.
6171
/// \return Name of the link.

include/sdf/Material.hh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace sdf
3131
//
3232

3333
// Forward declarations.
34+
class ParserConfig;
3435
class Pbr;
3536

3637
enum class ShaderType : int
@@ -55,6 +56,15 @@ namespace sdf
5556
/// an error code and message. An empty vector indicates no error.
5657
public: Errors Load(ElementPtr _sdf);
5758

59+
/// \brief Load the material based on a element pointer. This is *not* the
60+
/// usual entry point. Typical usage of the SDF DOM is through the Root
61+
/// object.
62+
/// \param[in] _sdf The SDF Element pointer
63+
/// \param[in] _config Parser configuration
64+
/// \return Errors, which is a vector of Error objects. Each Error includes
65+
/// an error code and message. An empty vector indicates no error.
66+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
67+
5868
/// \brief Get the ambient color. The ambient color is
5969
/// specified by a set of three numbers representing red/green/blue,
6070
/// each in the range of [0,1].

include/sdf/Mesh.hh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ namespace sdf
3030
inline namespace SDF_VERSION_NAMESPACE {
3131
//
3232

33+
// Forward declarations.
34+
class ParserConfig;
35+
3336
/// \brief Mesh represents a mesh shape, and is usually accessed through a
3437
/// Geometry.
3538
class SDFORMAT_VISIBLE Mesh
@@ -45,6 +48,15 @@ namespace sdf
4548
/// an error code and message. An empty vector indicates no error.
4649
public: Errors Load(ElementPtr _sdf);
4750

51+
/// \brief Load the mesh geometry based on a element pointer.
52+
/// This is *not* the usual entry point. Typical usage of the SDF DOM is
53+
/// through the Root object.
54+
/// \param[in] _sdf The SDF Element pointer
55+
/// \param[in] _config Parser configuration
56+
/// \return Errors, which is a vector of Error objects. Each Error includes
57+
/// an error code and message. An empty vector indicates no error.
58+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
59+
4860
/// \brief Get the mesh's URI.
4961
/// \return The URI of the mesh data.
5062
public: std::string Uri() const;

include/sdf/ParserConfig.hh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,29 @@ class SDFORMAT_VISIBLE ParserConfig
169169
public: const std::vector<CustomModelParser> &CustomModelParsers() const;
170170

171171
/// \brief Set the preserveFixedJoint flag.
172+
/// \param[in] _preserveFixedJoint flag value to set
172173
public: void URDFSetPreserveFixedJoint(bool _preserveFixedJoint);
173174

174175
/// \brief Get the preserveFixedJoint flag value.
176+
/// \return Current flag value
175177
public: bool URDFPreserveFixedJoint() const;
176178

179+
/// \brief Set the storeResolvedURIs flag value.
180+
/// \param[in] _resolveURI True to make the parser attempt to resolve any
181+
/// URIs found and store them. False to preserve original URIs
182+
///
183+
/// The Parser will use the FindFileCallback provided to attempt to resolve
184+
/// URIs in the Mesh, Material, Heightmap, and Skybox DOM objects
185+
/// If the FindFileCallback provides a non-empty string, the URI will be
186+
/// stored in the DOM object, and the original (unresolved) URI will be
187+
/// stored in the underlying Element.
188+
public: void SetStoreResovledURIs(bool _resolveURI);
189+
190+
/// \brief Get the storeResolvedURIs flag value.
191+
/// \return True if the parser will attempt to resolve any URIs found and
192+
/// store them. False to preserve original URIs
193+
public: bool StoreResolvedURIs() const;
194+
177195
/// \brief Private data pointer.
178196
GZ_UTILS_IMPL_PTR(dataPtr)
179197
};

include/sdf/Scene.hh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ namespace sdf
4343
/// an error code and message. An empty vector indicates no error.
4444
public: Errors Load(ElementPtr _sdf);
4545

46+
/// \brief Load the scene based on a element pointer. This is *not* the
47+
/// usual entry point. Typical usage of the SDF DOM is through the Root
48+
/// object.
49+
/// \param[in] _sdf The SDF Element pointer
50+
/// \param[in] _config Parser configuration
51+
/// \return Errors, which is a vector of Error objects. Each Error includes
52+
/// an error code and message. An empty vector indicates no error.
53+
public: Errors Load(sdf::ElementPtr _sdf, const ParserConfig &_config);
54+
4655
/// \brief Get the ambient color of the scene
4756
/// \return Scene ambient color
4857
public: gz::math::Color Ambient() const;

include/sdf/Sky.hh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ namespace sdf
3232
{
3333
// Inline bracket to help doxygen filtering.
3434
inline namespace SDF_VERSION_NAMESPACE {
35+
//
36+
37+
// Forward declarations.
38+
class ParserConfig;
39+
3540
class SDFORMAT_VISIBLE Sky
3641
{
3742
/// \brief Default constructor
@@ -117,6 +122,14 @@ namespace sdf
117122
/// an error code and message. An empty vector indicates no error.
118123
public: Errors Load(ElementPtr _sdf);
119124

125+
/// \brief Load the sky based on a element pointer. This is *not* the
126+
/// usual entry point. Typical usage of the SDF DOM is through the Root
127+
/// object.
128+
/// \param[in] _sdf The SDF Element pointer
129+
/// \return Errors, which is a vector of Error objects. Each Error includes
130+
/// an error code and message. An empty vector indicates no error.
131+
public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
132+
120133
/// \brief Get a pointer to the SDF element that was used during
121134
/// load.
122135
/// \return SDF element pointer. The value will be nullptr if Load has

include/sdf/Visual.hh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace sdf
4141

4242
// Forward declarations.
4343
class Geometry;
44+
class ParserConfig;
4445
struct PoseRelativeToGraph;
4546
template <typename T> class ScopedGraph;
4647

@@ -57,6 +58,15 @@ namespace sdf
5758
/// an error code and message. An empty vector indicates no error.
5859
public: Errors Load(ElementPtr _sdf);
5960

61+
/// \brief Load the visual based on a element pointer. This is *not* the
62+
/// usual entry point. Typical usage of the SDF DOM is through the Root
63+
/// object.
64+
/// \param[in] _sdf The SDF Element pointer
65+
/// \param[in] _config Parser configuration
66+
/// \return Errors, which is a vector of Error objects. Each Error includes
67+
/// an error code and message. An empty vector indicates no error.
68+
public: Errors Load(ElementPtr _sdf, const ParserConfig &_config);
69+
6070
/// \brief Get the name of the visual.
6171
/// The name of the visual must be unique within the scope of a Link.
6272
/// \return Name of the visual.

0 commit comments

Comments
 (0)