#include <tabvector.h>
List of all members.
Detailed Description
Definition at line 69 of file tabvector.h.
Constructor & Destructor Documentation
tesseract::TabConstraint::TabConstraint |
( |
| ) |
|
|
inline |
Member Function Documentation
void tesseract::TabConstraint::ApplyConstraints |
( |
TabConstraint_LIST * |
constraints | ) |
|
|
static |
Definition at line 120 of file tabvector.cpp.
{
GetConstraints(constraints, &y_min, &y_max);
int y = (y_min + y_max) / 2;
TabConstraint_IT it(constraints);
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
TabVector* v = constraint->vector_;
if (constraint->is_top_) {
v->SetYEnd(y);
v->set_top_constraints(
NULL);
} else {
v->SetYStart(y);
v->set_bottom_constraints(
NULL);
}
}
delete constraints;
}
bool tesseract::TabConstraint::CompatibleConstraints |
( |
TabConstraint_LIST * |
list1, |
|
|
TabConstraint_LIST * |
list2 |
|
) |
| |
|
static |
Definition at line 79 of file tabvector.cpp.
{
if (list1 == list2)
return false;
tprintf(
"Testing constraint compatibility\n");
GetConstraints(list1, &y_min, &y_max);
GetConstraints(list2, &y_min, &y_max);
tprintf(
"Resulting range = [%d,%d]\n", y_min, y_max);
return y_max >= y_min;
}
void tesseract::TabConstraint::CreateConstraint |
( |
TabVector * |
vector, |
|
|
bool |
is_top |
|
) |
| |
|
static |
Definition at line 67 of file tabvector.cpp.
{
TabConstraint_LIST* constraints = new TabConstraint_LIST;
TabConstraint_IT it(constraints);
it.add_to_end(constraint);
if (is_top)
vector->set_top_constraints(constraints);
else
vector->set_bottom_constraints(constraints);
}
void tesseract::TabConstraint::MergeConstraints |
( |
TabConstraint_LIST * |
list1, |
|
|
TabConstraint_LIST * |
list2 |
|
) |
| |
|
static |
Definition at line 96 of file tabvector.cpp.
{
if (list1 == list2)
return;
TabConstraint_IT it(list2);
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
constraint->vector_->Print("Merge");
if (constraint->is_top_)
constraint->vector_->set_top_constraints(list1);
else
constraint->vector_->set_bottom_constraints(list1);
}
it = list1;
it.add_list_before(list2);
delete list2;
}
The documentation for this class was generated from the following files: