Skip to content

Commit

Permalink
More fixes in header files. (#1567)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Habel <19556655+StefanHabel@users.noreply.github.com>
  • Loading branch information
StefanHabel committed Oct 31, 2023
1 parent be2db5e commit 71bd3fd
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 92 deletions.
28 changes: 14 additions & 14 deletions source/MaterialXFormat/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ class MX_FORMAT_API FilePath
/// Return this path as a standard string with the given format.
string asString(Format format = FormatNative) const;

/// Return true if the given path is empty.
/// Return true if this path is empty.
bool isEmpty() const
{
return _vec.empty();
}

/// Return true if the given path is absolute.
/// Return true if this path is absolute.
bool isAbsolute() const
{
return _type != TypeRelative;
}

/// Return the base name of the given path, with leading directory
/// Return the base name of this path, with leading directory
/// information removed.
const string& getBaseName() const
{
Expand All @@ -111,8 +111,8 @@ class MX_FORMAT_API FilePath
return _vec[_vec.size() - 1];
}

/// Return the parent directory of the given path, if any. If no
/// parent directory is present, then the empty path is returned.
/// Return the parent directory of this path, if any.
/// If no parent directory is present, then the empty path is returned.
FilePath getParentPath() const
{
FilePath parent(*this);
Expand All @@ -123,21 +123,21 @@ class MX_FORMAT_API FilePath
return parent;
}

/// Return the file extension of the given path.
/// Return the file extension of this path.
string getExtension() const
{
const string& baseName = getBaseName();
size_t i = baseName.rfind('.');
return i != string::npos ? baseName.substr(i + 1) : EMPTY_STRING;
}

/// Add a file extension to the given path.
/// Add a file extension to this path.
void addExtension(const string& ext)
{
assign(asString() + "." + ext);
}

/// Remove the file extension, if any, from the given path.
/// Remove the file extension, if any, from this path.
void removeExtension()
{
if (!isEmpty())
Expand Down Expand Up @@ -173,27 +173,27 @@ class MX_FORMAT_API FilePath
return _vec[index];
}

/// Return a normalized version of the given path, collapsing current path and
/// Return a normalized version of this path, collapsing current path and
/// parent path references so that 'a/./b' and 'c/../d/../a/b' become 'a/b'.
FilePath getNormalized() const;

/// @}
/// @name File System Operations
/// @{

/// Return true if the given path exists on the file system.
/// Return true if this path exists on the file system.
bool exists() const;

/// Return true if the given path is a directory on the file system.
/// Return true if this path is a directory on the file system.
bool isDirectory() const;

/// Return a vector of all files in the given directory with the given extension.
/// Return a vector of all files in this directory with the given extension.
FilePathVec getFilesInDirectory(const string& extension) const;

/// Return a vector of all directories at or beneath the given path.
/// Return a vector of all directories at or beneath this path.
FilePathVec getSubDirectories() const;

/// Create a directory on the file system at the given path.
/// Create a directory on the file system at this path.
void createDirectory() const;

/// Set the current working directory of the file system.
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenGlsl/GlslShaderGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class MX_GENGLSL_API GlslShaderGenerator : public HwShaderGenerator
/// the element and all dependencies upstream into shader code.
ShaderPtr generate(const string& name, ElementPtr element, GenContext& context) const override;

/// Return a unique identifier for the target this generator is for
/// Return a unique identifier for the target this generator is for.
const string& getTarget() const override { return TARGET; }

/// Return the version string for the GLSL version this generator is for
/// Return the version string for the GLSL version this generator is for.
virtual const string& getVersion() const { return VERSION; }

/// Emit a shader variable.
Expand Down
2 changes: 1 addition & 1 deletion source/MaterialXGenGlsl/VkShaderGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MX_GENGLSL_API VkShaderGenerator : public GlslShaderGenerator
/// Return a unique identifier for the target this generator is for
const string& getTarget() const override { return TARGET; }

/// Return the version string for the GLSL version this generator is for
/// Return the version string for the Vulkan GLSL version this generator is for
const string& getVersion() const override { return VERSION; }

string getVertexDataPrefix(const VariableBlock& vertexData) const override;
Expand Down
10 changes: 5 additions & 5 deletions source/MaterialXGenShader/GenContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MX_GENSHADER_API GenContext
/// Constructor.
GenContext(ShaderGeneratorPtr sg);

/// Return shader generatior.
/// Return shader generator.
ShaderGenerator& getShaderGenerator()
{
return *_sg;
Expand Down Expand Up @@ -126,7 +126,7 @@ class MX_GENSHADER_API GenContext
}

/// Add user data to the context to make it
/// available during shader generator.
/// available during shader generation.
void pushUserData(const string& name, GenUserDataPtr data)
{
auto it = _userData.find(name);
Expand Down Expand Up @@ -171,7 +171,7 @@ class MX_GENSHADER_API GenContext
/// @param input Node input
void removeInputSuffix(const ShaderInput* input);

/// Get an input suffix to be used for the input in this context.
/// Return an input suffix to be used for the input in this context.
/// @param input Node input
/// @param suffix Suffix string returned. Is empty if not found.
void getInputSuffix(const ShaderInput* input, string& suffix) const;
Expand All @@ -185,7 +185,7 @@ class MX_GENSHADER_API GenContext
/// @param output Node output
void removeOutputSuffix(const ShaderOutput* output);

/// Get an output suffix to be used for the output in this context.
/// Return an output suffix to be used for the output in this context.
/// @param output Node output
/// @param suffix Suffix string returned. Is empty if not found.
void getOutputSuffix(const ShaderOutput* output, string& suffix) const;
Expand All @@ -196,7 +196,7 @@ class MX_GENSHADER_API GenContext
_applicationVariableHandler = handler;
}

/// Get handler for application variables
/// Return handler for application variables
ApplicationVariableHandler getApplicationVariableHandler() const
{
return _applicationVariableHandler;
Expand Down
8 changes: 4 additions & 4 deletions source/MaterialXGenShader/ShaderGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,25 @@ class MX_GENSHADER_API ShaderGenerator
/// Return a registered shader node implementation for the given nodedef.
virtual ShaderNodeImplPtr getImplementation(const NodeDef& nodedef, GenContext& context) const;

/// Sets the color management system
/// Set the color management system
void setColorManagementSystem(ColorManagementSystemPtr colorManagementSystem)
{
_colorManagementSystem = colorManagementSystem;
}

/// Returns the color management system
/// Return the color management system
ColorManagementSystemPtr getColorManagementSystem() const
{
return _colorManagementSystem;
}

/// Sets the unit system
/// Set the unit system
void setUnitSystem(UnitSystemPtr unitSystem)
{
_unitSystem = unitSystem;
}

/// Returns the unit system
/// Return the unit system
UnitSystemPtr getUnitSystem() const
{
return _unitSystem;
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/ShaderNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class MX_GENSHADER_API ShaderPort : public std::enable_shared_from_this<ShaderPo
/// Return the name of this port.
const string& getName() const { return _name; }

/// Return the name of this port.
/// Return the full name of this port.
string getFullName() const;

/// Set the variable name of this port.
Expand Down Expand Up @@ -189,7 +189,7 @@ class MX_GENSHADER_API ShaderPort : public std::enable_shared_from_this<ShaderPo
/// geomprop to be assigned when it is unconnected.
void setGeomProp(const string& geomprop) { _geomprop = geomprop; }

/// Get geomprop name.
/// Return geomprop name.
const string& getGeomProp() const { return _geomprop; }

/// Set the path to this port.
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/ShaderStage.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ class MX_GENSHADER_API VariableBlock
{
}

/// Get the name of this block.
/// Return the name of this block.
const string& getName() const { return _name; }

/// Set the name of this block.
void setName(const string& name) { _name = name; }

/// Get the instance name of this block.
/// Return the instance name of this block.
const string& getInstance() const { return _instance; }

/// Set the instance name of this block.
Expand Down
4 changes: 2 additions & 2 deletions source/MaterialXGenShader/TypeDesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class MX_GENSHADER_API TypeDesc
unsigned char getSemantic() const { return _semantic; }

/// Return the number of elements the type is composed of.
/// Will return 1 for scalar types and a size greater than 1 for aggregate type.
/// For array types 0 is returned since the number of elements is undefined
/// Will return 1 for scalar types and a size greater than 1 for aggregate types.
/// For array types, 0 is returned, since the number of elements is undefined
/// until an array is instantiated.
size_t getSize() const { return _size; }

Expand Down
8 changes: 4 additions & 4 deletions source/MaterialXGenShader/UnitSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ class MX_GENSHADER_API UnitSystem
/// Assign unit converter registry replacing any previous assignment
virtual void setUnitConverterRegistry(UnitConverterRegistryPtr registry);

/// Returns the currently assigned unit converter registry
/// Return the currently assigned unit converter registry
virtual UnitConverterRegistryPtr getUnitConverterRegistry() const;

/// assign document with unit implementations replacing any previously loaded content.
/// Assign document with unit implementations replacing any previously loaded content.
virtual void loadLibrary(DocumentPtr document);

/// Returns whether this unit system supports a provided transform
/// Return whether this unit system supports a provided transform
bool supportsTransform(const UnitTransform& transform) const;

/// Create a node to use to perform the given unit space transformation.
ShaderNodePtr createNode(ShaderGraph* parent, const UnitTransform& transform, const string& name,
GenContext& context) const;

/// Returns a nodedef for a given transform
/// Return a nodedef for a given transform
virtual NodeDefPtr getNodeDef(const UnitTransform& transform) const;

static const string UNITSYTEM_NAME;
Expand Down
11 changes: 5 additions & 6 deletions source/MaterialXRender/GeometryHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class MX_RENDER_API GeometryLoader
}
virtual ~GeometryLoader() { }

/// Returns a list of supported extensions
/// @return List of support extensions
/// Return a set of extensions supported by the loader.
const StringSet& supportedExtensions() const
{
return _extensions;
Expand All @@ -47,7 +46,7 @@ class MX_RENDER_API GeometryLoader
virtual bool load(const FilePath& filePath, MeshList& meshList, bool texcoordVerticalFlip = false) = 0;

protected:
// List of supported string extensions
// Set of supported string extensions
StringSet _extensions;
};

Expand Down Expand Up @@ -78,7 +77,7 @@ class MX_RENDER_API GeometryHandler
/// @param loader Loader to add to list of available loaders.
void addLoader(GeometryLoaderPtr loader);

/// Get a list of extensions supported by the handler
/// Fill a set of extensions supported by the handler
void supportedExtensions(StringSet& extensions);

/// Clear all loaded geometry
Expand All @@ -95,7 +94,7 @@ class MX_RENDER_API GeometryHandler
/// @param texcoordVerticalFlip Flip texture coordinates in V. Default is to not flip.
bool loadGeometry(const FilePath& filePath, bool texcoordVerticalFlip = false);

/// Get list of meshes
/// Return list of meshes
const MeshList& getMeshes() const
{
return _meshes;
Expand All @@ -111,7 +110,7 @@ class MX_RENDER_API GeometryHandler
return _minimumBounds;
}

/// Return the minimum bounds for all meshes
/// Return the maximum bounds for all meshes
const Vector3& getMaximumBounds() const
{
return _maximumBounds;
Expand Down
7 changes: 3 additions & 4 deletions source/MaterialXRender/ImageHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ class MX_RENDER_API ImageLoader
static const string TX_EXTENSION;
static const string TXR_EXTENSION;

/// Returns a list of supported extensions
/// @return List of support extensions
/// Return a set of extensions supported by the loader.
const StringSet& supportedExtensions() const
{
return _extensions;
Expand All @@ -151,7 +150,7 @@ class MX_RENDER_API ImageLoader
virtual ImagePtr loadImage(const FilePath& filePath);

protected:
// List of supported string extensions
// Set of supported string extensions
StringSet _extensions;
};

Expand All @@ -173,7 +172,7 @@ class MX_RENDER_API ImageHandler
/// existing loaders cannot load a given image.
void addLoader(ImageLoaderPtr loader);

/// Get a list of extensions supported by the handler.
/// Return a set of extensions supported by the handler.
StringSet supportedExtensions();

/// Save image to disk. This method must be implemented by derived classes.
Expand Down
Loading

0 comments on commit 71bd3fd

Please sign in to comment.