#include <tabvector.h>
Definition at line 70 of file tabvector.h.
◆ TabConstraint()
tesseract::TabConstraint::TabConstraint |
( |
| ) |
|
|
default |
◆ ApplyConstraints()
void tesseract::TabConstraint::ApplyConstraints |
( |
TabConstraint_LIST * |
constraints | ) |
|
|
static |
Definition at line 116 of file tabvector.cpp.
117 int y_min = -INT32_MAX;
118 int y_max = INT32_MAX;
119 GetConstraints(constraints, &y_min, &y_max);
120 int y = (y_min + y_max) / 2;
121 TabConstraint_IT it(constraints);
122 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
124 TabVector* v = constraint->vector_;
125 if (constraint->is_top_) {
127 v->set_top_constraints(
nullptr);
130 v->set_bottom_constraints(
nullptr);
◆ CompatibleConstraints()
bool tesseract::TabConstraint::CompatibleConstraints |
( |
TabConstraint_LIST * |
list1, |
|
|
TabConstraint_LIST * |
list2 |
|
) |
| |
|
static |
Definition at line 75 of file tabvector.cpp.
79 int y_min = -INT32_MAX;
80 int y_max = INT32_MAX;
82 tprintf(
"Testing constraint compatibility\n");
83 GetConstraints(list1, &y_min, &y_max);
84 GetConstraints(list2, &y_min, &y_max);
86 tprintf(
"Resulting range = [%d,%d]\n", y_min, y_max);
87 return y_max >= y_min;
◆ CreateConstraint()
void tesseract::TabConstraint::CreateConstraint |
( |
TabVector * |
vector, |
|
|
bool |
is_top |
|
) |
| |
|
static |
Definition at line 63 of file tabvector.cpp.
65 auto* constraints =
new TabConstraint_LIST;
66 TabConstraint_IT it(constraints);
67 it.add_to_end(constraint);
69 vector->set_top_constraints(constraints);
71 vector->set_bottom_constraints(constraints);
◆ MergeConstraints()
void tesseract::TabConstraint::MergeConstraints |
( |
TabConstraint_LIST * |
list1, |
|
|
TabConstraint_LIST * |
list2 |
|
) |
| |
|
static |
Definition at line 92 of file tabvector.cpp.
96 TabConstraint_IT it(list2);
98 tprintf(
"Merging constraints\n");
100 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
103 constraint->vector_->Print(
"Merge");
104 if (constraint->is_top_)
105 constraint->vector_->set_top_constraints(list1);
107 constraint->vector_->set_bottom_constraints(list1);
110 it.add_list_before(list2);
The documentation for this class was generated from the following files: