SlotSide ParallelSlot::slotSide()
{
- if (!this->slotSide_) {
- float y0 = this->slot().bnodes()[0]->y();
- float x0 = this->slot().bnodes()[0]->x();
- float y1 = this->slot().bnodes()[1]->y();
- float x1 = this->slot().bnodes()[1]->x();
- float y3 = this->slot().bnodes()[3]->y();
- float x3 = this->slot().bnodes()[3]->x();
- if (sgn((x1 - x3) * (y0 - y3) - (y1 - y3) * (x0 - x3)) < 0)
- this->slotSide_ = LEFT;
- else
- this->slotSide_ = RIGHT;
- }
return this->slotSide_;
}
SlotType ParallelSlot::slotType()
{
- if (!this->slotType_) {
- float d1 = EDIST(
- this->slot().bnodes()[0],
- this->slot().bnodes()[1]
- );
- float d2 = EDIST(
- this->slot().bnodes()[1],
- this->slot().bnodes()[2]
- );
- if (d1 > d2)
- this->slotType_ = PERPENDICULAR;
- else
- this->slotType_ = PARALLEL;
- }
return this->slotType_;
}
this->DH_ = dh;
}
+void ParallelSlot::setAll()
+{
+ // slot side
+ float y0 = this->slot().bnodes()[0]->y();
+ float x0 = this->slot().bnodes()[0]->x();
+ float y1 = this->slot().bnodes()[1]->y();
+ float x1 = this->slot().bnodes()[1]->x();
+ float y3 = this->slot().bnodes()[3]->y();
+ float x3 = this->slot().bnodes()[3]->x();
+ if (sgn((x1 - x3) * (y0 - y3) - (y1 - y3) * (x0 - x3)) < 0)
+ this->slotSide_ = LEFT;
+ else
+ this->slotSide_ = RIGHT;
+ // slot type
+ float d1 = EDIST(
+ this->slot().bnodes()[0],
+ this->slot().bnodes()[1]
+ );
+ float d2 = EDIST(
+ this->slot().bnodes()[1],
+ this->slot().bnodes()[2]
+ );
+ if (d1 > d2)
+ this->slotType_ = PERPENDICULAR;
+ else
+ this->slotType_ = PARALLEL;
+}
+
// other
void ParallelSlot::fip()
{