25 #ifndef DIALECT_EXPANSION_H 26 #define DIALECT_EXPANSION_H 33 #include "libvpsc/rectangle.h" 36 #include "libdialect/commontypes.h" 37 #include "libdialect/treeplacement.h" 38 #include "libdialect/ortho.h" 143 ExpansionGoal_SP addGoalInDirec(CardinalDir dir);
146 TreePlacement_SP m_tp;
154 unsigned m_goalCounter = 0;
156 ExpansionGoals m_goals;
157 ExpansionGoals m_primaryDimGoals;
158 ExpansionGoals m_secondaryDimGoals;
161 struct ContainedSegment;
162 typedef std::shared_ptr<ContainedSegment> ContainedSegment_SP;
179 ExpansionGoal(
unsigned id, TreePlacement_SP tp, CardinalDir direc,
double padding)
180 : m_id(id), m_tp(tp), m_direc(direc), m_padding(padding) {
183 m_dim = Compass::constDim.at(m_direc);
195 CardinalDir
getDirec(
void)
const {
return m_direc; }
203 ProjSeq_SP
tryExpansionRec(ProjSeq_SP ps0, std::deque<ExpansionGoal_SP> &remainingGoals);
213 TreePlacement_SP m_tp;
221 struct ContainedSegment {
225 double padding, TreePlacement_SP tp,
vpsc::Dim sepDim);
230 double measureShortage(
void)
const;
233 std::string toString(
void)
const;
241 void makeRoomForTreeNode(ProjSeq_SP ps0,
bool doProject =
true);
258 LineSegment localGoalSeg;
260 LineSegment globalGoalSeg;
276 void addSepCoForPtAndNode(
Avoid::Point &pt, Node_SP &node, dimensions nodeDims, SepCoSet &sepcos, Node_SP &treeBox);
282 #endif // DIALECT_EXPANSION_H The ExpansionManager class.
Definition: expansion.h:98
ContainedSegment_SP computeContainedSegment(bool ignoreCollateralTreeBoxes=false)
Compute the contained segment for this goal.
Definition: expansion.cpp:229
double estimateCost(void) const
Estimate the cost of expanding.
Definition: expansion.cpp:104
std::map< CardinalDir, double > estimateCostByDirection(void) const
Estimate the cost of expanding in each cardinal direction.
Definition: expansion.cpp:140
ExpansionGoal(unsigned id, TreePlacement_SP tp, CardinalDir direc, double padding)
Standard constructor.
Definition: expansion.h:179
bool isAxial(vpsc::Dim dim)
Check whether a given dimension is axial w.r.t. this manager's placement.
Definition: expansion.h:110
The ExpansionGoal class.
Definition: expansion.h:170
libdialect: A library for computing human-like orthogonal network (DiAlEcT) layouts.
Definition: cola.h:44
ProjSeq_SP tryExpansionRec(ProjSeq_SP ps0, std::deque< ExpansionGoal_SP > &remainingGoals)
Try to expand, and work recursively, attempting all remaining goals.
Definition: expansion.cpp:290
Contains the interface for various geometry types and classes.
ExpansionManager(TreePlacement_SP tp, vpsc::Dim primaryDim=vpsc::HORIZONTAL, double padding=-1)
Standard constructor.
Definition: expansion.cpp:52
ExpansionGoals getGoals(void)
Access the goals.
Definition: expansion.h:132
bool isTransverse(vpsc::Dim dim)
Check whether a given dimension is transverse w.r.t. this manager's placement.
Definition: expansion.h:113
The Point class defines a point in the plane.
Definition: geomtypes.h:52
std::map< vpsc::Dim, double > estimateCostByDimension2(void) const
Estimate the cost of expanding in each dimension. This method computes the initial separation constra...
Definition: expansion.cpp:117
ProjSeq_SP extendProjSeq(ProjSeq_SP ps0)
Extend a given projection sequence with those projections necessary to achieve all expansion goals of...
Definition: expansion.cpp:186
The x-dimension (0).
Definition: rectangle.h:43
Dim
Indicates the x- or y-dimension.
Definition: rectangle.h:41
std::map< vpsc::Dim, double > estimateCostByDimension(void) const
Estimate the cost of expanding in each dimension. This method looks at the length of contained segmen...
Definition: expansion.cpp:109
CardinalDir getDirec(void) const
Get the direction of the goal.
Definition: expansion.h:195