0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / DsgPrs / DsgPrs.hxx
CommitLineData
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>
27class Prs3d_Presentation;
28class Prs3d_DimensionAspect;
29class gp_Pnt;
30class gp_Dir;
31class gp_Pln;
32class Geom_Surface;
33class Geom_Curve;
34class gp_Ax1;
35class gp_Circ;
36class gp_Elips;
37class DsgPrs_EllipseRadiusPresentation;
38class DsgPrs_LengthPresentation;
39class DsgPrs_RadiusPresentation;
40class DsgPrs_DiameterPresentation;
41class DsgPrs_FilletRadiusPresentation;
42class DsgPrs_AnglePresentation;
43class DsgPrs_Chamf2dPresentation;
44class DsgPrs_ParalPresentation;
45class DsgPrs_PerpenPresentation;
46class DsgPrs_SymmetricPresentation;
47class DsgPrs_MidPointPresentation;
48class DsgPrs_TangentPresentation;
49class DsgPrs_ConcentricPresentation;
50class DsgPrs_FixPresentation;
51class DsgPrs_IdenticPresentation;
52class DsgPrs_EqualRadiusPresentation;
53class DsgPrs_EqualDistancePresentation;
54class DsgPrs_SymbPresentation;
55class DsgPrs_ShapeDirPresentation;
56class DsgPrs_OffsetPresentation;
57class DsgPrs_XYZAxisPresentation;
58class DsgPrs_XYZPlanePresentation;
59class DsgPrs_ShadedPlanePresentation;
60
61
62//! Describes Standard Presentations for DsgIHM objects
63class DsgPrs
64{
65public:
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
94protected:
95
96
97
98
99
100private:
101
102
103
104
105friend class DsgPrs_EllipseRadiusPresentation;
106friend class DsgPrs_LengthPresentation;
107friend class DsgPrs_RadiusPresentation;
108friend class DsgPrs_DiameterPresentation;
109friend class DsgPrs_FilletRadiusPresentation;
110friend class DsgPrs_AnglePresentation;
111friend class DsgPrs_Chamf2dPresentation;
112friend class DsgPrs_ParalPresentation;
113friend class DsgPrs_PerpenPresentation;
114friend class DsgPrs_SymmetricPresentation;
115friend class DsgPrs_MidPointPresentation;
116friend class DsgPrs_TangentPresentation;
117friend class DsgPrs_ConcentricPresentation;
118friend class DsgPrs_FixPresentation;
119friend class DsgPrs_IdenticPresentation;
120friend class DsgPrs_EqualRadiusPresentation;
121friend class DsgPrs_EqualDistancePresentation;
122friend class DsgPrs_SymbPresentation;
123friend class DsgPrs_ShapeDirPresentation;
124friend class DsgPrs_OffsetPresentation;
125friend class DsgPrs_XYZAxisPresentation;
126friend class DsgPrs_XYZPlanePresentation;
127friend class DsgPrs_ShadedPlanePresentation;
128
129};
130
131
132
133
134
135
136
137#endif // _DsgPrs_HeaderFile