0024422: Wrong result done by FaceClassifier algorithm
[occt.git] / src / AIS / AIS_LengthDimension.cxx
CommitLineData
b311480e 1// Created on: 1996-12-05
2// Created by: Arnaud BOUZY/Odile Olivier
3// Copyright (c) 1996-1999 Matra Datavision
a6eb515f 4// Copyright (c) 1999-2013 OPEN CASCADE SAS
b311480e 5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
a6eb515f 21#include <AIS_LengthDimension.hxx>
7fd59977 22
23#include <AIS.hxx>
a6eb515f 24#include <BRep_Tool.hxx>
7fd59977 25#include <BRepAdaptor_Curve.hxx>
a6eb515f 26#include <BRepGProp_Face.hxx>
27#include <BRepLib_MakeVertex.hxx>
28#include <BRepTopAdaptor_FClass2d.hxx>
7fd59977 29#include <ElCLib.hxx>
30#include <ElSLib.hxx>
7fd59977 31#include <Geom_Line.hxx>
a6eb515f 32#include <gce_MakeDir.hxx>
a6eb515f 33#include <Graphic3d_Group.hxx>
34#include <Graphic3d_ArrayOfSegments.hxx>
d7bffd44 35#include <PrsMgr_PresentationManager.hxx>
36#include <Prs3d_Root.hxx>
7fd59977 37#include <TopExp.hxx>
38#include <TopExp_Explorer.hxx>
7fd59977 39
a6eb515f 40IMPLEMENT_STANDARD_HANDLE(AIS_LengthDimension, AIS_Dimension)
41IMPLEMENT_STANDARD_RTTIEXT(AIS_LengthDimension, AIS_Dimension)
7fd59977 42
43//=======================================================================
44//function : Constructor
a6eb515f 45//purpose : Dimension between two points
7fd59977 46//=======================================================================
47
a6eb515f 48AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
49 const gp_Pnt& theSecondPoint,
a6eb515f 50 const gp_Pln& theDimensionPlane)
d7bffd44 51: AIS_Dimension()
7fd59977 52{
a6eb515f 53 myIsInitialized = Standard_True;
54 myFirstPoint = theFirstPoint;
55 mySecondPoint = theSecondPoint;
56 myFirstShape = BRepLib_MakeVertex (myFirstPoint);
57 mySecondShape = BRepLib_MakeVertex (mySecondPoint);
58 myShapesNumber = 2;
59 SetKindOfDimension (AIS_KOD_LENGTH);
60 SetWorkingPlane (theDimensionPlane);
d7bffd44 61 SetFlyout (15.0);
7fd59977 62}
63
7fd59977 64//=======================================================================
65//function : Constructor
a6eb515f 66//purpose : Dimension between two shape
7fd59977 67//=======================================================================
68
a6eb515f 69AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
70 const TopoDS_Shape& theSecondShape,
71 const gp_Pln& theWorkingPlane)
d7bffd44 72: AIS_Dimension()
7fd59977 73{
a6eb515f 74 myIsInitialized = Standard_False;
75 myFirstShape = theFirstShape;
76 mySecondShape = theSecondShape;
77 myShapesNumber = 2;
78 SetKindOfDimension (AIS_KOD_LENGTH);
79 SetWorkingPlane (theWorkingPlane);
d7bffd44 80 SetFlyout (15.0);
7fd59977 81}
82
83//=======================================================================
84//function : Constructor
a6eb515f 85//purpose : Dimension of one edge
7fd59977 86//=======================================================================
87
a6eb515f 88AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge,
89 const gp_Pln& theWorkingPlane)
d7bffd44 90: AIS_Dimension()
7fd59977 91{
a6eb515f 92 myIsInitialized = Standard_False;
93 myFirstShape = theEdge;
94 myShapesNumber = 1;
95 SetKindOfDimension (AIS_KOD_LENGTH);
96 SetWorkingPlane (theWorkingPlane);
d7bffd44 97 SetFlyout (15.0);
7fd59977 98}
99
7fd59977 100//=======================================================================
a6eb515f 101//function : Constructor
102//purpose : Dimension between two faces
7fd59977 103//=======================================================================
104
a6eb515f 105AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
106 const TopoDS_Face& theSecondFace)
d7bffd44 107: AIS_Dimension()
7fd59977 108{
a6eb515f 109 myIsInitialized = Standard_False;
110 myFirstShape = theFirstFace;
111 mySecondShape = theSecondFace;
112 myShapesNumber = 2;
d7bffd44 113 SetKindOfDimension (AIS_KOD_LENGTH);
62b6361a 114 SetFlyout (15.0);
7fd59977 115}
116
117//=======================================================================
a6eb515f 118//function : Constructor
119//purpose : Dimension between two shape
7fd59977 120//=======================================================================
121
a6eb515f 122AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
123 const TopoDS_Edge& theEdge)
d7bffd44 124: AIS_Dimension()
7fd59977 125{
a6eb515f 126 myIsInitialized = Standard_False;
127 myFirstShape = theFace;
128 mySecondShape = theEdge;
129 myShapesNumber = 2;
d7bffd44 130 SetKindOfDimension (AIS_KOD_LENGTH);
62b6361a 131 SetFlyout (15.0);
7fd59977 132}
133
134//=======================================================================
a6eb515f 135//function : initTwoEdgesLength
136//purpose : Initialization of dimanesion between two linear edges
7fd59977 137//=======================================================================
138
a6eb515f 139Standard_Boolean AIS_LengthDimension::initTwoEdgesLength (const TopoDS_Edge & theFirstEdge,
d7bffd44 140 const TopoDS_Edge& theSecondEdge,
141 gp_Dir& theDirAttach)
7fd59977 142{
a6eb515f 143 Standard_Integer anExtShapeIndex = 0;
144 BRepAdaptor_Curve aFirstCurveAdapt (theFirstEdge);
145 if (aFirstCurveAdapt.GetType() != GeomAbs_Line)
146 return Standard_False;
147 BRepAdaptor_Curve aSecondCurveAdapt (theSecondEdge);
148 if (aSecondCurveAdapt.GetType() != GeomAbs_Line)
149 return Standard_False;
150 Handle(Geom_Curve) aFirstCurve, aSecondCurve;
151 gp_Pnt aPoint11,aPoint12,aPoint21,aPoint22;
152 Standard_Boolean isFirstInfinite (Standard_False),
153 isSecondInfinite (Standard_False);
154 Handle(Geom_Curve) anExtCurve;
155
156 if (!AIS::ComputeGeometry (theFirstEdge, theSecondEdge,anExtShapeIndex,
157 aFirstCurve, aSecondCurve, aPoint11, aPoint12,
158 aPoint21, aPoint22, anExtCurve, isFirstInfinite,
159 isSecondInfinite, new Geom_Plane(GetWorkingPlane())))
160 return Standard_False;
161
162 const Handle(Geom_Line)& aGeomLine1 = (Handle(Geom_Line)&) aFirstCurve;
163 const Handle(Geom_Line)& aGeomLine2 = (Handle(Geom_Line)&) aSecondCurve;
164 const gp_Lin& aLin1 = aGeomLine1->Lin();
165 const gp_Lin& aLin2 = aGeomLine2->Lin();
166
167 myValue = aLin1.Distance (aLin2);
168 theDirAttach = aLin1.Direction();
169
170 gp_Pnt aCurPos;
171 if (!isFirstInfinite)
172 {
173 gp_Pnt aPoint2 = ElCLib::Value(ElCLib::Parameter (aLin2, aPoint11), aLin2);
174 aCurPos.SetXYZ((aPoint11.XYZ() + aPoint2.XYZ()) / 2.);
175 }
176 else if (!isSecondInfinite)
177 {
178 gp_Pnt aPoint2 = ElCLib::Value (ElCLib::Parameter (aLin1, aPoint21), aLin1);
179 aCurPos.SetXYZ ((aPoint21.XYZ() + aPoint2.XYZ()) / 2.);
7fd59977 180 }
a6eb515f 181 else
182 aCurPos.SetXYZ((aLin1.Location().XYZ() + aLin2.Location().XYZ()) / 2.);
183
184 // Offset to avoid confusion Edge and Dimension
185 gp_Vec anOffset(theDirAttach);
186 anOffset = anOffset*myDrawer->DimensionAspect()->ArrowAspect()->Length()*(-10.);
187 aCurPos.Translate(anOffset);
188 myGeom.myTextPosition = aCurPos;
189 // Find attachment points
190 if (!isFirstInfinite)
191 {
192 if (myGeom.myTextPosition.Distance(aPoint11) > myGeom.myTextPosition.Distance(aPoint12))
193 myFirstPoint = aPoint12;
194 else
195 myFirstPoint = aPoint11;
7fd59977 196 }
a6eb515f 197 else
198 myFirstPoint = ElCLib::Value(ElCLib::Parameter(aLin1,myGeom.myTextPosition), aLin1);
7fd59977 199
a6eb515f 200 if (!isSecondInfinite)
201 {
202 if (myGeom.myTextPosition.Distance(aPoint21) > myGeom.myTextPosition.Distance(aPoint22))
203 mySecondPoint = aPoint22;
204 else
205 mySecondPoint = aPoint21;
206 }
7fd59977 207 else
a6eb515f 208 mySecondPoint = ElCLib::Value(ElCLib::Parameter(aLin2, myGeom.myTextPosition), aLin2);
7fd59977 209
a6eb515f 210 return Standard_True;
7fd59977 211}
212
7fd59977 213//=======================================================================
a6eb515f 214//function : initEdgeVertexLength
215//purpose : for first edge and second vertex shapes
7fd59977 216//=======================================================================
217
a6eb515f 218Standard_Boolean AIS_LengthDimension::initEdgeVertexLength (const TopoDS_Edge & theEdge,
d7bffd44 219 const TopoDS_Vertex & theVertex,
220 gp_Dir & theDirAttach,
221 Standard_Boolean isInfinite)
7fd59977 222{
a6eb515f 223 gp_Pnt anEdgePoint1,anEdgePoint2;
224 Handle(Geom_Curve) aCurve;
225 Handle(Geom_Curve) anExtCurve;
226 Standard_Boolean isEdgeOnPlane, isVertexOnPlane;
227 if (!AIS::ComputeGeometry(theEdge,aCurve,anEdgePoint1,anEdgePoint2,
228 anExtCurve,isInfinite,isEdgeOnPlane, new Geom_Plane (GetWorkingPlane())))
229 return Standard_False;
230 AIS::ComputeGeometry (theVertex, myFirstPoint, new Geom_Plane(GetWorkingPlane()), isVertexOnPlane);
231
232 const Handle(Geom_Line)& aGeomLine = (Handle(Geom_Line)&) aCurve;
233 const gp_Lin& aLin = aGeomLine->Lin();
234
235 myValue = aLin.Distance( myFirstPoint);
236 theDirAttach = aLin.Direction();
237
238 gp_Pnt aPoint = ElCLib::Value(ElCLib::Parameter(aLin,myFirstPoint),aLin);
239 gp_Pnt aCurPos((myFirstPoint.XYZ() + aPoint.XYZ())/2.);
240
241 if (!isInfinite)
242 {
243 if (myGeom.myTextPosition.Distance(anEdgePoint1) > myGeom.myTextPosition.Distance(anEdgePoint2))
244 mySecondPoint = anEdgePoint2;
245 else
246 mySecondPoint = anEdgePoint1;
7fd59977 247 }
a6eb515f 248 else
249 mySecondPoint = ElCLib::Value(ElCLib::Parameter(aLin,myGeom.myTextPosition),aLin);
250 return Standard_True;
7fd59977 251}
252
7fd59977 253//=======================================================================
a6eb515f 254//function : initEdgeVertexLength
7fd59977 255//purpose :
256//=======================================================================
257
a6eb515f 258Standard_Boolean AIS_LengthDimension::initEdgeFaceLength (const TopoDS_Edge& theEdge,
259 const TopoDS_Face& theFace,
260 gp_Dir& theDirAttach)
7fd59977 261{
a6eb515f 262 // The first attachment point is <aPoint1> from the reference <anEdge>.
263 // Find the second attachment point which belongs to the reference face
264 // Iterate over the edges of the face and find the point <aFacePoint1>.
265 // It is the closest point according to <aPoint1>.
266 TopoDS_Vertex aVertex1, aVertex2;
267 TopExp::Vertices (theEdge, aVertex1, aVertex2);
268 myFirstPoint = BRep_Tool::Pnt (aVertex1);
269 gp_Pnt aPoint = BRep_Tool::Pnt (aVertex2);
270 gp_Pnt2d aFacePoint1uv, aFacePoint2uv;
271 Standard_Real aDist1 = RealLast ();
272 Standard_Real aDist2 = RealLast ();
273
274 TopExp_Explorer anIt (theFace, TopAbs_EDGE);
275 for (; anIt.More (); anIt.Next ())
276 {
277 const TopoDS_Edge aFaceEdge = TopoDS::Edge(anIt.Current ());
278 if (aFaceEdge == theEdge)
279 return Standard_False;
280 TopExp::Vertices (aFaceEdge, aVertex1, aVertex2);
281 gp_Pnt aFacePoint1c = BRep_Tool::Pnt (aVertex1);
282 gp_Pnt aFacePoint2c = BRep_Tool::Pnt (aVertex2);
283 Standard_Real aDistc1 = myFirstPoint.SquareDistance (aFacePoint1c);
284 Standard_Real aDistc2 = myFirstPoint.SquareDistance (aFacePoint2c);
285 if (aDistc1 <= aDistc2)
7fd59977 286 {
a6eb515f 287 if (aDistc1 <= aDist1)
288 {
289 aDistc2 = aPoint.SquareDistance (aFacePoint2c);
290 if (aDistc2 <= aDist2)
291 {
292 mySecondPoint = aFacePoint1c;
293 aDist1 = aDistc1;
294 aDist2 = aDistc2;
295 BRep_Tool::UVPoints (aFaceEdge, theFace, aFacePoint1uv, aFacePoint2uv);
296 }
7fd59977 297 }
7fd59977 298 }
a6eb515f 299 else
300 {
301 if (aDistc2 <= aDist1)
302 {
303 aDistc1 = aPoint.SquareDistance (aFacePoint1c);
304 if (aDistc1 <= aDist2)
305 {
306 mySecondPoint = aFacePoint2c;
307 aDist1 = aDistc2;
308 aDist2 = aDistc1;
309 BRep_Tool::UVPoints (aFaceEdge, theFace, aFacePoint2uv, aFacePoint1uv);
310 }
7fd59977 311 }
7fd59977 312 }
313 }
7fd59977 314
a6eb515f 315 gp_Vec anOffsetDirection (0.0, 0.0, 0.0);
7fd59977 316
a6eb515f 317 //The offset direction is the normal to the face at the point FP1
318 BRepGProp_Face aGFace;
319 aGFace.Load (theFace);
320 aGFace.Normal (aFacePoint1uv.X(), aFacePoint1uv.Y(), aPoint, anOffsetDirection);
7fd59977 321
a6eb515f 322 if (anOffsetDirection.Magnitude () > Precision::Confusion ())
323 {
324 theDirAttach = gp_Dir (anOffsetDirection);
7fd59977 325 }
a6eb515f 326 else theDirAttach = gp::DZ ();
7fd59977 327
a6eb515f 328 gp_Vec aVector (theDirAttach);
329 aVector.Multiply (1.5 * myValue);
330 myGeom.myTextPosition = mySecondPoint.Translated (aVector);
331 return Standard_True;
7fd59977 332}
333
334//=======================================================================
a6eb515f 335//function : initTwoShapesPoints
336//purpose : Initialization of two points where dimension layouts
337// will be attached
7fd59977 338//=======================================================================
339
a6eb515f 340Standard_Boolean AIS_LengthDimension::initTwoShapesPoints (const TopoDS_Shape& theFirstShape,
341 const TopoDS_Shape& theSecondShape)
7fd59977 342{
a6eb515f 343 gp_Dir aDirAttach;
344 Standard_Boolean isInfinite = Standard_False;
345 Standard_Boolean isSuccess = Standard_False;
346 switch (theFirstShape.ShapeType())
347 {
348 case TopAbs_FACE:
7fd59977 349 {
a6eb515f 350 // Initialization for face
351 gp_Pln aFirstPlane;
352 Handle(Geom_Surface) aFirstSurface;
353 AIS_KindOfSurface aFirstSurfKind;
354 Standard_Real aFirstOffset;
355 TopoDS_Face aFirstFace = TopoDS::Face (theFirstShape);
356 AIS::InitFaceLength (TopoDS::Face (theFirstShape), aFirstPlane,
357 aFirstSurface,aFirstSurfKind, aFirstOffset);
358
359 if (theSecondShape.ShapeType () == TopAbs_FACE)
360 {
361 // Initialization for face
362 gp_Pln aSecondPlane;
363 Handle(Geom_Surface) aSecondSurface;
364 AIS_KindOfSurface aSecondSurfKind;
365 Standard_Real aSecondOffset;
366 TopoDS_Face aSecondFace = TopoDS::Face (theSecondShape);
367 AIS::InitFaceLength (aSecondFace, aSecondPlane,
368 aSecondSurface, aSecondSurfKind, aSecondOffset);
369 if (aFirstSurfKind == AIS_KOS_Plane)
7fd59977 370 {
a6eb515f 371 TopExp_Explorer anExplorer (theFirstShape, TopAbs_VERTEX);
372 // In case of infinite planes
373 if (!anExplorer.More())
374 myFirstPoint = aFirstPlane.Location();
375 else myFirstPoint = BRep_Tool::Pnt (TopoDS::Vertex (anExplorer.Current()));
376 mySecondPoint = AIS::ProjectPointOnPlane (myFirstPoint, aSecondPlane);
377
378 gp_Dir aLengthDir = aFirstPlane.Axis().Direction();
379 gp_Dir aDirAttach = aFirstPlane.Position().XDirection();
380 Quantity_Parameter anU, aV;
381 ElSLib::Parameters (aSecondPlane, mySecondPoint, anU, aV);
382 BRepTopAdaptor_FClass2d aClassifier (aSecondFace, Precision::Confusion());
383 TopAbs_State aState = aClassifier.Perform (gp_Pnt2d (anU, aV), Standard_False);
384 if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN)
385 {
386 mySecondPoint = AIS::Nearest(aSecondFace, myFirstPoint);
387 if (myFirstPoint.Distance(mySecondPoint) > Precision::Confusion())
388 {
389 gp_Vec aVec = gp_Vec(myFirstPoint, mySecondPoint) ^ aLengthDir;
390 if (aVec.SquareMagnitude() > Precision::SquareConfusion())
391 aDirAttach = aVec ^ aLengthDir;
392 }
393 }
394 isSuccess = Standard_True;
7fd59977 395 }
a6eb515f 396 else // curvilinear faces
7fd59977 397 {
a6eb515f 398 AIS::ComputeLengthBetweenCurvilinearFaces (aFirstFace, aSecondFace, aFirstSurface,
399 aSecondSurface,Standard_True, myValue,
400 myGeom.myTextPosition,myFirstPoint,mySecondPoint,aDirAttach);
401 isSuccess = Standard_True;
7fd59977 402 }
a6eb515f 403 }
404 else if (theFirstShape.ShapeType() == TopAbs_EDGE)
405 {
406 isSuccess = initEdgeFaceLength (TopoDS::Edge (theFirstShape),
407 TopoDS::Face (theSecondShape),
408 aDirAttach);
409 }
410 if (!myIsWorkingPlaneCustom)
411 resetWorkingPlane(gp_Pln(myFirstPoint, aDirAttach));
7fd59977 412 }
a6eb515f 413 break;
414 case TopAbs_EDGE:
7fd59977 415 {
a6eb515f 416 if (theSecondShape.ShapeType() == TopAbs_VERTEX)
417 {
418 return initEdgeVertexLength (TopoDS::Edge(theFirstShape),
419 TopoDS::Vertex(theSecondShape),
420 aDirAttach, isInfinite);
421 }
422 else if (theSecondShape.ShapeType() == TopAbs_EDGE)
423 {
424 return initTwoEdgesLength (TopoDS::Edge(theFirstShape),
425 TopoDS::Edge(theSecondShape),
426 aDirAttach);
427 }
7fd59977 428 }
a6eb515f 429 break;
430 case TopAbs_VERTEX:
7fd59977 431 {
a6eb515f 432 if (theSecondShape.ShapeType() == TopAbs_VERTEX)
433 {
434 myFirstPoint = BRep_Tool::Pnt (TopoDS::Vertex (theFirstShape));
435 mySecondPoint = BRep_Tool::Pnt (TopoDS::Vertex (theSecondShape));
436 isSuccess = Standard_True;
437 }
438 else if (theSecondShape.ShapeType() == TopAbs_EDGE)
439 {
440 return initEdgeVertexLength (TopoDS::Edge(theSecondShape),
441 TopoDS::Vertex(theFirstShape),
442 aDirAttach, isInfinite);
443 }
7fd59977 444 }
a6eb515f 445 break;
446 case TopAbs_COMPOUND:
447 case TopAbs_COMPSOLID:
448 case TopAbs_SOLID:
449 case TopAbs_SHELL:
450 case TopAbs_WIRE:
451 case TopAbs_SHAPE:
452 // nothing to do for these kinds
453 break;
454 }
455 return isSuccess;
7fd59977 456}
457
458//=======================================================================
a6eb515f 459//function : initOneShapePoints
460//purpose : Initialization of two points where dimension layouts
461// will be attached
462// Attention: 1) <theShape> can be only the edge in currect implementation
463// 2) No length for infinite edge
7fd59977 464//=======================================================================
465
a6eb515f 466Standard_Boolean AIS_LengthDimension::initOneShapePoints (const TopoDS_Shape& theShape)
7fd59977 467{
a6eb515f 468 if (theShape.ShapeType() == TopAbs_EDGE)
469 {
470 TopoDS_Edge anEdge = TopoDS::Edge (theShape);
471 BRepAdaptor_Curve aBrepCurve(anEdge);
472 Standard_Real aFirst = aBrepCurve.FirstParameter(),
473 aLast = aBrepCurve.LastParameter();
474 Standard_Boolean isInfinite = (Precision::IsInfinite (aFirst)
475 || Precision::IsInfinite (aLast));
476 if (isInfinite)
477 return Standard_False;
478
479 myFirstPoint = aBrepCurve.Value (aBrepCurve.FirstParameter());
480 mySecondPoint = aBrepCurve.Value (aBrepCurve.LastParameter());
481 }
482 else // Some other kinds of shapes
483 return Standard_False;
484 return Standard_True;
485}
7fd59977 486
a6eb515f 487//=======================================================================
488//function : Compute
489//purpose :
490//=======================================================================
7fd59977 491
a6eb515f 492void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/,
493 const Handle(Prs3d_Presentation)& thePresentation,
494 const Standard_Integer theMode)
495{
496 // Initialization of points, if they are not set
497 if (!myIsInitialized)
498 {
499 if (myShapesNumber == 1)
d7bffd44 500 {
501 myIsInitialized = initOneShapePoints (myFirstShape);
502 }
a6eb515f 503 else if (myShapesNumber == 2)
d7bffd44 504 {
505 myIsInitialized = initTwoShapesPoints (myFirstShape, mySecondShape);
506 }
a6eb515f 507 else
d7bffd44 508 {
a6eb515f 509 return;
d7bffd44 510 }
7fd59977 511 }
d7bffd44 512
a6eb515f 513 // If initialization failed
514 if (!myIsInitialized)
d7bffd44 515 {
a6eb515f 516 return;
d7bffd44 517 }
7fd59977 518
a6eb515f 519 thePresentation->Clear();
7fd59977 520
d7bffd44 521 drawLinearDimension (thePresentation, (AIS_DimensionDisplayMode)theMode);
7fd59977 522}
523
7fd59977 524//=======================================================================
a6eb515f 525//function : ComputeValue
7fd59977 526//purpose :
527//=======================================================================
7fd59977 528
d7bffd44 529void AIS_LengthDimension::computeValue()
7fd59977 530{
a6eb515f 531 myValue = myFirstPoint.Distance (mySecondPoint);
532 AIS_Dimension::computeValue ();
7fd59977 533}