0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / PrsDim / PrsDim_EqualDistanceRelation.hxx
CommitLineData
42cf5bc1 1// Created on: 1998-01-24
2// Created by: Julia GERASIMOVA
3// Copyright (c) 1998-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
787ff240 17#ifndef _PrsDim_EqualDistanceRelation_HeaderFile
18#define _PrsDim_EqualDistanceRelation_HeaderFile
42cf5bc1 19
787ff240 20#include <PrsDim_Relation.hxx>
21#include <PrsDim_TypeOfDist.hxx>
7dd7c146 22#include <DsgPrs_ArrowSide.hxx>
42cf5bc1 23
7dd7c146 24class Geom_Plane;
42cf5bc1 25
787ff240 26DEFINE_STANDARD_HANDLE(PrsDim_EqualDistanceRelation, PrsDim_Relation)
42cf5bc1 27
28//! A framework to display equivalent distances between
29//! shapes and a given plane.
30//! The distance is the length of a projection from the
31//! shape to the plane.
32//! These distances are used to compare shapes by this vector alone.
787ff240 33class PrsDim_EqualDistanceRelation : public PrsDim_Relation
42cf5bc1 34{
787ff240 35 DEFINE_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation)
42cf5bc1 36public:
37
42cf5bc1 38 //! Constructs a framework to display equivalent
39 //! distances between the shapes aShape1, aShape2,
40 //! aShape3, aShape4 and the plane aPlane.
41 //! The distance is the length of a projection from the
42 //! shape to the plane.
787ff240 43 Standard_EXPORT PrsDim_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane);
42cf5bc1 44
45 //! Sets the shape aShape to be used as the shape
46 //! aShape3 in the framework created at construction time.
787ff240 47 void SetShape3 (const TopoDS_Shape& aShape) { myShape3 = aShape; }
42cf5bc1 48
49 //! Returns the shape aShape3 from the framework
50 //! created at construction time.
787ff240 51 const TopoDS_Shape& Shape3() const { return myShape3; }
42cf5bc1 52
53 //! Sets the shape aShape to be used as the shape
54 //! aShape4 in the framework created at construction time.
787ff240 55 void SetShape4 (const TopoDS_Shape& aShape) { myShape4 = aShape; }
42cf5bc1 56
57 //! Returns the shape aShape4 from the framework
58 //! created at construction time.
787ff240 59 const TopoDS_Shape& Shape4() const { return myShape4; }
60
61public:
b5163d2f 62
42cf5bc1 63 //! Computes the location of an intreval between
64 //! between two edges. FirstAttach , SecondAttach
65 //! are the returned extreme points of the interval.
66 Standard_EXPORT static void ComputeTwoEdgesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& SecondEdge, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
67
68 //! Computes the interval position between two vertexs. FirstAttach,
69 //! SecondAttach are the returned extreme points of the interval.
787ff240 70 Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const PrsDim_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
42cf5bc1 71
72 //! Compute the interval location between a vertex and an edge. Edge may be
73 //! a line or a circle.
74 Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
75
42cf5bc1 76private:
77
787ff240 78 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
42cf5bc1 79
787ff240 80 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
81
82private:
42cf5bc1 83
84 TopoDS_Shape myShape3;
85 TopoDS_Shape myShape4;
86 gp_Pnt myAttachPoint1;
87 gp_Pnt myAttachPoint2;
88 gp_Pnt myAttachPoint3;
89 gp_Pnt myAttachPoint4;
90 gp_Pnt myPoint1;
91 gp_Pnt myPoint2;
92 gp_Pnt myPoint3;
93 gp_Pnt myPoint4;
94
42cf5bc1 95};
96
787ff240 97#endif // _PrsDim_EqualDistanceRelation_HeaderFile