Graphviz 12.1.0~dev.20240716.1117
Loading...
Searching...
No Matches
generate-constraints.cpp File Reference
#include <algorithm>
#include <set>
#include <cassert>
#include <cstdlib>
#include <memory>
#include <vector>
#include <vpsc/generate-constraints.h>
#include <vpsc/constraint.h>
Include dependency graph for generate-constraints.cpp:

Go to the source code of this file.

Data Structures

struct  Event
 

Enumerations

enum  EventType { Open , Close }
 

Functions

std::ostream & operator<< (std::ostream &os, const Rectangle &r)
 
static NodeSet getLeftNeighbours (NodeSet &scanline, Node *v)
 
static NodeSet getRightNeighbours (NodeSet &scanline, Node *v)
 
static bool compare_events (const Event &ea, const Event &eb)
 
int generateXConstraints (const vector< Rectangle > &rs, Variable **vars, Constraint **&cs, const bool useNeighbourLists)
 
int generateYConstraints (const vector< Rectangle > &rs, Variable **vars, Constraint **&cs)
 

Enumeration Type Documentation

◆ EventType

enum EventType
Enumerator
Open 
Close 

Definition at line 116 of file generate-constraints.cpp.

Function Documentation

◆ compare_events()

static bool compare_events ( const Event ea,
const Event eb 
)
static

Definition at line 125 of file generate-constraints.cpp.

References Open, Event::pos, Event::type, and Event::v.

Referenced by generateXConstraints(), and generateYConstraints().

Here is the caller graph for this function:

◆ generateXConstraints()

int generateXConstraints ( const vector< Rectangle > &  rs,
Variable **  vars,
Constraint **&  cs,
const bool  useNeighbourLists 
)

Prepares constraints in order to apply VPSC horizontally. Assumes variables have already been created. useNeighbourLists determines whether or not a heuristic is used to deciding whether to resolve all overlap in the x pass, or leave some overlaps for the y pass.

Definition at line 144 of file generate-constraints.cpp.

References Close, compare_events(), Variable::desiredPosition, getLeftNeighbours(), getRightNeighbours(), Open, and Rectangle::width().

Referenced by genXConstraints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateYConstraints()

int generateYConstraints ( const vector< Rectangle > &  rs,
Variable **  vars,
Constraint **&  cs 
)

Prepares constraints in order to apply VPSC vertically to remove ALL overlap.

Definition at line 221 of file generate-constraints.cpp.

References Close, compare_events(), Variable::desiredPosition, Rectangle::height(), and Open.

Referenced by genYConstraints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLeftNeighbours()

static NodeSet getLeftNeighbours ( NodeSet &  scanline,
Node v 
)
static

Definition at line 85 of file generate-constraints.cpp.

Referenced by generateXConstraints().

Here is the caller graph for this function:

◆ getRightNeighbours()

static NodeSet getRightNeighbours ( NodeSet &  scanline,
Node v 
)
static

Definition at line 100 of file generate-constraints.cpp.

Referenced by generateXConstraints().

Here is the caller graph for this function:

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Rectangle r 
)

Definition at line 31 of file generate-constraints.cpp.