ReadFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rdf::PixelGraph Class Reference

Represents a pixel graph. This class comes in handy if you want to map pixel edges with pixels. More...

#include <PixelSet.h>

Inheritance diagram for rdf::PixelGraph:
Collaboration diagram for rdf::PixelGraph:

Public Member Functions

 PixelGraph ()
 
 PixelGraph (const QVector< QSharedPointer< Pixel > > &set)
 
bool isEmpty () const
 
void draw (QPainter &p) const
 
void connect (const PixelConnector &connector=DelauneyPixelConnector())
 
QSharedPointer< PixelSetset () const
 
QVector< QSharedPointer
< PixelEdge > > 
edges (const QString &pixelID) const
 Returns all edges connected to the pixel with ID pixelID. More...
 
QVector< QSharedPointer
< PixelEdge > > 
edges (const QVector< int > &edgeIDs) const
 Returns a vector with all edges in the ID vector edgeIDs. More...
 
QVector< QSharedPointer
< PixelEdge > > 
edges () const
 Returns all pixel edges which were found using Delauney triangulation. More...
 
int pixelIndex (const QString &pixelID) const
 Maps pixel IDs (pixel->id()) to their current vector index. More...
 
QVector< int > edgeIndexes (const QString &pixelID) const
 Returns all edges indexes of the current pixel. Each pixel has N edges in the graph. This function returns a vector with all edge indexes of the current pixel. The edge objects can then be retreived using edges()[idx]. More...
 
- Public Member Functions inherited from rdf::BaseElement
 BaseElement (const QString &id=QString())
 This class keeps an ID to keep track of transformed elements during a processing chain. You can e.g. generate Pixel elements from MserBlobs. After filtering, processing etc. you can map back to the (pixel accurate) MserBlob using this ID. More...
 
QString id () const
 Returns the elment's id. More...
 

Protected Attributes

QSharedPointer< PixelSetmSet
 
QVector< QSharedPointer
< PixelEdge > > 
mEdges
 
QMap< QString, int > mPixelLookup
 
QMap< QString, QVector< int > > mPixelEdges
 
- Protected Attributes inherited from rdf::BaseElement
QString mId
 

Detailed Description

Represents a pixel graph. This class comes in handy if you want to map pixel edges with pixels.

See Also
BaseElement

Constructor & Destructor Documentation

rdf::PixelGraph::PixelGraph ( )
rdf::PixelGraph::PixelGraph ( const QVector< QSharedPointer< Pixel > > &  set)

Member Function Documentation

void rdf::PixelGraph::connect ( const PixelConnector connector = DelauneyPixelConnector())
void rdf::PixelGraph::draw ( QPainter &  p) const
QVector< int > rdf::PixelGraph::edgeIndexes ( const QString &  pixelID) const

Returns all edges indexes of the current pixel. Each pixel has N edges in the graph. This function returns a vector with all edge indexes of the current pixel. The edge objects can then be retreived using edges()[idx].

Parameters
pixelIDUnique pixel ID.
Returns
A vector with edge indexes.
QVector< QSharedPointer< PixelEdge > > rdf::PixelGraph::edges ( const QString &  pixelID) const

Returns all edges connected to the pixel with ID pixelID.

Parameters
pixelIDThe pixel identifier.
Returns
QVector< QSharedPointer< PixelEdge > > rdf::PixelGraph::edges ( const QVector< int > &  edgeIDs) const

Returns a vector with all edges in the ID vector edgeIDs.

Parameters
edgeIDsThe edge IDs.
Returns
QVector< QSharedPointer< PixelEdge > > rdf::PixelGraph::edges ( ) const

Returns all pixel edges which were found using Delauney triangulation.

Returns
A vector of PixelEdges which connect 2 pixels each.
bool rdf::PixelGraph::isEmpty ( ) const
int rdf::PixelGraph::pixelIndex ( const QString &  pixelID) const

Maps pixel IDs (pixel->id()) to their current vector index.

Parameters
pixelIDThe unique ID of a pixel.
Returns
The current vector position.
QSharedPointer< PixelSet > rdf::PixelGraph::set ( ) const

Member Data Documentation

QVector<QSharedPointer<PixelEdge> > rdf::PixelGraph::mEdges
protected
QMap<QString, QVector<int> > rdf::PixelGraph::mPixelEdges
protected
QMap<QString, int> rdf::PixelGraph::mPixelLookup
protected
QSharedPointer<PixelSet> rdf::PixelGraph::mSet
protected

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