Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5231: Handle patch vertex colours the same ways as brushes and entit…
…ies do
- Loading branch information
1 parent
4227575
commit d6c2136
Showing
12 changed files
with
138 additions
and
45 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
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
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
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,47 @@ | ||
#pragma once | ||
|
||
#include "ipatch.h" | ||
#include "math/Vector3.h" | ||
|
||
namespace patch | ||
{ | ||
|
||
class PatchSettings : | ||
public IPatchSettings | ||
{ | ||
private: | ||
Vector3 _vertexColourCorner; | ||
Vector3 _vertexColourInside; | ||
|
||
sigc::signal<void> _signalSettingsChanged; | ||
|
||
std::vector<Vector3> _vertexColours; | ||
public: | ||
PatchSettings() : | ||
_vertexColours(static_cast<std::size_t>(PatchEditVertexType::NumberOfVertexTypes)) | ||
{ | ||
_vertexColours[static_cast<std::size_t>(PatchEditVertexType::Corners)] = Vector3(1, 0, 1); | ||
_vertexColours[static_cast<std::size_t>(PatchEditVertexType::Inside)] = Vector3(0, 1, 0); | ||
} | ||
|
||
const Vector3& getVertexColour(PatchEditVertexType type) const override | ||
{ | ||
assert(type != PatchEditVertexType::NumberOfVertexTypes); | ||
return _vertexColours[static_cast<std::size_t>(type)]; | ||
} | ||
|
||
void setVertexColour(PatchEditVertexType type, const Vector3& value) override | ||
{ | ||
assert(type != PatchEditVertexType::NumberOfVertexTypes); | ||
_vertexColours[static_cast<std::size_t>(type)] = value; | ||
|
||
_signalSettingsChanged.emit(); | ||
} | ||
|
||
sigc::signal<void>& signal_settingsChanged() override | ||
{ | ||
return _signalSettingsChanged; | ||
} | ||
}; | ||
|
||
} |
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
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