42cf5bc1 |
1 | // Created on: 1992-08-26 |
2 | // Created by: Jean Louis FRENKEL |
3 | // Copyright (c) 1992-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 _Prs3d_HeaderFile |
18 | #define _Prs3d_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Quantity_Length.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Prs3d_Drawer.hxx> |
28 | class gp_Pnt; |
29 | class TopoDS_Shape; |
30 | class Prs3d_Presentation; |
31 | class Prs3d_BasicAspect; |
32 | class Prs3d_PointAspect; |
33 | class Prs3d_LineAspect; |
34 | class Prs3d_ShadingAspect; |
35 | class Prs3d_TextAspect; |
36 | class Prs3d_IsoAspect; |
37 | class Prs3d_ArrowAspect; |
38 | class Prs3d_PlaneAspect; |
39 | class Prs3d_DimensionAspect; |
40 | class Prs3d_DatumAspect; |
41 | class Prs3d_Projector; |
42 | class Prs3d_PlaneSet; |
43 | class Prs3d_Root; |
44 | class Prs3d_Text; |
45 | class Prs3d_ShapeTool; |
46 | class Prs3d_Arrow; |
47 | |
48 | |
49 | //! The Prs3d package provides the following services |
50 | //! - a presentation object (the context for all |
51 | //! modifications to the display, its presentation will be |
52 | //! displayed in every view of an active viewer) |
53 | //! - an attribute manager governing how objects such |
54 | //! as color, width, and type of line are displayed; |
55 | //! these are generic objects, whereas those in |
56 | //! StdPrs are specific geometries and topologies. |
57 | //! - generic algorithms providing default settings for |
58 | //! objects such as points, curves, surfaces and shapes |
59 | //! - a root object which provides the abstract |
60 | //! framework for the DsgPrs definitions at work in |
61 | //! display of dimensions, relations and trihedra. |
62 | class Prs3d |
63 | { |
64 | public: |
65 | |
66 | DEFINE_STANDARD_ALLOC |
67 | |
68 | |
69 | //! draws an arrow at a given location, with respect |
70 | //! to a given direction. |
71 | Standard_EXPORT static Standard_Boolean MatchSegment (const Quantity_Length X, const Quantity_Length Y, const Quantity_Length Z, const Quantity_Length aDistance, const gp_Pnt& p1, const gp_Pnt& p2, Quantity_Length& dist); |
72 | |
73 | //! Computes the absolute deflection value depending on |
74 | //! the type of deflection in theDrawer: |
75 | //! <ul> |
76 | //! <li><b>Aspect_TOD_RELATIVE</b>: the absolute deflection is computed using the relative |
77 | //! deviation coefficient from theDrawer and the shape's bounding box;</li> |
78 | //! <li><b>Aspect_TOD_ABSOLUTE</b>: the maximal chordial deviation from theDrawer is returned.</li> |
79 | //! </ul> |
80 | //! In case of the type of deflection in theDrawer computed relative deflection for shape |
81 | //! is stored as absolute deflection. It is necessary to use it later on for sub-shapes. |
82 | //! This function should always be used to compute the deflection value for building |
83 | //! discrete representations of the shape (triangualtion, wireframe) to avoid incosistencies |
84 | //! between different representations of the shape and undesirable visual artifacts. |
85 | Standard_EXPORT static Standard_Real GetDeflection (const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer); |
86 | |
87 | |
88 | |
89 | |
90 | protected: |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | private: |
97 | |
98 | |
99 | |
100 | |
101 | friend class Prs3d_Presentation; |
102 | friend class Prs3d_BasicAspect; |
103 | friend class Prs3d_PointAspect; |
104 | friend class Prs3d_LineAspect; |
105 | friend class Prs3d_ShadingAspect; |
106 | friend class Prs3d_TextAspect; |
107 | friend class Prs3d_IsoAspect; |
108 | friend class Prs3d_ArrowAspect; |
109 | friend class Prs3d_PlaneAspect; |
110 | friend class Prs3d_DimensionAspect; |
111 | friend class Prs3d_DatumAspect; |
112 | friend class Prs3d_Projector; |
113 | friend class Prs3d_PlaneSet; |
114 | friend class Prs3d_Root; |
115 | friend class Prs3d_Text; |
116 | friend class Prs3d_ShapeTool; |
117 | friend class Prs3d_Arrow; |
118 | |
119 | }; |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | |
127 | #endif // _Prs3d_HeaderFile |