Skip to content

Commit

Permalink
#5231: Extend brush interface to avoid having to reference the actual…
Browse files Browse the repository at this point in the history
… Brush.h header in the MapExporter.
  • Loading branch information
codereader committed May 23, 2020
1 parent 4870b02 commit 9b583da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions include/ibrush.h
Expand Up @@ -202,6 +202,9 @@ class IBrush

// Classify this brush against the given plane, used by clipper and CSG algorithms
virtual BrushSplitType classifyPlane(const Plane3& plane) const = 0;

// Method used internally to recalculate the brush windings
virtual void evaluateBRep() const = 0;
};

// Forward-declare the Brush object, only accessible from main binary
Expand Down
2 changes: 1 addition & 1 deletion radiant/brush/Brush.h
Expand Up @@ -211,7 +211,7 @@ class Brush :

BrushSplitType classifyPlane(const Plane3& plane) const override;

void evaluateBRep() const;
void evaluateBRep() const override;

void transformChanged();
void evaluateTransform();
Expand Down
5 changes: 2 additions & 3 deletions radiant/map/algorithm/MapExporter.cpp
Expand Up @@ -9,7 +9,6 @@
#include "imapresource.h"
#include "imap.h"
#include "igroupnode.h"
#include "../../brush/Brush.h"

#include "registry/registry.h"
#include "string/string.h"
Expand Down Expand Up @@ -271,9 +270,9 @@ void MapExporter::recalculateBrushWindings()
{
_root->foreachNode([] (const scene::INodePtr& child)->bool
{
Brush* brush = Node_getBrush(child);
auto* brush = Node_getIBrush(child);

if (brush != NULL)
if (brush != nullptr)
{
brush->evaluateBRep();
}
Expand Down

0 comments on commit 9b583da

Please sign in to comment.