42cf5bc1 |
1 | // Created on: 1994-10-03 |
2 | // Created by: Arnaud BOUZY |
3 | // Copyright (c) 1994-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 _DsgPrs_HeaderFile |
18 | #define _DsgPrs_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <DsgPrs_ArrowSide.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <Standard_Real.hxx> |
27 | class Prs3d_Presentation; |
28 | class Prs3d_DimensionAspect; |
29 | class gp_Pnt; |
30 | class gp_Dir; |
31 | class gp_Pln; |
32 | class Geom_Surface; |
33 | class Geom_Curve; |
34 | class gp_Ax1; |
35 | class gp_Circ; |
36 | class gp_Elips; |
37 | class DsgPrs_EllipseRadiusPresentation; |
38 | class DsgPrs_LengthPresentation; |
39 | class DsgPrs_RadiusPresentation; |
40 | class DsgPrs_DiameterPresentation; |
41 | class DsgPrs_FilletRadiusPresentation; |
42 | class DsgPrs_AnglePresentation; |
43 | class DsgPrs_Chamf2dPresentation; |
44 | class DsgPrs_ParalPresentation; |
45 | class DsgPrs_PerpenPresentation; |
46 | class DsgPrs_SymmetricPresentation; |
47 | class DsgPrs_MidPointPresentation; |
48 | class DsgPrs_TangentPresentation; |
49 | class DsgPrs_ConcentricPresentation; |
50 | class DsgPrs_FixPresentation; |
51 | class DsgPrs_IdenticPresentation; |
52 | class DsgPrs_EqualRadiusPresentation; |
53 | class DsgPrs_EqualDistancePresentation; |
54 | class DsgPrs_SymbPresentation; |
55 | class DsgPrs_ShapeDirPresentation; |
56 | class DsgPrs_OffsetPresentation; |
57 | class DsgPrs_XYZAxisPresentation; |
58 | class DsgPrs_XYZPlanePresentation; |
59 | class DsgPrs_ShadedPlanePresentation; |
60 | |
61 | |
62 | //! Describes Standard Presentations for DsgIHM objects |
63 | class DsgPrs |
64 | { |
65 | public: |
66 | |
67 | DEFINE_STANDARD_ALLOC |
68 | |
69 | |
70 | //! draws symbols ((one or two) arrows,(one or two)points |
71 | //! at thebeginning and at the end of the dimension |
72 | Standard_EXPORT static void ComputeSymbol (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_DimensionAspect)& anAspect, const gp_Pnt& pt1, const gp_Pnt& pt2, const gp_Dir& dir1, const gp_Dir& dir2, const DsgPrs_ArrowSide ArrowSide, const Standard_Boolean drawFromCenter = Standard_True); |
73 | |
74 | Standard_EXPORT static void ComputePlanarFacesLengthPresentation (const Standard_Real FirstArrowLength, const Standard_Real SecondArrowLength, const gp_Pnt& AttachmentPoint1, const gp_Pnt& AttachmentPoint2, const gp_Dir& DirAttach, const gp_Pnt& OffsetPoint, const gp_Pln& PlaneOfFaces, gp_Pnt& EndOfArrow1, gp_Pnt& EndOfArrow2, gp_Dir& DirOfArrow1); |
75 | |
76 | Standard_EXPORT static void ComputeCurvilinearFacesLengthPresentation (const Standard_Real FirstArrowLength, const Standard_Real SecondArrowLength, const Handle(Geom_Surface)& SecondSurf, const gp_Pnt& AttachmentPoint1, const gp_Pnt& AttachmentPoint2, const gp_Dir& DirAttach, gp_Pnt& EndOfArrow2, gp_Dir& DirOfArrow1, Handle(Geom_Curve)& VCurve, Handle(Geom_Curve)& UCurve, Standard_Real& FirstU, Standard_Real& deltaU, Standard_Real& FirstV, Standard_Real& deltaV); |
77 | |
78 | Standard_EXPORT static void ComputeFacesAnglePresentation (const Standard_Real ArrowLength, const Standard_Real Value, const gp_Pnt& CenterPoint, const gp_Pnt& AttachmentPoint1, const gp_Pnt& AttachmentPoint2, const gp_Dir& dir1, const gp_Dir& dir2, const gp_Dir& axisdir, const Standard_Boolean isPlane, const gp_Ax1& AxisOfSurf, const gp_Pnt& OffsetPoint, gp_Circ& AngleCirc, Standard_Real& FirstParAngleCirc, Standard_Real& LastParAngleCirc, gp_Pnt& EndOfArrow1, gp_Pnt& EndOfArrow2, gp_Dir& DirOfArrow1, gp_Dir& DirOfArrow2, gp_Pnt& ProjAttachPoint2, gp_Circ& AttachCirc, Standard_Real& FirstParAttachCirc, Standard_Real& LastParAttachCirc); |
79 | |
80 | Standard_EXPORT static void ComputeRadiusLine (const gp_Pnt& aCenter, const gp_Pnt& anEndOfArrow, const gp_Pnt& aPosition, const Standard_Boolean drawFromCenter, gp_Pnt& aRadLineOrign, gp_Pnt& aRadLineEnd); |
81 | |
82 | //! computes Geometry for fillet radius presentation; |
83 | //! special case flag SpecCase equal Standard_True if |
84 | //! radius of fillet circle = 0 or if anngle between |
85 | //! Vec1(Center, FirstPoint) and Vec2(Center,SecondPoint) equal 0 or PI |
86 | Standard_EXPORT static void ComputeFilletRadiusPresentation (const Standard_Real ArrowLength, const Standard_Real Value, const gp_Pnt& Position, const gp_Dir& NormalDir, const gp_Pnt& FirstPoint, const gp_Pnt& SecondPoint, const gp_Pnt& Center, const gp_Pnt& BasePnt, const Standard_Boolean drawRevers, Standard_Boolean& SpecCase, gp_Circ& FilletCirc, Standard_Real& FirstParCirc, Standard_Real& LastParCirc, gp_Pnt& EndOfArrow, gp_Dir& DirOfArrow, gp_Pnt& DrawPosition); |
87 | |
88 | //! computes length of ellipse arc in parametric units |
89 | Standard_EXPORT static Standard_Real DistanceFromApex (const gp_Elips& elips, const gp_Pnt& Apex, const Standard_Real par); |
90 | |
91 | |
92 | |
93 | |
94 | protected: |
95 | |
96 | |
97 | |
98 | |
99 | |
100 | private: |
101 | |
102 | |
103 | |
104 | |
105 | friend class DsgPrs_EllipseRadiusPresentation; |
106 | friend class DsgPrs_LengthPresentation; |
107 | friend class DsgPrs_RadiusPresentation; |
108 | friend class DsgPrs_DiameterPresentation; |
109 | friend class DsgPrs_FilletRadiusPresentation; |
110 | friend class DsgPrs_AnglePresentation; |
111 | friend class DsgPrs_Chamf2dPresentation; |
112 | friend class DsgPrs_ParalPresentation; |
113 | friend class DsgPrs_PerpenPresentation; |
114 | friend class DsgPrs_SymmetricPresentation; |
115 | friend class DsgPrs_MidPointPresentation; |
116 | friend class DsgPrs_TangentPresentation; |
117 | friend class DsgPrs_ConcentricPresentation; |
118 | friend class DsgPrs_FixPresentation; |
119 | friend class DsgPrs_IdenticPresentation; |
120 | friend class DsgPrs_EqualRadiusPresentation; |
121 | friend class DsgPrs_EqualDistancePresentation; |
122 | friend class DsgPrs_SymbPresentation; |
123 | friend class DsgPrs_ShapeDirPresentation; |
124 | friend class DsgPrs_OffsetPresentation; |
125 | friend class DsgPrs_XYZAxisPresentation; |
126 | friend class DsgPrs_XYZPlanePresentation; |
127 | friend class DsgPrs_ShadedPlanePresentation; |
128 | |
129 | }; |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | #endif // _DsgPrs_HeaderFile |