Public Member Functions | Private Member Functions | Private Attributes | List of all members
SceneModel::TopologyCreator Class Reference

#include <TopologyCreator.h>

Inheritance diagram for SceneModel::TopologyCreator:
Inheritance graph
[legend]

Public Member Functions

std::vector< boost::shared_ptr< Topology > > generateAllConnectedTopologies ()
 
boost::shared_ptr< TopologygenerateFullyMeshedTopology ()
 
std::vector< boost::shared_ptr< Topology > > generateNeighbours (boost::shared_ptr< Topology > pFrom)
 
boost::shared_ptr< TopologygenerateRandomTopology ()
 
std::vector< boost::shared_ptr< Topology > > generateStarTopologies ()
 
 TopologyCreator (const std::vector< std::string > &pAllObjectTypes, unsigned int pMaxNeighbourCount, bool pRemoveRelations, bool pSwapRelations)
 
 ~TopologyCreator ()
 

Private Member Functions

std::vector< std::vector< bool > > calculateNeighbours (std::vector< bool > pFrom)
 
boost::shared_ptr< TopologyconvertBitvectorToTopology (const std::vector< bool > &pBitvector)
 
std::vector< bool > convertTopologyToBitvector (boost::shared_ptr< Topology > pTopology)
 
std::vector< std::vector< bool > > selectRandomNeighbours (std::vector< std::vector< bool >> &pNeighbours)
 

Private Attributes

std::vector< std::string > mAllObjectTypes
 
boost::shared_ptr< ConnectivityCheckermConnectivityChecker
 
unsigned int mMaxNeighbourCount
 
bool mRemoveRelations
 
bool mSwapRelations
 

Detailed Description

Generates different topologies of object graphs.

Definition at line 34 of file TopologyCreator.h.

Constructor & Destructor Documentation

SceneModel::TopologyCreator::TopologyCreator ( const std::vector< std::string > &  pAllObjectTypes,
unsigned int  pMaxNeighbourCount,
bool  pRemoveRelations,
bool  pSwapRelations 
)

Constructor.

Parameters
pAllObjectTypesall object types to appear in the graphs.
pMaxNeighbourCountthe maximum count of neighbours to be created.
pRemoveRelationsWhether to use the removal of relations as an operation when generating neighbours.
pSwapRelationsWhether to use the swapping of relations as an operation when generating neighbours.

Definition at line 24 of file TopologyCreator.cpp.

SceneModel::TopologyCreator::~TopologyCreator ( )

Destructor.

Definition at line 30 of file TopologyCreator.cpp.

Member Function Documentation

std::vector< std::vector< bool > > SceneModel::TopologyCreator::calculateNeighbours ( std::vector< bool >  pFrom)
private

Calculate neighbours of topology represented as bitvector.

Parameters
pFromtopology represented as bitvector for which to create neighbours
Returns
the neighbours created.

Definition at line 269 of file TopologyCreator.cpp.

boost::shared_ptr< Topology > SceneModel::TopologyCreator::convertBitvectorToTopology ( const std::vector< bool > &  pBitvector)
private

Convert bitvector representing the relations into topology and set topology's identifier

Parameters
pBitvectorrepresenting the relations
Returns
Topology representing the same relations

Definition at line 213 of file TopologyCreator.cpp.

std::vector< bool > SceneModel::TopologyCreator::convertTopologyToBitvector ( boost::shared_ptr< Topology pTopology)
private

Convert topology into bitvector reporesenting its realtions.

Parameters
pTopologythe topology to convert
Returns
the bitvector representing the relations of the topology.

Definition at line 245 of file TopologyCreator.cpp.

std::vector< boost::shared_ptr< Topology > > SceneModel::TopologyCreator::generateAllConnectedTopologies ( )
virtual

Generates all connected topologies containing the object types from constructor.

Returns
all connected topologies.

Implements SceneModel::AbstractTopologyCreator.

Definition at line 138 of file TopologyCreator.cpp.

boost::shared_ptr< Topology > SceneModel::TopologyCreator::generateFullyMeshedTopology ( )
virtual

Generates the fully meshed topolgy containing all the object types from constructor.

Returns
the fully meshed topology.

Implements SceneModel::AbstractTopologyCreator.

Definition at line 111 of file TopologyCreator.cpp.

std::vector< boost::shared_ptr< Topology > > SceneModel::TopologyCreator::generateNeighbours ( boost::shared_ptr< Topology pFrom)
virtual

Generates a set of neighbouring topologies from the given one using up to three operations depending on the parameters passed in constructor. Operations are adding, removing and swapping relations.

Parameters
pFromthe topology to generate the neighbours for.
Returns
the set of neighbours of this topology.

Implements SceneModel::AbstractTopologyCreator.

Definition at line 33 of file TopologyCreator.cpp.

boost::shared_ptr< Topology > SceneModel::TopologyCreator::generateRandomTopology ( )
virtual

Generates a random topology containing the object types.

Returns
a random topology.

Implements SceneModel::AbstractTopologyCreator.

Definition at line 119 of file TopologyCreator.cpp.

std::vector< boost::shared_ptr< Topology > > SceneModel::TopologyCreator::generateStarTopologies ( )
virtual

Generates all possible star topologies containing all the object types passed in constructor. A star topology is one where all objects are connected only to a sigle reference object.

Returns
the set of all possible star topologies for the given object types.

Implements SceneModel::AbstractTopologyCreator.

Definition at line 83 of file TopologyCreator.cpp.

std::vector< std::vector< bool > > SceneModel::TopologyCreator::selectRandomNeighbours ( std::vector< std::vector< bool >> &  pNeighbours)
private

Randomly selects mMaxNeighbourCount neighbours from the given set.

Parameters
pNeighboursThe set of neighbours to randomly pick from.
Returns
the neighbours picked randomly.

Definition at line 180 of file TopologyCreator.cpp.

Member Data Documentation

std::vector<std::string> SceneModel::TopologyCreator::mAllObjectTypes
private

The object types the topologies connect through relations.

Definition at line 93 of file TopologyCreator.h.

boost::shared_ptr<ConnectivityChecker> SceneModel::TopologyCreator::mConnectivityChecker
private

The ConnectivityChecker used to check whether topologies are connected.

Definition at line 88 of file TopologyCreator.h.

unsigned int SceneModel::TopologyCreator::mMaxNeighbourCount
private

Maximum amount of neighbours to return.

Definition at line 119 of file TopologyCreator.h.

bool SceneModel::TopologyCreator::mRemoveRelations
private

Whether to use the removal of relations as an operation when generating neighbours.

Definition at line 131 of file TopologyCreator.h.

bool SceneModel::TopologyCreator::mSwapRelations
private

Whether to use the swapping of relations as an operation when generating neighbours.

Definition at line 136 of file TopologyCreator.h.


The documentation for this class was generated from the following files:


asr_relation_graph_generator
Author(s): Meißner Pascal
autogenerated on Fri Nov 15 2019 03:39:19