Skip to content

Commit

Permalink
#5623: Start creating a few object types to define a merge operation
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed May 24, 2021
1 parent c862c0a commit 684abd2
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
36 changes: 36 additions & 0 deletions libs/scene/merge/MergeAction.h
@@ -0,0 +1,36 @@
#pragma once

namespace scene
{

namespace merge
{

enum class ActionType
{

};

// Represents a single operation during a merge process
// There are various types of actions, i.e. brush addition,
// entity removal, keyvalue change, etc.
class MergeAction
{
private:
ActionType _type;

public:
MergeAction(ActionType type) :
_type(type)
{}

ActionType getType() const
{
return _type;
}
};


}

}
32 changes: 32 additions & 0 deletions libs/scene/merge/MergeOperation.h
@@ -0,0 +1,32 @@
#pragma once

#include <list>
#include <memory>
#include "../SceneGraphComparer.h"
#include "MergeAction.h"

namespace scene
{

namespace merge
{

// A MergeOperation groups one or more merge actions
// together in order to apply a set of changes to an existing map
class MergeOperation
{
private:
std::list<MergeAction> _actions;

public:
using Ptr = std::shared_ptr<MergeOperation>;

static MergeOperation::Ptr CreateFromComparisonResult(const ComparisonResult& comparisonResult)
{
return std::make_shared<MergeOperation>();
}
};

}

}
2 changes: 2 additions & 0 deletions tools/msvc/scenelib.vcxproj
Expand Up @@ -137,6 +137,8 @@
<ClInclude Include="..\..\libs\scene\InstanceWalkers.h" />
<ClInclude Include="..\..\libs\scene\LayerUsageBreakdown.h" />
<ClInclude Include="..\..\libs\scene\LayerValidityCheckWalker.h" />
<ClInclude Include="..\..\libs\scene\merge\MergeAction.h" />
<ClInclude Include="..\..\libs\scene\merge\MergeOperation.h" />
<ClInclude Include="..\..\libs\scene\ModelBreakdown.h" />
<ClInclude Include="..\..\libs\scene\ModelFinder.h" />
<ClInclude Include="..\..\libs\scene\Node.h" />
Expand Down
9 changes: 9 additions & 0 deletions tools/msvc/scenelib.vcxproj.filters
Expand Up @@ -4,6 +4,9 @@
<Filter Include="scene">
<UniqueIdentifier>{7effd458-1286-4c86-a9c4-cd4922f14c82}</UniqueIdentifier>
</Filter>
<Filter Include="scene\merge">
<UniqueIdentifier>{b3592cff-e97d-4da2-ade5-caef2835f906}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\libs\scene\InstanceWalkers.cpp">
Expand Down Expand Up @@ -103,5 +106,11 @@
<ClInclude Include="..\..\libs\scene\SceneGraphComparer.h">
<Filter>scene</Filter>
</ClInclude>
<ClInclude Include="..\..\libs\scene\merge\MergeAction.h">
<Filter>scene\merge</Filter>
</ClInclude>
<ClInclude Include="..\..\libs\scene\merge\MergeOperation.h">
<Filter>scene\merge</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit 684abd2

Please sign in to comment.