Remove dependency on CORBA staff in local geom engine

This commit is contained in:
vsr 2011-01-27 15:19:55 +00:00
parent 003f66b535
commit 8990dca3c5
5 changed files with 34 additions and 20 deletions

View File

@ -1360,7 +1360,7 @@ void AddObjectColors (int theDocID,
theScript += aCommand.ToCString();
}
SALOMEDS::Color aColor = obj->GetColor();
GEOM_Object::Color aColor = obj->GetColor();
if ( aColor.R >= 0 && aColor.G >= 0 && aColor.B >= 0 )
{
TCollection_AsciiString aCommand( "\n\t" );

View File

@ -328,7 +328,7 @@ char* GEOM_Object::GetName()
* SetColor
*/
//=============================================================================
void GEOM_Object::SetColor(const SALOMEDS::Color& theColor)
void GEOM_Object::SetColor(const GEOM_Object::Color& theColor)
{
Handle(TDataStd_RealArray) anArray = new TDataStd_RealArray();
anArray->Init( 1, 3 );
@ -346,12 +346,12 @@ void GEOM_Object::SetColor(const SALOMEDS::Color& theColor)
* GetColor
*/
//=============================================================================
SALOMEDS::Color GEOM_Object::GetColor()
GEOM_Object::Color GEOM_Object::GetColor()
{
Handle(TDataStd_RealArray) anArray;
bool isFound = _label.FindChild(COLOR_LABEL).FindAttribute(TDataStd_RealArray::GetID(), anArray);
SALOMEDS::Color aColor;
GEOM_Object::Color aColor;
aColor.R = isFound ? anArray->Value( 1 ) : -1;
aColor.G = isFound ? anArray->Value( 2 ) : -1;
aColor.B = isFound ? anArray->Value( 3 ) : -1;
@ -364,7 +364,7 @@ SALOMEDS::Color GEOM_Object::GetColor()
* SetAutoColor
*/
//=============================================================================
void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
void GEOM_Object::SetAutoColor(bool theAutoColor)
{
TDataStd_Integer::Set(_label.FindChild(AUTO_COLOR_LABEL), (int)theAutoColor);
}
@ -374,12 +374,12 @@ void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
* GetAutoColor
*/
//=============================================================================
CORBA::Boolean GEOM_Object::GetAutoColor()
bool GEOM_Object::GetAutoColor()
{
Handle(TDataStd_Integer) anAutoColor;
if(!_label.FindChild(AUTO_COLOR_LABEL).FindAttribute(TDataStd_Integer::GetID(), anAutoColor)) return false;
return anAutoColor->Get();
return bool(anAutoColor->Get());
}
//=============================================================================

View File

@ -60,9 +60,6 @@
#include <Aspect_TypeOfMarker.hxx>
#endif
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
class Handle_TColStd_HSequenceOfTransient;
class Standard_Transient;
@ -134,6 +131,16 @@ class GEOM_Object : public MMgt_TShared
{
friend class GEOM_Engine;
public:
struct Color {
//! Red component of the color
double R;
//! Green component of the color
double G;
//! Blue component of the color
double B;
};
public:
inline void* operator new(size_t,void* anAddress)
{
@ -208,16 +215,16 @@ class GEOM_Object : public MMgt_TShared
Standard_EXPORT char* GetName();
//Sets a color of this GEOM_Object
Standard_EXPORT void SetColor(const SALOMEDS::Color& theColor);
Standard_EXPORT void SetColor(const Color& theColor);
//Returns a color of this GEOM_Object
Standard_EXPORT SALOMEDS::Color GetColor();
Standard_EXPORT Color GetColor();
//Toggles an auto color mode on this GEOM_Object
Standard_EXPORT void SetAutoColor(CORBA::Boolean theAutoColor);
Standard_EXPORT void SetAutoColor(bool theAutoColor);
//Returns a flag of auto color mode of this GEOM_Object
Standard_EXPORT CORBA::Boolean GetAutoColor();
Standard_EXPORT bool GetAutoColor();
//Sets predefined point marker texture
Standard_EXPORT void SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize);
@ -302,6 +309,8 @@ class GEOM_Object : public MMgt_TShared
TCollection_AsciiString _ior;
TCollection_AsciiString _parameters;
int _docID;
};
#endif

View File

@ -64,15 +64,12 @@ salomeinclude_HEADERS = \
# additional information to compile and link file
libGEOMbasic_la_CPPFLAGS = \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
$(CAS_CPPFLAGS) \
$(KERNEL_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
-I$(top_builddir)/idl
libGEOMbasic_la_LDFLAGS = \
$(CORBA_LIBS) \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
$(STDLIB) \
$(CAS_LDPATH) -lTKXSBase \

View File

@ -216,7 +216,11 @@ char* GEOM_Object_i::GetName()
//=============================================================================
void GEOM_Object_i::SetColor(const SALOMEDS::Color& theColor)
{
_impl->SetColor(theColor);
::GEOM_Object::Color aColor;
aColor.R = theColor.R;
aColor.G = theColor.G;
aColor.B = theColor.B;
_impl->SetColor(aColor);
}
@ -227,7 +231,11 @@ void GEOM_Object_i::SetColor(const SALOMEDS::Color& theColor)
//=============================================================================
SALOMEDS::Color GEOM_Object_i::GetColor()
{
return _impl->GetColor();
SALOMEDS::Color aColor;
aColor.R = _impl->GetColor().R;
aColor.G = _impl->GetColor().G;
aColor.B = _impl->GetColor().B;
return aColor;
}