mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0026312: ColorScale doesn't work as expected.
Now 'vcolorscale' command works correctly with the active view. Changed types of some variables from Standard_Real to Standard_Integer. Added options to set the width or the height of color scale explicitly. Test case is added.
This commit is contained in:
parent
a4eba92071
commit
b4b2ecca89
@ -57,9 +57,10 @@ myLabelPos (Aspect_TOCSP_RIGHT),
|
|||||||
myTitlePos (Aspect_TOCSP_CENTER),
|
myTitlePos (Aspect_TOCSP_CENTER),
|
||||||
myXPos (0),
|
myXPos (0),
|
||||||
myYPos (0),
|
myYPos (0),
|
||||||
myWidth (0.2),
|
myWidth (0),
|
||||||
myHeight (1),
|
myHeight (0),
|
||||||
myTextHeight(20)
|
myTextHeight(20),
|
||||||
|
myBgColor (Quantity_NOC_BLACK)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +352,7 @@ void AIS_ColorScale::GetPosition (Standard_Real& theX, Standard_Real& theY) cons
|
|||||||
//function : SetPosition
|
//function : SetPosition
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetPosition (const Standard_Real theX, const Standard_Real theY)
|
void AIS_ColorScale::SetPosition (const Standard_Integer theX, const Standard_Integer theY)
|
||||||
{
|
{
|
||||||
if (myXPos == theX && myYPos == theY)
|
if (myXPos == theX && myYPos == theY)
|
||||||
return;
|
return;
|
||||||
@ -364,7 +365,7 @@ void AIS_ColorScale::SetPosition (const Standard_Real theX, const Standard_Real
|
|||||||
//function : SetXPosition
|
//function : SetXPosition
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetXPosition (const Standard_Real theX)
|
void AIS_ColorScale::SetXPosition (const Standard_Integer theX)
|
||||||
{
|
{
|
||||||
SetPosition (theX, GetYPosition());
|
SetPosition (theX, GetYPosition());
|
||||||
}
|
}
|
||||||
@ -373,7 +374,7 @@ void AIS_ColorScale::SetXPosition (const Standard_Real theX)
|
|||||||
//function : SetYPosition
|
//function : SetYPosition
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetYPosition (const Standard_Real theY)
|
void AIS_ColorScale::SetYPosition (const Standard_Integer theY)
|
||||||
{
|
{
|
||||||
SetPosition (GetXPosition(), theY);
|
SetPosition (GetXPosition(), theY);
|
||||||
}
|
}
|
||||||
@ -382,7 +383,7 @@ void AIS_ColorScale::SetYPosition (const Standard_Real theY)
|
|||||||
//function : GetSize
|
//function : GetSize
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::GetSize (Standard_Real& theWidth, Standard_Real& theHeight) const
|
void AIS_ColorScale::GetSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const
|
||||||
{
|
{
|
||||||
theWidth = myWidth;
|
theWidth = myWidth;
|
||||||
theHeight = myHeight;
|
theHeight = myHeight;
|
||||||
@ -392,7 +393,7 @@ void AIS_ColorScale::GetSize (Standard_Real& theWidth, Standard_Real& theHeight)
|
|||||||
//function : SetSize
|
//function : SetSize
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetSize (const Standard_Real theWidth, const Standard_Real theHeight)
|
void AIS_ColorScale::SetSize (const Standard_Integer theWidth, const Standard_Integer theHeight)
|
||||||
{
|
{
|
||||||
if (myWidth == theWidth && myHeight == theHeight)
|
if (myWidth == theWidth && myHeight == theHeight)
|
||||||
return;
|
return;
|
||||||
@ -405,7 +406,7 @@ void AIS_ColorScale::SetSize (const Standard_Real theWidth, const Standard_Real
|
|||||||
//function : SetWidth
|
//function : SetWidth
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetWidth (const Standard_Real theWidth)
|
void AIS_ColorScale::SetWidth (const Standard_Integer theWidth)
|
||||||
{
|
{
|
||||||
SetSize (theWidth, GetHeight());
|
SetSize (theWidth, GetHeight());
|
||||||
}
|
}
|
||||||
@ -414,7 +415,7 @@ void AIS_ColorScale::SetWidth (const Standard_Real theWidth)
|
|||||||
//function : SetHeight
|
//function : SetHeight
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_ColorScale::SetHeight (const Standard_Real theHeight)
|
void AIS_ColorScale::SetHeight (const Standard_Integer theHeight)
|
||||||
{
|
{
|
||||||
SetSize (GetWidth(), theHeight);
|
SetSize (GetWidth(), theHeight);
|
||||||
}
|
}
|
||||||
@ -546,11 +547,9 @@ void AIS_ColorScale::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
|||||||
const Handle(Prs3d_Presentation)& thePresentation,
|
const Handle(Prs3d_Presentation)& thePresentation,
|
||||||
const Standard_Integer /*theMode*/)
|
const Standard_Integer /*theMode*/)
|
||||||
{
|
{
|
||||||
Standard_Integer aWinWidth(0), aWinHeight(0);
|
|
||||||
Handle(V3d_Viewer) aViewer= GetContext()->CurrentViewer();
|
Handle(V3d_Viewer) aViewer= GetContext()->CurrentViewer();
|
||||||
aViewer->InitActiveViews();
|
aViewer->InitActiveViews();
|
||||||
aViewer->ActiveView()->Window()->Size (aWinWidth, aWinHeight);
|
Quantity_Color aBgColor = myBgColor;
|
||||||
Quantity_Color aBgColor = aViewer->ActiveView()->BackgroundColor();
|
|
||||||
Standard_Integer aNum = GetNumberOfIntervals();
|
Standard_Integer aNum = GetNumberOfIntervals();
|
||||||
Aspect_TypeOfColorScalePosition aLabPos = GetLabelPosition();
|
Aspect_TypeOfColorScalePosition aLabPos = GetLabelPosition();
|
||||||
|
|
||||||
@ -567,7 +566,7 @@ void AIS_ColorScale::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
|||||||
if (aTitle.Length())
|
if (aTitle.Length())
|
||||||
{
|
{
|
||||||
aTitleHeight += myTextHeight + aSpacer;
|
aTitleHeight += myTextHeight + aSpacer;
|
||||||
DrawText (thePresentation, aTitle, (Standard_Integer)myXPos + aSpacer, aWinHeight - ((Standard_Integer)myYPos - 2 * aSpacer + aTitleHeight), aFgColor);
|
DrawText (thePresentation, aTitle, (Standard_Integer)myXPos + aSpacer, myHeight - ((Standard_Integer)myYPos - 2 * aSpacer + aTitleHeight), aFgColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean toReverse = IsReversed();
|
Standard_Boolean toReverse = IsReversed();
|
||||||
@ -602,18 +601,18 @@ void AIS_ColorScale::Compute(const Handle(PrsMgr_PresentationManager3d)& /*thePr
|
|||||||
|
|
||||||
Standard_Integer aLabCount = aLabels.Length();
|
Standard_Integer aLabCount = aLabels.Length();
|
||||||
|
|
||||||
Standard_Real aSpc = ( aWinHeight - ( ( Min (aLabCount, 2) + Abs (aLabCount - aNum - 1) ) * aTextHeight ) - aTitleHeight );
|
Standard_Integer aSpc = ( myHeight - ( ( Min (aLabCount, 2) + Abs (aLabCount - aNum - 1) ) * aTextHeight ) - aTitleHeight );
|
||||||
Standard_Real aVal = aSpc != 0 ? 1.0 * ( aLabCount - Min (aLabCount, 0) ) * aTextHeight / aSpc : 0;
|
Standard_Real aVal = aSpc != 0 ? 1.0 * ( aLabCount - Min (aLabCount, 0) ) * aTextHeight / aSpc : 0;
|
||||||
Standard_Real anIPart;
|
Standard_Real anIPart;
|
||||||
Standard_Real anFPart = modf (aVal, &anIPart);
|
Standard_Real anFPart = modf (aVal, &anIPart);
|
||||||
Standard_Integer aFilter = (Standard_Integer)anIPart + ( anFPart != 0 ? 1 : 0 );
|
Standard_Integer aFilter = (Standard_Integer)anIPart + ( anFPart != 0 ? 1 : 0 );
|
||||||
|
|
||||||
Standard_Real aStep = 1.0 * ( aWinHeight - (aLabCount - aNum + Abs (aLabCount - aNum - 1)) * aTextHeight - aTitleHeight ) / aNum;
|
Standard_Real aStep = 1.0 * ( myHeight - (aLabCount - aNum + Abs (aLabCount - aNum - 1)) * aTextHeight - aTitleHeight ) / aNum;
|
||||||
|
|
||||||
Standard_Integer anAscent = 0;
|
Standard_Integer anAscent = 0;
|
||||||
Standard_Integer aColorWidth = Max (5, Min (20, aWinWidth - aTextWidth - 3 * aSpacer));
|
Standard_Integer aColorWidth = Max (5, Min (20, myWidth - aTextWidth - 3 * aSpacer));
|
||||||
if (aLabPos == Aspect_TOCSP_CENTER || !toDrawLabel)
|
if (aLabPos == Aspect_TOCSP_CENTER || !toDrawLabel)
|
||||||
aColorWidth = aWinWidth - 2 * aSpacer;
|
aColorWidth += aTextWidth;
|
||||||
|
|
||||||
// Draw colors
|
// Draw colors
|
||||||
Standard_Integer aX = (Standard_Integer)myXPos + aSpacer;
|
Standard_Integer aX = (Standard_Integer)myXPos + aSpacer;
|
||||||
|
@ -147,40 +147,46 @@ public:
|
|||||||
Standard_EXPORT void SetLabelAtBorder (const Standard_Boolean theOn);
|
Standard_EXPORT void SetLabelAtBorder (const Standard_Boolean theOn);
|
||||||
|
|
||||||
//! Returns the size of color scale.
|
//! Returns the size of color scale.
|
||||||
Standard_EXPORT void GetSize (Standard_Real& theWidth, Standard_Real& theHeight) const;
|
Standard_EXPORT void GetSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
|
||||||
|
|
||||||
//! Returns the width of color scale.
|
//! Returns the width of color scale.
|
||||||
Standard_EXPORT Standard_Real GetWidth() const { return myWidth; }
|
Standard_EXPORT Standard_Integer GetWidth() const { return myWidth; }
|
||||||
|
|
||||||
//! Returns the height of color scale.
|
//! Returns the height of color scale.
|
||||||
Standard_EXPORT Standard_Real GetHeight() const { return myHeight; }
|
Standard_EXPORT Standard_Integer GetHeight() const { return myHeight; }
|
||||||
|
|
||||||
|
//! Returns the background color of color scale.
|
||||||
|
const Quantity_Color& GetBgColor() const { return myBgColor; }
|
||||||
|
|
||||||
//! Sets the size of color scale.
|
//! Sets the size of color scale.
|
||||||
Standard_EXPORT void SetSize (const Standard_Real theWidth, const Standard_Real theHeight);
|
Standard_EXPORT void SetSize (const Standard_Integer theWidth, const Standard_Integer theHeight);
|
||||||
|
|
||||||
//! Sets the width of color scale.
|
//! Sets the width of color scale.
|
||||||
Standard_EXPORT void SetWidth (const Standard_Real theWidth);
|
Standard_EXPORT void SetWidth (const Standard_Integer theWidth);
|
||||||
|
|
||||||
//! Sets the height of color scale.
|
//! Sets the height of color scale.
|
||||||
Standard_EXPORT void SetHeight (const Standard_Real theHeight);
|
Standard_EXPORT void SetHeight (const Standard_Integer theHeight);
|
||||||
|
|
||||||
|
//! Sets the background color of color scale.
|
||||||
|
void SetBGColor (const Quantity_Color& theBgColor) { myBgColor = theBgColor; };
|
||||||
|
|
||||||
//! Returns the position of color scale.
|
//! Returns the position of color scale.
|
||||||
Standard_EXPORT void GetPosition (Standard_Real& theX, Standard_Real& theY) const;
|
Standard_EXPORT void GetPosition (Standard_Real& theX, Standard_Real& theY) const;
|
||||||
|
|
||||||
//! Returns the X position of color scale.
|
//! Returns the X position of color scale.
|
||||||
Standard_EXPORT Standard_Real GetXPosition() const { return myXPos; }
|
Standard_EXPORT Standard_Integer GetXPosition() const { return myXPos; }
|
||||||
|
|
||||||
//! Returns the height of color scale.
|
//! Returns the height of color scale.
|
||||||
Standard_EXPORT Standard_Real GetYPosition() const { return myYPos; }
|
Standard_EXPORT Standard_Integer GetYPosition() const { return myYPos; }
|
||||||
|
|
||||||
//! Sets the position of color scale.
|
//! Sets the position of color scale.
|
||||||
Standard_EXPORT void SetPosition (const Standard_Real theX, const Standard_Real theY);
|
Standard_EXPORT void SetPosition (const Standard_Integer theX, const Standard_Integer theY);
|
||||||
|
|
||||||
//! Sets the X position of color scale.
|
//! Sets the X position of color scale.
|
||||||
Standard_EXPORT void SetXPosition (const Standard_Real theX);
|
Standard_EXPORT void SetXPosition (const Standard_Integer theX);
|
||||||
|
|
||||||
//! Sets the Y position of color scale.
|
//! Sets the Y position of color scale.
|
||||||
Standard_EXPORT void SetYPosition (const Standard_Real theY);
|
Standard_EXPORT void SetYPosition (const Standard_Integer theY);
|
||||||
|
|
||||||
//! Returns the height of text of color scale.
|
//! Returns the height of text of color scale.
|
||||||
Standard_EXPORT Standard_Integer GetTextHeight() const { return myTextHeight; }
|
Standard_EXPORT Standard_Integer GetTextHeight() const { return myTextHeight; }
|
||||||
@ -265,10 +271,11 @@ private:
|
|||||||
TColStd_SequenceOfExtendedString myLabels;
|
TColStd_SequenceOfExtendedString myLabels;
|
||||||
Aspect_TypeOfColorScalePosition myLabelPos;
|
Aspect_TypeOfColorScalePosition myLabelPos;
|
||||||
Aspect_TypeOfColorScalePosition myTitlePos;
|
Aspect_TypeOfColorScalePosition myTitlePos;
|
||||||
Standard_Real myXPos;
|
Standard_Integer myXPos;
|
||||||
Standard_Real myYPos;
|
Standard_Integer myYPos;
|
||||||
Standard_Real myWidth;
|
Standard_Integer myWidth;
|
||||||
Standard_Real myHeight;
|
Standard_Integer myHeight;
|
||||||
Standard_Integer myTextHeight;
|
Standard_Integer myTextHeight;
|
||||||
|
Quantity_Color myBgColor;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -4550,6 +4550,9 @@ static Standard_Integer OCC12584 (Draw_Interpretor& di, Standard_Integer argc, c
|
|||||||
{
|
{
|
||||||
aCS->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
|
aCS->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
|
||||||
}
|
}
|
||||||
|
Standard_Integer aWinWidth, aWinHeight;
|
||||||
|
V->Window()->Size (aWinWidth, aWinHeight);
|
||||||
|
aCS->SetSize (aWinWidth, aWinHeight);
|
||||||
if ( !V.IsNull() ) {
|
if ( !V.IsNull() ) {
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
aContext->Display (aCS);
|
aContext->Display (aCS);
|
||||||
|
@ -3478,10 +3478,13 @@ static int VColorScale (Draw_Interpretor& theDI,
|
|||||||
|
|
||||||
Standard_Real aMinRange = aCS->GetMin();
|
Standard_Real aMinRange = aCS->GetMin();
|
||||||
Standard_Real aMaxRange = aCS->GetMax();
|
Standard_Real aMaxRange = aCS->GetMax();
|
||||||
|
Standard_Integer aWidth = aCS->GetWidth();
|
||||||
|
Standard_Integer aHeight = aCS->GetHeight();
|
||||||
Standard_Integer aNbIntervals = aCS->GetNumberOfIntervals();
|
Standard_Integer aNbIntervals = aCS->GetNumberOfIntervals();
|
||||||
Standard_Integer aTextHeight = aCS->GetTextHeight();
|
Standard_Integer aTextHeight = aCS->GetTextHeight();
|
||||||
Aspect_TypeOfColorScalePosition aLabPosition = aCS->GetLabelPosition();
|
Aspect_TypeOfColorScalePosition aLabPosition = aCS->GetLabelPosition();
|
||||||
gp_XY aPos (aCS->GetXPosition(), aCS->GetYPosition());
|
Standard_Integer aPosX = aCS->GetXPosition();
|
||||||
|
Standard_Integer aPosY = aCS->GetYPosition();
|
||||||
|
|
||||||
ViewerTest_AutoUpdater anUpdateTool (aContext, aView);
|
ViewerTest_AutoUpdater anUpdateTool (aContext, aView);
|
||||||
|
|
||||||
@ -3497,7 +3500,7 @@ static int VColorScale (Draw_Interpretor& theDI,
|
|||||||
<< "Max range: " << aMaxRange << "\n"
|
<< "Max range: " << aMaxRange << "\n"
|
||||||
<< "Number of intervals: " << aNbIntervals << "\n"
|
<< "Number of intervals: " << aNbIntervals << "\n"
|
||||||
<< "Text height: " << aTextHeight << "\n"
|
<< "Text height: " << aTextHeight << "\n"
|
||||||
<< "Color scale position: " << aPos.X() <<" "<< aPos.Y()<< "\n"
|
<< "Color scale position: " << aPosX <<" "<< aPosY<< "\n"
|
||||||
<< "Color scale title: " << aCS->GetTitle() << "\n"
|
<< "Color scale title: " << aCS->GetTitle() << "\n"
|
||||||
<< "Label position: ";
|
<< "Label position: ";
|
||||||
switch (aLabPosition)
|
switch (aLabPosition)
|
||||||
@ -3616,14 +3619,51 @@ static int VColorScale (Draw_Interpretor& theDI,
|
|||||||
|
|
||||||
TCollection_AsciiString aX (theArgVec[++anArgIter]);
|
TCollection_AsciiString aX (theArgVec[++anArgIter]);
|
||||||
TCollection_AsciiString aY (theArgVec[++anArgIter]);
|
TCollection_AsciiString aY (theArgVec[++anArgIter]);
|
||||||
if (!aX.IsRealValue()
|
if (!aX.IsIntegerValue()
|
||||||
|| !aY.IsRealValue())
|
|| !aY.IsIntegerValue())
|
||||||
{
|
{
|
||||||
std::cout << "Error: coordinates should be real values!\n";
|
std::cout << "Error: coordinates should be integer values!\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
aPos.SetCoord (aX.RealValue(), aY.RealValue());
|
aPosX = aX.IntegerValue();
|
||||||
|
aPosY = aY.IntegerValue();
|
||||||
|
}
|
||||||
|
else if (aFlag == "-width"
|
||||||
|
|| aFlag == "-w")
|
||||||
|
{
|
||||||
|
if (anArgIter + 1 >= theArgNb)
|
||||||
|
{
|
||||||
|
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TCollection_AsciiString aW (theArgVec[++anArgIter]);
|
||||||
|
if (!aW.IsIntegerValue())
|
||||||
|
{
|
||||||
|
std::cout << "Error: a width should be an integer value!\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
aWidth = aW.IntegerValue();
|
||||||
|
}
|
||||||
|
else if (aFlag == "-height"
|
||||||
|
|| aFlag == "-h")
|
||||||
|
{
|
||||||
|
if (anArgIter + 1 >= theArgNb)
|
||||||
|
{
|
||||||
|
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TCollection_AsciiString aH (theArgVec[++anArgIter]);
|
||||||
|
if (!aH.IsIntegerValue())
|
||||||
|
{
|
||||||
|
std::cout << "Error: a width should be an integer value!\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
aHeight = aH.IntegerValue();
|
||||||
}
|
}
|
||||||
else if (aFlag == "-color")
|
else if (aFlag == "-color")
|
||||||
{
|
{
|
||||||
@ -3828,11 +3868,14 @@ static int VColorScale (Draw_Interpretor& theDI,
|
|||||||
else if (aFlag == "-demoversion"
|
else if (aFlag == "-demoversion"
|
||||||
|| aFlag == "-demo")
|
|| aFlag == "-demo")
|
||||||
{
|
{
|
||||||
aPos.SetCoord (0.0, 0.0);
|
aPosX = 0;
|
||||||
|
aPosY = 0;
|
||||||
aTextHeight = 16;
|
aTextHeight = 16;
|
||||||
aMinRange = 0.0;
|
aMinRange = 0.0;
|
||||||
aMaxRange = 100;
|
aMaxRange = 100;
|
||||||
aNbIntervals = 10;
|
aNbIntervals = 10;
|
||||||
|
aWidth = 0;
|
||||||
|
aHeight = 0;
|
||||||
aLabPosition = Aspect_TOCSP_RIGHT;
|
aLabPosition = Aspect_TOCSP_RIGHT;
|
||||||
aCS->SetColorType (Aspect_TOCSD_AUTO);
|
aCS->SetColorType (Aspect_TOCSD_AUTO);
|
||||||
aCS->SetLabelType (Aspect_TOCSD_AUTO);
|
aCS->SetLabelType (Aspect_TOCSD_AUTO);
|
||||||
@ -3843,13 +3886,26 @@ static int VColorScale (Draw_Interpretor& theDI,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!aWidth || !aHeight)
|
||||||
aCS->SetPosition (aPos.X(), aPos.Y());
|
{
|
||||||
aCS->SetHeight (0.95);
|
Standard_Integer aWinWidth, aWinHeight;
|
||||||
|
aView->Window()->Size (aWinWidth, aWinHeight);
|
||||||
|
if (!aWidth)
|
||||||
|
{
|
||||||
|
aWidth = aWinWidth;
|
||||||
|
}
|
||||||
|
if (!aHeight)
|
||||||
|
{
|
||||||
|
aHeight = aWinHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
aCS->SetSize (aWidth, aHeight);
|
||||||
|
aCS->SetPosition (aPosX, aPosY);
|
||||||
aCS->SetTextHeight (aTextHeight);
|
aCS->SetTextHeight (aTextHeight);
|
||||||
aCS->SetRange (aMinRange, aMaxRange);
|
aCS->SetRange (aMinRange, aMaxRange);
|
||||||
aCS->SetNumberOfIntervals (aNbIntervals);
|
aCS->SetNumberOfIntervals (aNbIntervals);
|
||||||
aCS->SetLabelPosition (aLabPosition);
|
aCS->SetLabelPosition (aLabPosition);
|
||||||
|
aCS->SetBGColor (aView->BackgroundColor());
|
||||||
aCS->SetToUpdate();
|
aCS->SetToUpdate();
|
||||||
aContext->Display (aCS);
|
aContext->Display (aCS);
|
||||||
|
|
||||||
|
27
tests/bugs/vis/bug26312
Normal file
27
tests/bugs/vis/bug26312
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC26312"
|
||||||
|
puts "ColorScale doesn't work as expected."
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
vinit View1
|
||||||
|
vclear
|
||||||
|
vaxo
|
||||||
|
|
||||||
|
# Disable ffp
|
||||||
|
vcaps -ffp 0
|
||||||
|
# draw color scale
|
||||||
|
vcolorscale cs -demo
|
||||||
|
vdump ${imagedir}/${casename}_View1.png
|
||||||
|
|
||||||
|
#add more views
|
||||||
|
vinit View2 w=300 h=500
|
||||||
|
vinit View3 w=500 h=300
|
||||||
|
|
||||||
|
# dump all views
|
||||||
|
vactivate View2
|
||||||
|
vcolorscale cs -height 500
|
||||||
|
vdump ${imagedir}/${casename}_View2.png
|
||||||
|
vactivate View3
|
||||||
|
vcolorscale cs -height 300
|
||||||
|
vdump ${imagedir}/${casename}_View3.png
|
Loading…
x
Reference in New Issue
Block a user