Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5746: Introduce a texture tool scene graph module which is going to …
…be hosted in the core module. It will collect and represent the editable faces, patches and their vertices, and expose them to both the UI module for rendering as well as to the Manipulator algorithms which are in the same binary.
- Loading branch information
1 parent
1520dbb
commit 050efe5
Showing
4 changed files
with
68 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include "imodule.h" | ||
#include "inode.h" | ||
|
||
namespace textool | ||
{ | ||
|
||
// The base element of every node in the ITextureToolSceneGraph | ||
class INode | ||
{ | ||
public: | ||
virtual ~INode() {} | ||
|
||
using Ptr = std::shared_ptr<INode>; | ||
|
||
// The scene node this texture tool node is relating to | ||
virtual scene::INodePtr getSceneNode() = 0; | ||
}; | ||
|
||
/** | ||
* The scene graph of all texture tool items. From all the selected | ||
* items in the regular SceneGraph the texture-editable elements | ||
* are extracted and put into this graph. | ||
* | ||
* It can have multiple top-level elements (faces, patches) each of which | ||
* can have an arbitrary number of child elements (vertices). | ||
* | ||
* Like in the regular scene graph, some of the elements have special | ||
* properties like being renderable or transformable, which manifests | ||
* in them implementing the corresponding interface. | ||
*/ | ||
class ITextureToolSceneGraph : | ||
public RegisterableModule | ||
{ | ||
public: | ||
virtual ~ITextureToolSceneGraph() {} | ||
|
||
// Iterate over every node in this graph calling the given functor | ||
virtual void foreachNode(const std::function<bool(const INode::Ptr&)>& functor) = 0; | ||
}; | ||
|
||
} | ||
|
||
constexpr const char* const MODULE_TEXTOOL_SCENEGRAPH("TextureToolSceneGraph"); | ||
|
||
inline textool::ITextureToolSceneGraph& GlobalTextureToolSceneGraph() | ||
{ | ||
static module::InstanceReference<textool::ITextureToolSceneGraph> _reference(MODULE_TEXTOOL_SCENEGRAPH); | ||
return _reference; | ||
} |
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