AlToolMeshMerge
Class used for merging meshes from input data model mesh nodes into one mesh node target.
Synopsis
This is an algorithmic tool class used for merging meshes from input data model mesh nodes into one mesh node target.
#include <AlToolMeshMerge.h>Description
The algorithm object gets constructed with the option:
- keepOriginals - Keep the original meshes after the mesh creation.
The input meshes can be set with the base class AlModelTool::setNodes() or added with AlModelTool::addNode().
The first node in the list of inputs is the target node, which will hold the merged meshes After the execution, the result mesh node is added to the model. To access the results, use the base class AlModelTool::getResult() for AlDagNode objects, or getMesh() for AlMeshNode object.
Example:
auto& meshes = getSomeMeshes();
AlToolMeshMerge tool( false );
tool.setNodes( meshes );
or:
for( auto meshNode : meshes )
mergeTool.addNode( meshNode );
if( tool.execute() == sSuccess )
{
auto& result = tool.getResult();
nextTool.setNodes( result );
//or
auto mesh = tool.getMesh();
}
#ifndef _AlToolMeshMerge
#define _AlToolMeshMerge
#include <AlStudioAPIDecl.h>
#include <AlModelTool.h>
#include <statusCodes.h>
class AlMeshNode;
class STUDIOAPI_DECL AlToolMeshMerge : public AlModelTool
{
public:
AlToolMeshMerge( bool keepOriginal );
~AlToolMeshMerge();
statusCode execute() override;
AlMeshNode* getMesh() const;
private:
AlToolMeshMerge( const AlToolMeshMerge& ) = delete;
AlToolMeshMerge( const AlToolMeshMerge&& ) = delete;
AlToolMeshMerge& operator=( const AlToolMeshMerge& ) = delete;
struct Impl;
Impl* m_impl{ nullptr };
};
