Commit 4f0b09cd authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[entitynetwork] minimize virtual interfaces

The virtual interface now solely defines the basic maps that must be
available, e.g. for writing the network into a brep file.
parent 2b4f41b1
......@@ -92,7 +92,7 @@ public:
/*!
* \brief The map of intersection id to intersecting entity indices.
*/
virtual const ConnectivityMap& intersectionConnectivityMap() const override
const ConnectivityMap& intersectionConnectivityMap() const
{ return isConnectivityMap_; }
private:
......
......@@ -35,6 +35,10 @@ namespace Frackit {
* \ingroup EntityNetwork
* \brief Interface defining networks of entities contained
* in (possibly multiple) sub-domains.
* Defines the mandatory functions required, for instance,
* to write the network into a brep or geo file. Actual
* implementations may provide additional, more user-friendly
* functions.
*/
class ContainedEntityNetworkInterface
{
......@@ -86,11 +90,6 @@ public:
*/
virtual const ShapeMap& intersectionFragmentsMap() const = 0;
/*!
* \brief The map of intersection id to intersecting entity indices.
*/
virtual const ConnectivityMap& intersectionConnectivityMap() const = 0;
private:
int entityDimension_;
int domainDimension_;
......
......@@ -87,7 +87,7 @@ public:
/*!
* \brief The map of intersection id to intersecting entity indices.
*/
virtual const ConnectivityMap& intersectionConnectivityMap() const override
const ConnectivityMap& intersectionConnectivityMap() const
{ return isConnectivityMap_; }
private:
......
......@@ -33,6 +33,10 @@ namespace Frackit {
/*!
* \ingroup EntityNetwork
* \brief Interface defining networks of entities.
* Defines the mandatory functions required, for instance,
* to write the network into a brep or geo file. Actual
* implementations may provide additional, more user-friendly
* functions.
*/
class EntityNetworkInterface
{
......@@ -70,10 +74,6 @@ public:
*/
virtual const ShapeMap& intersectionFragmentsMap() const = 0;
/*!
* \brief The map of intersection id to intersecting entity indices.
*/
virtual const ConnectivityMap& intersectionConnectivityMap() const = 0;
private:
int entityDimension_;
......
......@@ -42,8 +42,8 @@
#include <TopoDS.hxx>
#include <frackit/occ/breputilities.hh>
#include <frackit/entitynetwork/entitynetwork.hh>
#include <frackit/entitynetwork/containedentitynetwork.hh>
#include <frackit/entitynetwork/entitynetworkinterface.hh>
#include <frackit/entitynetwork/containedentitynetworkinterface.hh>
namespace Frackit {
......@@ -60,7 +60,7 @@ public:
/*!
* \brief Construction from an entity network.
*/
BRepWriter(const EntityNetwork& network)
BRepWriter(const EntityNetworkInterface& network)
{
if (network.entityDimension() != 2)
throw std::runtime_error("BRepWriter only implemented for 2d networks so far");
......@@ -72,7 +72,7 @@ public:
/*!
* \brief Construction from a contained entity network.
*/
BRepWriter(const ContainedEntityNetwork& network)
BRepWriter(const ContainedEntityNetworkInterface& network)
{
if (network.entityDimension() != 2)
throw std::runtime_error("BRepWriter only implemented for 2d networks so far");
......@@ -124,9 +124,9 @@ private:
* \brief Fill the sub-shape maps with all shapes that describe the network.
* \note This overload is for contained entity networks.
*/
void makeSubShapeMaps_(const ContainedEntityNetwork& network)
void makeSubShapeMaps_(const ContainedEntityNetworkInterface& network)
{
using Iterator = typename ContainedEntityNetwork::ShapeMap::Iterator;
using Iterator = typename ContainedEntityNetworkInterface::ShapeMap::Iterator;
for (Iterator it(network.subDomainFragmentsMap()); it.More(); it.Next())
addSubDomain_(network.entityDimension()+1, it.Key(), it.Value());
......@@ -141,9 +141,9 @@ private:
* \brief Fill the sub-shape maps with all shapes that describe the network.
* \note This overload is for uncontained entity networks.
*/
void makeSubShapeMaps_(const EntityNetwork& network)
void makeSubShapeMaps_(const EntityNetworkInterface& network)
{
using Iterator = typename ContainedEntityNetwork::ShapeMap::Iterator;
using Iterator = typename EntityNetworkInterface::ShapeMap::Iterator;
for (Iterator it(network.entityFragmentsMap()); it.More(); it.Next())
addEntity_(network.entityDimension(), it.Key(), it.Value());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment