0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / AIS / AIS_OffsetDimension.hxx
1 // Created on: 1997-03-04
2 // Created by: Jean-Pierre COMBE
3 // Copyright (c) 1997-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
17 #ifndef _AIS_OffsetDimension_HeaderFile
18 #define _AIS_OffsetDimension_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <gp_Pnt.hxx>
24 #include <gp_Dir.hxx>
25 #include <gp_Trsf.hxx>
26 #include <AIS_Relation.hxx>
27 #include <Standard_Real.hxx>
28 #include <PrsMgr_PresentationManager3d.hxx>
29 #include <Standard_Integer.hxx>
30 #include <SelectMgr_Selection.hxx>
31 #include <AIS_KindOfDimension.hxx>
32 #include <Standard_Boolean.hxx>
33 class TopoDS_Shape;
34 class TCollection_ExtendedString;
35 class Prs3d_Presentation;
36 class Prs3d_Projector;
37 class Geom_Transformation;
38 class gp_Trsf;
39
40
41 class AIS_OffsetDimension;
42 DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation)
43
44 //! A framework to display dimensions of offsets.
45 //! The relation between the offset and the basis shape
46 //! is indicated. This relation is displayed with arrows and
47 //! text. The text gives the dsitance between the offset
48 //! and the basis shape.
49 class AIS_OffsetDimension : public AIS_Relation
50 {
51
52 public:
53
54   
55   //! Constructs the offset display object defined by the
56   //! first shape aFShape, the second shape aSShape, the
57   //! dimension aVal, and the text aText.
58   Standard_EXPORT AIS_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
59   
60   //! computes the presentation according to a point of view
61   //! given by <aProjector>.
62   //! To be Used when the associated degenerated Presentations
63   //! have been transformed by <aTrsf> which is not a Pure
64   //! Translation. The HLR Prs can't be deducted automatically
65   //! WARNING :<aTrsf> must be applied
66   //! to the object to display before computation  !!!
67   Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
68   
69
70   //! Indicates that the dimension we are concerned with is an offset.
71     virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE;
72   
73   //! Returns true if the offset datum is movable.
74     virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
75   
76   //! Sets a transformation aTrsf for presentation and
77   //! selection to a relative position.
78     void SetRelativePos (const gp_Trsf& aTrsf);
79
80
81
82
83   DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension,AIS_Relation)
84
85 protected:
86
87
88
89
90 private:
91
92   
93   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
94   
95   Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
96   
97   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
98   
99   Standard_EXPORT void ComputeTwoFacesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
100   
101   Standard_EXPORT void ComputeTwoAxesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
102   
103   Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
104
105   gp_Pnt myFAttach;
106   gp_Pnt mySAttach;
107   gp_Dir myDirAttach;
108   gp_Dir myDirAttach2;
109   gp_Trsf myRelativePos;
110
111
112 };
113
114
115 #include <AIS_OffsetDimension.lxx>
116
117
118
119
120
121 #endif // _AIS_OffsetDimension_HeaderFile