- Added test cases to check label and arrows positioning of AIS length, angle, radius, diameter dimensions;
- Added new arguments to "vdim" command to modify "flyout", "arrow orientation", "label position" properties;
- Corrected bug: duplication of text label of linear dimensions for the horizontal-centered text.
- Rename and revise argument interface of "vdimension" (vdim) command.
- Correct test cases for new command name and arguments style.
corrected test cases - check with testdiff instead of "checkcolor"
aSecondArrowEnd, aSecondExtensionDir,
THE_EMPTY_LABEL, theMode, LabelPosition_None);
}
+
+ break;
}
// ------------------------------------------------------------------------ //
// LEFT //
RedrawAllViews;
---Purpose: redraws all defined views.
+ SplitParameter (theString : AsciiString from TCollection;
+ theName : out AsciiString from TCollection;
+ theValue : out AsciiString from TCollection)
+ returns Boolean from Standard;
+ ---Purpose: Splits "parameter=value" string into separate
+ -- parameter and value strings.
+ -- @return TRUE if the string matches pattern "<string>=<empty or string>"
+
end;
return 0;
}
+//==============================================================================
+//function : splitParameter
+//purpose : Split parameter string to parameter name an parameter value
+//==============================================================================
+Standard_Boolean ViewerTest::SplitParameter (const TCollection_AsciiString& theString,
+ TCollection_AsciiString& theName,
+ TCollection_AsciiString& theValue)
+{
+ Standard_Integer aParamNameEnd = theString.FirstLocationInSet ("=", 1, theString.Length());
+
+ if (aParamNameEnd == 0)
+ {
+ return Standard_False;
+ }
+
+ TCollection_AsciiString aString (theString);
+ if (aParamNameEnd != 0)
+ {
+ theValue = aString.Split (aParamNameEnd);
+ aString.Split (aString.Length() - 1);
+ theName = aString;
+ }
+ return Standard_True;
+}
//============================================================================
// MyCommands
//=======================================================================
//function : VDimBuilder
-//purpose : Command for updated dimenasions: angle, length, radius, diameter
-//draw args : vdim -{angle|length|radius|diameter} -name={Dim_Name}
-// shape1 [shape2 [shape3]] [-text={2d|3d} -plane={xoy|yoz|zox}]
+//purpose : Command for building dimension presentations: angle,
+// length, radius, diameter
//=======================================================================
-
static int VDimBuilder(Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgs)
{
if (theArgsNb < 2)
{
- theDi << theArgs[0] << ": command argument is required. Type help for more information.\n";
+ std::cerr << theArgs[0] << ": command argument is required. Type help for more information.\n";
return 1;
}
// Parse parameters
TCollection_AsciiString aDimType(theArgs[1]);
AIS_KindOfDimension aKindOfDimension;
- if (aDimType == "-length")
+ if (aDimType == "length")
{
aKindOfDimension = AIS_KOD_LENGTH;
}
- else if (aDimType == "-angle")
+ else if (aDimType == "angle")
{
aKindOfDimension = AIS_KOD_PLANEANGLE;
}
- else if (aDimType == "-radius")
+ else if (aDimType == "radius")
{
aKindOfDimension = AIS_KOD_RADIUS;
}
- else if (aDimType == "-diameter" || aDimType == "-diam")
+ else if (aDimType == "diameter" || aDimType == "diam")
{
aKindOfDimension = AIS_KOD_DIAMETER;
}
else
{
- theDi << theArgs[0] << ": wrong type of dimension. Type help for more information.\n";
+ std::cerr << theArgs[0] << ": wrong type of dimension. Type help for more information.\n";
return 1;
}
NCollection_List<Handle(AIS_InteractiveObject)> aShapes;
Standard_Boolean isPlaneCustom = Standard_False;
TCollection_AsciiString aName;
gp_Pln aWorkingPlane;
+ Standard_Boolean isCustomFlyout = Standard_False;
+ Standard_Real aCustomFlyout = 0.0;
+
for (Standard_Integer anIt = 2; anIt < theArgsNb; ++anIt)
{
- TCollection_AsciiString aParam (theArgs[anIt]);
- if (aParam.Search("-text") == 1)
+ TCollection_AsciiString anArgString = theArgs[anIt];
+ TCollection_AsciiString aParamName;
+ TCollection_AsciiString aParamValue;
+ if (ViewerTest::SplitParameter (anArgString, aParamName, aParamValue))
{
- anAspect->MakeText3d(aParam.Search("3d") != -1 ? Standard_True : Standard_False);
- }
- else if (aParam.Search("-name") == 1)
- {
- Standard_Integer aParamNameEnd = aParam.FirstLocationInSet("=",1, aParam.Length());
- if (aParamNameEnd == 0)
+ aParamName.LowerCase();
+ aParamValue.LowerCase();
+
+ if (aParamName == "text")
{
- theDi << theArgs[0] << ": no name for dimension.\n";
- return 1;
+ anAspect->MakeText3d (aParamValue == "3d");
+ }
+ else if (aParamName == "name")
+ {
+ if (aParamValue.IsEmpty())
+ {
+ std::cerr << theArgs[0] << ": no name for dimension.\n";
+ return 1;
+ }
+
+ aName = aParamValue;
+ }
+ else if (aParamName == "plane")
+ {
+ if (aParamValue == "xoy")
+ {
+ aWorkingPlane = gp_Pln (gp_Ax3 (gp::XOY()));
+ }
+ else if (aParamValue == "zox")
+ {
+ aWorkingPlane = gp_Pln (gp_Ax3 (gp::ZOX()));
+ }
+ else if (aParamValue == "yoz")
+ {
+ aWorkingPlane = gp_Pln (gp_Ax3 (gp::YOZ()));
+ }
+ else
+ {
+ std::cerr << theArgs[0] << ": wrong plane.\n";
+ return 1;
+ }
+
+ isPlaneCustom = Standard_True;
+ }
+ else if (aParamName == "label")
+ {
+ NCollection_List<TCollection_AsciiString> aListOfLabelVals;
+ while (aParamValue.Length() > 0)
+ {
+ TCollection_AsciiString aValue = aParamValue;
+
+ Standard_Integer aSeparatorPos = aParamValue.Search (",");
+ if (aSeparatorPos >= 0)
+ {
+ aValue.Trunc (aSeparatorPos - 1);
+ aParamValue.Remove (aSeparatorPos, 1);
+ }
+
+ aListOfLabelVals.Append (aValue);
+
+ aParamValue.Remove (1, aValue.Length());
+ }
+
+ NCollection_List<TCollection_AsciiString>::Iterator aLabelValueIt (aListOfLabelVals);
+ for ( ; aLabelValueIt.More(); aLabelValueIt.Next())
+ {
+ aParamValue = aLabelValueIt.Value();
+
+ if (aParamValue == "left")
+ {
+ anAspect->SetTextHorizontalPosition (Prs3d_DTHP_Left);
+ }
+ else if (aParamValue == "right")
+ {
+ anAspect->SetTextHorizontalPosition (Prs3d_DTHP_Right);
+ }
+ else if (aParamValue == "hcenter")
+ {
+ anAspect->SetTextHorizontalPosition (Prs3d_DTHP_Center);
+ }
+ else if (aParamValue == "hfit")
+ {
+ anAspect->SetTextHorizontalPosition (Prs3d_DTHP_Fit);
+ }
+ else if (aParamValue == "above")
+ {
+ anAspect->SetTextVerticalPosition (Prs3d_DTVP_Above);
+ }
+ else if (aParamValue == "below")
+ {
+ anAspect->SetTextVerticalPosition (Prs3d_DTVP_Below);
+ }
+ else if (aParamValue == "vcenter")
+ {
+ anAspect->SetTextVerticalPosition (Prs3d_DTVP_Center);
+ }
+ else
+ {
+ std::cerr << theArgs[0] << ": invalid label position: \"" << aParamValue << "\".\n";
+ return 1;
+ }
+ }
+ }
+ else if (aParamName == "flyout")
+ {
+ if (!aParamValue.IsRealValue())
+ {
+ std::cerr << theArgs[0] << ": numeric value expected for flyout.\n";
+ return 1;
+ }
+
+ aCustomFlyout = aParamValue.RealValue();
+
+ isCustomFlyout = Standard_True;
+ }
+ else if (aParamName == "arrows")
+ {
+ if (aParamValue == "external")
+ {
+ anAspect->SetArrowOrientation (Prs3d_DAO_External);
+ }
+ else if (aParamValue == "internal")
+ {
+ anAspect->SetArrowOrientation (Prs3d_DAO_Internal);
+ }
+ else if (aParamValue == "fit")
+ {
+ anAspect->SetArrowOrientation (Prs3d_DAO_Fit);
+ }
}
- aName = aParam.Split(aParamNameEnd);
- }
- else if (aParam.Search("-plane") == 1)
- {
- isPlaneCustom = Standard_True;
- if (aParam.Search("xoy") != -1)
- aWorkingPlane = gp_Pln (gp_Ax3(gp::XOY()));
- else if (aParam.Search("zox") != -1)
- aWorkingPlane = gp_Pln (gp_Ax3(gp::ZOX()));
- else if (aParam.Search("yoz") != -1)
- aWorkingPlane = gp_Pln (gp_Ax3(gp::YOZ()));
else
{
- theDi << theArgs[0] << ": wrong plane.\n";
+ std::cerr << theArgs[0] << ": unknow parameter: \"" << aParamName << "\".\n";
return 1;
}
}
- else if (aParam.Search("-") != 1) // Shape
+ else // Shape
{
- if (!GetMapOfAIS().IsBound2 (aParam))
+ if (!GetMapOfAIS().IsBound2 (anArgString))
{
- theDi << theArgs[0] << ": wrong name of shape. May be here is a wrong parameter.\n";
+ std::cerr << theArgs[0] << ": wrong name of shape. May be here is a wrong parameter.\n";
return 1;
}
- Handle(AIS_InteractiveObject) aShape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aParam));
+
+ Handle(AIS_InteractiveObject) aShape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (anArgString));
if (aShape.IsNull())
+ {
+ std::cerr << theArgs[0] << ": wrong name of shape. Not a shape.\n";
return 1;
+ }
+
aShapes.Append (aShape);
}
}
+ if (aName.IsEmpty())
+ {
+ std::cerr << theArgs[0] << ": no name for dimension.\n";
+ return 1;
+ }
+
// Build dimension
Handle(AIS_Dimension) aDim;
switch (aKindOfDimension)
{
- case AIS_KOD_LENGTH:
+ case AIS_KOD_LENGTH:
{
if (!isPlaneCustom)
{
- theDi << theArgs[0] << ": can build dimension without working plane.\n";
+ std::cerr << theArgs[0] << ": can not build dimension without working plane.\n";
return 1;
}
if (aShapes.Extent() == 1)
if (aShapes.First()->Type() == AIS_KOI_Shape
&& (Handle(AIS_Shape)::DownCast(aShapes.First()))->Shape().ShapeType() != TopAbs_EDGE)
{
- theDi << theArgs[0] << ": wrong shape type.\n";
+ std::cerr << theArgs[0] << ": wrong shape type.\n";
return 1;
}
aDim = new AIS_LengthDimension (TopoDS::Edge ((Handle(AIS_Shape)::DownCast(aShapes.First()))->Shape()), aWorkingPlane);
}
else
{
- theDi << theArgs[0] << ": wrong number of shapes to build dimension.\n";
+ std::cerr << theArgs[0] << ": wrong number of shapes to build dimension.\n";
return 1;
}
+
+ break;
}
- break;
- case AIS_KOD_PLANEANGLE:
+
+ case AIS_KOD_PLANEANGLE:
{
if (aShapes.Extent() == 1 && aShapes.First()->Type()==AIS_KOI_Shape)
{
aDim = new AIS_AngleDimension (TopoDS::Edge(aShape1->Shape()),TopoDS::Edge(aShape2->Shape()));
else
{
- theDi << theArgs[0] << ": wrong shapes for angle dimension.\n";
+ std::cerr << theArgs[0] << ": wrong shapes for angle dimension.\n";
return 1;
}
}
}
else
{
- theDi << theArgs[0] << ": wrong number of shapes to build dimension.\n";
+ std::cerr << theArgs[0] << ": wrong number of shapes to build dimension.\n";
return 1;
}
+
+ break;
}
- break;
- case AIS_KOD_RADIUS: // radius of the circle
+
+ case AIS_KOD_RADIUS: // radius of the circle
{
if (aShapes.Extent() == 1)
{
}
else
{
- theDi << theArgs[0] << ": wrong number of shapes to build dimension.\n";
+ std::cerr << theArgs[0] << ": wrong number of shapes to build dimension.\n";
return 1;
}
+
+ break;
}
- break;
- case AIS_KOD_DIAMETER:
+
+ case AIS_KOD_DIAMETER:
{
if (aShapes.Extent() == 1)
{
}
else
{
- theDi << theArgs[0] << ": wrong number of shapes to build dimension.\n";
+ std::cerr << theArgs[0] << ": wrong number of shapes to build dimension.\n";
return 1;
}
+
+ break;
}
- break;
- default:
+
+ default:
{
- theDi << theArgs[0] << ": wrong type of dimension. Type help for more information.\n";
+ std::cerr << theArgs[0] << ": wrong type of dimension. Type help for more information.\n";
return 1;
}
}
+
aDim->SetDimensionAspect (anAspect);
+
+ if (isCustomFlyout)
+ {
+ aDim->SetFlyout (aCustomFlyout);
+ }
+
if (GetMapOfAIS().IsBound2(aName))
{
theDi << theArgs[0] << ": shape with name " << aName.ToCString ()<< " already exists. It will be replaced\n";
TheAISContext()->Remove(anObj, Standard_False);
GetMapOfAIS().UnBind2(aName);
}
+
GetMapOfAIS().Bind (aDim,aName);
+
return 0;
}
{
const char *group = "AISRelations";
- theCommands.Add("vdim",
- "vdim -{angle|length|radius|diameter} -name={Dim_Name}"
- " shape1 [shape2 [shape3]] [-text={2d|3d} -plane={xoy|yoz|zox}]"
- " -Build a angle, length, radius and diameter dimensions;"
- " -Workis only with interactive objects",
+ theCommands.Add("vdimension",
+ "vdimension {angle|length|radius|diameter} name={Dim_Name} shape1 [shape2 [shape3]]\n"
+ " [text={2d|3d}] [plane={xoy|yoz|zox}]\n"
+ " [label={left|right|hcenter|hfit},{above|below|vcenter}]\n"
+ " [flyout=value] [arrows={external|internal|fit}]\n"
+ " -Builds angle, length, radius and diameter dimensions.\n"
__FILE__,VDimBuilder,group);
theCommands.Add("vangledim",
}
}
-//==============================================================================
-//function : splitParameter
-//purpose : Split parameter string to parameter name an parameter value
-//==============================================================================
-Standard_Boolean splitParameter (const TCollection_AsciiString& theString,
- TCollection_AsciiString& theName,
- TCollection_AsciiString& theValue)
-{
- Standard_Integer aParamNameEnd = theString.FirstLocationInSet("=",1, theString.Length());
- if (aParamNameEnd == 0)
- return Standard_False;
- TCollection_AsciiString aString(theString);
- if (aParamNameEnd != 0)
- {
- theValue = aString.Split(aParamNameEnd);
- aString.Split(aString.Length()-1);
- theName = aString;
- }
- return Standard_True;
-}
-
//==============================================================================
//function : Vinit
//purpose : Create the window viewer and initialize all the global variable
const TCollection_AsciiString anArg = theArgVec[anArgIt];
TCollection_AsciiString anArgCase = anArg;
anArgCase.UpperCase();
- if (splitParameter (anArg, aName, aValue))
+ if (ViewerTest::SplitParameter (anArg, aName, aValue))
{
aName.UpperCase();
if (aName.IsEqual ("NAME"))
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
TCollection_AsciiString aKey, aValue;
- if (!splitParameter (anArg, aKey, aValue)
+ if (!ViewerTest::SplitParameter (anArg, aKey, aValue)
|| aValue.IsEmpty())
{
std::cerr << "Error, wrong syntax at: '" << anArg.ToCString() << "'!\n";
vinit
vpoint lengthP1 0 0 0
vpoint lengthP2 50 50 50
-vdim -length -name=dim1 -plane=xoy lengthP1 lengthP2
+vdimension length name=dim1 plane=xoy lengthP1 lengthP2
vdisplay dim1
vfit
vmoveto 82 254
vpoint angleP1 0 0 0
vpoint angleP2 50 50 50
vpoint angleP3 50 50 100
-vdim -angle -name=dim1 angleP1 angleP2 angleP3
+vdimension angle name=dim1 angleP1 angleP2 angleP3
vdisplay dim1
vfit
vmoveto 249 206
}
vinit Viewer2/View2
vdisplay angleP1 angleP2 angleP3
-vdim -angle -name=dim2 -text=3d angleP1 angleP2 angleP3
+vdimension angle name=dim2 text=3d angleP1 angleP2 angleP3
vdisplay dim2
vfit
vmoveto 263 251
vpoint radP3 100 0 0
vcircle circle radP1 radP2 radP3 0
verase radP1 radP2 radP3
-vdim -radius -name=dim1 circle
+vdimension radius name=dim1 circle
vdisplay dim1
vfit
vmoveto 123 158
vinit Viewer2/View2
vdisplay circle
-vdim -radius -name=dim2 -text=3d circle
+vdimension radius name=dim2 text=3d circle
vdisplay dim2
vfit
vmoveto 191 196
vpoint diamP3 100 0 0
vcircle circle diamP1 diamP2 diamP3 0
verase diamP1 diamP2 diamP3
-vdim -diam -name=dim1 circle
+vdimension diameter name=dim1 circle
vdisplay dim1
vfit
vmoveto 208 205
vinit Viewer2/View2
vdisplay circle
-vdim -diam -name=dim2 -text=3d circle
+vdimension diameter name=dim2 text=3d circle
vdisplay dim2
vfit
vmoveto 208 205
vcircle circle radP1 radP2 radP3 0
vrotate 0 -$m_pi2 0
verase radP1 radP2 radP3
-vdim -radius -name=dim -text=3d circle
+vdimension radius name=dim text=3d circle
vdisplay dim
vfit
vmoveto 110 111
vcircle circle radP1 radP2 radP3 0
vrotate 0 -$m_pi2 0
verase radP1 radP2 radP3
-vdim -radius -name=dim -text=3d circle
+vdimension radius name=dim text=3d circle
vdisplay dim
vfit
vmoveto 110 111
vcircle circle radP1 radP2 radP3 0
vrotate 0 -$m_pi2 0
verase radP1 radP2 radP3
-vdim -radius -name=dim -text=3d circle
+vdimension radius name=dim text=3d circle
vdisplay dim
vfit
vmoveto 110 111
vinit
vpoint lengthP1 0 0 0
vpoint lengthP2 10 10 10
-vdim -length -name=dim1 -plane=xoy lengthP1 lengthP2
+vdimension length name=dim1 plane=xoy lengthP1 lengthP2
vdisplay dim1
vfit
vmoveto 202 191
--- /dev/null
+puts "============"
+puts "CR24351"
+puts "============"
+puts ""
+#######################################################################
+# Test AIS Length dimensions: label position and arrow orientation
+#######################################################################
+pload VISUALIZATION
+
+vinit
+vright
+
+set hpos "left hcenter right"
+set vpos "above vcenter below"
+
+# ---------------------------------------------------------------------
+# create dimensions with different arrow orientation and fit algorithm
+# ---------------------------------------------------------------------
+
+vpoint arrow_p1 0 0 0
+vpoint arrow_p2 50 0 0
+
+vpoint arrow_p3 100 0 0
+vpoint arrow_p4 150 0 0
+
+vpoint arrow_p5 0 0 50
+vpoint arrow_p6 10 0 50
+
+vpoint arrow_p7 100 0 50
+vpoint arrow_p8 127 0 50
+
+vdimension length name=arrow_d1 text=3d plane=zox label=hfit flyout=10.0 arrows=internal arrow_p1 arrow_p2
+vdimension length name=arrow_d2 text=3d plane=zox label=hfit flyout=10.0 arrows=external arrow_p3 arrow_p4
+vdimension length name=arrow_d3 text=3d plane=zox label=hfit flyout=10.0 arrows=fit arrow_p5 arrow_p6
+vdimension length name=arrow_d4 text=3d plane=zox label=hfit flyout=10.0 arrows=fit arrow_p7 arrow_p8
+vdisplay arrow_d1 arrow_d2 arrow_d3 arrow_d4
+vfit
+
+# ------------------------------------------------
+# create dimension with different label positions
+# ------------------------------------------------
+
+vinit Viewer2/View2
+vright
+
+set idx 0
+for {set r 0} {$r < 3} {incr r} {
+ for {set c 0} {$c < 3} {incr c} {
+
+ set point1 p_[expr "$idx * 2 + 0"]
+ set point2 p_[expr "$idx * 2 + 1"]
+
+ vpoint $point1 [expr "50.0 * ($c*2 + 0)"] 0.0 [expr "50.0 * $r"]
+ vpoint $point2 [expr "50.0 * ($c*2 + 1)"] 0.0 [expr "50.0 * $r"]
+
+ set dimension d_$idx
+
+ vdimension length name=$dimension text=3d plane=zox label=[lindex $hpos $c],[lindex $vpos $r] arrows=external flyout=10.0 $point1 $point2
+ vdisplay $dimension
+
+ incr idx
+ }
+}
+vfit
+
+set only_screen 1
--- /dev/null
+puts "============"
+puts "CR24351"
+puts "============"
+puts ""
+#######################################################################
+# Test AIS Diameter dimensions: label position and arrow orientation
+#######################################################################
+pload VISUALIZATION
+
+vinit
+vright
+
+set hpos "left hcenter right"
+set vpos "above vcenter below"
+
+# ---------------------------------------------------------------------
+# create dimensions with different arrow orientation and fit algorithm
+# ---------------------------------------------------------------------
+
+vpoint circle1_p1 0 0 30
+vpoint circle1_p2 30 0 0
+vpoint circle1_p3 60 0 30
+vcircle circle1 circle1_p1 circle1_p2 circle1_p3 0
+vdimension diameter name=diam1 text=3d plane=zox label=hfit flyout=0 arrows=internal circle1
+
+vpoint circle2_p1 100 0 30
+vpoint circle2_p2 130 0 0
+vpoint circle2_p3 160 0 30
+vcircle circle2 circle2_p1 circle2_p2 circle2_p3 0
+vdimension diameter name=diam2 text=3d plane=zox label=hfit flyout=0 arrows=external circle2
+
+vpoint circle3_p1 0 0 102
+vpoint circle3_p2 22 0 80
+vpoint circle3_p3 44 0 102
+vcircle circle3 circle3_p1 circle3_p2 circle3_p3 0
+vdimension diameter name=diam3 text=3d plane=zox label=hfit flyout=0 label=hfit arrows=fit circle3
+
+vpoint circle4_p1 100 0 92
+vpoint circle4_p2 112 0 80
+vpoint circle4_p3 124 0 92
+vcircle circle4 circle4_p1 circle4_p2 circle4_p3 0
+vdimension diameter name=diam4 text=3d plane=zox label=hfit flyout=0 label=hfit arrows=fit circle4
+
+vdisplay diam1 diam2 diam3 diam4
+vfit
+
+# ------------------------------------------------
+# create dimension with different label positions
+# ------------------------------------------------
+
+vinit Viewer2/View2
+vright
+
+set idx 0
+for {set r 0} {$r < 3} {incr r} {
+ for {set c 0} {$c < 3} {incr c} {
+
+ set point1 p_[expr "$idx * 3 + 0"]
+ set point2 p_[expr "$idx * 3 + 1"]
+ set point3 p_[expr "$idx * 3 + 2"]
+ set circle c_[expr "$idx"]
+
+ vpoint $point1 [expr "80.0 * $c + 0"] 0.0 [expr "60.0 * $r + 22"]
+ vpoint $point2 [expr "80.0 * $c + 22"] 0.0 [expr "60.0 * $r + 0"]
+ vpoint $point3 [expr "80.0 * $c + 44"] 0.0 [expr "60.0 * $r + 22"]
+ vcircle $circle $point1 $point2 $point3 0
+
+ set dimension d_$idx
+
+ vdimension diameter name=$dimension text=3d plane=zox label=[lindex $hpos $c],[lindex $vpos $r] arrows=external flyout=0.0 $circle
+ vdisplay $dimension
+
+ incr idx
+ }
+}
+vfit
+
+set only_screen 1
--- /dev/null
+puts "============"
+puts "CR24351"
+puts "============"
+puts ""
+#######################################################################
+# Test AIS Radius dimensions: label position and arrow orientation
+#######################################################################
+pload VISUALIZATION
+
+vinit
+vright
+
+set hpos "left hcenter"
+set vpos "above vcenter below"
+
+# ---------------------------------------------------------------------
+# create dimensions with different arrow orientation and fit algorithm
+# ---------------------------------------------------------------------
+
+vpoint circle1_p1 0 0 30
+vpoint circle1_p2 30 0 0
+vpoint circle1_p3 60 0 30
+vcircle circle1 circle1_p1 circle1_p2 circle1_p3 0
+vdimension radius name=rad1 text=3d plane=zox label=hfit flyout=0 arrows=internal circle1
+
+vpoint circle2_p1 100 0 30
+vpoint circle2_p2 130 0 0
+vpoint circle2_p3 160 0 30
+vcircle circle2 circle2_p1 circle2_p2 circle2_p3 0
+vdimension radius name=rad2 text=3d plane=zox label=hfit flyout=0 arrows=external circle2
+
+vpoint circle3_p1 0 0 113
+vpoint circle3_p2 33 0 80
+vpoint circle3_p3 66 0 113
+vcircle circle3 circle3_p1 circle3_p2 circle3_p3 0
+vdimension radius name=rad3 text=3d plane=zox label=hfit flyout=0 arrows=fit circle3
+
+vpoint circle4_p1 120 0 95
+vpoint circle4_p2 135 0 80
+vpoint circle4_p3 150 0 95
+vcircle circle4 circle4_p1 circle4_p2 circle4_p3 0
+vdimension radius name=rad4 text=3d plane=zox label=hfit flyout=0 arrows=fit circle4
+
+vdisplay rad1 rad2 rad3 rad4
+vfit
+
+# ------------------------------------------------
+# create dimension with different label positions
+# ------------------------------------------------
+
+vinit Viewer2/View2
+vright
+
+set idx 0
+for {set r 0} {$r < 3} {incr r} {
+ for {set c 0} {$c < 2} {incr c} {
+
+ set point1 p_[expr "$idx * 3 + 0"]
+ set point2 p_[expr "$idx * 3 + 1"]
+ set point3 p_[expr "$idx * 3 + 2"]
+ set circle c_[expr "$idx"]
+
+ vpoint $point1 [expr "90.0 * $c + 0"] 0.0 [expr "80.0 * $r + 33"]
+ vpoint $point2 [expr "90.0 * $c + 33"] 0.0 [expr "80.0 * $r + 0"]
+ vpoint $point3 [expr "90.0 * $c + 66"] 0.0 [expr "80.0 * $r + 33"]
+ vcircle $circle $point1 $point2 $point3 0
+
+ set dimension r_$idx
+
+ vdimension radius name=$dimension text=3d plane=zox label=[lindex $hpos $c],[lindex $vpos $r] arrows=external flyout=0.0 $circle
+ vdisplay $dimension
+
+ incr idx
+ }
+}
+vfit
+
+set only_screen 1
--- /dev/null
+puts "============"
+puts "CR24351"
+puts "============"
+puts ""
+#######################################################################
+# Test AIS angle dimensions: label position and arrow orientation
+#######################################################################
+pload VISUALIZATION
+
+vinit
+vright
+
+set hpos "left hcenter right"
+set vpos "above vcenter below"
+
+# ---------------------------------------------------------------------
+# create dimensions with different arrow orientation and fit algorithm
+# ---------------------------------------------------------------------
+
+vpoint angle1_p1 0 0 40
+vpoint angle1_p2 0 0 0
+vpoint angle1_p3 40 0 0
+vdimension angle name=ang1 text=3d plane=zox label=hfit flyout=40.0 arrows=internal angle1_p1 angle1_p2 angle1_p3
+
+vpoint angle2_p1 80 0 40
+vpoint angle2_p2 80 0 0
+vpoint angle2_p3 120 0 0
+vdimension angle name=ang2 text=3d plane=zox label=hfit flyout=40.0 arrows=external angle2_p1 angle2_p2 angle2_p3
+
+vpoint angle3_p1 0 0 115
+vpoint angle3_p2 0 0 80
+vpoint angle3_p3 35 0 80
+vdimension angle name=ang3 text=3d plane=zox label=hfit flyout=35.0 arrows=fit angle3_p1 angle3_p2 angle3_p3
+
+vpoint angle4_p1 80 0 100
+vpoint angle4_p2 80 0 80
+vpoint angle4_p3 100 0 80
+vdimension angle name=ang4 text=3d plane=zox label=hfit flyout=20.0 arrows=fit angle4_p1 angle4_p2 angle4_p3
+
+vdisplay ang1 ang2 ang3 ang4
+vfit
+
+# ------------------------------------------------
+# create dimension with different label positions
+# ------------------------------------------------
+
+vinit Viewer2/View2
+vright
+
+set idx 0
+for {set r 0} {$r < 3} {incr r} {
+ for {set c 0} {$c < 3} {incr c} {
+
+ set point1 p_[expr "$idx * 3 + 0"]
+ set point2 p_[expr "$idx * 3 + 1"]
+ set point3 p_[expr "$idx * 3 + 2"]
+
+ vpoint $point1 [expr "60.0 * $c + 0"] 0.0 [expr "60.0 * $r + 40"]
+ vpoint $point2 [expr "60.0 * $c + 0"] 0.0 [expr "60.0 * $r + 0"]
+ vpoint $point3 [expr "60.0 * $c + 40"] 0.0 [expr "60.0 * $r + 0"]
+
+ set dimension r_$idx
+
+ vdimension angle name=$dimension text=3d plane=zox label=[lindex $hpos $c],[lindex $vpos $r] arrows=external flyout=40.0 $point1 $point2 $point3
+ vdisplay $dimension
+
+ incr idx
+ }
+}
+vfit
+
+set only_screen 1