From: abk Date: Mon, 11 Nov 2013 09:04:25 +0000 (+0400) Subject: 0024342: Create non-constant methods ChangeCoord with index parameter in classes... X-Git-Tag: V6_8_0_beta~496 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=db71702d4b2e768c170736dffba9e8cbf98d11ea;p=occt-copy.git 0024342: Create non-constant methods ChangeCoord with index parameter in classes gp_XY and gp_XYZ The methods were created. --- 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