0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / AIS / AIS_IdenticRelation.hxx
CommitLineData
42cf5bc1 1// Created on: 1997-03-03
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_IdenticRelation_HeaderFile
18#define _AIS_IdenticRelation_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Boolean.hxx>
24#include <gp_Pnt.hxx>
25#include <AIS_Relation.hxx>
26#include <PrsMgr_PresentationManager3d.hxx>
27#include <Standard_Integer.hxx>
28#include <SelectMgr_Selection.hxx>
29#include <Standard_Real.hxx>
30class TopoDS_Shape;
31class Geom_Plane;
32class Prs3d_Presentation;
33class Prs3d_Projector;
34class Geom_Transformation;
35class Geom_Line;
36class gp_Pnt;
37class Geom_Circle;
38class Geom_Ellipse;
39class TopoDS_Wire;
40class TopoDS_Vertex;
41class gp_Dir;
42
43
44class AIS_IdenticRelation;
45DEFINE_STANDARD_HANDLE(AIS_IdenticRelation, AIS_Relation)
46
47//! Constructs a constraint by a relation of identity
48//! between two or more datums figuring in shape
49//! Interactive Objects.
50class AIS_IdenticRelation : public AIS_Relation
51{
52
53public:
54
55
56
57 //! Initializes the relation of identity between the two
58 //! entities, FirstShape and SecondShape. The plane
59 //! aPlane is initialized in case a visual reference is
60 //! needed to show identity.
61 Standard_EXPORT AIS_IdenticRelation(const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
62
63
64 //! Returns true if the interactive object is movable.
65 virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
66
67 //! computes the presentation according to a point of view
68 //! given by <aProjector>.
69 //! To be Used when the associated degenerated Presentations
70 //! have been transformed by <aTrsf> which is not a Pure
71 //! Translation. The HLR Prs can't be deducted automatically
72 //! WARNING :<aTrsf> must be applied
73 //! to the object to display before computation !!!
74 Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
75
76
77
78
79 DEFINE_STANDARD_RTTI(AIS_IdenticRelation,AIS_Relation)
80
81protected:
82
83
84
85
86private:
87
88
89 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
90
91 Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
92
93 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
94
95 Standard_EXPORT void ComputeOneEdgeOVertexPresentation (const Handle(Prs3d_Presentation)& aPresentation);
96
97 Standard_EXPORT void ComputeTwoEdgesPresentation (const Handle(Prs3d_Presentation)& aPresentation);
98
99 Standard_EXPORT void ComputeTwoLinesPresentation (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Geom_Line)& aLin, gp_Pnt& Pnt1On1, gp_Pnt& Pnt2On1, gp_Pnt& Pnt1On2, gp_Pnt& Pnt2On2, const Standard_Boolean isInf1, const Standard_Boolean isInf2);
100
101 Standard_EXPORT void ComputeTwoCirclesPresentation (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Geom_Circle)& aCircle, const gp_Pnt& Pnt1On1, const gp_Pnt& Pnt2On1, const gp_Pnt& Pnt1On2, const gp_Pnt& Pnt2On2);
102
103 //! Computes the presentation of the identic constraint
104 //! between 2 arcs in the case of automatic presentation
105 Standard_EXPORT void ComputeAutoArcPresentation (const Handle(Geom_Circle)& aCircle, const gp_Pnt& firstp, const gp_Pnt& lastp, const Standard_Boolean isstatic = Standard_False);
106
107 //! Computes the presentation of the identic constraint
108 //! between 2 circles in the case of non automatic presentation
109 Standard_EXPORT void ComputeNotAutoCircPresentation (const Handle(Geom_Circle)& aCircle);
110
111 //! Computes the presentation of the identic constraint
112 //! between 2 arcs in the case of non automatic presentation
113 Standard_EXPORT void ComputeNotAutoArcPresentation (const Handle(Geom_Circle)& aCircle, const gp_Pnt& pntfirst, const gp_Pnt& pntlast);
114
115 Standard_EXPORT void ComputeTwoEllipsesPresentation (const Handle(Prs3d_Presentation)& aPrs, const Handle(Geom_Ellipse)& anEll, const gp_Pnt& Pnt1On1, const gp_Pnt& Pnt2On1, const gp_Pnt& Pnt1On2, const gp_Pnt& Pnt2On2);
116
117 //! Computes the presentation of the identic constraint
118 //! between 2 arcs in the case of automatic presentation
119 Standard_EXPORT void ComputeAutoArcPresentation (const Handle(Geom_Ellipse)& theEll, const gp_Pnt& firstp, const gp_Pnt& lastp, const Standard_Boolean isstatic = Standard_False);
120
121 //! Computes the presentation of the identic constraint
122 //! between 2 ellipses in the case of non automatic presentation
123 Standard_EXPORT void ComputeNotAutoElipsPresentation (const Handle(Geom_Ellipse)& theEll);
124
125 //! Computes the presentation of the identic constraint
126 //! between 2 arcs in the case of non automatic presentation
127 Standard_EXPORT void ComputeNotAutoArcPresentation (const Handle(Geom_Ellipse)& theEll, const gp_Pnt& pntfirst, const gp_Pnt& pntlast);
128
129 Standard_EXPORT void ComputeTwoVerticesPresentation (const Handle(Prs3d_Presentation)& aPresentation);
130
131 Standard_EXPORT Standard_Real ComputeSegSize() const;
132
133 Standard_EXPORT Standard_Boolean ComputeDirection (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, gp_Dir& aDir) const;
134
135 Standard_EXPORT gp_Dir ComputeLineDirection (const Handle(Geom_Line)& aLin, const gp_Pnt& anExtremity) const;
136
137 Standard_EXPORT gp_Dir ComputeCircleDirection (const Handle(Geom_Circle)& aCirc, const TopoDS_Vertex& ConnectedVertex) const;
138
139 Standard_Boolean isCircle;
140 gp_Pnt myFAttach;
141 gp_Pnt mySAttach;
142 gp_Pnt myCenter;
143
144
145};
146
147
148#include <AIS_IdenticRelation.lxx>
149
150
151
152
153
154#endif // _AIS_IdenticRelation_HeaderFile