ColorMap aColorMap;
for (aGroupsIter = theGroups.begin(); aGroupsIter != theGroups.end(); aGroupsIter++)
{
- SALOMEDS::Color aColor = (*aGroupsIter)->GetColor();
+ Quantity_Color aQColor = (*aGroupsIter)->GetColor();
+ SALOMEDS::Color aColor;
+ aColor.R = aQColor.Red();
+ aColor.G = aQColor.Green();
+ aColor.B = aQColor.Blue();
bool isFound = false;
for (ColorMap::iterator aColorIter = aColorMap.begin(); aColorIter != aColorMap.end(); aColorIter++)
ColorMap::const_iterator aColorIter = theColorMap.begin();
for (; aColorIter != theColorMap.end(); aColorIter++)
{
+ Quantity_Color aGroupQColor = theGroup->GetColor();
+ SALOMEDS::Color aGroupColor;
+ aGroupColor.R = aGroupQColor.Red();
+ aGroupColor.G = aGroupQColor.Green();
+ aGroupColor.B = aGroupQColor.Blue();
+
SALOMEDS::Color aColor = aColorIter->second;
- if( CompareColors( theGroup->GetColor(), aColor ) )
+ if( CompareColors( aGroupColor, aColor ) )
{
myGroupAttributVal = aColorIter->first;
break;
#include <boost/shared_ptr.hpp>
#include <set>
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(SALOMEDS)
+#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+
#define REST_NODES_FAMILY 1
#define REST_EDGES_FAMILY -1
#define REST_FACES_FAMILY -2
$(GEOM_CXX_FLAGS) \
$(BOOST_CPPFLAGS) \
$(CAS_CPPFLAGS) \
- $(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
@HDF5_INCLUDES@ \
-I$(srcdir)/../Controls \
-I$(srcdir)/../Driver \
#include <string>
#include <TopoDS_Shape.hxx>
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
class SMESHDS_GroupBase;
class SMESH_Mesh;
SMESHDS_GroupBase * GetGroupDS () { return myGroupDS; }
- void SetColor (const SALOMEDS::Color& theColor) { myColor = theColor; }
- SALOMEDS::Color GetColor() const { return myColor; }
-
private:
SMESH_Group (const SMESH_Group& theOther);
// prohibited copy constructor
SMESHDS_GroupBase * myGroupDS;
std::string myName;
- int myColorNumber;
- SALOMEDS::Color myColor;
};
#endif
libSMESHDS_la_CPPFLAGS = \
$(KERNEL_CXXFLAGS) \
$(CAS_CPPFLAGS) \
- $(CORBA_CXXFLAGS) \
- $(CORBA_INCLUDES) \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../SMDS
myID(theID), myMesh(theMesh), myType(theType), myStoreName(""),
myCurIndex(0), myCurID(-1)
{
- myColor.R = 0.f;
- myColor.G = 0.f;
- myColor.B = 0.f;
+ myColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB );
}
//=============================================================================
{
myType = theType;
}
+
+//=======================================================================
+//function : SetType
+//purpose :
+//=======================================================================
+
+void SMESHDS_GroupBase::SetColorGroup(int theColorGroup)
+{
+ if( theColorGroup < 0 || theColorGroup > 360 )
+ {
+ MESSAGE("SMESHDS_GroupBase::SetColorGroup : Value must be in range [0,360]");
+ return;
+ }
+
+ Quantity_Color aColor( (double)theColorGroup, 1.0, 1.0, Quantity_TOC_HLS );
+ SetColor( aColor );
+}
+
+//=======================================================================
+//function : SetType
+//purpose :
+//=======================================================================
+
+int SMESHDS_GroupBase::GetColorGroup() const
+{
+ Quantity_Color aColor = GetColor();
+ double aHue = aColor.Hue();
+ if( aHue < 0 )
+ return 0;
+ return (int)( aHue );
+}
+
#include <string>
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_MeshElement.hxx"
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
+#include <Quantity_Color.hxx>
+
class SMESHDS_Mesh;
class SMESHDS_EXPORT SMESHDS_GroupBase
virtual ~SMESHDS_GroupBase() {}
- void SetColor (const SALOMEDS::Color& theColor)
+ void SetColor (const Quantity_Color& theColor)
{ myColor = theColor;}
- SALOMEDS::Color GetColor() const
+ Quantity_Color GetColor() const
{ return myColor;}
+
+ void SetColorGroup (int theColorGroup);
+
+ int GetColorGroup() const;
protected:
const SMDS_MeshElement* findInMesh (const int theID) const;
int myCurIndex;
int myCurID;
SMDS_ElemIteratorPtr myIterator;
- SALOMEDS::Color myColor;
+ Quantity_Color myColor;
};
#endif
double* anRGB = new double[ size ];
aDataset->ReadFromDisk( anRGB );
aDataset->CloseOnDisk();
- SALOMEDS::Color aColor;
- aColor.R = anRGB[0];
- aColor.G = anRGB[1];
- aColor.B = anRGB[2];
+ Quantity_Color aColor( anRGB[0], anRGB[1], anRGB[2], Quantity_TOC_RGB );
aGroupBaseDS->SetColor( aColor );
}
{
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
- return aGroupDS->GetColor();
+ {
+ Quantity_Color aQColor = aGroupDS->GetColor();
+ SALOMEDS::Color aColor;
+ aColor.R = aQColor.Red();
+ aColor.G = aQColor.Green();
+ aColor.B = aQColor.Blue();
+
+ return aColor;
+ }
MESSAGE("get color of a group");
return SALOMEDS::Color();
}
{
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
- return aGroupDS->SetColor(color);
+ {
+ Quantity_Color aQColor( color.R, color.G, color.B, Quantity_TOC_RGB );
+ return aGroupDS->SetColor(aQColor);
+ }
MESSAGE("set color of a group");
return ;
}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+CORBA::Long SMESH_GroupBase_i::GetColorNumber()
+{
+ SMESHDS_GroupBase* aGroupDS = GetGroupDS();
+ if (aGroupDS)
+ return aGroupDS->GetColorGroup();
+ MESSAGE("get color number of a group");
+ return 0;
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color)
+{
+ SMESHDS_GroupBase* aGroupDS = GetGroupDS();
+ if (aGroupDS)
+ return aGroupDS->SetColorGroup(color);
+ MESSAGE("set color number of a group");
+ return ;
+}
void SetColor(const SALOMEDS::Color& color);
SALOMEDS::Color GetColor();
+ void SetColorNumber(CORBA::Long color);
+ CORBA::Long GetColorNumber();
+
private:
SMESH_Mesh_i* myMeshServant;
int myLocalID;