Overview     Modules     Class Hierarchy     Classes     Members  

#include <LayoutProperty.h>

Inheritance diagram for tlp::LayoutProperty:
Collaboration diagram for tlp::LayoutProperty:

Public Member Functions

 LayoutProperty (Graph *graph, std::string name="")
PropertyInterfaceclonePrototype (Graph *, const std::string &)
std::string getTypename () const
Coord getMax (Graph *subgraph=NULL)
Coord getMin (Graph *subgraph=NULL)
void translate (const Vec3f &move, Graph *subgraph=NULL)
void translate (const Vec3f &move, Iterator< node > *itNodes, Iterator< edge > *itEdges)
void scale (const Vec3f &scaleFactors, Graph *subgraph=NULL)
void scale (const Vec3f &scaleFactors, Iterator< node > *itNodes, Iterator< edge > *itEdges)
void rotateX (const double &alpha, Graph *subgraph=NULL)
void rotateY (const double &alpha, Graph *subgraph=NULL)
void rotateZ (const double &alpha, Graph *subgraph=NULL)
void rotateX (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
void rotateY (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
void rotateZ (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
void center (Graph *subgraph=NULL)
void center (const Vec3f &newCenter, Graph *subgraph=NULL)
void normalize (Graph *subgraph=NULL)
void perfectAspectRatio ()
double edgeLength (const edge e) const
double averageEdgeLength (const Graph *subgraph=NULL) const
double averageAngularResolution (const Graph *subgraph=NULL) const
double averageAngularResolution (const node n, const Graph *subgraph=NULL) const
std::vector< double > angularResolutions (const node n, const Graph *subgraph=NULL) const
void computeEmbedding (Graph *subgraph=NULL)
void computeEmbedding (const node n, Graph *subgraph=NULL)
unsigned int crossingNumber () const
virtual void setNodeValue (const node, const Coord &v)
virtual void setEdgeValue (const edge, const std::vector< Coord > &v)
virtual void setAllNodeValue (const Coord &v)
virtual void setAllEdgeValue (const std::vector< Coord > &v)
- Public Member Functions inherited from tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >
 AbstractProperty (Graph *, std::string n="")
Tnode::RealType getNodeDefaultValue () const
 Returns the default node value of the property.
Tedge::RealType getEdgeDefaultValue () const
 Returns the default edge value of the property.
tlp::StoredType< typename
Tnode::RealType >
::ReturnedConstValue 
getNodeValue (const node n) const
 Returns the value associated with the node n in this property. If there is no value, it returns the default ndoe value.
tlp::StoredType< typename
Tedge::RealType >
::ReturnedConstValue 
getEdgeValue (const edge e) const
 Returns the value associated to the edge e in this property. If there is no value, it returns the default edge value.
virtual void setNodeValue (const node n, const typename Tnode::RealType &v)
 Sets the value of a node and notify the observers of a modification.
virtual void setEdgeValue (const edge e, const typename Tedge::RealType &v)
 Set the value of an edge and notify the observers of a modification.
virtual void setAllNodeValue (const typename Tnode::RealType &v)
 Sets the value of all nodes and notify the observers.
virtual void setAllEdgeValue (const typename Tedge::RealType &v)
 Sets the value of all edges and notify the observers.
virtual void erase (const node n)
 Resets the value of a node to the default value.
virtual void erase (const edge e)
 Resets the value of an edge to the default value.
virtual AbstractProperty
< Tnode, Tedge, TPROPERTY > & 
operator= (AbstractProperty< Tnode, Tedge, TPROPERTY > &prop)
virtual std::string getNodeDefaultStringValue () const
virtual std::string getEdgeDefaultStringValue () const
virtual std::string getNodeStringValue (const node n) const
virtual std::string getEdgeStringValue (const edge e) const
virtual bool setNodeStringValue (const node inN, const std::string &inV)
virtual bool setEdgeStringValue (const edge inE, const std::string &inV)
virtual bool setAllNodeStringValue (const std::string &inV)
virtual bool setAllEdgeStringValue (const std::string &inV)
virtual tlp::Iterator< node > * getNonDefaultValuatedNodes (const Graph *g=NULL) const
 Returns an iterator on all nodes whose value is different from the default value. When the pointer to the graph is not NULL, only the nodes owned by this graph are returned by the iterator.
virtual tlp::Iterator< edge > * getNonDefaultValuatedEdges (const Graph *g=NULL) const
 Returns an iterator on all edges whose value is different from the default value. When the pointer to the graph is not NULL, only the edges owned by this graph are returned by the iterator.
virtual void copy (const node destination, const node source, PropertyInterface *property, bool ifNotDefault=false)
 Copies the value hold by a property on a node to another node on this property.
virtual void copy (const edge destination, const edge source, PropertyInterface *property, bool ifNotDefault=false)
 Copies the value hold by a property on an edge to another edge on this property.
virtual void copy (PropertyInterface *property)
 Copies the values hold by a property on this property.
virtual DataMemgetNodeDefaultDataMemValue () const
virtual DataMemgetEdgeDefaultDataMemValue () const
virtual DataMemgetNodeDataMemValue (const node n) const
virtual DataMemgetEdgeDataMemValue (const edge e) const
virtual DataMemgetNonDefaultDataMemValue (const node n) const
virtual DataMemgetNonDefaultDataMemValue (const edge e) const
virtual void setNodeDataMemValue (const node n, const DataMem *v)
virtual void setEdgeDataMemValue (const edge e, const DataMem *v)
virtual void setAllNodeDataMemValue (const DataMem *v)
virtual void setAllEdgeDataMemValue (const DataMem *v)
virtual void computeMetaValue (node n, Graph *sg, Graph *mg)
virtual void computeMetaValue (edge e, tlp::Iterator< edge > *itE, Graph *mg)
virtual void setMetaValueCalculator (PropertyInterface::MetaValueCalculator *mvCalc)
int compare (const node n1, const node n2) const
 Default implementation of PropertyInterface::compare(node n1,node n2)
int compare (const edge e1, const edge e2) const
 Default implementation of PropertyInterface::compare(edge e1,edge e2)
- Public Member Functions inherited from tlp::PropertyInterface
virtual ~PropertyInterface ()
const std::string & getName () const
tlp::GraphgetGraph ()
MetaValueCalculatorgetMetaValueCalculator ()
void addPropertyObserver (PropertyObserver *pObs)
void removePropertyObserver (PropertyObserver *pObs)
unsigned int countPropertyObservers () const
- Public Member Functions inherited from tlp::Observable
 Observable ()
_DEPRECATED Observable (bool)
virtual ~Observable ()
tlp::Iterator< Observable * > * getOnlookers () const
 return an Iterator on all Onlookers
tlp::Iterator< Observable * > * getObservables () const
virtual void treatEvents (const std::vector< Event > &events)
virtual void _DEPRECATED update (std::set< Observable * >::iterator, std::set< Observable * >::iterator)
virtual void _DEPRECATED observableDestroyed (Observable *)
virtual void treatEvent (const Event &)
void addObserver (Observable *const obs) const
 use for old observer tulip compatibility
void addListener (Observable *const obs) const
 use for old observer tulip compatibility
void removeOnlooker (const Observable &, OLOEDGETYPE type) const
 remove an Observer/Listener of the observable
void removeObserver (Observable *const obs) const
 use for old observer tulip compatibility
void removeListener (Observable *const obs) const
void _DEPRECATED notifyObservers ()
 use for old observer tulip compatibility
unsigned int countObservers () const
unsigned int countOnLookers () const
unsigned int countListeners () const
bool hasOnlookers () const
 remove all Observer/Listener of the observable
- Public Member Functions inherited from tlp::OLOObject
tlp::node getNode () const
 return the node representing that OLOObject in the OLOGraph
unsigned int getSent () const
 return the number of sent nofication
unsigned int getReceived () const
 return the number of received nofication
- Public Member Functions inherited from tlp::GraphObserver
 GraphObserver ()
virtual ~GraphObserver ()
 GraphObserver (const GraphObserver &)
GraphObserveroperator= (const GraphObserver &)
virtual void addNode (Graph *, const node)
virtual void addEdge (Graph *, const edge)
virtual void beforeSetEnds (Graph *, const edge)
virtual void afterSetEnds (Graph *, const edge)
virtual void delNode (Graph *, const node)
virtual void delEdge (Graph *, const edge)
virtual void reverseEdge (Graph *, const edge)
virtual void destroy (Graph *)
virtual void addSubGraph (Graph *, Graph *)
virtual void delSubGraph (Graph *, Graph *)
virtual void addLocalProperty (Graph *, const std::string &)
virtual void beforeDelLocalProperty (Graph *g, const std::string &pName)
virtual void afterDelLocalProperty (Graph *, const std::string &)
virtual void delLocalProperty (Graph *, const std::string &)
virtual void addInheritedProperty (Graph *, const std::string &)
virtual void beforeDelInheritedProperty (Graph *, const std::string &)
virtual void afterDelInheritedProperty (Graph *, const std::string &)
virtual void beforeSetAttribute (Graph *, const std::string &)
virtual void afterSetAttribute (Graph *, const std::string &)
virtual void removeAttribute (Graph *, const std::string &)

Static Public Attributes

static const std::string propertyTypename

Protected Member Functions

virtual void clone_handler (AbstractProperty< PointType, LineType, LayoutAlgorithm > &)
- Protected Member Functions inherited from tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >
virtual void clone_handler (AbstractProperty< Tnode, Tedge, TPROPERTY > &)
 Enable to clone part of sub_class.
- Protected Member Functions inherited from tlp::PropertyInterface
void notifyBeforeSetNodeValue (const node n)
void notifyAfterSetNodeValue (const node n)
void notifyBeforeSetEdgeValue (const edge e)
void notifyAfterSetEdgeValue (const edge e)
void notifyBeforeSetAllNodeValue ()
void notifyAfterSetAllNodeValue ()
void notifyBeforeSetAllEdgeValue ()
void notifyAfterSetAllEdgeValue ()
void notifyDestroy ()
 use for old observer tulip compatibility
- Protected Member Functions inherited from tlp::Observable
void addOnlooker (const Observable &, OLOEDGETYPE type) const
 add an Observer/Listener to the observable
void sendEvent (const Event &)
 Enable to send an event to all Observer/Listener.
void observableDeleted ()
 Enable to send Event::DELETE before the deletion of subclass internal objects.
- Protected Member Functions inherited from tlp::OLOObject
 OLOObject ()
 OLOObject (const OLOObject &)
virtual ~OLOObject ()
OLOObjectoperator= (const OLOObject &)
tlp::Iterator< tlp::node > * getInObjects () const
 return an iterator on in objects (Observable), the iterator guarantee that all objects are alive (not deleted during hold or notify)
tlp::Iterator< tlp::node > * getOutObjects () const
 return an iterator on out objects (Listener/Observer), the iterator garantee that all objects are alive (not deleted during hold or notify)

Friends

class LayoutAlgorithm

Additional Inherited Members

- Static Public Member Functions inherited from tlp::Observable
static void holdObservers ()
 start delay of events to all Observer
static void unholdObservers ()
 Send queued event to all Observer.
static void _DEPRECATED unholdObservers (bool)
static unsigned int observersHoldCounter ()
- Protected Types inherited from tlp::OLOObject
enum  OLOEDGETYPE { OBSERVABLE = 0x01, OBSERVER = 0x02, LISTENER = 0x04 }
- Protected Attributes inherited from tlp::AbstractProperty< Tnode, Tedge, TPROPERTY >
MutableContainer< typename
Tnode::RealType > 
nodeProperties
MutableContainer< typename
Tedge::RealType > 
edgeProperties
Tnode::RealType nodeDefaultValue
Tedge::RealType edgeDefaultValue

Constructor & Destructor Documentation

tlp::LayoutProperty::LayoutProperty ( Graph graph,
std::string  name = "" 
)

LayoutProperty constructor

Parameters
graphThe graph on wich to attach that layout property
nameThe string identifier of that layout property

Member Function Documentation

std::vector<double> tlp::LayoutProperty::angularResolutions ( const node  n,
const Graph subgraph = NULL 
) const

Returns a vector of all angular resolution of a node. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
nthe graph node on which to compute the angular resolution
subgraphIf not null, only computes the average angular resolution for the node in that sub-graph
double tlp::LayoutProperty::averageAngularResolution ( const Graph subgraph = NULL) const

Returns the average angular resolution of the layout. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
subgraphIt not null, only computes the average angular resolution for that sub-graph
double tlp::LayoutProperty::averageAngularResolution ( const node  n,
const Graph subgraph = NULL 
) const

Returns the average angular resolution of a node. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
nthe graph node on which to compute the angular resolution
subgraphIf not null, only computes the average angular resolution for the node in that sub-graph
double tlp::LayoutProperty::averageEdgeLength ( const Graph subgraph = NULL) const

Returns the average edge length of the layout, the bends are taken into account

Parameters
subgraphIf not null, only compute the average edge length for that sub-graph
void tlp::LayoutProperty::center ( Graph subgraph = NULL)

Centers the layout, meaning translating it in order that the center of its bounding box is (0,0,0)

Parameters
subgraphIf not null, only centers the layout of that sub-graph
void tlp::LayoutProperty::center ( const Vec3f newCenter,
Graph subgraph = NULL 
)

Centers the layout to newCenter, meaning translating it in order that the center of its bounding box is equal to newCenter

Parameters
newCenterthe coordinate of the new layout center
subgraphIf not null, only centers the layout of that sub-graph
virtual void tlp::LayoutProperty::clone_handler ( AbstractProperty< PointType, LineType, LayoutAlgorithm > &  )
protectedvirtual
PropertyInterface* tlp::LayoutProperty::clonePrototype ( Graph ,
const std::string &   
)
virtual

Creates an object of the same real type of the current property, in the the graph (first parameter) with the name (second parameter). Values are not copied.

Implements tlp::PropertyInterface.

void tlp::LayoutProperty::computeEmbedding ( Graph subgraph = NULL)

Fixes embedding of the graph according to the layout ie. sort edges around nodes according to their neighbors/bends position in the layout/ Only works in 2D, the third coordinate is not taken into account.

Parameters
subgraphIt not null, only fixes embedding in that sub-graph
void tlp::LayoutProperty::computeEmbedding ( const node  n,
Graph subgraph = NULL 
)

Fixes embedding of the node according to the layout ie. sort edges around the node according to its neighbors/bends position in the layout/ Only work in 2D, the third coordinate is not taken into account.

Parameters
nthe graph node on which to fix embedding
subgraphIf not null, only fixes the embedding of the node in that sub-graph
unsigned int tlp::LayoutProperty::crossingNumber ( ) const

Returns the number of crossings in the layout

double tlp::LayoutProperty::edgeLength ( const edge  e) const

Returns the length of an edge, the bends are taken into account. Thus, it measure the length of a polyline.

Parameters
ethe graph edge on which to compute its length
Warning
this function only measure the length of the polyline between bends, when using curves like Bézier etc... the result will not be the length of the curve.
Coord tlp::LayoutProperty::getMax ( Graph subgraph = NULL)

Returns the maximum coordinate of the layout, i.e. the top-right corner of the induced bounding box

Parameters
subgraphIf not null, returns the maximum coordinate for a sub-graph layout
Coord tlp::LayoutProperty::getMin ( Graph subgraph = NULL)

Returns the minimum coordinate of the layout, i.e. the bottom-left corner of the induced bounding box

Parameters
subgraphIf not null, returns the minimum coordinate for a sub-graph layout
std::string tlp::LayoutProperty::getTypename ( ) const
inlinevirtual

Returns a string describing the type of the property. i.e. "graph", "double", "layout", "string", "integer", "color", "size", ...

Implements tlp::PropertyInterface.

void tlp::LayoutProperty::normalize ( Graph subgraph = NULL)

Normalizes the layout, meaning dividing each nodes and edges coordinate by the maximum magnitude of the whole coordinates set

Parameters
subgraphIf not null, only normalizes the layout of that sub-graph
void tlp::LayoutProperty::perfectAspectRatio ( )

Scales the layout in order to approach an aspect ratio (width / height) of 1.0 .

void tlp::LayoutProperty::rotateX ( const double &  alpha,
Graph subgraph = NULL 
)

Rotates the layout around the X-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateX ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the X-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::rotateY ( const double &  alpha,
Graph subgraph = NULL 
)

Rotates the layout around the Y-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateY ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the Y-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::rotateZ ( const double &  alpha,
Graph subgraph = NULL 
)

Rotates the layout around the Z-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateZ ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the Z-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::scale ( const Vec3f scaleFactors,
Graph subgraph = NULL 
)

Scales the current layout according to a vector of scale factors (sx, sy, sz).

Parameters
scaleFactorsa vector of scale factors
subgraphIf not null, only scales the layout of that sub-graph
void tlp::LayoutProperty::scale ( const Vec3f scaleFactors,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Scales the layout of a set of nodes and edges provided through iterators according to a vector of scale factors (sx, sy, sz).

Parameters
scaleFactorsa vector of scale factors
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
virtual void tlp::LayoutProperty::setAllEdgeValue ( const std::vector< Coord > &  v)
virtual
virtual void tlp::LayoutProperty::setAllNodeValue ( const Coord v)
virtual
virtual void tlp::LayoutProperty::setEdgeValue ( const edge  ,
const std::vector< Coord > &  v 
)
virtual
virtual void tlp::LayoutProperty::setNodeValue ( const node  ,
const Coord v 
)
virtual
void tlp::LayoutProperty::translate ( const Vec3f move,
Graph subgraph = NULL 
)

Translates the current layout according to a movement vector

Parameters
movea movement vector
subgraphIf not null, only translates the layout of that sub-graph
void tlp::LayoutProperty::translate ( const Vec3f move,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Translates the layout of a set of nodes and edges provided through iterators according to a movement vector

Parameters
movea movement vector
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted

Friends And Related Function Documentation

friend class LayoutAlgorithm
friend

Member Data Documentation

const std::string tlp::LayoutProperty::propertyTypename
static


Tulip Software by LaBRI Visualization Team    2001 - 2012