0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / AIS / AIS_Plane.hxx
CommitLineData
42cf5bc1 1// Created on: 1995-08-02
2// Created by: Arnaud BOUZY/Odile Olivier
3// Copyright (c) 1995-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_Plane_HeaderFile
18#define _AIS_Plane_HeaderFile
19
87432b82 20#include <AIS_InteractiveObject.hxx>
42cf5bc1 21#include <AIS_TypeOfPlane.hxx>
87432b82 22#include <gp_Pnt.hxx>
42cf5bc1 23#include <Select3D_TypeOfSensitivity.hxx>
87432b82 24
42cf5bc1 25class Geom_Plane;
26class Geom_Axis2Placement;
42cf5bc1 27
28//! Constructs plane datums to be used in construction of
29//! composite shapes.
30class AIS_Plane : public AIS_InteractiveObject
31{
87432b82 32 DEFINE_STANDARD_RTTIEXT(AIS_Plane, AIS_InteractiveObject)
42cf5bc1 33public:
34
42cf5bc1 35 //! initializes the plane aComponent. If
36 //! the mode aCurrentMode equals true, the drawing
37 //! tool, "Drawer" is not initialized.
38 Standard_EXPORT AIS_Plane(const Handle(Geom_Plane)& aComponent, const Standard_Boolean aCurrentMode = Standard_False);
39
40 //! initializes the plane aComponent and
41 //! the point aCenter. If the mode aCurrentMode
42 //! equals true, the drawing tool, "Drawer" is not
43 //! initialized. aCurrentMode equals true, the drawing
44 //! tool, "Drawer" is not initialized.
45 Standard_EXPORT AIS_Plane(const Handle(Geom_Plane)& aComponent, const gp_Pnt& aCenter, const Standard_Boolean aCurrentMode = Standard_False);
46
47 //! initializes the plane aComponent, the
48 //! point aCenter, and the minimum and maximum
49 //! points, aPmin and aPmax. If the mode
50 //! aCurrentMode equals true, the drawing tool, "Drawer" is not initialized.
51 Standard_EXPORT AIS_Plane(const Handle(Geom_Plane)& aComponent, const gp_Pnt& aCenter, const gp_Pnt& aPmin, const gp_Pnt& aPmax, const Standard_Boolean aCurrentMode = Standard_False);
52
53 Standard_EXPORT AIS_Plane(const Handle(Geom_Axis2Placement)& aComponent, const AIS_TypeOfPlane aPlaneType, const Standard_Boolean aCurrentMode = Standard_False);
54
55 //! Same value for x and y directions
56 Standard_EXPORT void SetSize (const Standard_Real aValue);
57
58 //! Sets the size defined by the length along the X axis
59 //! XVal and the length along the Y axis YVal.
60 Standard_EXPORT void SetSize (const Standard_Real Xval, const Standard_Real YVal);
61
62 Standard_EXPORT void UnsetSize();
63
64 Standard_EXPORT Standard_Boolean Size (Standard_Real& X, Standard_Real& Y) const;
87432b82 65
66 Standard_Boolean HasOwnSize() const { return myHasOwnSize; }
67
b06da8f1 68 //! Sets transform persistence for zoom with value of minimum size
69 Standard_EXPORT void SetMinimumSize (const Standard_Real theValue);
70
71 //! Unsets transform persistence zoom
72 Standard_EXPORT void UnsetMinimumSize();
73
74 //! Returns true if transform persistence for zoom is set
75 Standard_EXPORT Standard_Boolean HasMinimumSize() const;
76
82b856b8 77 virtual Standard_Integer Signature() const Standard_OVERRIDE { return 7; }
78
79 virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
42cf5bc1 80
81 //! Returns the component specified in SetComponent.
87432b82 82 const Handle(Geom_Plane)& Component() { return myComponent; }
83
42cf5bc1 84 //! Creates an instance of the plane aComponent.
85 Standard_EXPORT void SetComponent (const Handle(Geom_Plane)& aComponent);
86
87 //! Returns the settings for the selected plane
88 //! aComponent, provided in SetPlaneAttributes.
89 //! These include the points aCenter, aPmin, and aPmax
90 Standard_EXPORT Standard_Boolean PlaneAttributes (Handle(Geom_Plane)& aComponent, gp_Pnt& aCenter, gp_Pnt& aPmin, gp_Pnt& aPmax);
91
92 //! Allows you to provide settings other than default ones
93 //! for the selected plane. These include: center point
94 //! aCenter, maximum aPmax and minimum aPmin.
95 Standard_EXPORT void SetPlaneAttributes (const Handle(Geom_Plane)& aComponent, const gp_Pnt& aCenter, const gp_Pnt& aPmin, const gp_Pnt& aPmax);
87432b82 96
42cf5bc1 97 //! Returns the coordinates of the center point.
87432b82 98 const gp_Pnt& Center() const { return myCenter; }
99
100 //! Provides settings for the center theCenter other than (0, 0, 0).
101 void SetCenter (const gp_Pnt& theCenter) { myCenter = theCenter; }
42cf5bc1 102
42cf5bc1 103 //! Allows you to provide settings for the position and
104 //! direction of one of the plane's axes, aComponent, in
105 //! 3D space. The coordinate system used is
106 //! right-handed, and the type of plane aPlaneType is one of:
107 //! - AIS_ TOPL_Unknown
108 //! - AIS_ TOPL_XYPlane
109 //! - AIS_ TOPL_XZPlane
110 //! - AIS_ TOPL_YZPlane}.
111 Standard_EXPORT void SetAxis2Placement (const Handle(Geom_Axis2Placement)& aComponent, const AIS_TypeOfPlane aPlaneType);
112
113 //! Returns the position of the plane's axis2 system
114 //! identifying the x, y, or z axis and giving the plane a
115 //! direction in 3D space. An axis2 system is a right-handed coordinate system.
116 Standard_EXPORT Handle(Geom_Axis2Placement) Axis2Placement();
117
118 //! Returns the type of plane - xy, yz, xz or unknown.
87432b82 119 AIS_TypeOfPlane TypeOfPlane() { return myTypeOfPlane; }
120
42cf5bc1 121 //! Returns the type of plane - xy, yz, or xz.
87432b82 122 Standard_Boolean IsXYZPlane() { return myIsXYZPlane; }
123
42cf5bc1 124 //! Returns the non-default current display mode set by SetCurrentMode.
87432b82 125 Standard_Boolean CurrentMode() { return myCurrentMode; }
42cf5bc1 126
127 //! Allows you to provide settings for a non-default
128 //! current display mode.
87432b82 129 void SetCurrentMode (const Standard_Boolean theCurrentMode) { myCurrentMode = theCurrentMode; }
130
42cf5bc1 131 //! Returns true if the display mode selected, aMode, is valid for planes.
132 Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
133
134 //! connection to <aCtx> default drawer implies a recomputation of Frame values.
135 Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& aCtx) Standard_OVERRIDE;
87432b82 136
42cf5bc1 137 //! Returns the type of sensitivity for the plane;
87432b82 138 Select3D_TypeOfSensitivity TypeOfSensitivity() const { return myTypeOfSensitivity; }
139
42cf5bc1 140 //! Sets the type of sensitivity for the plane.
87432b82 141 void SetTypeOfSensitivity (Select3D_TypeOfSensitivity theTypeOfSensitivity) { myTypeOfSensitivity = theTypeOfSensitivity; }
142
42cf5bc1 143 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE;
42cf5bc1 144
87432b82 145 Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
42cf5bc1 146
87432b82 147 Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
42cf5bc1 148
149private:
150
decbff0d 151 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
152 const Handle(Prs3d_Presentation)& thePrs,
153 const Standard_Integer theMode) Standard_OVERRIDE;
154
42cf5bc1 155 Standard_EXPORT void ComputeFrame();
decbff0d 156
42cf5bc1 157 Standard_EXPORT void ComputeFields();
decbff0d 158
42cf5bc1 159 Standard_EXPORT void InitDrawerAttributes();
160
87432b82 161private:
162
42cf5bc1 163 Handle(Geom_Plane) myComponent;
164 Handle(Geom_Axis2Placement) myAx2;
165 gp_Pnt myCenter;
166 gp_Pnt myPmin;
167 gp_Pnt myPmax;
168 Standard_Boolean myCurrentMode;
169 Standard_Boolean myAutomaticPosition;
170 AIS_TypeOfPlane myTypeOfPlane;
171 Standard_Boolean myIsXYZPlane;
172 Standard_Boolean myHasOwnSize;
173 Select3D_TypeOfSensitivity myTypeOfSensitivity;
174
42cf5bc1 175};
176
87432b82 177DEFINE_STANDARD_HANDLE(AIS_Plane, AIS_InteractiveObject)
42cf5bc1 178
179#endif // _AIS_Plane_HeaderFile