Read@CVL
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 Types

enum  SortMode {
  sort_none, sort_edges, sort_line_edges, sort_distance,
  sort_end
}
 

Public Member Functions

 PixelGraph ()
 
 PixelGraph (const PixelSet &set)
 
bool isEmpty () const
 
void draw (QPainter &p, const PixelDistance::EdgeWeightFunction *weightFnc=0, double dynamicRange=1.0) const
 
void connect (const PixelConnector &connector=DelaunayPixelConnector(), const SortMode &sort=sort_none)
 
PixelSet set () 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 Delaunay 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...
 
void setId (const QString &id)
 Sets the (preferably unique) ID. If no ID is set, a unqiue ID is generated and assigned. More...
 
QString id () const
 Returns the elment's id. More...
 
virtual QString toString () const
 
virtual void scale (double factor)
 

Protected Attributes

PixelSet mSet
 
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

Member Enumeration Documentation

Enumerator
sort_none 
sort_edges 
sort_line_edges 
sort_distance 
sort_end 

Constructor & Destructor Documentation

rdf::PixelGraph::PixelGraph ( )
rdf::PixelGraph::PixelGraph ( const PixelSet set)

Member Function Documentation

void rdf::PixelGraph::connect ( const PixelConnector connector = DelaunayPixelConnector(),
const SortMode sort = sort_none 
)
void rdf::PixelGraph::draw ( QPainter &  p,
const PixelDistance::EdgeWeightFunction weightFnc = 0,
double  dynamicRange = 1.0 
) 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 Delaunay 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.
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
PixelSet rdf::PixelGraph::mSet
protected

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