From 617d7df3b5826ea43af51eaa9aa2460e4a4c5452 Mon Sep 17 00:00:00 2001 From: srn Date: Mon, 4 Apr 2005 11:42:09 +0000 Subject: [PATCH] Changed vector on structure STextColor --- src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx | 33 +++++++++-------- src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx | 5 ++- .../SALOMEDS_AttributeTextHighlightColor.cxx | 37 ++++++++++--------- .../SALOMEDS_AttributeTextHighlightColor.hxx | 5 ++- 4 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx index 4ee4d88b3..93b159e5e 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor.cxx @@ -18,38 +18,39 @@ SALOMEDS_AttributeTextColor::~SALOMEDS_AttributeTextColor() {} -std::vector SALOMEDS_AttributeTextColor::TextColor() +STextColor SALOMEDS_AttributeTextColor::TextColor() { - std::vector aVector; - int i, aLength; + STextColor aColor; if(_isLocal) { Handle(TColStd_HArray1OfReal) aSeq = Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_local_impl)->TextColor(); - aLength = aSeq->Length(); - for(i=1; i<=aLength; i++) aVector.push_back(aSeq->Value(i)); + aColor.R = aSeq->Value(1); + aColor.G = aSeq->Value(2); + aColor.B = aSeq->Value(3); } else { - SALOMEDS::Color aColor = SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->TextColor(); - aVector.push_back(aColor.R); - aVector.push_back(aColor.G); - aVector.push_back(aColor.B); + SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->TextColor(); + aColor.R = anImplColor.R; + aColor.G = anImplColor.G; + aColor.B = anImplColor.B; } - return aVector; + return aColor; } -void SALOMEDS_AttributeTextColor::SetTextColor(const std::vector& value) +void SALOMEDS_AttributeTextColor::SetTextColor(STextColor value) { CheckLocked(); - int i; if(_isLocal) { Handle(TColStd_HArray1OfReal) aSeq = new TColStd_HArray1OfReal(1, 3); - for(i=0; i<3; i++) aSeq->SetValue(i+1, value[i]); + aSeq->SetValue(1, value.R); + aSeq->SetValue(2, value.G); + aSeq->SetValue(3, value.B); Handle(SALOMEDSImpl_AttributeTextColor)::DownCast(_local_impl)->ChangeArray(aSeq); } else { SALOMEDS::Color aColor; - aColor.R = value[0]; - aColor.G = value[1]; - aColor.B = value[2]; + aColor.R = value.R; + aColor.G = value.G; + aColor.B = value.B; SALOMEDS::AttributeTextColor::_narrow(_corba_impl)->SetTextColor(aColor); } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx b/src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx index 5933ae4fc..fef62ebee 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextColor.hxx @@ -8,6 +8,7 @@ #include "SALOMEDSClient_AttributeTextColor.hxx" #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDSImpl_AttributeTextColor.hxx" +#include "SALOMEDSClient_definitions.hxx" // IDL headers #include @@ -23,8 +24,8 @@ public: SALOMEDS_AttributeTextColor(SALOMEDS::AttributeTextColor_ptr theAttr); ~SALOMEDS_AttributeTextColor(); - virtual std::vector TextColor(); - virtual void SetTextColor(const std::vector& value); + virtual STextColor TextColor(); + virtual void SetTextColor(STextColor value); }; diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx index 644b8835d..cbeab6dbd 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.cxx @@ -18,38 +18,39 @@ SALOMEDS_AttributeTextHighlightColor::~SALOMEDS_AttributeTextHighlightColor() {} -std::vector SALOMEDS_AttributeTextHighlightColor::TextHighlightColor() +STextColor SALOMEDS_AttributeTextHighlightColor::TextHighlightColor() { - std::vector aVector; - int i, aLength; + STextColor aColor; if(_isLocal) { - Handle(TColStd_HArray1OfReal) aSeq = Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_local_impl)->TextHighlightColor(); - aLength = aSeq->Length(); - for(i=1; i<=aLength; i++) aVector.push_back(aSeq->Value(i)); + Handle(TColStd_HArray1OfReal) aSeq; + aSeq = Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_local_impl)->TextHighlightColor(); + aColor.R = aSeq->Value(1); + aColor.G = aSeq->Value(2); + aColor.B = aSeq->Value(3); } else { - SALOMEDS::Color aColor = SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->TextHighlightColor(); - aVector.push_back(aColor.R); - aVector.push_back(aColor.G); - aVector.push_back(aColor.B); + SALOMEDS::Color anImplColor = SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->TextHighlightColor(); + aColor.R = anImplColor.R; + aColor.G = anImplColor.G; + aColor.B = anImplColor.B; } - return aVector; + return aColor; } -void SALOMEDS_AttributeTextHighlightColor::SetTextHighlightColor(const std::vector& value) +void SALOMEDS_AttributeTextHighlightColor::SetTextHighlightColor(STextColor value) { - CheckLocked(); - int i; if(_isLocal) { Handle(TColStd_HArray1OfReal) aSeq = new TColStd_HArray1OfReal(1, 3); - for(i=0; i<3; i++) aSeq->SetValue(i+1, value[i]); + aSeq->SetValue(1, value.R); + aSeq->SetValue(2, value.G); + aSeq->SetValue(3, value.B); Handle(SALOMEDSImpl_AttributeTextHighlightColor)::DownCast(_local_impl)->ChangeArray(aSeq); } else { SALOMEDS::Color aColor; - aColor.R = value[0]; - aColor.G = value[1]; - aColor.B = value[2]; + aColor.R = value.R; + aColor.G = value.G; + aColor.B = value.B; SALOMEDS::AttributeTextHighlightColor::_narrow(_corba_impl)->SetTextHighlightColor(aColor); } } diff --git a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.hxx b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.hxx index 482e3b1e1..df2428696 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTextHighlightColor.hxx @@ -8,6 +8,7 @@ #include "SALOMEDSClient_AttributeTextHighlightColor.hxx" #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDSImpl_AttributeTextHighlightColor.hxx" +#include "SALOMEDSClient_definitions.hxx" // IDL headers #include @@ -23,8 +24,8 @@ public: SALOMEDS_AttributeTextHighlightColor(SALOMEDS::AttributeTextHighlightColor_ptr theAttr); ~SALOMEDS_AttributeTextHighlightColor(); - virtual std::vector TextHighlightColor(); - virtual void SetTextHighlightColor(const std::vector& value); + virtual STextColor TextHighlightColor(); + virtual void SetTextHighlightColor(STextColor value); }; -- 2.39.2