Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# ShockGraph Class Reference

Represents a shock graph consisting of <SGNode *>'s. More...

`#include <ShockGraph.h>`

Inheritance diagram for ShockGraph:

List of all members.

## Public Methods
int | NodeType (leda_node v) const
int | GetBranchDir (leda_node u, leda_node wrtV) const
| The direction of branch in u with respect to the joint point with v.
sg::DDSkeleton * | ComputeDDSkeleton (const char *szPPMFileName)
| Computes the discrete divergence skeleton of a closed curve in a ppm file.
bool | ComputeSGFromDDSkeleton (sg::DDSkeleton *sk)
| Maps the edges in the DDSkeleton to nodes in a shock graph and copies the shocks' info.
void | LabelEndPoints (SGNode *pNode, sg::FluxPointList &fpl, sg::DDSNode *n1, sg::DDSNode *n2)
| Determines whether the end shock points in the given branch are joints or terminal points.
SGNode * | GroupShockPoints (leda_node u, SGNode *pNode)
| Groups the points according to their type. It aslo computes the derived values for each now, since they will not be further subdevided.
void | ConnectNodes (leda_node u, SGNode *pNode, sg::DDSEdge *e, sg::DDSNode *n)
| Traverses the skeleton and creates a "pre" Shock Graph.
void | RevertEdge (leda_edge pxEdge)
| Revers the direction of an edge and moves all the edges that meet at a junction.
void | DetectLigatureNodes (sg::DDSkeleton *sk)
void | Insert4sAnd2s ()
| Inserts type 4 and type 2 nodes, which are local maxima or minima SINGLE shock points.
void | Relabel3As2or4 (leda_node v)
| Relabels type 3 nodes acting as a 2s or 4s. i.e., a type 3 branch that is a sort of neck between two type 1s of opposite directions.
NODE_LABEL | GetNodeLbl (leda_node v) const
virtual DAG & | operator= (const DAG &rhs)
| Extends the behaviour of the same function in the base class.
virtual void | Clear ()
| It sets to zero all the DAG's member variables.
virtual void | ComputeDerivedValues ()
| Computes the object name and view number from the DAG's label.
virtual double | NodeDistance (leda_node g1Node, const DAG &g2, leda_node g2Node) const
virtual bool | AreNodesRelated (leda_node g1Node, const DAG &g2, leda_node g2Node) const
virtual DAG * | CreateObject () const
| Creates a new shock graph object.
virtual DAGNodePtr | CreateNodeObject (NODE_LABEL lbl) const
| Creates a new shock graph node object.
virtual DAGNodePtr | ReadNode (istream &is) const
virtual String | ClassName () const
| Returns the classs name.
virtual istream & | Read (istream &is, bool bOnlyDataForMatching=false)
| Extends the behaviour of the same function in the base class.
virtual ostream & | Write (ostream &os) const
| Extends the behaviour of the same function in the base class.
virtual void | Print (ostream &os=cout) const
| Extends the behaviour of the same function in the base class.
## Public Attributes
double | area
double | perimeter

## Detailed Description

Represents a shock graph consisting of <SGNode *>'s.

Will be further extended by various local-to-global transformations, etc.

See also:
  DAG, SGNode, DAGNode.

Definition at line 82 of file ShockGraph.h.

## Member Function Documentation

bool ShockGraph::AreNodesRelated | ( | leda_node | u,
|  | const DAG & | from,
|  | leda_node | v
| ) | const`[virtual]`

| Relation function for two Shock Graph nodes. For now, all nodes of the same type are related. Implements DAG. Definition at line 312 of file ShockGraph.cpp.

bool ShockGraph::ComputeSGFromDDSkeleton | ( | sg::DDSkeleton * | sk | ) |

| Maps the edges in the DDSkeleton to nodes in a shock graph and copies the shocks' info. The DDSkeleton has the shock point info stored in the edges of the graph. The endpoint shocks are the nodes in this graph and the edges conect these endpoints. Definition at line 1053 of file ShockGraph.cpp. References ComputeDerivedValues(), ConnectNodes(), Insert4sAnd2s(), SGNode::m_shocks, Relabel3As2or4(), and RevertEdge().

void ShockGraph::DetectLigatureNodes | ( | sg::DDSkeleton * | sk | ) |

| right_t1 and right_t2 parameter values between which the contour segment on the right is. left_t1 and left_t1 parameter values between which the contour segment on the left is. Definition at line 1013 of file ShockGraph.cpp.

void ShockGraph::Insert4sAnd2s | ( |  | ) |

| Inserts type 4 and type 2 nodes, which are local maxima or minima SINGLE shock points. If there are a bunch of type 1 nodes conectd at a point and they have the same direction with respect to the join point, then the joint is either a type 2 or a type 4. Definition at line 843 of file ShockGraph.cpp. References SmartArray< ShockInfo >::AddTail(), SGNode::ComputeDerivedValues(), GetBranchDir(), and SGNode::m_shocks. Referenced by ComputeSGFromDDSkeleton().

void ShockGraph::LabelEndPoints | ( | SGNode * | pNode,
|  | sg::FluxPointList & | fpl,
|  | sg::DDSNode * | n1,
|  | sg::DDSNode * | n2
| ) |

| Determines whether the end shock points in the given branch are joints or terminal points. In general, joint points will be outliers wrt the points in the branch. Definition at line 497 of file ShockGraph.cpp. References SGNode::m_nEndPt0, and SGNode::m_nEndPtN.

double ShockGraph::NodeDistance | ( | leda_node | u,
|  | const DAG & | from,
|  | leda_node | v
| ) | const`[virtual]`

| Calls the appropiate node distance function. Implements DAG. Definition at line 301 of file ShockGraph.cpp. References DistMeasurer::GetDistance().

DAGNodePtr ShockGraph::ReadNode | ( | istream & | is | ) | const`[virtual]`

| Creates a new SGNode and fill its contents with the current information in the stream. Implements DAG. Definition at line 333 of file ShockGraph.cpp.

void ShockGraph::RevertEdge | ( | leda_edge | pxEdge | ) |

| Revers the direction of an edge and moves all the edges that meet at a junction. All the children of a node are linked with each other at a juntion, so when we move a node up, we need to redistribute the relations in the juntion as well. we start with parent->x and check for to cases: parent->x or parent->x->children Definition at line 773 of file ShockGraph.cpp. Referenced by ComputeSGFromDDSkeleton().

## Member Data Documentation

double ShockGraph::area

| The possibly approximate area of the corresponding region. In case of approximation, obtained as the sum of all radii. Definition at line 95 of file ShockGraph.h. Referenced by Clear(), operator=(), Print(), Read(), and Write().

double ShockGraph::perimeter

| The possibly approximate perimeter of the corresponding region. In case of approximation, obtained as the number of skeleton pts. Definition at line 99 of file ShockGraph.h. Referenced by Clear(), operator=(), Print(), Read(), and Write().

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

- ShockGraph.h
- ShockGraph.cpp