diff --git a/src/gp/gp_XY.cdl b/src/gp/gp_XY.cdl index f3331e0a15..800c10d1aa 100644 --- a/src/gp/gp_XY.cdl +++ b/src/gp/gp_XY.cdl @@ -70,6 +70,11 @@ is raises OutOfRange is static; + ChangeCoord (me: in out; theIndex : Integer) returns Real + ---C++: inline + ---C++: return & + raises OutOfRange; + Coord (me; X, Y : out Real) is static; ---C++: inline ---Purpose: For this number pair, returns its coordinates X and Y. diff --git a/src/gp/gp_XY.lxx b/src/gp/gp_XY.lxx index 32183e95ab..460bbb638c 100644 --- a/src/gp/gp_XY.lxx +++ b/src/gp/gp_XY.lxx @@ -47,6 +47,12 @@ inline Standard_Real gp_XY::Coord (const Standard_Integer i) const return (&x)[i-1]; } +inline Standard_Real& gp_XY::ChangeCoord (const Standard_Integer theIndex) +{ + Standard_OutOfRange_Raise_if(theIndex < 1 || theIndex > 2,NULL); + return (&x)[theIndex - 1]; +} + inline void gp_XY::Coord (Standard_Real& X, Standard_Real& Y) const { X = x; Y = y; } diff --git a/src/gp/gp_XYZ.cdl b/src/gp/gp_XYZ.cdl index 8e40c31a45..a775fdb70a 100644 --- a/src/gp/gp_XYZ.cdl +++ b/src/gp/gp_XYZ.cdl @@ -78,6 +78,12 @@ is raises OutOfRange is static; + ChangeCoord (me: in out; theIndex : Integer) returns Real + ---C++: inline + ---C++: return & + raises OutOfRange; + + Coord (me; X, Y, Z : out Real) is static; ---C++: inline --Purpose: For this XYZ object, returns: diff --git a/src/gp/gp_XYZ.lxx b/src/gp/gp_XYZ.lxx index b060336abf..9a9ed2a754 100644 --- a/src/gp/gp_XYZ.lxx +++ b/src/gp/gp_XYZ.lxx @@ -50,6 +50,12 @@ inline Standard_Real gp_XYZ::Coord (const Standard_Integer i) const { return (&x)[i-1]; } +inline Standard_Real& gp_XYZ::ChangeCoord(const Standard_Integer theIndex) +{ + Standard_OutOfRange_Raise_if(theIndex < 1 || theIndex > 3,NULL); + return (&x)[theIndex - 1]; +} + inline void gp_XYZ::Coord (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const