mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 10:08:35 +05:00
Remove dependency on CORBA staff in local geom engine
This commit is contained in:
parent
003f66b535
commit
8990dca3c5
@ -1360,7 +1360,7 @@ void AddObjectColors (int theDocID,
|
|||||||
theScript += aCommand.ToCString();
|
theScript += aCommand.ToCString();
|
||||||
}
|
}
|
||||||
|
|
||||||
SALOMEDS::Color aColor = obj->GetColor();
|
GEOM_Object::Color aColor = obj->GetColor();
|
||||||
if ( aColor.R >= 0 && aColor.G >= 0 && aColor.B >= 0 )
|
if ( aColor.R >= 0 && aColor.G >= 0 && aColor.B >= 0 )
|
||||||
{
|
{
|
||||||
TCollection_AsciiString aCommand( "\n\t" );
|
TCollection_AsciiString aCommand( "\n\t" );
|
||||||
|
@ -328,7 +328,7 @@ char* GEOM_Object::GetName()
|
|||||||
* SetColor
|
* 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();
|
Handle(TDataStd_RealArray) anArray = new TDataStd_RealArray();
|
||||||
anArray->Init( 1, 3 );
|
anArray->Init( 1, 3 );
|
||||||
@ -346,12 +346,12 @@ void GEOM_Object::SetColor(const SALOMEDS::Color& theColor)
|
|||||||
* GetColor
|
* GetColor
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
SALOMEDS::Color GEOM_Object::GetColor()
|
GEOM_Object::Color GEOM_Object::GetColor()
|
||||||
{
|
{
|
||||||
Handle(TDataStd_RealArray) anArray;
|
Handle(TDataStd_RealArray) anArray;
|
||||||
bool isFound = _label.FindChild(COLOR_LABEL).FindAttribute(TDataStd_RealArray::GetID(), 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.R = isFound ? anArray->Value( 1 ) : -1;
|
||||||
aColor.G = isFound ? anArray->Value( 2 ) : -1;
|
aColor.G = isFound ? anArray->Value( 2 ) : -1;
|
||||||
aColor.B = isFound ? anArray->Value( 3 ) : -1;
|
aColor.B = isFound ? anArray->Value( 3 ) : -1;
|
||||||
@ -364,7 +364,7 @@ SALOMEDS::Color GEOM_Object::GetColor()
|
|||||||
* SetAutoColor
|
* SetAutoColor
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
|
void GEOM_Object::SetAutoColor(bool theAutoColor)
|
||||||
{
|
{
|
||||||
TDataStd_Integer::Set(_label.FindChild(AUTO_COLOR_LABEL), (int)theAutoColor);
|
TDataStd_Integer::Set(_label.FindChild(AUTO_COLOR_LABEL), (int)theAutoColor);
|
||||||
}
|
}
|
||||||
@ -374,12 +374,12 @@ void GEOM_Object::SetAutoColor(CORBA::Boolean theAutoColor)
|
|||||||
* GetAutoColor
|
* GetAutoColor
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
CORBA::Boolean GEOM_Object::GetAutoColor()
|
bool GEOM_Object::GetAutoColor()
|
||||||
{
|
{
|
||||||
Handle(TDataStd_Integer) anAutoColor;
|
Handle(TDataStd_Integer) anAutoColor;
|
||||||
if(!_label.FindChild(AUTO_COLOR_LABEL).FindAttribute(TDataStd_Integer::GetID(), anAutoColor)) return false;
|
if(!_label.FindChild(AUTO_COLOR_LABEL).FindAttribute(TDataStd_Integer::GetID(), anAutoColor)) return false;
|
||||||
|
|
||||||
return anAutoColor->Get();
|
return bool(anAutoColor->Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -60,9 +60,6 @@
|
|||||||
#include <Aspect_TypeOfMarker.hxx>
|
#include <Aspect_TypeOfMarker.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "SALOMEconfig.h"
|
|
||||||
#include CORBA_SERVER_HEADER(SALOMEDS)
|
|
||||||
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
|
||||||
|
|
||||||
class Handle_TColStd_HSequenceOfTransient;
|
class Handle_TColStd_HSequenceOfTransient;
|
||||||
class Standard_Transient;
|
class Standard_Transient;
|
||||||
@ -134,6 +131,16 @@ class GEOM_Object : public MMgt_TShared
|
|||||||
{
|
{
|
||||||
friend class GEOM_Engine;
|
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:
|
public:
|
||||||
inline void* operator new(size_t,void* anAddress)
|
inline void* operator new(size_t,void* anAddress)
|
||||||
{
|
{
|
||||||
@ -208,16 +215,16 @@ class GEOM_Object : public MMgt_TShared
|
|||||||
Standard_EXPORT char* GetName();
|
Standard_EXPORT char* GetName();
|
||||||
|
|
||||||
//Sets a color of this GEOM_Object
|
//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
|
//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
|
//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
|
//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
|
//Sets predefined point marker texture
|
||||||
Standard_EXPORT void SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize);
|
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 _ior;
|
||||||
TCollection_AsciiString _parameters;
|
TCollection_AsciiString _parameters;
|
||||||
int _docID;
|
int _docID;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,15 +64,12 @@ salomeinclude_HEADERS = \
|
|||||||
# additional information to compile and link file
|
# additional information to compile and link file
|
||||||
|
|
||||||
libGEOMbasic_la_CPPFLAGS = \
|
libGEOMbasic_la_CPPFLAGS = \
|
||||||
$(CORBA_CXXFLAGS) \
|
|
||||||
$(CORBA_INCLUDES) \
|
|
||||||
$(CAS_CPPFLAGS) \
|
$(CAS_CPPFLAGS) \
|
||||||
$(KERNEL_CXXFLAGS) \
|
$(KERNEL_CXXFLAGS) \
|
||||||
$(BOOST_CPPFLAGS) \
|
$(BOOST_CPPFLAGS) \
|
||||||
-I$(top_builddir)/idl
|
-I$(top_builddir)/idl
|
||||||
|
|
||||||
libGEOMbasic_la_LDFLAGS = \
|
libGEOMbasic_la_LDFLAGS = \
|
||||||
$(CORBA_LIBS) \
|
|
||||||
$(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
|
$(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \
|
||||||
$(STDLIB) \
|
$(STDLIB) \
|
||||||
$(CAS_LDPATH) -lTKXSBase \
|
$(CAS_LDPATH) -lTKXSBase \
|
||||||
|
@ -216,7 +216,11 @@ char* GEOM_Object_i::GetName()
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
void GEOM_Object_i::SetColor(const SALOMEDS::Color& theColor)
|
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()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user