//File gp_Parab2d.lxx #include inline gp_Parab2d::gp_Parab2d () : focalLength(RealLast()) { } inline gp_Parab2d::gp_Parab2d (const gp_Ax22d& A, const Standard_Real Focal) : pos (A), focalLength (Focal) { Standard_ConstructionError_Raise_if(Focal < 0.0,""); } inline gp_Parab2d::gp_Parab2d (const gp_Ax2d& MirrorAxis, const Standard_Real Focal, const Standard_Boolean Sense) : focalLength (Focal) { pos = gp_Ax22d(MirrorAxis,Sense); Standard_ConstructionError_Raise_if(Focal < 0.0,""); } inline void gp_Parab2d::SetFocal (const Standard_Real Focal) { Standard_ConstructionError_Raise_if(Focal < 0.0,""); focalLength = Focal; } inline void gp_Parab2d::SetLocation (const gp_Pnt2d& P) { pos.SetLocation(P); } inline void gp_Parab2d::SetMirrorAxis (const gp_Ax2d& A) { pos.SetXAxis(A); } inline void gp_Parab2d::SetAxis (const gp_Ax22d& A) { pos.SetAxis(A); } inline gp_Ax2d gp_Parab2d::Directrix() const { gp_Pnt2d P (pos.Location().X() - focalLength * pos.XDirection().X(), pos.Location().Y() - focalLength * pos.XDirection().Y() ); gp_Dir2d V (pos.YDirection().Reversed()); return gp_Ax2d (P, V); } inline Standard_Real gp_Parab2d::Focal() const { return focalLength; } inline gp_Pnt2d gp_Parab2d::Focus() const { return gp_Pnt2d (pos.Location().X() + focalLength * pos.XDirection().X(), pos.Location().Y() + focalLength * pos.XDirection().Y()); } inline gp_Pnt2d gp_Parab2d::Location () const { return pos.Location(); } inline gp_Ax2d gp_Parab2d::MirrorAxis () const { return pos.XAxis(); } inline gp_Ax22d gp_Parab2d::Axis () const { return pos; } inline Standard_Real gp_Parab2d::Parameter() const { return 2.0 * focalLength; } inline void gp_Parab2d::Reverse() { gp_Dir2d Temp = pos.YDirection (); Temp.Reverse (); pos.SetAxis(gp_Ax22d(pos.Location(),pos.XDirection(),Temp)); } inline gp_Parab2d gp_Parab2d::Reversed() const { gp_Parab2d P = *this; gp_Dir2d Temp = pos.YDirection (); Temp.Reverse (); P.pos.SetAxis(gp_Ax22d(pos.Location(),pos.XDirection(),Temp)); return P; } inline Standard_Boolean gp_Parab2d::IsDirect() const { return (pos.XDirection().Crossed(pos.YDirection())) >= 0.0; } inline void gp_Parab2d::Rotate (const gp_Pnt2d& P, const Standard_Real Ang) {pos.Rotate (P, Ang);} inline gp_Parab2d gp_Parab2d::Rotated (const gp_Pnt2d& P, const Standard_Real Ang) const { gp_Parab2d Prb = *this; Prb.pos.Rotate (P, Ang); return Prb; } inline void gp_Parab2d::Scale (const gp_Pnt2d& P, const Standard_Real S) { focalLength *= S; if (focalLength < 0) focalLength = - focalLength; pos.Scale (P, S); } inline gp_Parab2d gp_Parab2d::Scaled (const gp_Pnt2d& P, const Standard_Real S) const { gp_Parab2d Prb = *this; Prb.focalLength *= S; if (Prb.focalLength < 0) Prb.focalLength = - Prb.focalLength; Prb.pos.Scale (P, S); return Prb; } inline void gp_Parab2d::Transform (const gp_Trsf2d& T) { focalLength *= T.ScaleFactor(); if (focalLength < 0) focalLength = - focalLength; pos.Transform (T); } inline gp_Parab2d gp_Parab2d::Transformed (const gp_Trsf2d& T) const { gp_Parab2d Prb = *this; Prb.focalLength *= T.ScaleFactor(); if (Prb.focalLength < 0) Prb.focalLength = - Prb.focalLength; Prb.pos.Transform (T); return Prb; } inline void gp_Parab2d::Translate (const gp_Vec2d& V) { pos.Translate (V); } inline gp_Parab2d gp_Parab2d::Translated (const gp_Vec2d& V) const { gp_Parab2d Prb = *this; Prb.pos.Translate(V); return Prb; } inline void gp_Parab2d::Translate (const gp_Pnt2d& P1, const gp_Pnt2d& P2) { pos.Translate (P1, P2); } inline gp_Parab2d gp_Parab2d::Translated (const gp_Pnt2d& P1, const gp_Pnt2d& P2) const { gp_Parab2d Prb = *this; Prb.pos.Translate (P1, P2); return Prb; }