mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Small corrections. Added test case
This commit is contained in:
@@ -549,15 +549,18 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
Standard_Real aSymbolWidth = 0.0;
|
Standard_Real aSymbolWidth = 0.0;
|
||||||
Standard_Real aSymbolHeight = 0.0;
|
Standard_Real aSymbolHeight = 0.0;
|
||||||
getLabelSizes (theText, aWidth, aHeight, aSymbolWidth, aSymbolHeight);
|
getLabelSizes (theText, aWidth, aHeight, aSymbolWidth, aSymbolHeight);
|
||||||
aWidth += aSymbolWidth;
|
|
||||||
|
|
||||||
// Compute label offsets
|
// Compute label offsets
|
||||||
Standard_Real aMarginSize = aFontHeight * THE_3D_TEXT_MARGIN;
|
Standard_Real aMarginSize = aFontHeight * THE_3D_TEXT_MARGIN;
|
||||||
Standard_Real aCenterHOffset = 0.0;
|
Standard_Real aCenterHOffset = 0.0;
|
||||||
Standard_Real aCenterVOffset = 0.0;
|
Standard_Real aCenterVOffset = 0.0;
|
||||||
Standard_Real aSymbolVOffset = 0.0; //< Offset of symbol relative to the main text
|
Standard_Real aSymbolVOffset = 0.0; //< Offset of symbol relative to the main text
|
||||||
|
Standard_Real aSymbolHOffset = 0.0;
|
||||||
|
Standard_Real aShapeHOffset = 0.0;
|
||||||
|
Standard_Real aShapeVOffset = 0.0;
|
||||||
|
|
||||||
Standard_Integer aVLabelPos = theLabelPosition & LabelPosition_VMask;
|
Standard_Integer aVLabelPos = theLabelPosition & LabelPosition_VMask;
|
||||||
|
Standard_Integer aHLabelPos = theLabelPosition & LabelPosition_HMask;
|
||||||
|
|
||||||
if (myDrawer->DimensionAspect()->IsText3d())
|
if (myDrawer->DimensionAspect()->IsText3d())
|
||||||
{
|
{
|
||||||
@@ -565,6 +568,7 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
Font_BRepFont aFont (aFontName, aFontAspect, aFontHeight);
|
Font_BRepFont aFont (aFontName, aFontAspect, aFontHeight);
|
||||||
NCollection_Utf8String anUTFString = (Standard_Utf16Char* )theText.ToExtString();
|
NCollection_Utf8String anUTFString = (Standard_Utf16Char* )theText.ToExtString();
|
||||||
TopoDS_Shape aTextShape = aFont.RenderText (anUTFString);
|
TopoDS_Shape aTextShape = aFont.RenderText (anUTFString);
|
||||||
|
const Standard_Real aHeightOfLine = aFont.LineSpacing();
|
||||||
|
|
||||||
// Add special symbol
|
// Add special symbol
|
||||||
TopoDS_Shape aSymbolShape;
|
TopoDS_Shape aSymbolShape;
|
||||||
@@ -575,15 +579,22 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Formating text position in XOY plane
|
// Formating text position in XOY plane
|
||||||
Standard_Integer aHLabelPos = theLabelPosition & LabelPosition_HMask;
|
|
||||||
switch (aHLabelPos)
|
switch (aHLabelPos)
|
||||||
{
|
{
|
||||||
case LabelPosition_HCenter : aCenterHOffset = 0.0; break;
|
case LabelPosition_HCenter : aCenterHOffset = 0.0; break;
|
||||||
case LabelPosition_Right : aCenterHOffset = aWidth / 2.0 + aMarginSize; break;
|
case LabelPosition_Right : aCenterHOffset = (aWidth + aSymbolWidth) / 2.0 + aMarginSize; break;
|
||||||
case LabelPosition_Left : aCenterHOffset = -aWidth / 2.0 - aMarginSize; break;
|
case LabelPosition_Left : aCenterHOffset = -(aWidth + aSymbolWidth) / 2.0 - aMarginSize; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Standard_Real aHeightOfLine = aFont.LineSpacing();
|
// Correct text direction
|
||||||
|
gp_Dir aTextDir = (aHLabelPos == LabelPosition_Left ? -theTextDir : theTextDir);
|
||||||
|
|
||||||
|
// Transform text to myWorkingPlane coordinate system
|
||||||
|
gp_Ax3 aTextCoordSystem (theTextPos, GetPlane().Axis().Direction(), aTextDir);
|
||||||
|
gp_Trsf aTextPlaneTrsf;
|
||||||
|
aTextPlaneTrsf.SetTransformation (aTextCoordSystem, gp_Ax3 (gp::XOY()));
|
||||||
|
|
||||||
|
// ALIGNMENT: Vertical
|
||||||
|
|
||||||
switch (aVLabelPos)
|
switch (aVLabelPos)
|
||||||
{
|
{
|
||||||
@@ -591,8 +602,8 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
{
|
{
|
||||||
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
||||||
{
|
{
|
||||||
aCenterVOffset = aHeight / 2.0 - aHeightOfLine;
|
aShapeVOffset = aHeightOfLine - aHeight / 2.0 ;
|
||||||
aSymbolVOffset = aCenterVOffset - aHeightOfLine / 2.0 + aMarginSize;
|
aSymbolVOffset = aShapeVOffset - aHeightOfLine / 2.0 + aMarginSize;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -600,15 +611,22 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
{
|
{
|
||||||
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
||||||
{
|
{
|
||||||
aCenterVOffset = aHeightOfLine - aHeight / 2.0 ;
|
aShapeVOffset = aHeight / 2.0 - aHeightOfLine;
|
||||||
aSymbolVOffset = aCenterVOffset - aHeight + aHeightOfLine / 2.0 - aMarginSize;
|
aSymbolVOffset = aShapeVOffset - aHeight / 2.0 - aMarginSize;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LabelPosition_VCenter : aCenterVOffset = 0.0; break;
|
case LabelPosition_VCenter :
|
||||||
|
{
|
||||||
|
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
||||||
|
{
|
||||||
|
aSymbolVOffset = aCenterVOffset - aHeight / 2.0 + aHeightOfLine / 2.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case LabelPosition_Above:
|
case LabelPosition_Above:
|
||||||
{
|
{
|
||||||
aCenterVOffset = aHeight / 2.0 + aMarginSize;
|
aCenterVOffset = aHeight / 2.0 + aMarginSize;
|
||||||
if (myTypeOfLabel == TOL_Text)
|
if (myTypeOfLabel == TOL_Text)
|
||||||
{
|
{
|
||||||
aSymbolVOffset = aCenterVOffset / 2;
|
aSymbolVOffset = aCenterVOffset / 2;
|
||||||
@@ -617,7 +635,7 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
}
|
}
|
||||||
case LabelPosition_Below:
|
case LabelPosition_Below:
|
||||||
{
|
{
|
||||||
aCenterVOffset = -aHeight / 2.0 - aMarginSize;
|
aCenterVOffset = - aHeight / 2.0 - aMarginSize;
|
||||||
if (myTypeOfLabel == TOL_Text)
|
if (myTypeOfLabel == TOL_Text)
|
||||||
{
|
{
|
||||||
aSymbolVOffset = aCenterVOffset / 2;
|
aSymbolVOffset = aCenterVOffset / 2;
|
||||||
@@ -626,46 +644,63 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Correct text direction
|
// ALIGNMENT: Horisontal
|
||||||
gp_Dir aTextDir = (aHLabelPos == LabelPosition_Left ? -theTextDir : theTextDir);
|
|
||||||
|
|
||||||
// Compute shape offset transformation
|
// Center shape in its bounding box (suppress border spacing added by FT_Font)
|
||||||
Standard_Real aShapeHOffset = aCenterHOffset - aWidth / 2.0 + aSymbolWidth / 2.0;
|
|
||||||
Standard_Real aShapeVOffset = aCenterVOffset - aHeight / 2.0;
|
|
||||||
|
|
||||||
// center shape in its bounding box (suppress border spacing added by FT_Font)
|
|
||||||
Bnd_Box aShapeBnd;
|
Bnd_Box aShapeBnd;
|
||||||
BRepBndLib::AddClose (aTextShape, aShapeBnd);
|
BRepBndLib::AddClose (aTextShape, aShapeBnd);
|
||||||
|
|
||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||||
aShapeBnd.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
aShapeBnd.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
|
|
||||||
Standard_Real aXalign = aWidth * 0.5 - (aXmax + aXmin) * 0.5;
|
Standard_Real aXalign = aWidth * 0.5 - (aXmax + aXmin) * 0.5;
|
||||||
Standard_Real aYalign = aHeight * 0.5 - (aYmax + aYmin) * 0.5;
|
Standard_Real aYalign = aHeight * 0.5 - (aYmax + aYmin) * 0.5;
|
||||||
aShapeHOffset += aXalign;
|
|
||||||
aShapeVOffset += aYalign;
|
// Compute where to place main part of label (without special symbol) relative to the input text position
|
||||||
|
aShapeHOffset = aCenterHOffset - aWidth / 2.0 + aXalign;
|
||||||
|
aShapeVOffset += aCenterVOffset - aHeight / 2.0 + aYalign;
|
||||||
|
|
||||||
gp_Trsf anOffsetTrsf;
|
gp_Trsf anOffsetTrsf;
|
||||||
anOffsetTrsf.SetTranslation (gp::Origin(), gp_Pnt (aShapeHOffset, aShapeVOffset, 0.0));
|
|
||||||
aTextShape.Move (anOffsetTrsf);
|
|
||||||
|
|
||||||
// transform text to myWorkingPlane coordinate system
|
|
||||||
gp_Ax3 aTextCoordSystem (theTextPos, GetPlane().Axis().Direction(), aTextDir);
|
|
||||||
gp_Trsf aTextPlaneTrsf;
|
|
||||||
aTextPlaneTrsf.SetTransformation (aTextCoordSystem, gp_Ax3 (gp::XOY()));
|
|
||||||
aTextShape.Move (aTextPlaneTrsf);
|
|
||||||
|
|
||||||
if (!aSymbolShape.IsNull())
|
if (!aSymbolShape.IsNull())
|
||||||
{
|
{
|
||||||
|
Bnd_Box aSymbolBnd;
|
||||||
|
BRepBndLib::AddClose (aSymbolShape, aSymbolBnd);
|
||||||
|
aSymbolBnd.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
|
aXalign = aSymbolWidth * 0.5 - (aXmax + aXmin) * 0.5;
|
||||||
|
|
||||||
|
aSymbolHOffset = aCenterHOffset + aXalign;
|
||||||
aSymbolVOffset += aYalign - aHeight / 2.0;
|
aSymbolVOffset += aYalign - aHeight / 2.0;
|
||||||
|
|
||||||
|
switch (myDisplaySpecialSymbol)
|
||||||
|
{
|
||||||
|
case AIS_DSS_After:
|
||||||
|
{
|
||||||
|
aSymbolHOffset += aWidth * 0.5;
|
||||||
|
aShapeHOffset -= aSymbolWidth * 0.5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AIS_DSS_Before:
|
||||||
|
{
|
||||||
|
aSymbolHOffset -= (aWidth + aSymbolWidth) * 0.5;
|
||||||
|
aShapeHOffset += aSymbolWidth * 0.5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AIS_DSS_No:
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Modify transformation for a special symbol relative! to the main text
|
// Modify transformation for a special symbol relative! to the main text
|
||||||
anOffsetTrsf.SetTranslation (gp::Origin(), gp_Pnt (aShapeHOffset - aSymbolWidth, aSymbolVOffset, 0.0));
|
anOffsetTrsf.SetTranslation (gp::Origin(), gp_Pnt (aSymbolHOffset, aSymbolVOffset, 0.0));
|
||||||
aSymbolShape.Move (anOffsetTrsf);
|
aSymbolShape.Move (anOffsetTrsf);
|
||||||
aSymbolShape.Move (aTextPlaneTrsf);
|
aSymbolShape.Move (aTextPlaneTrsf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set text flipping anchors
|
anOffsetTrsf.SetTranslation (gp::Origin(), gp_Pnt (aShapeHOffset, aShapeVOffset, 0.0));
|
||||||
|
aTextShape.Move (anOffsetTrsf);
|
||||||
|
aTextShape.Move (aTextPlaneTrsf);
|
||||||
|
|
||||||
|
// Compute anchor point for flipping options
|
||||||
gp_Trsf aCenterOffsetTrsf;
|
gp_Trsf aCenterOffsetTrsf;
|
||||||
gp_Pnt aCenterOffset (aCenterHOffset, aCenterVOffset, 0.0);
|
gp_Pnt aCenterOffset (aCenterHOffset, aCenterVOffset, 0.0);
|
||||||
aCenterOffsetTrsf.SetTranslation (gp::Origin(), aCenterOffset);
|
aCenterOffsetTrsf.SetTranslation (gp::Origin(), aCenterOffset);
|
||||||
@@ -688,7 +723,6 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
myDrawer->ShadingAspect()->Aspect()->SetBackInteriorColor (aColor);
|
myDrawer->ShadingAspect()->Aspect()->SetBackInteriorColor (aColor);
|
||||||
myDrawer->ShadingAspect()->SetMaterial (aShadeMat);
|
myDrawer->ShadingAspect()->SetMaterial (aShadeMat);
|
||||||
|
|
||||||
// Drawing text
|
|
||||||
StdPrs_ShadedShape::Add (thePresentation, aTextShape, myDrawer);
|
StdPrs_ShadedShape::Add (thePresentation, aTextShape, myDrawer);
|
||||||
StdPrs_ShadedShape::Add (thePresentation, aSymbolShape, myDrawer);
|
StdPrs_ShadedShape::Add (thePresentation, aSymbolShape, myDrawer);
|
||||||
}
|
}
|
||||||
@@ -696,11 +730,11 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
{
|
{
|
||||||
// Setting color for text
|
// Setting color for text
|
||||||
myDrawer->FreeBoundaryAspect()->Aspect()->SetColor (aColor);
|
myDrawer->FreeBoundaryAspect()->Aspect()->SetColor (aColor);
|
||||||
|
|
||||||
// Drawing text
|
|
||||||
StdPrs_WFShape::Add (thePresentation, aTextShape, myDrawer);
|
StdPrs_WFShape::Add (thePresentation, aTextShape, myDrawer);
|
||||||
StdPrs_WFShape::Add (thePresentation, aSymbolShape, myDrawer);
|
StdPrs_WFShape::Add (thePresentation, aSymbolShape, myDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_False, gp_Ax2());
|
Prs3d_Root::CurrentGroup (thePresentation)->SetFlippingOptions (Standard_False, gp_Ax2());
|
||||||
|
|
||||||
mySelectionGeom.TextPos = aCenterOfLabel;
|
mySelectionGeom.TextPos = aCenterOfLabel;
|
||||||
@@ -711,7 +745,8 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate primitives for 2D text
|
// 2D text
|
||||||
|
|
||||||
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
|
myDrawer->DimensionAspect()->TextAspect()->Aspect()->SetDisplayType (Aspect_TODT_DIMENSION);
|
||||||
|
|
||||||
gp_Pnt aTextPos = theTextPos;
|
gp_Pnt aTextPos = theTextPos;
|
||||||
@@ -732,7 +767,7 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
{
|
{
|
||||||
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
||||||
{
|
{
|
||||||
aSymbolVOffset = -aWidth / 2;
|
aSymbolVOffset = -aHeight / 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -740,34 +775,33 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation,
|
|||||||
{
|
{
|
||||||
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
if (myTypeOfLabel == TOL_Text && aHeight > aHeightOfLine)
|
||||||
{
|
{
|
||||||
aSymbolVOffset = aWidth / 2;
|
aSymbolVOffset = aHeight / 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Prs3d_Text::Draw (thePresentation, myDrawer->DimensionAspect()->TextAspect(),
|
// NOTE: for 2d text that is always parallel to view plane,
|
||||||
theText, aTextPos);
|
// multiline text alignment with special symbol does not applied.
|
||||||
|
TCollection_ExtendedString aText = theText;
|
||||||
switch (myDisplaySpecialSymbol)
|
switch (myDisplaySpecialSymbol)
|
||||||
{
|
{
|
||||||
case AIS_DSS_Before:
|
case AIS_DSS_Before:
|
||||||
{
|
{
|
||||||
gp_Pnt aSymbolPos (theTextPos.X(), theTextPos.Y() + aSymbolVOffset, theTextPos.Z());
|
aText.Insert (1, mySpecialSymbol);
|
||||||
Prs3d_Text::Draw (thePresentation, myDrawer->DimensionAspect()->TextAspect(),
|
|
||||||
TCollection_ExtendedString (mySpecialSymbol), aSymbolPos);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AIS_DSS_After:
|
case AIS_DSS_After:
|
||||||
{
|
{
|
||||||
gp_Pnt aSymbolPos (theTextPos.X() + aWidth, theTextPos.Y() + aSymbolVOffset, theTextPos.Z());
|
aText += mySpecialSymbol;
|
||||||
Prs3d_Text::Draw (thePresentation, myDrawer->DimensionAspect()->TextAspect(),
|
break;
|
||||||
TCollection_ExtendedString (mySpecialSymbol), aSymbolPos);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case AIS_DSS_No: break;
|
case AIS_DSS_No: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Prs3d_Text::Draw (thePresentation, aTextAspect, aText, aTextPos);
|
||||||
|
|
||||||
mySelectionGeom.TextPos = theTextPos;
|
mySelectionGeom.TextPos = theTextPos;
|
||||||
mySelectionGeom.TextDir = theTextDir;
|
mySelectionGeom.TextDir = theTextDir;
|
||||||
mySelectionGeom.TextWidth = 0.0;
|
mySelectionGeom.TextWidth = 0.0;
|
||||||
@@ -793,7 +827,7 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
|
|||||||
Standard_Boolean hasLabel = theLabelString.Length() > 0;
|
Standard_Boolean hasLabel = theLabelString.Length() > 0;
|
||||||
|
|
||||||
gp_Dir aTextDir = myIsTextAligned
|
gp_Dir aTextDir = myIsTextAligned
|
||||||
? (myTextDir*theExtensionDir < 0 ? -myTextDir : myTextDir)
|
? (myTextDir * theExtensionDir < 0 ? -myTextDir : myTextDir)
|
||||||
: theExtensionDir;
|
: theExtensionDir;
|
||||||
|
|
||||||
// Compute graphical primitives and sensitives for extension line
|
// Compute graphical primitives and sensitives for extension line
|
||||||
@@ -1109,7 +1143,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
|||||||
// add dimension line primitives
|
// add dimension line primitives
|
||||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
||||||
{
|
{
|
||||||
if (theToDrawDimensionLine || !isArrowsExternal)
|
if (theToDrawDimensionLine || !isArrowsExternal || abs(myFlyout) > Precision::Confusion() )
|
||||||
{
|
{
|
||||||
// add central dimension line
|
// add central dimension line
|
||||||
Prs3d_Root::NewGroup (thePresentation);
|
Prs3d_Root::NewGroup (thePresentation);
|
||||||
@@ -1176,7 +1210,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
|||||||
|
|
||||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
|
||||||
{
|
{
|
||||||
if (theToDrawDimensionLine || !isArrowsExternal)
|
if (theToDrawDimensionLine || !isArrowsExternal || abs(myFlyout) > Precision::Confusion())
|
||||||
{
|
{
|
||||||
// add central dimension line
|
// add central dimension line
|
||||||
Prs3d_Root::NewGroup (thePresentation);
|
Prs3d_Root::NewGroup (thePresentation);
|
||||||
|
@@ -18,8 +18,10 @@ vcircle aCircle aCircleP1 aCircleP2 aCircleP3 0
|
|||||||
#Check all text and arrow positions
|
#Check all text and arrow positions
|
||||||
vdimension aDim1 -radius -shapes aCircle -text 3d -plane zox -label hfit -arrow external -hidedimline
|
vdimension aDim1 -radius -shapes aCircle -text 3d -plane zox -label hfit -arrow external -hidedimline
|
||||||
vdimension aDim2 -radius -shapes aCircle -circleparam 20 -text 3d -plane zox -label right -arrow external -hidedimline
|
vdimension aDim2 -radius -shapes aCircle -circleparam 20 -text 3d -plane zox -label right -arrow external -hidedimline
|
||||||
vdimension aDim3 -radius -shapes aCircle -circleparam 40 -text 3d -plane zox -label vcenter -arrow internal -hidedimline
|
|
||||||
vdimension aDim3 -radius -shapes aCircle -circleparam 40 -text 3d -plane zox -label hfit -arrow internal -hidedimline
|
vdimension aDim3 -radius -shapes aCircle -circleparam 40 -text 3d -plane zox -label hfit -arrow internal -hidedimline
|
||||||
|
|
||||||
|
vdimension aDim4 -radius -shapes aCircle -circleparam 60 -text 2d -flyout 30 -plane zox -label right -arrow external -hidedimline
|
||||||
|
vdimparam aDim4 -text 20
|
||||||
vfit
|
vfit
|
||||||
|
|
||||||
#finalize and dump
|
#finalize and dump
|
||||||
|
@@ -16,12 +16,16 @@ vpoint aCircleP3 120 0 60
|
|||||||
vcircle aCircle aCircleP1 aCircleP2 aCircleP3 0
|
vcircle aCircle aCircleP1 aCircleP2 aCircleP3 0
|
||||||
|
|
||||||
#Check all text and arrow positions
|
#Check all text and arrow positions
|
||||||
vdimension aDim1 -radius -shapes aCircle -circleparam 10 -text 3d -label right -arrow external -hidedimline -valuetext "+2.0\n-3.0\nThickness" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
vdimension aDim1 -radius -shapes aCircle -circleparam 10 -text 3d -label right -arrow external -hidedimline -valuetext "+2.0\n -3.0\nThickness" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
||||||
vdimension aDim2 -diameter -shapes aCircle -circleparam 5 -text 3d -label left -arrow external -hidedimline -valuetext "+4.0\n -6.0" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
vdimension aDim2 -diameter -shapes aCircle -circleparam 5 -text 3d -label left -arrow external -hidedimline -valuetext "+4.0\n -6.0" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
||||||
vdimension aDim3 -radius -shapes aCircle -circleparam 20 -text 3d -plane zox -label right -arrow external -hidedimline
|
vdimension aDim3 -radius -shapes aCircle -circleparam 20 -text 3d -plane zox -label right -arrow external -hidedimline
|
||||||
vdimension aDim4 -radius -shapes aCircle -circleparam 40 -text 3d -plane zox -label vcenter -arrow internal -hidedimline
|
vdimension aDim4 -radius -shapes aCircle -circleparam 30 -text 3d -plane zox -label vcenter -arrow internal -hidedimline
|
||||||
|
|
||||||
|
vdimension aDim5 -radius -shapes aCircle -circleparam 40 -text 2d -label right -arrow external -hidedimline -valuetext "+2.0\n -3.0\nThickness" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
||||||
|
|
||||||
vdimparam aDim1 -text 6
|
vdimparam aDim1 -text 6
|
||||||
vdimparam aDim3 -text 6
|
vdimparam aDim3 -text 6
|
||||||
|
|
||||||
vfit
|
vfit
|
||||||
|
|
||||||
#finalize and dump
|
#finalize and dump
|
||||||
|
25
tests/bugs/vis/bug26507_6
Normal file
25
tests/bugs/vis/bug26507_6
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
puts "================================================================"
|
||||||
|
puts "CR26507"
|
||||||
|
puts "Visualization - Improved presentations of dimensions"
|
||||||
|
puts "================================================================"
|
||||||
|
puts ""
|
||||||
|
puts "Radius dimension vertical alignment with multiline custom text"
|
||||||
|
|
||||||
|
#set anImage1 $imagedir/${casename}_1.png
|
||||||
|
|
||||||
|
vinit Viewer1/View
|
||||||
|
vright
|
||||||
|
|
||||||
|
vpoint aCircleP1 0 0 60
|
||||||
|
vpoint aCircleP2 60 0 0
|
||||||
|
vpoint aCircleP3 120 0 60
|
||||||
|
vcircle aCircle aCircleP1 aCircleP2 aCircleP3 0
|
||||||
|
|
||||||
|
#Check all text and arrow positions
|
||||||
|
vdimension aDim1 -radius -shapes aCircle -circleparam 10 -text 3d -label right -arrow external -hidedimline -valuetext "+2.0\n -3.0\nThickness" -aligntext 1.0 0.0 0.0 -segment 15 -label left firstline
|
||||||
|
vdimension aDim2 -radius -shapes aCircle -circleparam 20 -text 3d -label right -arrow external -hidedimline -valuetext "+3.0\n -4.0\nThickness" -aligntext 1.0 0.0 0.0 -segment 15 -label left lastline
|
||||||
|
vdimension aDim3 -radius -shapes aCircle -circleparam 30 -text 3d -label right -arrow external -hidedimline -valuetext "+4.0\n -5.0\nThickness" -aligntext 1.0 0.0 0.0 -flyout -70 -segment 15 -label left vcenter
|
||||||
|
vfit
|
||||||
|
|
||||||
|
#finalize and dump
|
||||||
|
set only_screen 1
|
Reference in New Issue
Block a user