0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / PrsDim / PrsDim_FixRelation.hxx
CommitLineData
42cf5bc1 1// Created on: 1996-12-05
2// Created by: Flore Lantheaume/Odile Olivier
3// Copyright (c) 1996-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
787ff240 17#ifndef _PrsDim_FixRelation_HeaderFile
18#define _PrsDim_FixRelation_HeaderFile
42cf5bc1 19
d5477f8c 20#include <gp_Circ.hxx>
42cf5bc1 21#include <TopoDS_Wire.hxx>
787ff240 22#include <PrsDim_Relation.hxx>
42cf5bc1 23
7dd7c146 24class Geom_Plane;
42cf5bc1 25
787ff240 26DEFINE_STANDARD_HANDLE(PrsDim_FixRelation, PrsDim_Relation)
42cf5bc1 27
28//! Constructs and manages a constraint by a fixed
29//! relation between two or more interactive datums. This
30//! constraint is represented by a wire from a shape -
31//! point, vertex, or edge - in the first datum and a
32//! corresponding shape in the second.
33//! Warning: This relation is not bound with any kind of parametric
34//! constraint : it represents the "status" of an parametric
35//! object.
787ff240 36class PrsDim_FixRelation : public PrsDim_Relation
42cf5bc1 37{
787ff240 38 DEFINE_STANDARD_RTTIEXT(PrsDim_FixRelation, PrsDim_Relation)
42cf5bc1 39public:
42cf5bc1 40
41 //! initializes the vertex aShape, the
42 //! plane aPlane and the wire aWire, which connects
43 //! the two vertices in a fixed relation.
787ff240 44 Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire);
42cf5bc1 45
46 //! initializes the vertex aShape, the
47 //! plane aPlane and the wire aWire, the position
48 //! aPosition, the arrow size anArrowSize and the
49 //! wire aWire, which connects the two vertices in a fixed relation.
787ff240 50 Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
42cf5bc1 51
52 //! initializes the edge aShape and the plane aPlane.
787ff240 53 Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane);
42cf5bc1 54
55 //! initializes the edge aShape, the
56 //! plane aPlane, the position aPosition and the arrow
57 //! size anArrowSize.
787ff240 58 Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
42cf5bc1 59
60 //! Returns the wire which connects vertices in a fixed relation.
787ff240 61 const TopoDS_Wire& Wire() { return myWire; }
42cf5bc1 62
63 //! Constructs the wire aWire. This connects vertices
64 //! which are in a fixed relation.
787ff240 65 void SetWire (const TopoDS_Wire& aWire) { myWire = aWire; }
42cf5bc1 66
67 //! Returns true if the Interactive Objects in the relation
68 //! are movable.
b31fbc83 69 virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
42cf5bc1 70
42cf5bc1 71private:
decbff0d 72
73 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
74 const Handle(Prs3d_Presentation)& thePrs,
75 const Standard_Integer theMode) Standard_OVERRIDE;
76
77 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
78 const Standard_Integer theMode) Standard_OVERRIDE;
79
80 //! computes the presentation for <myFixShape> if it's a vertex.
42cf5bc1 81 Standard_EXPORT void ComputeVertex (const TopoDS_Vertex& FixVertex, gp_Pnt& curpos);
82
83 Standard_EXPORT gp_Pnt ComputePosition (const Handle(Geom_Curve)& curv1, const Handle(Geom_Curve)& curv2, const gp_Pnt& firstp1, const gp_Pnt& lastp1, const gp_Pnt& firstp2, const gp_Pnt& lastp2) const;
84
85 Standard_EXPORT gp_Pnt ComputePosition (const Handle(Geom_Curve)& curv, const gp_Pnt& firstp, const gp_Pnt& lastp) const;
86
87 //! computes the presentation for <myFixShape> if it's a
88 //! edge.
89 Standard_EXPORT void ComputeEdge (const TopoDS_Edge& FixEdge, gp_Pnt& curpos);
90
91 Standard_EXPORT void ComputeLinePosition (const gp_Lin& glin, gp_Pnt& pos, Standard_Real& pfirst, Standard_Real& plast);
92
93 Standard_EXPORT void ComputeCirclePosition (const gp_Circ& gcirc, gp_Pnt& pos, Standard_Real& pfirst, Standard_Real& plast);
94
95 Standard_EXPORT static Standard_Boolean ConnectedEdges (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, TopoDS_Edge& Edge1, TopoDS_Edge& Edge2);
96
787ff240 97private:
98
42cf5bc1 99 TopoDS_Wire myWire;
100 gp_Pnt myPntAttach;
101
42cf5bc1 102};
103
787ff240 104#endif // _PrsDim_FixRelation_HeaderFile